Discussion:
Testing requested: Hybrid ISO/USB boot
(too old to reply)
Benno Rice
2018-03-22 18:06:24 UTC
Permalink
Hello all!

I’ve been working on the ability to create hybrid ISO/HDD boot images for x86, a la what Linux systems do with ISOHYBRID. The general theory seems to be that ISO images have a 32KB hunk of zeroes at the front that they generally ignore so we’ll stick something in there that can handle booting if need be. The cases generally break down as follows:

UEFI with CD: Boots using an EFI system partition embedded in the ISO image. This loads loader, and so on.
UEFI with HDD: Same as above as UEFI doesn’t really care what the underlying medium is and it sees the ISO image.
Legacy BIOS with CD: Boots using El Torrito as always.

And now for the new part:

Legacy BIOS with HDD: Sees a DOS MBR stuck in the 32KB at the front of the ISO image. This MBR contains our MBR boot code, which sees an active BSD slice containing a variant of our BSD boot code that reads from the ISO filesystem instead of UFS. This finds loader in the ISO filesystem and loads that. Loader has had support for reading ISO9660 images off HDDs added. Everything continues normally after that.

The review for these changes is here:

https://reviews.freebsd.org/D14799 <https://reviews.freebsd.org/D14799>

And a version of the standard “bootonly” ISO image built with these changes is here:

https://people.freebsd.org/~benno/hybrid-bootonly.iso.xz <https://people.freebsd.org/~benno/hybrid-bootonly.iso.xz>

I’ve tested this image under qemu and VMware under all four of the BIOS/UEFI and CD/HDD combinations. I’ve also booted a system build around an Asus X399 Prime motherboard with this dd’ed to a USB stick. I’d love some testing on more systems, especially things that are more likely to have more customized boot firmwares (I’m thinking Dell, HP, etc).

Many thanks,
Benno.
Franco Fichtner
2018-03-23 07:50:57 UTC
Permalink
Hi Benno,
Very cool!

I ported the patch to 11.1-RELEASE and built an OPNsense image[1]
based on the commands enclosed.

(I'm not entirely sure if the porting was ok as there were quite
a few challenges... but for the sake of testing...)

Bhyve boot: ok

VirtualBox boot: ok (when using extension .iso)

APU1C boot: aborts with "Invalid partition" 3x, then "No /boot/loader"
and then escapes to "FreeBSD/x86 boot" etc.

It's an UEFI style ISO[2] so not sure if this is problematic.

I have other hardware to try and your image, but that's for later.


Cheers,
Franco

--
[1] https://pkg.opnsense.org/FreeBSD:11:amd64/snapshots/OPNsense-18.1.5-OpenSSL-dvd-amd64.iso.bz2
[2] https://github.com/opnsense/tools/blob/master/build/dvd.sh
Franco Fichtner
2018-03-23 08:01:50 UTC
Permalink
Hi Benno,
Post by Franco Fichtner
APU1C boot: aborts with "Invalid partition" 3x, then "No /boot/loader"
and then escapes to "FreeBSD/x86 boot" etc.
Small follow-up: the hybrid-bootonly.iso goes blank on this one due to
no dual boot / serial settings. Cannot conform nor deny at this point.


Cheers,
Franco
Maurizio Vairani
2018-03-23 12:53:43 UTC
Permalink
Post by Benno Rice
Hello all!
I’ve been working on the ability to create hybrid ISO/HDD boot images for
x86, a la what Linux systems do with ISOHYBRID. The general theory seems to
be that ISO images have a 32KB hunk of zeroes at the front that they
generally ignore so we’ll stick something in there that can handle booting
UEFI with CD: Boots using an EFI system partition embedded in the ISO
image. This loads loader, and so on.
UEFI with HDD: Same as above as UEFI doesn’t really care what the
underlying medium is and it sees the ISO image.
Legacy BIOS with CD: Boots using El Torrito as always.
Legacy BIOS with HDD: Sees a DOS MBR stuck in the 32KB at the front of the
ISO image. This MBR contains our MBR boot code, which sees an active BSD
slice containing a variant of our BSD boot code that reads from the ISO
filesystem instead of UFS. This finds loader in the ISO filesystem and
loads that. Loader has had support for reading ISO9660 images off HDDs
added. Everything continues normally after that.
https://reviews.freebsd.org/D14799 <https://reviews.freebsd.org/D14799>
https://people.freebsd.org/~benno/hybrid-bootonly.iso.xz <
https://people.freebsd.org/~benno/hybrid-bootonly.iso.xz>
I’ve tested this image under qemu and VMware under all four of the
BIOS/UEFI and CD/HDD combinations. I’ve also booted a system build around
an Asus X399 Prime motherboard with this dd’ed to a USB stick. I’d love
some testing on more systems, especially things that are more likely to
have more customized boot firmwares (I’m thinking Dell, HP, etc).
Many thanks,
Benno.
_______________________________________________
https://lists.freebsd.org/mailman/listinfo/freebsd-current
Hi Benno,
thank you for your work.

On a Mac mini "Core i5" 2.3 (Mid-2011), booting via USB, it hangs very
early, after writing:
FreeBSD/x86 bootstrap loader, version 1.1
(Wed Mar 21 10:27:48 PDT 2018 ***@bobthe)

Regards,
Maurizio

Loading...