From 48f4c7164f7aad7fee7f39375fd8b44437f10e1f Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Tue, 23 Jun 2009 17:27:52 +0100 Subject: [PATCH] Compress the initrd with LZMA by default, now that the kernel supports this across the board. Saves about 3MB on Ubuntu live CDs. --- debian/changelog | 7 +++++++ livecd.sh | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/debian/changelog b/debian/changelog index 666789d3..5a7ff406 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +livecd-rootfs (0.85) UNRELEASED; urgency=low + + * Compress the initrd with LZMA by default, now that the kernel supports + this across the board. Saves about 3MB on Ubuntu live CDs. + + -- Colin Watson Tue, 23 Jun 2009 17:26:36 +0100 + livecd-rootfs (0.84) karmic; urgency=low * Don't force installation of libgoffice-gtk-0-6 on xubuntu; this package diff --git a/livecd.sh b/livecd.sh index b635f1ac..dfe517ee 100755 --- a/livecd.sh +++ b/livecd.sh @@ -70,6 +70,7 @@ export CASPER_GENERATE_UUID=1 SRCMIRROR=http://archive.ubuntu.com/ubuntu ARCH=$(dpkg --print-architecture) OPTMIRROR= +INITRD_COMPRESSOR=lzma select_mirror () { case $ARCH in @@ -499,6 +500,12 @@ ${COMMENT}deb-src ${SECSRCMIRROR} ${STE}-security multiverse # ubiquity >= 1.9.4 copies the kernel from the CD root if it doesn't # find one on the livefs, allowing us to save space mv ${ROOT}/boot/vmlinu?-"${KVER}" livecd.${FSS}.kernel-"${SUBARCH}" + if [ "$INITRD_COMPRESSOR" != gz ]; then + zcat "livecd.${FSS}.initrd-${SUBARCH}" | "$INITRD_COMPRESSOR" -9c \ + > "livecd.${FSS}.initrd-${SUBARCH}.new" + mv "livecd.${FSS}.initrd-${SUBARCH}.new" \ + "livecd.${FSS}.initrd-${SUBARCH}" + fi done NUMKVERS="$(set -- $KVERS; echo $#)" if [ "$NUMKVERS" = 1 ]; then