1

I have created a modified Ubuntu 22.04 ISO image from recent desktop ISO images. It boots and installs correctly as an ISO in a new VirtualBox VM (if I don't enable UEFI); however, my relatively new laptop will not boot from a USB stick formatted with my modified ISO, although it recognizes and installs from the original Ubuntu 22.04 ISO image. I imagine I am misusing xorriso, but do not understand it well enough to discover my error. What am I doing wrong?

xorriso reports the following details for the original Ubuntu 22.04 desktop ISO:

$  xorriso -indev jammy-desktop-amd64.iso -report_el_torito as_mkisofs
xorriso 1.5.4 : RockRidge filesystem manipulator, libburnia project.

xorriso : NOTE : Loading ISO image tree from LBA 0 xorriso : UPDATE : 963 nodes read in 1 seconds libisofs: NOTE : Found hidden El-Torito image for EFI. libisofs: NOTE : EFI image start and size: 2007921 * 2048 , 8496 * 512 xorriso : NOTE : Detected El-Torito boot information which currently is set to be discarded Drive current: -indev 'jammy-desktop-amd64.iso' Media current: stdio file, overwriteable Media status : is written , is appendable Boot record : El Torito , MBR protective-msdos-label grub2-mbr cyl-align-off GPT Media summary: 1 session, 2010211 data blocks, 3926m data, 1117g free Volume id : 'Ubuntu 22.04.1 LTS amd64' -V 'Ubuntu 22.04.1 LTS amd64' --modification-date='2022080117275700' --grub2-mbr --interval:local_fs:0s-15s:zero_mbrpt,zero_gpt:'jammy-desktop-amd64.iso' --protective-msdos-label -partition_cyl_align off -partition_offset 16 --mbr-force-bootable -append_partition 2 28732ac11ff8d211ba4b00a0c93ec93b --interval:local_fs:8031684d-8040179d::'jammy-desktop-amd64.iso' -appended_part_as_gpt -iso_mbr_part_type a2a0d0ebe5b9334487c068b6b72699c7 -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_start_2007921s_size_8496d:all::' -no-emul-boot -boot-load-size 8496

And, I create the new ISO using most of the same arguments:

$ xorriso -as mkisofs -o my-modified-ubuntu-22.04.iso \
    -V 'Modified Ubuntu 22.04 amd64' \
    --grub2-mbr --interval:local_fs:0s-15s:zero_mbrpt,zero_gpt:'jammy-desktop-amd64.iso' \
    --protective-msdos-label \
    -partition_cyl_align off \
    -partition_offset 16 \
    --mbr-force-bootable \
    -append_partition 2 28732ac11ff8d211ba4b00a0c93ec93b \
    --interval:local_fs:7129428d-7137923d::'jammy-desktop-amd64.iso' \
    -appended_part_as_gpt -iso_mbr_part_type a2a0d0ebe5b9334487c068b6b72699c7 \
    -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_start_1782357s_size_8496d:all::' \
    -no-emul-boot \
    -boot-load-size 8496 \
    <SRC_DIR>

My <SRC_DIR> is an overlay that uses the original ISO as its base, but I modify the following files in its root:

  • /casper/filesystem.squashfs
  • /casper/filesystem.manifest
  • /casper/filesystem.size
  • /md5sum.txt
  • /preseed/ubuntu.seed

All other files and ISO contents are identical to the original.

I'm confident the ISO is almost good, because it works well in VirtualBox, exhibiting the desired modifications, but I cannot coerce my laptop to see it and boot from it, even though it will boot from the original Ubuntu 22.04 desktop ISO. :(

I am working on the same laptop with Ubuntu 22.04 desktop, installed from the original upstream ISO.

And, I created the USB key using:

$ dd bs=4M \
    if=/home/me/my-modified-ubuntu-22.04.iso \
    of=/dev/sda \
    status=progress \
    oflag=sync

$ xorriso --version xorriso 1.5.4 : RockRidge filesystem manipulator, libburnia project.

xorriso 1.5.4 ISO 9660 Rock Ridge filesystem manipulator and CD/DVD/BD burn program Copyright (C) 2019, Thomas Schmitt <scdbackup@gmx.net>, libburnia project. xorriso version : 1.5.4 Version timestamp : 2021.01.30.150001 Build timestamp : -none-given- libisofs in use : 1.5.4 (min. 1.5.4) libjte in use : 2.0.0 (min. 2.0.0) libburn in use : 1.5.4 (min. 1.5.4) libburn OS adapter: internal GNU/Linux SG_IO adapter sg-linux libisoburn in use : 1.5.4 (min. 1.5.4) Provided under GNU GPL version 3 or later, due to libreadline license. There is NO WARRANTY, to the extent permitted by law.

Trevor
  • 123

2 Answers2

2

The xorriso run looks ok. I tried with mounted ubuntu-22.04-desktop-amd64.iso as SRC_DIR and then let xorriso report its boot equipment. The only significant differences are the volume id (-V) and the --modification-date. Both could be theoretically needed for GRUB or the booting system to find the ISO. But you should at least see some message text from GRUB if it fails to find its ISO, and it should not work better in VirtualBox than on real iron.

Secure Boot comes to my mind as potential source of problems. But i don't know enough of it to propose experiments, except that you could try to disable it in the laptop's EFI.

The only other experiment idea i have is that you try whether it works if you avoid the overlay filesystem and simply repack the ISO with its original file content.

(If you post results here and receive no reply from me, send mail to bug-xorriso@gnu.org)


Update after answer by Trevor:

So probably VirtualBox booted via BIOS, not via EFI.

I wish there was some way to automatically pull those offsets :

xorriso in its native command mode can load an ISO, manipulate the loaded ISO model, and write a new ISO from the data in the old ISO and the changes. The cumbersome numbers will stay hidden. See the xorriso run at the end of https://dev.lovelyhq.com/libburnia/libisoburn/raw/branch/master/test/merge_debian_isos or the end of my answer to How to create bootable ISO from custom Ubuntu 22.04 Image? Essential are -indev, -outdev, and -boot_image "any" "replay".

1

@Thomas, the problem was that the location of the reused partitions in the original ISO had shifted position during development, and I had not noticed. I needed to update the byte offsets. Please see:

@@ -144,7 +144,7 @@ Makefile
                -partition_cyl_align off \
                -partition_offset 16 \
                --mbr-force-bootable \
-               -append_partition 2 28732ac11ff8d211ba4b00a0c93ec93b --interval:local_fs:7129428d-7137923d::'jammy-desktop-amd64.iso' \
+               -append_partition 2 28732ac11ff8d211ba4b00a0c93ec93b --interval:local_fs:8031684d-8040179d::'jammy-desktop-amd64.iso' \
                -appended_part_as_gpt -iso_mbr_part_type a2a0d0ebe5b9334487c068b6b72699c7 \
                -c '/boot.catalog' \
                -b '/boot/grub/i386-pc/eltorito.img' \
@@ -152,7 +152,7 @@ Makefile
                -boot-load-size 4 \
                -boot-info-table \
                --grub2-boot-info \
-               -eltorito-alt-boot -e '--interval:appended_partition_2_start_1782357s_size_8496d:all::' \
+               -eltorito-alt-boot -e '--interval:appended_partition_2_start_2007921s_size_8496d:all::' \
                -no-emul-boot \
                -boot-load-size 8496 \
                iso/overlay

It works now. I should have paid closer attention to the xorriso report output while posting the question. Sorry for the distraction.

I wish there was some way to automatically pull those offsets instead of hard-coding them. But, I think that's a question for another day? :)

Trevor
  • 123