Tuesday, 31 October 2017

Add FreeBSD-based ISOs to E2B (+ new MPI Tool Pack released)

Bootable ISOs based on FreeBSD (e.g. FreeBSD-*11.1.iso) can now be booted by using .imgPTN image files.

I have just updated the MPI Tool Pack v.0.078.

Instructions are basically the same as for memstick images - see here (bottom of page).

For instance, you can MBR-boot to OPNsense ISOs (OPNsense-17.7.5-OpenSSL-dvd-amd64.iso) by creating a dummy .imgPTN file and removing the file extension from the ISO file so it is also loaded as a partition image.

To check if your ISO is compatible, load the ISO into 7Zip and look for a \boot\loader file inside the ISO.

Note: FreeNas .ISO files do not work using this method. You must use FreeNAS memstick images instead.

Geek notes

It is not possible to boot directly from the ISO using a simple menu such as:

title FreeBSD
set ISO=FreeBSD-11.1-RELEASE-amd64-bootonly.iso
partnew (hd0,2) 0x83 $HOME$/%ISO%
root (hd0,2)
kernel /boot/loader

This does not work with FreeBSD because it fails the BSD partition integrity check on booting because partition 3 (hd0,2) is inside partition 1 (hd0,0) and so BSD fails to mount partition 3 as a iso9660 filesystem.

It may work for some other FreeBSD-based ISOs which do not perform partition integrity checks.

It can be made to work as follows:

1. Use the menu to boot to the FreeBSD menu and select the '3 Escape to loader' menu option.
2. At the OK command prompt, type:

set kern.geom.part.check_integrity="0"
boot kernel

So we could use a .mnu file like this in E2B:

title FreeBSD\n Boot FreeBSD ISO with some typing
set ISO=FreeBSD-11.1-RELEASE-amd64-bootonly.iso
partnew (hd0,2) 0x83 $HOME$/%ISO%
root (hd0,2)
echo Select Option 3 = Boot to loader
echo Then type:
echo set kern.geom.part.check_integrity="0"
echo boot kernel
pause Press a key when ready...
kernel /boot/loader

Note that partition #3 is permanently set to type 0x83 and should be deleted after you have finished booting to FreeBSD.

If we use partition images however, we can avoid this because the partitions do not overlap.