grub-mkrescue builds ISO images suitable for EFI only
Posted: Wed Dec 03, 2014 4:29 pm
So, I've recently bought a new laptop, got it all set up, etc. and am trying to build my OS on it. The actual build goes fine, but it appears that grub-mkrescue has decided that I need HFS+ formatted EFI-only boot images, rather than anything that QEMU is going to understand, so the ISO images are completely useless. I'm not sure why it thinks I need Apple's filesystem and CoreServices, but since this new laptop does boot via UEFI, I suppose creating EFI-based images makes some sort of sense (because nobody would ever need to build images for a different system, right?).
The relevant xorriso command (from grub-mkrescue -v) is:
grub-mkrescue: info: executing xorriso -as mkisofs -graft-points --modification-date=2014120322113800 -hfsplus -apm-block-size 2048 -hfsplus-file-creator-type chrp tbxj /System/Library/CoreServices/.disk_label -hfs-bless-by i /System/Library/CoreServices/boot.efi --efi-boot efi.img -efi-boot-part --efi-boot-image --protective-msdos-label -o btos.iso -r /tmp/grub.LYil9e --sort-weight 0 / --sort-weight 1 /boot isodir/.
Of course, grub-mkrescue has no (documented) options to make it do the right thing, so short of an undocumented option I'm probably going to have to write a script to replace it. The script will also need to work on my existing systems.
Does anybody know the steps that grub-mkrescue goes through? Does it do anything that's not possible via a shell script?
The other option would be to install grub on the HDD image that's also built by my build process, but the lack of decent disk image manipulation tools makes that difficult (it seems that everyone expects you just to mount the image on the host OS to manipulate it, but that would require 'root', which would require user input during the build, which is not an option).
I suppose this post also acts as a warning that the days of grub-mkrescue being a useful tool for osdev are severely limited...
(Before someone says it: Yes, I know it's vaguely possible to configure QEMU to support EFI. No, I'm not going to consider that a "solution" to this problem.)
The relevant xorriso command (from grub-mkrescue -v) is:
grub-mkrescue: info: executing xorriso -as mkisofs -graft-points --modification-date=2014120322113800 -hfsplus -apm-block-size 2048 -hfsplus-file-creator-type chrp tbxj /System/Library/CoreServices/.disk_label -hfs-bless-by i /System/Library/CoreServices/boot.efi --efi-boot efi.img -efi-boot-part --efi-boot-image --protective-msdos-label -o btos.iso -r /tmp/grub.LYil9e --sort-weight 0 / --sort-weight 1 /boot isodir/.
Of course, grub-mkrescue has no (documented) options to make it do the right thing, so short of an undocumented option I'm probably going to have to write a script to replace it. The script will also need to work on my existing systems.
Does anybody know the steps that grub-mkrescue goes through? Does it do anything that's not possible via a shell script?
The other option would be to install grub on the HDD image that's also built by my build process, but the lack of decent disk image manipulation tools makes that difficult (it seems that everyone expects you just to mount the image on the host OS to manipulate it, but that would require 'root', which would require user input during the build, which is not an option).
I suppose this post also acts as a warning that the days of grub-mkrescue being a useful tool for osdev are severely limited...
(Before someone says it: Yes, I know it's vaguely possible to configure QEMU to support EFI. No, I'm not going to consider that a "solution" to this problem.)