Merge lp:~xnox/debian-cd/cd-boot-images-arm64 into lp:~ubuntu-cdimage/debian-cd/ubun3

Proposed by Dimitri John Ledkov on 2020-06-18
Status: Merged
Merged at revision: 2067
Proposed branch: lp:~xnox/debian-cd/cd-boot-images-arm64
Merge into: lp:~ubuntu-cdimage/debian-cd/ubun3
Diff against target: 327 lines (+51/-257)
1 file modified
tools/boot/groovy/boot-arm64 (+51/-257)
To merge this branch: bzr merge lp:~xnox/debian-cd/cd-boot-images-arm64
Reviewer Review Type Date Requested Status
Steve Langasek 2020-06-18 Pending
Review via email: mp+385966@code.launchpad.net

This proposal supersedes a proposal from 2020-06-14.

Commit message

Switch arm64 to cd-boot-images

To post a comment you must log in.
Steve Langasek (vorlon) wrote : Posted in a previous version of this proposal

There had discussion of making the cd-boot-images bits arch: all binary packages with the architecture name in the package name (cd-boot-images-arm64 etc). Shouldn't that be settled before merging this?

review: Needs Information
Dimitri John Ledkov (xnox) wrote : Posted in a previous version of this proposal

I have uploaded cd-boot-images-arm64 with identical content. It's sitting in NEW, once that package is out of NEW, and available in release, i will update s/cd-boot-images/cd-boot-images-arm64/ prior to removal of the old src:cd-boot-images from the archive.

So, in a way the two actions are independent (changing debian-cd, and renaming cd-boot-images).

Steve Langasek (vorlon) wrote : Posted in a previous version of this proposal

Since cd-boot-images-arm64 is now in groovy, let's please adjust that as part of landing this.

review: Needs Fixing
Dimitri John Ledkov (xnox) wrote :

Tested that it boots on arm64 laptop.

Also the way it is built it is detected as both "usb attached cdrom" and as "usb disk"

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'tools/boot/groovy/boot-arm64'
2--- tools/boot/groovy/boot-arm64 2020-05-21 21:59:34 +0000
3+++ tools/boot/groovy/boot-arm64 2020-06-18 01:17:06 +0000
4@@ -1,7 +1,6 @@
5 #!/bin/bash
6 #
7-# Do install stuff for amd64, including making bootable CDs
8-# Works with debian-installer
9+# Do install stuff for arm64, including making bootable CDs
10 #
11 # $1 is the CD number
12 # $2 is the temporary CD build dir
13@@ -12,264 +11,59 @@
14
15 N=$1
16 CDDIR=$2
17-BOOTDIR=
18-if [ ! "$DI_DIST" ]; then
19- export DI_DIST="$DI_CODENAME"
20-fi
21-if [ -z "$DI_PATH" ]; then
22- DI_PATH="$($BASEDIR/tools/find-newest-installer)"
23-fi
24-
25-default_preseed
26-default_language
27-
28 cd $CDDIR/..
29
30-#
31-# This script is called with $1 (now $N) as the CD to
32-# make bootable. N may be in the form "n" or "n_NONUS"
33-# There may be more than 4 disks...support extras.
34-
35-# Strip NONUS part of disk number
36-# NN will be 1...N so it can be used as an index
37-#
38-NN=`echo $N | sed -e 's/_NONUS//'`
39-
40-if [ "$CDIMAGE_ADDON" ]; then
41- # second disk, at least in spirit
42- NN=2
43-fi
44-
45 > $N.mkisofs_opts
46
47-# List of boot image for each CD
48-KTYPE[1]="" #isolinux multiboot in fact
49-KTYPE[2]=""
50-# XXX add net-image back when it's fixed
51-KTYPE[3]=""
52-KTYPE[4]=""
53-KTYPE[5]=""
54-KTYPE[6]=""
55-KTYPE[7]=""
56-KTYPE[8]=""
57-KTYPE[9]=""
58-KTYPE[10]=""
59-
60-THISTYPE=${KTYPE[$NN]}
61-
62-PREFIX_PRESEED="$(dirname "$DEFAULT_PRESEED")/"
63-PREFIX_GA=""
64-PREFIX_HWE=""
65-KERNEL_PREFIXES="PREFIX_GA"
66-if [ "$BACKPORT_KERNEL" ]; then
67- PREFIX_HWE="hwe-"
68- if [ "$PROJECT" = ubuntu-server ]; then
69- KERNEL_PREFIXES="$KERNEL_PREFIXES PREFIX_HWE"
70- fi
71-fi
72-
73-BOOT_IMAGES=""
74-TAR_IMAGES=""
75-DISK_IMAGES=""
76-for kp in $KERNEL_PREFIXES; do
77- BOOT_IMAGES="$BOOT_IMAGES ${!kp}cdrom/vmlinuz ${!kp}cdrom/initrd.gz ${!kp}cdrom/debian-cd_info.tar.gz"
78- TAR_IMAGES="$TAR_IMAGES ${!kp}netboot/netboot.tar.gz"
79-done
80-
81-FLAVOUR=generic
82-
83-# Download boot images
84-for image in MANIFEST.udebs $BOOT_IMAGES $DISK_IMAGES $TAR_IMAGES; do
85- if [ ! -e "$image" ]; then
86- dir=$(dirname $image)
87- mkdir -p $dir
88- if [ ! "$DI_WWW_HOME" ];then
89- cp "$DI_PATH/current/legacy-images/$image" "$image"
90- else
91- wget "$DI_WWW_HOME/$image" -O "$image"
92- fi
93- fi
94-done
95-
96-if [ "$NN" = "1" ]; then
97- list_kernel_abis $BOOT_IMAGES | check_kernel_sync $FLAVOUR
98-
99- if [ "$CDIMAGE_INSTALL_BASE" = 1 ]; then
100- for kp in $KERNEL_PREFIXES; do
101- cp -lf "${!kp}cdrom/vmlinuz" "$CDDIR/install/${!kp}vmlinuz"
102- cp -lf "${!kp}cdrom/initrd.gz" "$CDDIR/install/${!kp}initrd.gz"
103- done
104- fi
105- if [ "$CDIMAGE_LIVE" = 1 ]; then
106- if [ -e "$CDDIR/casper/filesystem.kernel-$FLAVOUR.efi.signed" ]; then
107- mv $CDDIR/casper/filesystem.kernel-$FLAVOUR.efi.signed $CDDIR/casper/vmlinuz.efi
108- rm -f $CDDIR/casper/filesystem.kernel-$FLAVOUR
109- CASPER_KERNEL=/casper/vmlinuz.efi
110- else
111- mv $CDDIR/casper/filesystem.kernel-$FLAVOUR $CDDIR/casper/vmlinuz
112- CASPER_KERNEL=/casper/vmlinuz
113- fi
114- CASPER_INITRD="/casper/initrd$(initrd_suffix "$CDDIR/casper/filesystem.initrd-$FLAVOUR")"
115- mv $CDDIR/casper/filesystem.initrd-$FLAVOUR "$CDDIR$CASPER_INITRD"
116- fi
117- echo -n "-J -l -c boot/boot.cat -partition_offset 16 " >> $N.mkisofs_opts
118- # Once we move to xorriso >= 1.4.4, we should consider changing from
119- # "-e boot/grub/efi.img"
120- # to
121- # "-e --interval:appended_partition_2:all::"
122- # This will point the el torito catalog to the appended partition instead
123- # of the in-ISO file, which will allow us to remove efi.img from the ISO
124- # filesystem and recover it's space.
125- echo -n "-append_partition 2 0xef $CDDIR/boot/grub/efi.img -e boot/grub/efi.img -no-emul-boot " >> $N.mkisofs_opts
126-fi
127-
128-# Only disk one gets the extra files installed
129-#
130-if [ "$NN" = "1" ]; then
131-
132-
133-# populate the install directory as well
134-for disk in $DISK_IMAGES; do
135- dir=$(dirname $disk)
136- mkdir -p $CDDIR/install/$dir
137- cp -lf $disk $CDDIR/install/$dir
138-done
139-
140-if [ "$CDIMAGE_INSTALL" = 1 ]; then
141- for tar in $TAR_IMAGES; do
142- dir=$(dirname $tar)
143- mkdir -p $CDDIR/install/$dir
144- tar -C $CDDIR/install/$dir -xzpf $tar
145- done
146-fi
147-
148-mkdir -p $CDDIR/boot
149-cat cdrom/debian-cd_info.tar.gz | (cd $CDDIR/boot/; tar xz)
150-# If we want a copy of grub on the ISO as well, seems redundant:
151-#mkdir -p $CDDIR/EFI/BOOT
152-#mcopy -i $CDDIR/boot/grub/efi.img ::EFI/BOOT/bootaa64.efi $CDDIR/EFI/BOOT/bootaa64.efi
153-sed -i '/^menuentry/Q' $CDDIR/boot/grub/grub.cfg
154-
155-# Set a timeout for grub.
156+# rename kernel+initrd
157+mv $CDDIR/casper/filesystem.kernel-generic $CDDIR/casper/vmlinuz
158+mv $CDDIR/casper/filesystem.initrd-generic $CDDIR/casper/initrd
159+HWE=
160+if [ -e $CDDIR/casper/filesystem.kernel-generic-hwe ]; then
161+ HWE="true"
162+ mv $CDDIR/casper/filesystem.kernel-generic-hwe $CDDIR/casper/hwe-vmlinuz
163+ mv $CDDIR/casper/filesystem.initrd-generic-hwe $CDDIR/casper/hwe-initrd
164+fi
165+
166+# download, extract and include cd-boot-images
167+mkdir cd-boot-images
168+$BASEDIR/tools/apt-selection download cd-boot-images-arm64
169+dpkg --fsys-tarfile cd-boot-images-arm64*_all.deb | tar xf - -C cd-boot-images
170+echo -n " -J -joliet-long -l -c boot/boot.cat -partition_offset 16 -append_partition 2 0xef cd-boot-images/usr/share/cd-boot-images-arm64/tree/boot/grub/efi.img -e boot/grub/efi.img -no-emul-boot -partition_cyl_align all cd-boot-images/usr/share/cd-boot-images-arm64/tree" >> $N.mkisofs_opts
171+
172+# generate grub.cfg
173+mkdir -p $CDDIR/boot/grub/
174 cat >> $CDDIR/boot/grub/grub.cfg <<EOF
175 set timeout=30
176-EOF
177-
178-if [ "$BACKPORT_KERNEL" ]; then
179- cat > $CDDIR/boot/grub/hwe-grub.cfg <<EOF
180-submenu 'Boot and Install with the HWE kernel' {
181-EOF
182-fi
183-
184-LAYERFS_PATH_OPT=$(add_layerfs_path_opt)
185-
186-if [ "$CDIMAGE_LIVE" = 1 ]; then
187- if [ "$PROJECT" = kubuntu ] || [ "$PROJECT" = kubuntu-plasma5 ]; then
188- livelabel="^Start $HUMANPROJECT"
189- liveparams=' maybe-ubiquity'
190- else
191- livelabel="^Try $HUMANPROJECT without installing"
192- liveparams=
193- fi
194- cat >> $CDDIR/boot/grub/grub.cfg <<EOF
195-menuentry "${livelabel#^}" {
196- set gfxpayload=keep
197- linux $CASPER_KERNEL $KERNEL_PARAMS $DEFAULT_PRESEED$liveparams$LAYERFS_PATH_OPT quiet splash ---
198- initrd $CASPER_INITRD
199-}
200-EOF
201- cat >> $CDDIR/boot/grub/loopback.cfg <<EOF
202-menuentry "${livelabel#^}" {
203- set gfxpayload=keep
204- linux $CASPER_KERNEL $KERNEL_PARAMS $DEFAULT_PRESEED$liveparams$LAYERFS_PATH_OPT iso-scan/filename=\${iso_path} quiet splash ---
205- initrd $CASPER_INITRD
206-}
207-EOF
208- if [ "$PROJECT" != ubuntu-mid ] && [ "$PROJECT" != kubuntu ] && [ "$PROJECT" != kubuntu-plasma5 ]; then
209- cat >> $CDDIR/boot/grub/grub.cfg <<EOF
210-menuentry "Install $HUMANPROJECT" {
211- set gfxpayload=keep
212- linux $CASPER_KERNEL $KERNEL_PARAMS $DEFAULT_PRESEED$LAYERFS_PATH_OPT only-ubiquity quiet splash ---
213- initrd $CASPER_INITRD
214-}
215-EOF
216- cat >> $CDDIR/boot/grub/loopback.cfg <<EOF
217-menuentry "Install $HUMANPROJECT" {
218- linux $CASPER_KERNEL $KERNEL_PARAMS $DEFAULT_PRESEED$LAYERFS_PATH_OPT only-ubiquity iso-scan/filename=\${iso_path} quiet splash ---
219- initrd $CASPER_INITRD
220-}
221-EOF
222- fi
223-fi
224-if [ "$CDIMAGE_INSTALL" = 1 ]; then
225- if [ "$CDIMAGE_LIVE" != 1 ]; then
226- for kp in $KERNEL_PREFIXES; do
227- cat >> $CDDIR/boot/grub/${!kp}grub.cfg <<EOF
228-menuentry "Install $HUMANPROJECT" {
229- set gfxpayload=keep
230- linux /install/${!kp}vmlinuz $KERNEL_PARAMS ${DEFAULT_PRESEED/$PREFIX_PRESEED/$PREFIX_PRESEED${!kp}} quiet ---
231- initrd /install/${!kp}initrd.gz
232-}
233-EOF
234- done
235- else
236- cat >> $CDDIR/boot/grub/grub.cfg <<EOF
237-menuentry "Install $HUMANPROJECT in text mode" {
238- set gfxpayload=keep
239- linux /install/vmlinuz $KERNEL_PARAMS $DEFAULT_PRESEED quiet ---
240- initrd /install/initrd.gz
241-}
242-EOF
243- fi
244-fi
245-# The GRUB versions of this only correspond to single isolinux labels,
246-# because we don't yet have the necessary technology in our GRUB menu stack
247-# to have a two-dimensional set of boot options, as is implemented for
248-# isolinux using the gfxboot "applies" keyword.
249-if [ "$CDIMAGE_LIVE" = 1 ]; then
250- cat >> $CDDIR/boot/grub/grub.cfg <<EOF
251-menuentry "OEM install (for manufacturers)" {
252- set gfxpayload=keep
253- linux $CASPER_KERNEL $KERNEL_PARAMS $DEFAULT_PRESEED$LAYERFS_PATH_OPT only-ubiquity quiet splash oem-config/enable=true ---
254- initrd $CASPER_INITRD
255-}
256-EOF
257-else
258- for kp in $KERNEL_PREFIXES; do
259- cat >> $CDDIR/boot/grub/${!kp}grub.cfg <<EOF
260-menuentry "OEM install (for manufacturers)" {
261- set gfxpayload=keep
262- linux /install/${!kp}vmlinuz $KERNEL_PARAMS ${DEFAULT_PRESEED/$PREFIX_PRESEED/$PREFIX_PRESEED${!kp}} quiet oem-config/enable=true ---
263- initrd /install/${!kp}initrd.gz
264-}
265-EOF
266- done
267-fi
268-if [ "$CDIMAGE_INSTALL_BASE" = 1 ]; then
269- for kp in $KERNEL_PREFIXES; do
270- cat >> $CDDIR/boot/grub/${!kp}grub.cfg <<EOF
271-menuentry "Check disc for defects" {
272- set gfxpayload=keep
273- linux /install/${!kp}vmlinuz $KERNEL_PARAMS MENU=/bin/cdrom-checker-menu quiet ---
274- initrd /install/${!kp}initrd.gz
275-}
276-EOF
277- cat >> $CDDIR/boot/grub/${!kp}grub.cfg <<EOF
278-menuentry "Rescue a broken system" {
279- set gfxpayload=keep
280- linux /install/${!kp}vmlinuz $KERNEL_PARAMS rescue/enable=true ---
281- initrd /install/${!kp}initrd.gz
282-}
283-EOF
284- done
285-fi
286-if [ "$BACKPORT_KERNEL" ] && [ "$PROJECT" = ubuntu-server ]; then
287- cat >> $CDDIR/boot/grub/hwe-grub.cfg <<EOF
288-}
289-EOF
290- cat $CDDIR/boot/grub/hwe-grub.cfg >> $CDDIR/boot/grub/grub.cfg
291-fi
292-rm -f $CDDIR/boot/grub/hwe-grub.cfg
293-fi
294-
295-# th,th, thats all
296+
297+loadfont unicode
298+
299+set menu_color_normal=white/black
300+set menu_color_highlight=black/light-gray
301+
302+menuentry "$HUMANPROJECT" {
303+ set gfxpayload=keep
304+ linux /casper/vmlinuz quiet ---
305+ initrd /casper/initrd
306+}
307+EOF
308+
309+if [ "$HWE" ]; then
310+ cat >> $CDDIR/boot/grub/grub.cfg <<EOF
311+menuentry "$HUMANPROJECT with the HWE kernel" {
312+ set gfxpayload=keep
313+ linux /casper/hwe-vmlinuz quiet ---
314+ initrd /casper/hwe-initrd
315+}
316+EOF
317+fi
318+
319+# UEFI Entries
320+cat >> $CDDIR/boot/grub/grub.cfg <<EOF
321+menuentry 'Boot from next volume' {
322+ exit
323+}
324+menuentry 'UEFI Firmware Settings' {
325+ fwsetup
326+}
327+EOF

Subscribers

People subscribed via source and target branches