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
=== modified file 'tools/boot/groovy/boot-amd64'
--- tools/boot/groovy/boot-amd64 2020-07-08 01:39:32 +0000
+++ tools/boot/groovy/boot-amd64 2020-09-07 11:33:14 +0000
@@ -45,7 +45,80 @@
45#45#
46# TODO test if --efi-boot-image can be used instead of -e46# TODO test if --efi-boot-image can be used instead of -e
4747
48echo -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_opts48mkisofs_opts ()
49{
50 printf "%s " $@ >> $N.mkisofs_opts
51}
52
53## Boring mkisofs options that should be set somewhere architecture independent.
54mkisofs_opts -J -joliet-long -l
55
56## Generalities on booting
57
58# There is a 2x2 matrix of boot modes we care about: legacy or UEFI
59# boot modes and having the installer be on a cdrom or a disk. Booting
60# from cdrom uses the el torito standard and booting from disk expects
61# a MBR or GPT partition table.
62#
63# https://wiki.osdev.org/El-Torito has a lot more background on this.
64
65## Set up the mkisofs options for legacy boot.
66
67# Set the el torito boot image "name", i.e. the path on the ISO
68# containing the bootloader for legacy-cdrom boot.
69mkisofs_opts -b boot/grub/i386-pc/eltorito.img
70
71# Back in the day, el torito booting worked by emulating a floppy
72# drive. This hasn't been a useful way of operating for a long time.
73mkisofs_opts -no-emul-boot
74
75# Misc options to make the legacy-cdrom boot work.
76mkisofs_opts -boot-load-size 4 -boot-info-table --grub2-boot-info
77
78# The bootloader to write to the MBR for legacy-disk boot.
79#
80# Another approach is to use the very small isohdpfx.bin from isolinux
81# and -isohybrid-mbr to boot from a disk (isohdpfx.bin just jumps to
82# the legacy el torito boot block set up above) but this didn't work
83# when mwhudson tested it in July 2020.
84mkisofs_opts --grub2-mbr cd-boot-images/usr/share/cd-boot-images-amd64/tree/boot/grub/i386-pc/boot_hybrid.img
85
86## Set up the mkisofs options for UEFI boot.
87
88# Start a new entry in the el torito boot catalog.
89mkisofs_opts -eltorito-alt-boot
90
91# Specify where the el torito UEFI boot image "name", i.e. the path on
92# the ISO containing a FAT filesystem with a bootloader at the right
93# path (i.e. EFI/BOOT/BOOTX64.EFI).
94mkisofs_opts -e boot/grub/efi.img
95
96# Whether to emulate a floppy or not is a per-boot-catalog-entry
97# thing, so we need to say it again.
98mkisofs_opts -no-emul-boot
99
100# Add an ESP for uefi-disk boot.
101#
102# This is a very by hand way of doing it: it is possible to create a
103# partition table that points to the FAT filesystem above that will be
104# used by the uefi-cdrom boot. But it seems this leads to xorriso
105# creating a GPT that does not work; instead of creating a GPT with
106# overlapping partitions (which is not allowed by the spec) like so:
107# | partition 1 / p1 |
108# | ESP |
109# it splits the "main" partition so the partitions look like this:
110# | p1 | ESP | p3 |
111# which doesn't work at all when we mount p1 (it doesn't contain all
112# the files!)
113mkisofs_opts -append_partition 2 0xef cd-boot-images/usr/share/cd-boot-images-amd64/tree/boot/grub/efi.img
114
115## Create a partition table entry that covers the iso9660 filesystem.
116
117mkisofs_opts -partition_offset 16
118
119## Add the boot images from cd-boot-images-amd64 to the ISO.
120
121mkisofs_opts cd-boot-images/usr/share/cd-boot-images-amd64/tree
49122
50default_kernel_params123default_kernel_params
51124

Subscribers

People subscribed via source and target branches