From 0d750f78bc19d042d281685d1e8d38584801def1 Mon Sep 17 00:00:00 2001 From: Michael Hudson-Doyle Date: Tue, 13 Mar 2018 21:37:06 +1300 Subject: [PATCH 1/4] Set INITRAMFS_COMPRESSION to gzip for live-server builds to speed up the boot. (LP: #1750873) --- debian/changelog | 7 +++++++ live-build/auto/config | 1 + 2 files changed, 8 insertions(+) diff --git a/debian/changelog b/debian/changelog index 8089d062..6d6b0c39 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +livecd-rootfs (2.510) UNRELEASED; urgency=medium + + * Set INITRAMFS_COMPRESSION to gzip for live-server builds to speed up the + boot. (LP: #1750873) + + -- Michael Hudson-Doyle Tue, 13 Mar 2018 21:24:27 +1300 + livecd-rootfs (2.509) bionic; urgency=medium [ Steve Langasek ] diff --git a/live-build/auto/config b/live-build/auto/config index 6dc8881f..0601ab67 100755 --- a/live-build/auto/config +++ b/live-build/auto/config @@ -507,6 +507,7 @@ case $PROJECT in case $ARCH in amd64) add_package live linux-signed-generic ;; esac + INITRAMFS_COMPRESSION='gzip' ;; esac COMPONENTS='main' From b7f3ec398b43fd2f42babc71a749d14c813dafb2 Mon Sep 17 00:00:00 2001 From: Michael Hudson-Doyle Date: Wed, 14 Mar 2018 15:54:06 +1300 Subject: [PATCH 2/4] Make lzma initramfs compression opt-in rather than opt-out, and do not opt-in to it for live-server builds to speed up the boot. (LP: #1750873) --- debian/changelog | 4 ++-- live-build/auto/config | 24 +++++++++++++++++++++--- 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/debian/changelog b/debian/changelog index 6d6b0c39..ec079204 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,7 +1,7 @@ livecd-rootfs (2.510) UNRELEASED; urgency=medium - * Set INITRAMFS_COMPRESSION to gzip for live-server builds to speed up the - boot. (LP: #1750873) + * Make lzma initramfs compression opt-in rather than opt-out, and do not + opt-in to it for live-server builds to speed up the boot. (LP: #1750873) -- Michael Hudson-Doyle Tue, 13 Mar 2018 21:24:27 +1300 diff --git a/live-build/auto/config b/live-build/auto/config index 0601ab67..9554c6b9 100755 --- a/live-build/auto/config +++ b/live-build/auto/config @@ -324,6 +324,7 @@ fi case $PROJECT in ubuntu|ubuntu-dvd) + INITRAMFS_COMPRESSION='lzma' add_task install minimal standard ubuntu-desktop LIVE_TASK='ubuntu-live' case $ARCH in @@ -332,6 +333,7 @@ case $PROJECT in ;; ubuntu-desktop-next) + INITRAMFS_COMPRESSION='lzma' add_task install minimal standard ubuntu-desktop-next ubuntu-sdk-libs COMPONENTS='main restricted universe' LIVE_TASK='ubuntu-touch-live' @@ -351,6 +353,7 @@ case $PROJECT in ;; kubuntu|kubuntu-dvd) + INITRAMFS_COMPRESSION='lzma' add_task install minimal standard add_task install kubuntu-desktop LIVE_TASK='kubuntu-live' @@ -362,6 +365,7 @@ case $PROJECT in ;; kubuntu-active) + INITRAMFS_COMPRESSION='lzma' add_task install minimal standard kubuntu-active LIVE_TASK='kubuntu-active-live' COMPONENTS='main restricted universe' @@ -369,6 +373,7 @@ case $PROJECT in ;; kubuntu-plasma5) + INITRAMFS_COMPRESSION='lzma' add_task install minimal standard add_package install kubuntu-plasma5-desktop # Technically cheating, but PPAs don't have tasks and the @@ -381,6 +386,7 @@ case $PROJECT in ;; edubuntu|edubuntu-dvd) + INITRAMFS_COMPRESSION='lzma' add_task install minimal standard ubuntu-desktop edubuntu-desktop-gnome LIVE_TASK='edubuntu-live' case $ARCH in @@ -390,6 +396,7 @@ case $PROJECT in ;; xubuntu) + INITRAMFS_COMPRESSION='lzma' add_task install minimal standard xubuntu-desktop add_package install xterm LIVE_TASK='xubuntu-live' @@ -403,11 +410,13 @@ case $PROJECT in ;; ubuntu-netbook) + INITRAMFS_COMPRESSION='lzma' add_task install minimal standard ubuntu-netbook LIVE_TASK='netbook-live' ;; mythbuntu) + INITRAMFS_COMPRESSION='lzma' add_task install minimal standard mythbuntu-desktop LIVE_TASK='mythbuntu-live' case $ARCH in @@ -417,6 +426,7 @@ case $PROJECT in ;; lubuntu) + INITRAMFS_COMPRESSION='lzma' add_task install minimal standard lubuntu-desktop LIVE_TASK='lubuntu-live' case $ARCH in @@ -433,6 +443,7 @@ case $PROJECT in ;; lubuntu-next) + INITRAMFS_COMPRESSION='lzma' add_task install minimal standard lubuntu-qt-desktop LIVE_TASK='lubuntu-live-qt' case $ARCH in @@ -449,6 +460,7 @@ case $PROJECT in ;; ubuntu-gnome) + INITRAMFS_COMPRESSION='lzma' add_task install minimal standard ubuntu-gnome-desktop LIVE_TASK='ubuntu-gnome-live' case $ARCH in @@ -458,6 +470,7 @@ case $PROJECT in ;; ubuntu-budgie) + INITRAMFS_COMPRESSION='lzma' add_task install minimal standard ubuntu-budgie-desktop LIVE_TASK='ubuntu-budgie-live' case $ARCH in @@ -467,6 +480,7 @@ case $PROJECT in ;; ubuntu-mate) + INITRAMFS_COMPRESSION='lzma' add_task install minimal standard ubuntu-mate-core ubuntu-mate-desktop LIVE_TASK='ubuntu-mate-live' case $ARCH in @@ -476,6 +490,7 @@ case $PROJECT in ;; ubuntustudio-dvd) + INITRAMFS_COMPRESSION='lzma' add_task install minimal standard ubuntustudio-desktop ubuntustudio-audio ubuntustudio-fonts ubuntustudio-graphics ubuntustudio-video ubuntustudio-publishing ubuntustudio-photography COMPONENTS='main restricted universe multiverse' case $ARCH in @@ -484,6 +499,7 @@ case $PROJECT in ;; ubuntukylin) + INITRAMFS_COMPRESSION='lzma' add_task install minimal standard ubuntukylin-desktop add_package install ubuntukylin-default-settings LIVE_TASK='ubuntukylin-live' @@ -494,6 +510,7 @@ case $PROJECT in ;; base) + INITRAMFS_COMPRESSION='lzma' add_task install minimal standard ;; @@ -507,7 +524,6 @@ case $PROJECT in case $ARCH in amd64) add_package live linux-signed-generic ;; esac - INITRAMFS_COMPRESSION='gzip' ;; esac COMPONENTS='main' @@ -571,10 +587,12 @@ case $PROJECT in ;; ubuntu-base) + INITRAMFS_COMPRESSION='lzma' OPTS="${OPTS:+$OPTS }--bootstrap-flavour=minimal" ;; ubuntu-touch|ubuntu-touch-custom) + INITRAMFS_COMPRESSION='lzma' HINTS="packagekit ubuntu-system-settings" case $ARCH in amd64|i386) @@ -613,6 +631,7 @@ case $PROJECT in ;; ubuntu-cpc) + INITRAMFS_COMPRESSION='lzma' if [ "${SUBPROJECT:-}" = minimized ]; then add_task install cloud-image add_package install sudo @@ -656,7 +675,6 @@ case $PROJECT in OPTS="${OPTS:+$OPTS }--hdd-label=cloudimg-rootfs" OPTS="${OPTS:+$OPTS }--ext-resize-blocks=536870912 --ext-block-size=4096" OPTS="${OPTS:+$OPTS }--ext-fudge-factor=15" - INITRAMFS_COMPRESSION="gzip" ;; *) @@ -818,7 +836,7 @@ lb config noauto \ ${KERNEL_FLAVOURS:+--linux-flavours "$KERNEL_FLAVOURS"} \ --initsystem none \ --bootloader "$BOOTLOADER" \ - --initramfs-compression "${INITRAMFS_COMPRESSION:-lzma}" \ + ${INITRAMFS_COMPRESSION:+--initramfs-compression "$INITRAMFS_COMPRESSION}" \ --cache false \ ${BOOTAPPEND_LIVE:+--bootappend-live "$BOOTAPPEND_LIVE"} \ $OPTS \ From d46edbffdb1d6288faf382ef88be6161c2808543 Mon Sep 17 00:00:00 2001 From: Michael Hudson-Doyle Date: Thu, 15 Mar 2018 09:48:10 +1300 Subject: [PATCH 3/4] reduce duplication somewhat --- live-build/auto/config | 49 ++++++++++++++++++++++++------------------ 1 file changed, 28 insertions(+), 21 deletions(-) diff --git a/live-build/auto/config b/live-build/auto/config index 9554c6b9..c03b5218 100755 --- a/live-build/auto/config +++ b/live-build/auto/config @@ -322,9 +322,36 @@ if ! [ -e config/germinate-output/structure ]; then ${COMPONENTS:+-c "$COMPONENTS"} -a $ARCH) fi +case $PROJECT in + base|edubuntu|edubuntu-dvd|kubuntu|kubuntu-active|kubuntu-dvd|kubuntu-plasma5|lubuntu|lubuntu-next|mythbuntu|ubuntu|ubuntu-base|ubuntu-budgie|ubuntu-desktop-next|ubuntu-dvd|ubuntu-gnome|ubuntu-mate|ubuntu-netbook|ubuntu-touch|ubuntu-touch-custom|ubuntukylin|ubuntustudio-dvd|xubuntu) + INITRAMFS_COMPRESSION="lzma" + ;; + + ubuntu-server) + case ${SUBPROJECT:-} in + live) + ;; + *) + INITRAMFS_COMPRESSION="lzma" + ;; + esac + ;; + + ubuntu-core) + INITRAMFS_COMPRESSION="none" + ;; + + ubuntu-cpc) + ;; + + *) + echo "unknown project $PROJECT" >&2 + exit 2 + ;; +esac + case $PROJECT in ubuntu|ubuntu-dvd) - INITRAMFS_COMPRESSION='lzma' add_task install minimal standard ubuntu-desktop LIVE_TASK='ubuntu-live' case $ARCH in @@ -333,7 +360,6 @@ case $PROJECT in ;; ubuntu-desktop-next) - INITRAMFS_COMPRESSION='lzma' add_task install minimal standard ubuntu-desktop-next ubuntu-sdk-libs COMPONENTS='main restricted universe' LIVE_TASK='ubuntu-touch-live' @@ -353,7 +379,6 @@ case $PROJECT in ;; kubuntu|kubuntu-dvd) - INITRAMFS_COMPRESSION='lzma' add_task install minimal standard add_task install kubuntu-desktop LIVE_TASK='kubuntu-live' @@ -365,7 +390,6 @@ case $PROJECT in ;; kubuntu-active) - INITRAMFS_COMPRESSION='lzma' add_task install minimal standard kubuntu-active LIVE_TASK='kubuntu-active-live' COMPONENTS='main restricted universe' @@ -373,7 +397,6 @@ case $PROJECT in ;; kubuntu-plasma5) - INITRAMFS_COMPRESSION='lzma' add_task install minimal standard add_package install kubuntu-plasma5-desktop # Technically cheating, but PPAs don't have tasks and the @@ -386,7 +409,6 @@ case $PROJECT in ;; edubuntu|edubuntu-dvd) - INITRAMFS_COMPRESSION='lzma' add_task install minimal standard ubuntu-desktop edubuntu-desktop-gnome LIVE_TASK='edubuntu-live' case $ARCH in @@ -396,7 +418,6 @@ case $PROJECT in ;; xubuntu) - INITRAMFS_COMPRESSION='lzma' add_task install minimal standard xubuntu-desktop add_package install xterm LIVE_TASK='xubuntu-live' @@ -410,13 +431,11 @@ case $PROJECT in ;; ubuntu-netbook) - INITRAMFS_COMPRESSION='lzma' add_task install minimal standard ubuntu-netbook LIVE_TASK='netbook-live' ;; mythbuntu) - INITRAMFS_COMPRESSION='lzma' add_task install minimal standard mythbuntu-desktop LIVE_TASK='mythbuntu-live' case $ARCH in @@ -426,7 +445,6 @@ case $PROJECT in ;; lubuntu) - INITRAMFS_COMPRESSION='lzma' add_task install minimal standard lubuntu-desktop LIVE_TASK='lubuntu-live' case $ARCH in @@ -443,7 +461,6 @@ case $PROJECT in ;; lubuntu-next) - INITRAMFS_COMPRESSION='lzma' add_task install minimal standard lubuntu-qt-desktop LIVE_TASK='lubuntu-live-qt' case $ARCH in @@ -460,7 +477,6 @@ case $PROJECT in ;; ubuntu-gnome) - INITRAMFS_COMPRESSION='lzma' add_task install minimal standard ubuntu-gnome-desktop LIVE_TASK='ubuntu-gnome-live' case $ARCH in @@ -470,7 +486,6 @@ case $PROJECT in ;; ubuntu-budgie) - INITRAMFS_COMPRESSION='lzma' add_task install minimal standard ubuntu-budgie-desktop LIVE_TASK='ubuntu-budgie-live' case $ARCH in @@ -480,7 +495,6 @@ case $PROJECT in ;; ubuntu-mate) - INITRAMFS_COMPRESSION='lzma' add_task install minimal standard ubuntu-mate-core ubuntu-mate-desktop LIVE_TASK='ubuntu-mate-live' case $ARCH in @@ -490,7 +504,6 @@ case $PROJECT in ;; ubuntustudio-dvd) - INITRAMFS_COMPRESSION='lzma' add_task install minimal standard ubuntustudio-desktop ubuntustudio-audio ubuntustudio-fonts ubuntustudio-graphics ubuntustudio-video ubuntustudio-publishing ubuntustudio-photography COMPONENTS='main restricted universe multiverse' case $ARCH in @@ -499,7 +512,6 @@ case $PROJECT in ;; ubuntukylin) - INITRAMFS_COMPRESSION='lzma' add_task install minimal standard ubuntukylin-desktop add_package install ubuntukylin-default-settings LIVE_TASK='ubuntukylin-live' @@ -510,7 +522,6 @@ case $PROJECT in ;; base) - INITRAMFS_COMPRESSION='lzma' add_task install minimal standard ;; @@ -576,7 +587,6 @@ case $PROJECT in ;; esac OPTS="${OPTS:+$OPTS }--linux-packages=none --initramfs=none" - INITRAMFS_COMPRESSION="none" # contains the framework definition add_package install ubuntu-core-libs @@ -587,12 +597,10 @@ case $PROJECT in ;; ubuntu-base) - INITRAMFS_COMPRESSION='lzma' OPTS="${OPTS:+$OPTS }--bootstrap-flavour=minimal" ;; ubuntu-touch|ubuntu-touch-custom) - INITRAMFS_COMPRESSION='lzma' HINTS="packagekit ubuntu-system-settings" case $ARCH in amd64|i386) @@ -631,7 +639,6 @@ case $PROJECT in ;; ubuntu-cpc) - INITRAMFS_COMPRESSION='lzma' if [ "${SUBPROJECT:-}" = minimized ]; then add_task install cloud-image add_package install sudo From c787069c5cfc618675b76ac53b76fd39f350b877 Mon Sep 17 00:00:00 2001 From: Michael Hudson-Doyle Date: Thu, 15 Mar 2018 10:17:40 +1300 Subject: [PATCH 4/4] do not set INITRAMFS_COMPRESSION for projects that end up passing --initramfs=none to lb config --- live-build/auto/config | 24 +----------------------- 1 file changed, 1 insertion(+), 23 deletions(-) diff --git a/live-build/auto/config b/live-build/auto/config index c03b5218..4017aba1 100755 --- a/live-build/auto/config +++ b/live-build/auto/config @@ -323,31 +323,9 @@ if ! [ -e config/germinate-output/structure ]; then fi case $PROJECT in - base|edubuntu|edubuntu-dvd|kubuntu|kubuntu-active|kubuntu-dvd|kubuntu-plasma5|lubuntu|lubuntu-next|mythbuntu|ubuntu|ubuntu-base|ubuntu-budgie|ubuntu-desktop-next|ubuntu-dvd|ubuntu-gnome|ubuntu-mate|ubuntu-netbook|ubuntu-touch|ubuntu-touch-custom|ubuntukylin|ubuntustudio-dvd|xubuntu) + base|edubuntu|edubuntu-dvd|kubuntu|kubuntu-active|kubuntu-dvd|kubuntu-plasma5|lubuntu|lubuntu-next|mythbuntu|ubuntu|ubuntu-budgie|ubuntu-desktop-next|ubuntu-dvd|ubuntu-gnome|ubuntu-mate|ubuntu-netbook|ubuntukylin|ubuntustudio-dvd|xubuntu) INITRAMFS_COMPRESSION="lzma" ;; - - ubuntu-server) - case ${SUBPROJECT:-} in - live) - ;; - *) - INITRAMFS_COMPRESSION="lzma" - ;; - esac - ;; - - ubuntu-core) - INITRAMFS_COMPRESSION="none" - ;; - - ubuntu-cpc) - ;; - - *) - echo "unknown project $PROJECT" >&2 - exit 2 - ;; esac case $PROJECT in