[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Trying to create UEFI & Bios bootable .iso using xorriso
From: |
Thomas Schmitt |
Subject: |
Re: Trying to create UEFI & Bios bootable .iso using xorriso |
Date: |
Wed, 08 Jan 2020 16:18:03 +0100 |
Hi,
larry wrote:
> I'm using xorriso to create an iso that boots on both Bios and EFI. The iso
> boots fine on a bios machine but isn't even recognized on an EFI machine.
You seem to have provided the necessary options for your xorriso -as mkisofs
run.
The combination of
-isohybrid-gpt-basdat
and
-e --interval:appended_partition_2:all::
is unusual. I advise to omit
-isohybrid-gpt-basdat
because the resulting GPT is invalid anyways because of the two emerging MBR
partitions.
For clarity i advise to move
-append_partition 2 0xef efi.img
before
-e --interval:appended_partition_2:all::
because the former causes the partition to be added while the latter then
refers as target of the El Torito Catalog entry for EFI.
> foxclone025-02.iso1 * 0 1351679 1351680 660M 0 Empty
> foxclone025-02.iso2 276 5203 4928 2.4M ef EFI (FAT-12/16/32)
Partition 2 is lure for EFI if the ISO is presented on USB stick.
> Section Header Entry:
> Header Indicator: 0x91 (Final Section Header Entry)
> PlatformId: 0xef (EFI)
> ...
> Boot Catalog Section Entry:
> Entry is bootable
> Boot Media emulation type: no emulation
This is the entry in the El Torito Catalog. It serves as lure for EFI if
the ISO is presented on CD, DVD, or BD medium.
---------------------------------------------------------------------------
Now we are getting a bit off topic for this list. But i watch your efforts
in the stackexchange empire since a few days. Their captcha test does not let
my browser pass. So i only answered to the one direct xorriso issue using
a Debian 10 Live system.
The next thing to do would be to mount the file efi.img and to look whether
the boot program (made by grub-mkimage) is at the correct position.
E.g. mounting by
sudo mkdir /mnt/fat
sudo mount -o loop efi.img /mnt/fat
and inspection by
find /mnt/fat
should list at least
/mnt/fat
/mnt/fat/efi
/mnt/fat/efi/boot
/mnt/fat/efi/boot/bootx64.efi
Fishy looking are:
> mcopy -i $BOOT_IMG -s $BOOT_IMG_DATA/efi ::
I cannot find any mcopy manual which mentions option -i.
> grub-mkimage \
There is no embedding of a config file to see (-c) and you put no .cfg
file into the efi.img. See
https://www.gnu.org/software/grub/manual/grub/html_node/Embedded-configuration.html
But EFI should not care about this and at least bring you to a GRUB prompt.
You could make a minimal grub-mkrescue image and compare the behavior of
both:
mkdir minimal
touch minimal/empty-file.txt
grub-mkrescue -o output.iso minimal
Whatever, you will need a GRUB configuration.
Older Debian ISOs have embedded confgurations in their bootx64.efi and the
newer ones have a configuration file /efi/debian/grub.cfg in efi.img.
Both seem to make the connection to the GRUB stuff in the ISO
search --file --set=root /.disk/info
set prefix=($root)/boot/grub
source $prefix/x86_64-efi/grub.cfg
But since you started by an ISO without any GRUB equipment, you will probably
not have it now.
You could copy it from a Debian ISO
sudo mkdir /mnt/iso
sudo mount -o loop debian-10.0.0-amd64-netinst.iso /mnt/iso
find /mnt/iso/boot/grub | less
shows 264 lines. (boot/grub/efi.img is the EFI partition image, which you
will not need to copy.)
The content of the main .cfg file would have to be adapted to your needs:
boot/grub/grub.cfg
But after you translated your ISOLINUX configuration to a GRUB configuration,
why struggeling with grub-mkimage and xorriso when you can let grub-mkrescue
do the job of controlling both ?
Manual:
https://www.gnu.org/software/grub/manual/grub/html_node/Invoking-grub_002dmkrescue.html
A bit more tangible:
https://wiki.osdev.org/GRUB#ISO_instructions
One of the many toy operatings systems which use grub-mkrescue
https://github.com/Nufflee/EPIC
https://github.com/Nufflee/EPIC/blob/master/Makefile
The boot audience for grub-mkrescue is defined by the installed GRUB
architectures. Stuff like listed for BIOS, 64 bit EFI, 32 bit EFI in:
https://packages.debian.org/sid/amd64/grub-pc-bin/filelist
https://packages.debian.org/sid/amd64/grub-efi-amd64-bin/filelist
https://packages.debian.org/sid/i386/grub-efi-ia32-bin/filelist
If you need help with installing GRUB for above targets or with converting
ISOLINUX configuration to GRUB, you may try this mailing list
https://lists.gnu.org/mailman/listinfo/help-grub
Have a nice day :)
Thomas