Merge lp:~mwhudson/debian-cd/half-the-grubs into lp:~ubuntu-cdimage/debian-cd/ubun3

Proposed by Michael Hudson-Doyle
Status: Merged
Merged at revision: 2080
Proposed branch: lp:~mwhudson/debian-cd/half-the-grubs
Merge into: lp:~ubuntu-cdimage/debian-cd/ubun3
Prerequisite: lp:~mwhudson/debian-cd/document-xorriso-options
Diff against target: 70 lines (+22/-25)
1 file modified
tools/boot/groovy/boot-amd64 (+22/-25)
To merge this branch: bzr merge lp:~mwhudson/debian-cd/half-the-grubs
Reviewer Review Type Date Requested Status
Steve Langasek Approve
Paride Legovini (community) Needs Fixing
Review via email: mp+387085@code.launchpad.net

Description of the change

go back to two copies of grub on the ISO, not four

Staring hard at the previous command line and some experimentation got me there
in the end. Read the comments for more explanation.

To post a comment you must log in.
Revision history for this message
Dimitri John Ledkov (xnox) :
Revision history for this message
Michael Hudson-Doyle (mwhudson) :
Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

ping

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

Two inline comments, of which one I think it's an actual thing to fix.

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

The static validation of the Groovy images is currently failing because UTAH is unable to find the EFI files, but the images themselves work. I'd prefer to see this MP land before working on UTAH to avoid fixing it twice :)

The ISO testing jobs are currently only testing the images booting them in cdrom mode (both bios and uefi). I'd like to add jobs to also test the "boot as disk" path at some point, as that's certainly the most common scenario nowadays.

2082. By Michael Hudson-Doyle

review feedback

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

Thanks for the review! I'd like this to land soon too :/

Revision history for this message
Steve Langasek (vorlon) wrote :

We'll have to subject this to testing to figure out in the end if it's correct.

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-09-10 23:09:52 +0000
+++ tools/boot/groovy/boot-amd64 2020-09-10 23:09:53 +0000
@@ -36,14 +36,11 @@
36mkdir cd-boot-images36mkdir cd-boot-images
37$BASEDIR/tools/apt-selection download cd-boot-images-amd6437$BASEDIR/tools/apt-selection download cd-boot-images-amd64
38dpkg --fsys-tarfile cd-boot-images-amd64*_all.deb | tar xf - -C cd-boot-images38dpkg --fsys-tarfile cd-boot-images-amd64*_all.deb | tar xf - -C cd-boot-images
3939# we should add isohdpfx.bin to cd-boot-images and then the next three lines
40# --efi-boot -efi-boot-part --efi-boot-image seem to generate broken40# will not be needed.
41# .iso, specifically despite -partition_offset 16, the first partition41mkdir syslinux
42# is mountable, but results in I/O errors without anything42$BASEDIR/tools/apt-selection download isolinux
43# readable. Thus use just append_partition syntax to add ESP & -e43dpkg --fsys-tarfile isolinux*_all.deb | tar xf - -C syslinux ./usr/lib
44# "more rawly" way to specify ESP.
45#
46# TODO test if --efi-boot-image can be used instead of -e
4744
48mkisofs_opts ()45mkisofs_opts ()
49{46{
@@ -77,11 +74,15 @@
7774
78# The bootloader to write to the MBR for legacy-disk boot.75# The bootloader to write to the MBR for legacy-disk boot.
79#76#
80# Another approach is to use the very small isohdpfx.bin from isolinux77# We use the very small isohdpfx.bin from isolinux and -isohybrid-mbr
81# and -isohybrid-mbr to boot from a disk (isohdpfx.bin just jumps to78# to boot from a disk which just jumps to the legacy el torito boot
82# the legacy el torito boot block set up above) but this didn't work79# block set up above.
83# when mwhudson tested it in July 2020.80#
84mkisofs_opts --grub2-mbr cd-boot-images/usr/share/cd-boot-images-amd64/tree/boot/grub/i386-pc/boot_hybrid.img81# We also needs -isohybrid-mbr to have the -isohybrid-gpt-basdat below
82# to have any effect. Newer xorriso supports a "-part_like_isohybrid"
83# option which makes -isohybrid-gpt-basdat work without -isohybrid-mbr
84# but it's not in the xorriso in Xenial.
85mkisofs_opts -isohybrid-mbr syslinux/usr/lib/ISOLINUX/isohdpfx.bin
8586
86## Set up the mkisofs options for UEFI boot.87## Set up the mkisofs options for UEFI boot.
8788
@@ -99,18 +100,14 @@
99100
100# Add an ESP for uefi-disk boot.101# Add an ESP for uefi-disk boot.
101#102#
102# This is a very by hand way of doing it: it is possible to create a103# This isn't what this command is documented to do (which is "Mark El
103# partition table that points to the FAT filesystem above that will be104# Torito boot image as Basic Data in GPT") but the effect of it is to
104# used by the uefi-cdrom boot. But it seems this leads to xorriso105# create an invalid (!) GPT and a MBR with two partitions, one of type
105# creating a GPT that does not work; instead of creating a GPT with106# 0 covering the whole ISO and one of type 0xef (i.e. ESP) pointing at
106# overlapping partitions (which is not allowed by the spec) like so:107# the boot/grub/efi.img specified above, which perhaps more by luck
107# | partition 1 / p1 |108# than judgement allows the ISO to boot when used as a disk in an UEFI
108# | ESP |109# system.
109# it splits the "main" partition so the partitions look like this:110mkisofs_opts -isohybrid-gpt-basdat
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
114111
115## Create a partition table entry that covers the iso9660 filesystem.112## Create a partition table entry that covers the iso9660 filesystem.
116113

Subscribers

People subscribed via source and target branches