0% found this document useful (0 votes)
19 views2 pages

Ubuntu UEFI Installation Image

Uploaded by

Jehonan
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
Download as txt, pdf, or txt
0% found this document useful (0 votes)
19 views2 pages

Ubuntu UEFI Installation Image

Uploaded by

Jehonan
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1/ 2

I do remaster the images for installing ubuntu on my computers to have a custom

preseed, but with 20.10 my previous used process and commands did not work.

That's the command I used with 20.04:

xorriso -as mkisofs -r -V "$disk_title" -J -joliet-long -cache-inodes -l -


isohybrid-mbr "$MBR_FILE" -c isolinux/boot.cat -b isolinux/isolinux.bin -boot-load-
size 4 -iso-level 3 -boot-info-table -eltorito-alt-boot -e boot/grub/efi.img -no-
emul-boot -isohybrid-gpt-basdat -o Image.iso unpackedImageDirectory

But 20.10 doesn't seem to use isolinux(syslinux) at all, as I can't spot the
directory. The files in the boot direkctory have changed too.

What's the new correct process?!

Much has changed in Ubuntu's ISO.

The BIOS boot image and MBR are now from GRUB.

The EFI System Partition is not a file in the ISO any more.

The partition table is now GPT.

But the ISO keeps its old jackalope style by an additional MBR partition of type 00
and size 1.

This nearly not existing partition holds the boot flag for some few old BIOS
machines which boot only if this flag is present in some MBR partition entry.

The protective MBR partition of type EE is not allowed to bear this flag.

fdisk -l ubuntu-23.04-desktop-legacy-amd64.iso

Disk ubuntu-23.04-desktop-legacy-amd64.iso: 3,64 GiB, 3908573184 bytes, 7633932


sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: DE145A2E-4FD2-4844-8EDA-453E757750CD

Device Start End Sectors Size Type


ubuntu-23.04-desktop-legacy-amd64.iso1 64 7623199 7623136 3,6G Microsoft
basic data
ubuntu-23.04-desktop-legacy-amd64.iso2 7623200 7633267 10068 4,9M EFI System
ubuntu-23.04-desktop-legacy-amd64.iso3 7633268 7633867 600 300K Microsoft
basic data

You may extract MBR and EFI partition image from the original ISO:

orig=ubuntu-23.04-desktop-legacy-amd64.iso
mbr=ubuntu-23.04-desktop-legacy-amd64.mbr
efi=ubuntu-23.04-desktop-legacy-amd64.efi

# Extract the MBR template


dd if="$orig" bs=1 count=446 of="$mbr"

# Extract EFI partition image


skip=$(/sbin/fdisk -l "$orig" | fgrep '.iso2 ' | awk '{print $2}')
size=$(/sbin/fdisk -l "$orig" | fgrep '.iso2 ' | awk '{print $4}')
dd if="$orig" bs=512 skip="$skip" count="$size" of="$efi"

Now you can pack up the new ISO:

new=ubuntu-23.04-desktop-legacy-amd64.iso
disk=Ubuntu 23.04 amd64

xorriso -as mkisofs -R -r -V "$disk" -J -joliet-long -l -iso-level 3 -


partition_offset 16 --grub2-mbr "$mbr" --mbr-force-bootable -append_partition 2
0xEF "$efi" -appended_part_as_gpt -c /boot.catalog -b
/boot/grub/i386-pc/eltorito.img -no-emul-boot -boot-load-size 4 -boot-info-table --
grub2-boot-info -eltorito-alt-boot -e '--interval:appended_partition_2:all::' -no-
emul-boot -boot-load-size 8504 -o "$new" unpackedImageDirectory

I obtained the boot preparation options from a run of:

xorriso -indev "$orig" -report_el_torito as_mkisofs

Regrettably xorriso <= 1.5.2 has a bug in the output of this command with ISOs
using --mbr-force-bootable, by also reporting -as mkisofs option

-part_like_isohybrid

which would spoil the ISO for booting from new Lenovo laptops. The newest GNU
xorriso-1.5.3 tarball has this bug fixed.

Edit on request:

About the new boot equipment.

The set of boot lures is as crammed as in the the old ISOs: El Torito for BIOS and
EFI from optical media, MBR x86 code for BIOS from USB stick, a partition table
with EFI partition for EFI from USB stick.

Reason to give up SYSLINUX/ISOLINUX was probably its poor maintainance state and
the fact that one needs GRUB anyways for booting via EFI from optical media. The
old partition layout mix of ISOLINUX and GRUB did not work with GRUB+GRUB on some
modern EFI laptops. My suspicion is that they tolerate MBR partition table only if
an ISOLINUX MBR is present. That old layout was quite an abominality if seen from
the UEFI specs.

So Ubuntu went to appended partitions and GPT as partition table. Some old HP
laptops bailed out and had to be dragged in by a boot flag in the MBR partition
table.

The change was laborsome and in part painful. https://bugs.launchpad.net/ubuntu-


cdimage/+bug/1886148 https://bugs.launchpad.net/ubuntu-cdimage/+bug/1899308

You might also like