Merge lp:~xnox/debian-cd/revert-modaliases into lp:~ubuntu-cdimage/debian-cd/ubun3

Proposed by Dimitri John Ledkov
Status: Merged
Approved by: Iain Lane
Approved revision: 2050
Merged at revision: 2053
Proposed branch: lp:~xnox/debian-cd/revert-modaliases
Merge into: lp:~ubuntu-cdimage/debian-cd/ubun3
Diff against target: 101 lines (+14/-32)
1 file modified
tools/boot/focal/boot-amd64 (+14/-32)
To merge this branch: bzr merge lp:~xnox/debian-cd/revert-modaliases
Reviewer Review Type Date Requested Status
Iain Lane Approve
Ubuntu CD Image Team Pending
Review via email: mp+382296@code.launchpad.net

Commit message

Revert dmi_modalias detection, but keep casper dual-flavour support.

Description of the change

Revert dmi_modalias detection, but keep casper dual-flavour support.

To post a comment you must log in.
lp:~xnox/debian-cd/revert-modaliases updated
2050. By Dimitri John Ledkov

Revert dmi_modalias detection

Revision history for this message
Iain Lane (laney) wrote :

Yes, this is moving to the installer itself now.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'tools/boot/focal/boot-amd64'
--- tools/boot/focal/boot-amd64 2020-04-15 09:08:10 +0000
+++ tools/boot/focal/boot-amd64 2020-04-15 12:05:01 +0000
@@ -310,24 +310,6 @@
310rmdir boot$N/isolinux/grub310rmdir boot$N/isolinux/grub
311sed -i '/^menuentry/Q' $CDDIR/boot/grub/grub.cfg311sed -i '/^menuentry/Q' $CDDIR/boot/grub/grub.cfg
312312
313
314# FIXME: dmi_modalias.cfg should be shipped in grub, with autopkgtest
315cp $BASEDIR/tools/boot/$DI_CODENAME/dmi_modalias.cfg $CDDIR/boot/grub
316
317# This dumps all oem meta packages in the cache, dumps their Modaliases fields,
318# extracts all dmi: modaliases, joins them together using |, and then converts
319# to a regular expressions by: anchoring it using ^(...)$, and converting *
320# to .*.
321# Then it uses grub's regexp module to match that one regex against the
322# dmi_modalias variable that dmi_modalias.cfg generated for us.
323cat >> $CDDIR/boot/grub/grub.cfg <<EOF
324set casper_flavour=""
325source \$prefix/dmi_modalias.cfg
326if regexp '$($BASEDIR/tools/apt-selection cache show ^oem-.*-meta$ | grep-dctrl -v -XF Ubuntu-OEM-Kernel-Flavour default | grep-dctrl -P "" -nsModaliases | grep -o 'dmi:[^), ]*' | tr '\n' '|' | sed -E -e 's/(.*)/^(\1)$/' -e 's/\*/.*/g')' "\$dmi_modalias"; then
327 set casper_flavour="-oem"
328fi
329EOF
330
331if [ "$BACKPORT_KERNEL" ]; then313if [ "$BACKPORT_KERNEL" ]; then
332 cat > $CDDIR/boot/grub/hwe-grub.cfg <<EOF314 cat > $CDDIR/boot/grub/hwe-grub.cfg <<EOF
333submenu 'Boot and Install with the HWE kernel' {315submenu 'Boot and Install with the HWE kernel' {
@@ -478,16 +460,16 @@
478 cat >> $CDDIR/boot/grub/grub.cfg <<EOF460 cat >> $CDDIR/boot/grub/grub.cfg <<EOF
479menuentry "${livelabel#^}${suffix}" {461menuentry "${livelabel#^}${suffix}" {
480 set gfxpayload=keep462 set gfxpayload=keep
481 linux $CASPER_KERNEL\$casper_flavour $KERNEL_PARAMS $DEFAULT_PRESEED$liveparams$LAYERFS_PATH_OPT $QUIET $SPLASH$extra_kopt ---463 linux $CASPER_KERNEL $KERNEL_PARAMS $DEFAULT_PRESEED$liveparams$LAYERFS_PATH_OPT $QUIET $SPLASH$extra_kopt ---
482 initrd $CASPER_INITRD\$casper_flavour464 initrd $CASPER_INITRD
483}465}
484EOF466EOF
485done467done
486 cat >> $CDDIR/boot/grub/loopback.cfg <<EOF468 cat >> $CDDIR/boot/grub/loopback.cfg <<EOF
487menuentry "${livelabel#^}" {469menuentry "${livelabel#^}" {
488 set gfxpayload=keep470 set gfxpayload=keep
489 linux $CASPER_KERNEL\$casper_flavour $KERNEL_PARAMS $DEFAULT_PRESEED$liveparams$LAYERFS_PATH_OPT iso-scan/filename=\${iso_path} $QUIET $SPLASH ---471 linux $CASPER_KERNEL $KERNEL_PARAMS $DEFAULT_PRESEED$liveparams$LAYERFS_PATH_OPT iso-scan/filename=\${iso_path} $QUIET $SPLASH ---
490 initrd $CASPER_INITRD\$casper_flavour472 initrd $CASPER_INITRD
491}473}
492EOF474EOF
493 if [ "$NOTRYONLYDO" != "true" ]; then475 if [ "$NOTRYONLYDO" != "true" ]; then
@@ -503,15 +485,15 @@
503 cat >> $CDDIR/boot/grub/grub.cfg <<EOF485 cat >> $CDDIR/boot/grub/grub.cfg <<EOF
504menuentry "Install $HUMANPROJECT${suffix}" {486menuentry "Install $HUMANPROJECT${suffix}" {
505 set gfxpayload=keep487 set gfxpayload=keep
506 linux $CASPER_KERNEL\$casper_flavour $KERNEL_PARAMS $DEFAULT_PRESEED$LAYERFS_PATH_OPT only-ubiquity $QUIET $SPLASH$extra_kopt ---488 linux $CASPER_KERNEL $KERNEL_PARAMS $DEFAULT_PRESEED$LAYERFS_PATH_OPT only-ubiquity $QUIET $SPLASH$extra_kopt ---
507 initrd $CASPER_INITRD\$casper_flavour489 initrd $CASPER_INITRD
508}490}
509EOF491EOF
510 done492 done
511 cat >> $CDDIR/boot/grub/loopback.cfg <<EOF493 cat >> $CDDIR/boot/grub/loopback.cfg <<EOF
512menuentry "Install $HUMANPROJECT" {494menuentry "Install $HUMANPROJECT" {
513 linux $CASPER_KERNEL\$casper_flavour $KERNEL_PARAMS $DEFAULT_PRESEED$LAYERFS_PATH_OPT only-ubiquity iso-scan/filename=\${iso_path} $QUIET $SPLASH ---495 linux $CASPER_KERNEL $KERNEL_PARAMS $DEFAULT_PRESEED$LAYERFS_PATH_OPT only-ubiquity iso-scan/filename=\${iso_path} $QUIET $SPLASH ---
514 initrd $CASPER_INITRD\$casper_flavour496 initrd $CASPER_INITRD
515}497}
516EOF498EOF
517 fi499 fi
@@ -592,8 +574,8 @@
592 cat >> $CDDIR/boot/grub/${!kp}grub.cfg <<EOF574 cat >> $CDDIR/boot/grub/${!kp}grub.cfg <<EOF
593menuentry "OEM install (for manufacturers)" {575menuentry "OEM install (for manufacturers)" {
594 set gfxpayload=keep576 set gfxpayload=keep
595 linux $CASPER_KERNEL\$casper_flavour $KERNEL_PARAMS ${DEFAULT_PRESEED/$PREFIX_PRESEED/$PREFIX_PRESEED${!kp}}$LAYERFS_PATH_OPT only-ubiquity quiet splash oem-config/enable=true ---577 linux $CASPER_KERNEL $KERNEL_PARAMS ${DEFAULT_PRESEED/$PREFIX_PRESEED/$PREFIX_PRESEED${!kp}}$LAYERFS_PATH_OPT only-ubiquity quiet splash oem-config/enable=true ---
596 initrd $CASPER_INITRD\$casper_flavour578 initrd $CASPER_INITRD
597}579}
598EOF580EOF
599else581else
@@ -654,14 +636,14 @@
654 cat >> $CDDIR/boot/grub/grub.cfg <<EOF636 cat >> $CDDIR/boot/grub/grub.cfg <<EOF
655menuentry "Check disc for defects" {637menuentry "Check disc for defects" {
656 set gfxpayload=keep638 set gfxpayload=keep
657 linux $CASPER_KERNEL\$casper_flavour $KERNEL_PARAMS$LAYERFS_PATH_OPT integrity-check quiet splash ---639 linux $CASPER_KERNEL $KERNEL_PARAMS$LAYERFS_PATH_OPT integrity-check quiet splash ---
658 initrd $CASPER_INITRD\$casper_flavour640 initrd $CASPER_INITRD
659}641}
660EOF642EOF
661 cat >> $CDDIR/boot/grub/loopback.cfg <<EOF643 cat >> $CDDIR/boot/grub/loopback.cfg <<EOF
662menuentry "Check disc for defects" {644menuentry "Check disc for defects" {
663 linux $CASPER_KERNEL\$casper_flavour $KERNEL_PARAMS$LAYERFS_PATH_OPT integrity-check iso-scan/filename=\${iso_path} quiet splash ---645 linux $CASPER_KERNEL $KERNEL_PARAMS$LAYERFS_PATH_OPT integrity-check iso-scan/filename=\${iso_path} quiet splash ---
664 initrd $CASPER_INITRD\$casper_flavour646 initrd $CASPER_INITRD
665}647}
666EOF648EOF
667elif [ "$CDIMAGE_INSTALL_BASE" = 1 ]; then649elif [ "$CDIMAGE_INSTALL_BASE" = 1 ]; then
668650
=== removed file 'tools/boot/focal/dmi_modalias.cfg'

Subscribers

People subscribed via source and target branches