Help in Creating a Custom FreeBSD ISO

Hi! 👋
I am currently attempting to create a FreeBSD-based Operating System, although I'm not building from source.
I download base.txz and kernel.txz and extracted them
# im doing this in a bash script on linux, hence the variable
tar -xpvf base.txz -C "$WORKDIR" --same-owner
tar -xpvf kernel.txz -C "$WORKDIR" --same-owner


I already had my modification done and had copied them into their designated directories

Then i tried to creating an ISO using
xorriso()

xorriso -as mkisofs -o "$ISO_NAME".iso -V "QUARTZOS" -b "boot/cdboot" -no-emul-boot -boot-load-size 4 -boot-info-table -r -J "$WORKDIR"/
The ISO was created successfully, but it remains unbootable.
I'm currently aiming for Legacy BIOS only as that's what I primarily use when testing although UEFI support would be nice too.
Is there anything I may be missing in the command, for I have no clue where to go from this point.

Note: I was doing all of this via linux as I do not have FreeBSD installed on my machine, and this method works presumably on both platforms either way.

Thanks in advance 🎩
 
Assuming the ISO to be created is not a FreeBSD installer image but a bootable FreeBSD system on CD.

# im doing this in a bash script [B]on linux[/B], hence the variable
I have no idea how to create a custom FreeBSD ISO on Linux, but this can be done in a few steps from a FreeBSD system in a VM without building from source.

Download a disc1.iso (i.e. FreeBSD-14.3-RELEASE-amd64-disc1.iso.xz), unxz, attach ISO for installation to a VM.

Include "src" (System source tree) during installation at the "Distribution Select" menu.

After installation has finished, let the installation ISO attached to the VM, boot system, create a ISO root file system directory for the custom ISO, mount installer image ISO (/dev/cd0), extract base.txz and kernel.txz, update ISO root file system, eventually install 3rd party applications, modify ISO file system to your liking, create ISO.

Inside FreeBSD VM (# = root user prompt):
Code:
# cd  /tmp
# mkdir  rootfs

# mount_cd9660   /dev/cd0   /mnt

# tar  xfC  /mnt/usr/freebsd-dist/base.txz  /tmp/rootfs
# tar  xfC  /mnt/usr/freebsd-dist/kernel.txz  /tmp/rootfs

# freebsd-update  -b  /tmp/rootfs  fetch
# freebsd-update  -b  /tmp/rootfs  install

# pkg  -r  /tmp/rootfs  install  pkg  emacs  neovim

# sh /usr/src/release/amd64/mkisoimages.sh -b '14_3_RELEASE_AMD64_CD'  14.3-RELEASE-amd64.iso  rootfs
For "mkisoimages.sh" see "BUILDING AUTOMATIC INSTALL MEDIA" at end of bsdinstall(8) manual.

Copy .iso from the VM over network (i.e., scp(1)), or shared folder to host system.

The created ISO is suitable for BIOS and UEFI.


Alternative ways to create custom ISO images (on FreeBSD) are described in the https://klarasystems.com/articles/building-customized-freebsd-images/ article.

Skip installworld, distribution, installkernel, extract base.txz, kernel.txz instead.
 
Assuming the ISO to be created is not a FreeBSD installer image but a bootable FreeBSD system on CD.


I have no idea how to create a custom FreeBSD ISO on Linux, but this can be done in a few steps from a FreeBSD system in a VM without building from source.

Download a disc1.iso (i.e. FreeBSD-14.3-RELEASE-amd64-disc1.iso.xz), unxz, attach ISO for installation to a VM.

Include "src" (System source tree) during installation at the "Distribution Select" menu.

After installation has finished, let the installation ISO attached to the VM, boot system, create a ISO root file system directory for the custom ISO, mount installer image ISO (/dev/cd0), extract base.txz and kernel.txz, update ISO root file system, eventually install 3rd party applications, modify ISO file system to your liking, create ISO.

Inside FreeBSD VM (# = root user prompt):
Code:
# cd  /tmp
# mkdir  rootfs

# mount_cd9660   /dev/cd0   /mnt

# tar  xfC  /mnt/usr/freebsd-dist/base.txz  /tmp/rootfs
# tar  xfC  /mnt/usr/freebsd-dist/kernel.txz  /tmp/rootfs

# freebsd-update  -b  /tmp/rootfs  fetch
# freebsd-update  -b  /tmp/rootfs  install

# pkg  -r  /tmp/rootfs  install  pkg  emacs  neovim

# sh /usr/src/release/amd64/mkisoimages.sh -b '14_3_RELEASE_AMD64_CD'  14.3-RELEASE-amd64.iso  rootfs
For "mkisoimages.sh" see "BUILDING AUTOMATIC INSTALL MEDIA" at end of bsdinstall(8) manual.

Copy .iso from the VM over network (i.e., scp(1)), or shared folder to host system.

The created ISO is suitable for BIOS and UEFI.


Alternative ways to create custom ISO images (on FreeBSD) are described in the https://klarasystems.com/articles/building-customized-freebsd-images/ article.

Skip installworld, distribution, installkernel, extract base.txz, kernel.txz instead.

I initially intended on using FreeBSD to build the ISO, although my VM is unbearably slow, hence why I've avoided using a VM.
On top of that, after finalizing the build script, I wanna have the building take place via Github Actions, which doesn't offer any FreeBSD containers.
I'll be using Github Actions as they have more powerful hardware, first build there took just a minute to create the final ISO.
1751307178878.png
 
Back
Top