Merge lp:~mwhudson/debian-cd/document-xorriso-options into lp:~ubuntu-cdimage/debian-cd/ubun3

Proposed by Michael Hudson-Doyle
Status: Merged
Merged at revision: 2079
Proposed branch: lp:~mwhudson/debian-cd/document-xorriso-options
Merge into: lp:~ubuntu-cdimage/debian-cd/ubun3
Prerequisite: lp:~xnox/debian-cd/unbreak-grub2-hybrid-iso
Diff against target: 84 lines (+74/-1)
1 file modified
tools/boot/groovy/boot-amd64 (+74/-1)
To merge this branch: bzr merge lp:~mwhudson/debian-cd/document-xorriso-options
Reviewer Review Type Date Requested Status
Steve Langasek Approve
Paride Legovini (community) Approve
Review via email: mp+387015@code.launchpad.net

Description of the change

Add a lot of words. Do not change behaviour (hopefully).

To post a comment you must log in.
Revision history for this message
Steve Langasek (vorlon) wrote :

I agree with the overall intent here, thanks.

review: Needs Information
2080. By Michael Hudson-Doyle

expand "make various things unhappy"

Revision history for this message
Michael Hudson-Doyle (mwhudson) :
Revision history for this message
Dimitri John Ledkov (xnox) :
Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

ping

Revision history for this message
Paride Legovini (paride) wrote :

One inline comment, for the rest LGTM. I wonder if we'll ever be able to discontinue some of those legacy modes one day :)

review: Needs Fixing
Revision history for this message
Paride Legovini (paride) wrote :

The only difference I can see with the original command is that the

-eltorito-alt-boot -e boot/grub/efi.img -no-emul-boot

options block and the

-append_partition 2 0xef cd-boot-images/usr/share/cd-boot-images-amd64/tree/boot/grub/efi.img

options block are swapped. I imagine you did it on purpose to add the boot options in a logical order:

- Legacy cdrom
- Legacy disk
- UEFI cdrom
- UEFI disk

I don't see a reason why the new options order shouldn't work, but I didn't test it.

Added another inline comment.

review: Needs Fixing
2081. By Michael Hudson-Doyle

address review comments

Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

Thanks for looking at this!!

> The only difference I can see with the original command is that the
>
> -eltorito-alt-boot -e boot/grub/efi.img -no-emul-boot
>
> options block and the
>
> -append_partition 2 0xef cd-boot-images/usr/share/cd-boot-images-
> amd64/tree/boot/grub/efi.img
>
> options block are swapped. I imagine you did it on purpose to add the boot
> options in a logical order:
>
> - Legacy cdrom
> - Legacy disk
> - UEFI cdrom
> - UEFI disk

Right.

> I don't see a reason why the new options order shouldn't work, but I didn't
> test it.

I think I tested this at the time...

> Added another inline comment.

Thanks, fixed this and the other one.

Revision history for this message
Paride Legovini (paride) wrote :

LGTM, thanks!

review: Approve
Revision history for this message
Steve Langasek (vorlon) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'tools/boot/groovy/boot-amd64'
2--- tools/boot/groovy/boot-amd64 2020-07-08 01:39:32 +0000
3+++ tools/boot/groovy/boot-amd64 2020-09-07 11:33:14 +0000
4@@ -45,7 +45,80 @@
5 #
6 # TODO test if --efi-boot-image can be used instead of -e
7
8-echo -n "-J -joliet-long -l -b boot/grub/i386-pc/eltorito.img -no-emul-boot -boot-load-size 4 -boot-info-table --grub2-boot-info --grub2-mbr cd-boot-images/usr/share/cd-boot-images-amd64/tree/boot/grub/i386-pc/boot_hybrid.img -append_partition 2 0xef cd-boot-images/usr/share/cd-boot-images-amd64/tree/boot/grub/efi.img -eltorito-alt-boot -e boot/grub/efi.img -no-emul-boot -partition_offset 16 cd-boot-images/usr/share/cd-boot-images-amd64/tree" >> $N.mkisofs_opts
9+mkisofs_opts ()
10+{
11+ printf "%s " $@ >> $N.mkisofs_opts
12+}
13+
14+## Boring mkisofs options that should be set somewhere architecture independent.
15+mkisofs_opts -J -joliet-long -l
16+
17+## Generalities on booting
18+
19+# There is a 2x2 matrix of boot modes we care about: legacy or UEFI
20+# boot modes and having the installer be on a cdrom or a disk. Booting
21+# from cdrom uses the el torito standard and booting from disk expects
22+# a MBR or GPT partition table.
23+#
24+# https://wiki.osdev.org/El-Torito has a lot more background on this.
25+
26+## Set up the mkisofs options for legacy boot.
27+
28+# Set the el torito boot image "name", i.e. the path on the ISO
29+# containing the bootloader for legacy-cdrom boot.
30+mkisofs_opts -b boot/grub/i386-pc/eltorito.img
31+
32+# Back in the day, el torito booting worked by emulating a floppy
33+# drive. This hasn't been a useful way of operating for a long time.
34+mkisofs_opts -no-emul-boot
35+
36+# Misc options to make the legacy-cdrom boot work.
37+mkisofs_opts -boot-load-size 4 -boot-info-table --grub2-boot-info
38+
39+# The bootloader to write to the MBR for legacy-disk boot.
40+#
41+# Another approach is to use the very small isohdpfx.bin from isolinux
42+# and -isohybrid-mbr to boot from a disk (isohdpfx.bin just jumps to
43+# the legacy el torito boot block set up above) but this didn't work
44+# when mwhudson tested it in July 2020.
45+mkisofs_opts --grub2-mbr cd-boot-images/usr/share/cd-boot-images-amd64/tree/boot/grub/i386-pc/boot_hybrid.img
46+
47+## Set up the mkisofs options for UEFI boot.
48+
49+# Start a new entry in the el torito boot catalog.
50+mkisofs_opts -eltorito-alt-boot
51+
52+# Specify where the el torito UEFI boot image "name", i.e. the path on
53+# the ISO containing a FAT filesystem with a bootloader at the right
54+# path (i.e. EFI/BOOT/BOOTX64.EFI).
55+mkisofs_opts -e boot/grub/efi.img
56+
57+# Whether to emulate a floppy or not is a per-boot-catalog-entry
58+# thing, so we need to say it again.
59+mkisofs_opts -no-emul-boot
60+
61+# Add an ESP for uefi-disk boot.
62+#
63+# This is a very by hand way of doing it: it is possible to create a
64+# partition table that points to the FAT filesystem above that will be
65+# used by the uefi-cdrom boot. But it seems this leads to xorriso
66+# creating a GPT that does not work; instead of creating a GPT with
67+# overlapping partitions (which is not allowed by the spec) like so:
68+# | partition 1 / p1 |
69+# | ESP |
70+# it splits the "main" partition so the partitions look like this:
71+# | p1 | ESP | p3 |
72+# which doesn't work at all when we mount p1 (it doesn't contain all
73+# the files!)
74+mkisofs_opts -append_partition 2 0xef cd-boot-images/usr/share/cd-boot-images-amd64/tree/boot/grub/efi.img
75+
76+## Create a partition table entry that covers the iso9660 filesystem.
77+
78+mkisofs_opts -partition_offset 16
79+
80+## Add the boot images from cd-boot-images-amd64 to the ISO.
81+
82+mkisofs_opts cd-boot-images/usr/share/cd-boot-images-amd64/tree
83
84 default_kernel_params
85

Subscribers

People subscribed via source and target branches