Small helper repository for building a customized FreeBSD installer ISO by grafting extra content into an existing FreeBSD release image.
The project currently consists of a single script, repack.sh,
which can either:
- download a FreeBSD release ISO image, verify its SHA-512 checksum, and repack it
- repack a local
.isoor.iso.xzfile
The script writes the resulting image to new.iso.
repack.sh appends a new ISO session with one or both of these payloads:
/etc/installerconfig/usr/freeebsd-dist/custom.txz
The second payload is generated from files listed in files/custom.mtree.
If neither payload is present, the script exits with ERROR: Nothing to graft.
.
|-- repack.sh
|-- files/
| `-- custom.mtree # optional; list of files to package into custom.txz
|-- installerconfig.txt # optional; checked by the script
`-- new.iso # output image created by the script
The script assumes the following tools are available:
shrealpathfilexztarawkfetchsha512sumisoinfogrowisofs
On most systems, isoinfo and growisofs come from cdrtools/dvd+rw-tools
or equivalent packages.
./repack.sh FreeBSD-15.1-RELEASE-amd64-dvd1.iso.xzYou can also pass an uncompressed .iso:
./repack.sh /path/to/FreeBSD-15.1-RELEASE-amd64-dvd1.iso./repack.sh -dThe default download target is:
- release:
15.1 - machine:
amd64 - variant:
dvd1
You can override them:
./repack.sh -d -r 15.1 -m arm64 -a aarch64 -t dvd1Supported values are defined directly in the script:
- machines:
amd64,arm64,powerpc,riscv - variants:
amd64:bootonly,disc1,dvd1arm64:bootonly,disc1,dvd1powerpc:bootonly,disc1riscv:bootonly,disc1
If installerconfig.txt exists and is non-empty, the script tries to graft an
installer configuration file into the ISO.
If files/custom.mtree exists and is non-empty, the script runs:
tar -cpf - @files/custom.mtree | xz --compress --stdout > custom.txzand then grafts the resulting archive into the image as a custom distribution set.
This is useful when you want to preload site-specific files into the installer media and extract them during installation.
Running the script may create:
new.iso- repacked installer imagecustom.txz- temporary custom distribution archive
The original input image is not modified.
The current script has a couple of naming inconsistencies worth knowing before you rely on it:
- it checks for
installerconfig.txtbut graftsinstallerconf.txt - it writes the custom archive to
/usr/freeebsd-dist/custom.txzinside the ISO
Those strings are documented here because they reflect the script as it exists today.