[SOLVED] BIOS+EFI boot for ISO file

If none of the more specific forums is the right place to ask

[SOLVED] BIOS+EFI boot for ISO file

Postby Antonio Rizzo » 2019-11-17 18:19

I created a custom Debian Live ISO and burned to pendrive with dd. The pendrive can be booted from BIOS with no problems.
Now I want to be able to boot the same live system from UEFI too (without removing isolinux). This way I can use the same pendrive with any firmware (BIOS and UEFI). I tried with rufus with no success. I think xorriso should do the trick, but many attempts didn't success. I even created an ESP partition on the pendrive and there I copied the content of the /boot/grub directory (and changed grub.cfg accordingly). No way to make it work. Can someone help me? Thanks.

Shortly, the procedure:
Code: Select all
debootstrap --arch=amd64 buster /media/Live/livework/chroot
chroot /media/Live/livework/chroot
... install Debian+LXDE+customizations
... copy kernel & initrd on /media/Live/livework/binary/live/
cd /media/Live/livework/
mksquashfs chroot binary/live/filesystem.squashfs -comp xz -e boot
... configure isolinux

Finally:
Code: Select all
xorriso -as mkisofs -r -J -joliet-long -l \
   -isohybrid-mbr /usr/lib/ISOLINUX/isohdpfx.bin -partition_offset 16 \
   -A "my_Debian_Live"  -b isolinux/isolinux.bin -c \
   isolinux/boot.cat -no-emul-boot -boot-load-size 4 \
   -boot-info-table -o my_Debian_Live.iso \
binary
Last edited by Antonio Rizzo on 2019-11-18 20:49, edited 1 time in total.
Antonio Rizzo
 
Posts: 15
Joined: 2015-09-27 09:13

Re: BIOS+EFI boot for ISO file

Postby Head_on_a_Stick » 2019-11-17 18:30

Check the mkiso function in this gist: https://gist.github.com/Head-on-a-Stick ... -mkshrc-L7

But you should probably be using live-build instead of doing this manually.
Don't break DebianHow to report bugs

SharpBang GNU/Linux® — a pre-configured Openbox/Tint2 desktop running on Debian stable
User avatar
Head_on_a_Stick
 
Posts: 10695
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: BIOS+EFI boot for ISO file

Postby Antonio Rizzo » 2019-11-17 20:19

Thank you for your answer. I don't have any "boot/grub/efi.img", so xorriso was unable to operate.
As regards to https://live-team.pages.debian.net/live-manual/ I had a look, but I didn't find any reference to (U)EFI/ESP (sorry, I didn't read all pages). I found this https://willhaley.com/blog/custom-debian-live-environment/; I could give it a try.
Antonio Rizzo
 
Posts: 15
Joined: 2015-09-27 09:13

Re: BIOS+EFI boot for ISO file

Postby Dai_trying » 2019-11-17 20:24

Head_on_a_Stick wrote:But you should probably be using live-build instead of doing this manually.


I totally agree, I have used livebuild to create my own installation images giving me exactly the system I want (including non-debian software) and it has worked really really well, so much so I rarely need to download iso files anymore :D

this page got me started.

EDIT: Also I think using --binary-images iso-hybrid in lb config gives you both Bios and UEFI boot options available.
Dai_trying
 
Posts: 834
Joined: 2016-01-07 12:25

Re: BIOS+EFI boot for ISO file

Postby Antonio Rizzo » 2019-11-18 20:48

Since the procedure used by Will Haley (https://willhaley.com/blog/custom-debian-live-environment/) is similar to mine, I followed that. I can confirm it WORKS. I successfully created an ISO file that can be started by BIOS and UEFI firmwares. The "nomodeset" kernel option had to be removed for VirtualBox to work. I didn't used live-build, though, so I cannot tell you which procedure is faster or better. However, thank you for your suggestions. Maybe I'll try live-build in the future.
Antonio Rizzo
 
Posts: 15
Joined: 2015-09-27 09:13

Re: BIOS+EFI boot for ISO file

Postby Head_on_a_Stick » 2019-11-23 10:34

Antonio Rizzo wrote:Since the procedure used by Will Haley (https://willhaley.com/blog/custom-debian-live-environment/) is similar to mine, I followed that.

That is a nice guide but creating the same ISO with live-build would be considerably simpler.
Don't break DebianHow to report bugs

SharpBang GNU/Linux® — a pre-configured Openbox/Tint2 desktop running on Debian stable
User avatar
Head_on_a_Stick
 
Posts: 10695
Joined: 2014-06-01 17:46
Location: /dev/chair


Return to General Questions

Who is online

Users browsing this forum: Giygas and 10 guests

fashionable