[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#627677: marked as done (alternative initramfs compressor)



Your message dated Mon, 13 Jun 2011 19:02:51 +0000
with message-id <E1QWCPT-0001H5-CO@franck.debian.org>
and subject line Bug#627677: fixed in live-build 3.0~a21-1
has caused the Debian Bug report #627677,
regarding alternative initramfs compressor
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
627677: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=627677
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: live-build
Version: 3.0~a17-1
Severity: wishlist
Tags: patch
User: ubuntu-devel@lists.ubuntu.com
Usertags: origin-ubuntu ubuntu-patch oneiric

We compress the initramfs on the Ubuntu live CD with LZMA to save a bit
of space.  Here's a patch to allow live-build to do this.

Thanks,

-- 
Colin Watson                                       [cjwatson@ubuntu.com]
>From 71d20b7f5a057c0e234fc1080d61a8840d9e0ad6 Mon Sep 17 00:00:00 2001
From: Colin Watson <cjwatson@canonical.com>
Date: Mon, 23 May 2011 15:43:59 +0100
Subject: [PATCH] Add --initramfs-compression option.

---
 functions/defaults.sh         |    4 ++++
 manpages/en/lb_config.1       |    4 ++++
 scripts/build/lb_chroot_hacks |   25 +++++++++++++++++++++++++
 scripts/build/lb_config       |   12 +++++++++++-
 4 files changed, 44 insertions(+), 1 deletions(-)

diff --git a/functions/defaults.sh b/functions/defaults.sh
index a1e5c83..b6824b7 100755
--- a/functions/defaults.sh
+++ b/functions/defaults.sh
@@ -84,6 +84,8 @@ Set_defaults ()
 
 	LZIP_OPTIONS="${LZIP_OPTIONS:---best}"
 
+	LZMA_OPTIONS="${LZMA_OPTIONS:---best}"
+
 	# Setting apt recommends
 	case "${LB_MODE}" in
 		emdebian|progress)
@@ -153,6 +155,8 @@ Set_defaults ()
 			;;
 	esac
 
+	LB_INITRAMFS_COMPRESSION="${LB_INITRAMFS_COMPRESSION:-gzip}"
+
 	# Setting initsystem
 	case "${LB_MODE}" in
 		ubuntu)
diff --git a/manpages/en/lb_config.1 b/manpages/en/lb_config.1
index 5e247b4..a8a9c6f 100644
--- a/manpages/en/lb_config.1
+++ b/manpages/en/lb_config.1
@@ -111,6 +111,8 @@
 .br
 	[\fB\-\-initramfs\fR auto|none|live\-boot|casper]
 .br
+	[\fB\-\-initramfs\-compression\fR bzip2|gzip|lzma]
+.br
 	[\fB\-\-initsystem\fR sysvinit|runit|systemd|upstart|none]
 .br
 	[\fB\-\-interactive\fR shell]
@@ -361,6 +363,8 @@ sets the hostname of the live system.
 sets the path to the includes that live\-build is going to use, e.g. additional minimal documentation that you want to have on all live systems. By default, this is set to /usr/share/live/build/includes/. Choose none to disable inclusion of documentation.
 .IP "\fB\-\-initramfs\fR auto|none|live\-boot|casper" 4
 sets the name of package that contains the live system specific initramfs modification. By default, auto is used, which means that at build time of the image rather than on configuration time, the value will be expanded to casper when building ubuntu systems, to live\-boot for all other systems. Using 'none' is useful if the resulting system image should not be a live image (experimental).
+.IP "\fB\-\-initramfs\-compression\fR bzip2|gzip|lzma]
+defines the compression program to be used to compress the initramfs. Defaults to gzip.
 .IP "\fB\-\-interactive\fR shell" 4
 defines if after the chroot stage and before the beginning of the binary stage, a interactive shell login should be spawned in the chroot in order to allow you to do manual customizations. Once you close the shell with logout or exit, the build will continue as usual. Note that it's strongly discouraged to use this for anything else than testing. Modifications that should be present in all builds of a live system should be properly made through hooks. Everything else destroys the beauty of being able to completely automatise the build process and making it non interactive. By default, this is of course false.
 .IP "\fB\-\-isohybrid\-options\fR \fIOPTION\fR|""\fIOPTIONS\fR""" 4
diff --git a/scripts/build/lb_chroot_hacks b/scripts/build/lb_chroot_hacks
index 194d667..12279fd 100755
--- a/scripts/build/lb_chroot_hacks
+++ b/scripts/build/lb_chroot_hacks
@@ -183,6 +183,31 @@ esac
 
 Chroot chroot "${UPDATE_INITRAMFS_OPTIONS} update-initramfs -k all -t -u"
 
+# We probably ought to use COMPRESS= in a temporary file in
+# /etc/initramfs-tools/conf.d/ instead, but it's hard to pass options that
+# way.
+case "${LB_INITRAMFS_COMPRESSION}" in
+	gzip)
+		;;
+
+	bzip2)
+		for INITRAMFS in $(find chroot/boot -name 'initrd*'); do
+			zcat "${INITRAMFS}" | bzip2 -c ${BZIP2_OPTIONS} > "${INITRAMFS}.new"
+			mv "${INITRAMFS}.new" "${INITRAMFS}"
+		done
+		;;
+
+	lzma)
+		# We probably ought to use COMPRESS= in a temporary file in
+		# /etc/initramfs-tools/conf.d/ instead, but it's hard to
+		# pass options that way.
+		for INITRAMFS in $(find chroot/boot -name 'initrd*'); do
+			zcat "${INITRAMFS}" | lzma -c ${LZMA_OPTIONS} > "${INITRAMFS}.new"
+			mv "${INITRAMFS}.new" "${INITRAMFS}"
+		done
+		;;
+esac
+
 # Ensure readable permissions on initramfs. loop-aes-utils sets umask to
 # protect GPG keys, which live-build does not support.
 # Note: Use find rather than chmod on the wildcard, one never knows what
diff --git a/scripts/build/lb_config b/scripts/build/lb_config
index a2f90eb..f2c6bdc 100755
--- a/scripts/build/lb_config
+++ b/scripts/build/lb_config
@@ -80,6 +80,7 @@ USAGE="${PROGRAM}   [--apt apt|aptitude]\n\
 \t    [--ignore-system-defaults]\n\
 \t    [--includes PATH|none]\n\
 \t    [--initramfs auto|none|live-boot|casper]\n\
+\t    [--initramfs-compression bzip2|gzip|lzma]\n\
 \t    [--initsystem sysvinit|runit|systemd|upstart|none]\n\
 \t    [--interactive shell]\n\
 \t    [--isohybrid-options OPTION|\"OPTIONS\"]\n\
@@ -152,7 +153,7 @@ Local_arguments ()
 	LONG_OPTIONS="apt:,apt-ftp-proxy:,apt-http-proxy:,apt-options:,aptitute-options:,
 		apt-pipeline:,apt-recommends:,apt-secure:,bootstrap:,cache:,cache-indices:,cache-packages:,
 		cache-stages:,debconf-frontend:,debconf-nowarnings:,debconf-priority:,dump,
-		initramfs:,initsystem:,fdisk:,losetup:,mode:,repositories:,root-command:,use-fakeroot:,tasksel:,includes:,
+		initramfs:,initramfs-compression:,initsystem:,fdisk:,losetup:,mode:,repositories:,root-command:,use-fakeroot:,tasksel:,includes:,
 		templates:,architectures:,bootstrap-config:,bootstrap-flavour:,bootstrap-keyring:,clean,
 		distribution:,parent-distribution:,parent-debian-installer-distribution:,parent-mirror-bootstrap:,parent-mirror-chroot:,parent-mirror-chroot-security:,parent-mirror-chroot-volatile:,parent-mirror-chroot-backports:,parent-mirror-binary:,
 		parent-mirror-binary-security:,parent-mirror-binary-volatile:,parent-mirror-binary-backports:,parent-mirror-debian-installer:,
@@ -316,6 +317,11 @@ Local_arguments ()
 				shift 2
 				;;
 
+			--initramfs-compression)
+				LB_INITRAMFS_COMPRESSION="${2}"
+				shift 2
+				;;
+
 			--initsystem)
 				LB_INITSYSTEM="${2}"
 				shift 2
@@ -951,6 +957,10 @@ LB_DEBCONF_PRIORITY="${LB_DEBCONF_PRIORITY}"
 # (Default: ${LB_INITRAMFS})
 LB_INITRAMFS="${LB_INITRAMFS}"
 
+# \$LB_INITRAMFS_COMPRESSION: set initramfs compression
+# (Default: ${LB_INITRAMFS_COMPRESSION})
+LB_INITRAMFS_COMPRESSION="${LB_INITRAMFS_COMPRESSION}"
+
 # \$LB_INITSYSTEM: set init system
 # (Default: ${LB_INITSYSTEM})
 LB_INITSYSTEM="${LB_INITSYSTEM}"
-- 
1.7.4.1


--- End Message ---
--- Begin Message ---
Source: live-build
Source-Version: 3.0~a21-1

We believe that the bug you reported is fixed in the latest version of
live-build, which is due to be installed in the Debian FTP archive:

live-build-cgi_3.0~a21-1_all.deb
  to main/l/live-build/live-build-cgi_3.0~a21-1_all.deb
live-build_3.0~a21-1.debian.tar.gz
  to main/l/live-build/live-build_3.0~a21-1.debian.tar.gz
live-build_3.0~a21-1.dsc
  to main/l/live-build/live-build_3.0~a21-1.dsc
live-build_3.0~a21-1_all.deb
  to main/l/live-build/live-build_3.0~a21-1_all.deb
live-build_3.0~a21.orig.tar.gz
  to main/l/live-build/live-build_3.0~a21.orig.tar.gz



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 627677@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Daniel Baumann <daniel@debian.org> (supplier of updated live-build package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.8
Date: Mon, 13 Jun 2011 20:42:13 +0200
Source: live-build
Binary: live-build live-build-cgi
Architecture: source all
Version: 3.0~a21-1
Distribution: unstable
Urgency: low
Maintainer: Debian Live Project <debian-live@lists.debian.org>
Changed-By: Daniel Baumann <daniel@debian.org>
Description: 
 live-build - Debian Live - System Build Scripts
 live-build-cgi - Debian Live - System Build Scripts (cgi frontend)
Closes: 627677 629637 630350
Changes: 
 live-build (3.0~a21-1) unstable; urgency=low
 .
   [ Daniel Baumann ]
   * Obtaining the live passes package selection information at the
     latest point to catch all other modifications in the package
     selection.
   * Moving installation of live packages to second pass.
   * Removing now unecessary stagefile check in lb_source.
   * Correct lb cleans source removals.
 .
   [ Colin Watson ]
   * Add --swap-file-path and --swap-file-size options (Closes: #629637).
   * Divert flash-kernel aside while building the chroot (Closes:
     #630350).
   * Add --initramfs-compression option (Closes: #627677).
Checksums-Sha1: 
 0a8aa2989a2bf98500deab3ba0c96626f9357fa7 1282 live-build_3.0~a21-1.dsc
 8ac7c300a633007324ef45fb9ed96c9d593816e9 1886786 live-build_3.0~a21.orig.tar.gz
 ac0892dfc5bcd305538cdcc5b48927302980c6ad 41818 live-build_3.0~a21-1.debian.tar.gz
 e854dd96a4ad3a9cc4344aff8395f883a3cb2e87 1130664 live-build_3.0~a21-1_all.deb
 7838cde2af8c81cdab30f5a23dffd6ba72a3b6e5 58300 live-build-cgi_3.0~a21-1_all.deb
Checksums-Sha256: 
 0c4bb39620b0f44794630c09c64c0ec05f2eb79957bf94948948ad1ffdb3cf02 1282 live-build_3.0~a21-1.dsc
 dee4a7dcd7fe5756e4fecbd7b717c2c4432897d1ce0fc8020667784e3e17f113 1886786 live-build_3.0~a21.orig.tar.gz
 4dd813d7dd1fed0a5bb5be6162b6d2f6b1aa5792f54184b6a2714d029e30107f 41818 live-build_3.0~a21-1.debian.tar.gz
 4037f117ddf6260a746f492c2c030ec8b8476ac48cd0f62c39cb14528a6cf004 1130664 live-build_3.0~a21-1_all.deb
 88fd284707c3f597d0a8ad23a8e9ca9e0796e85974ee55b8948ed8922f34970f 58300 live-build-cgi_3.0~a21-1_all.deb
Files: 
 f6ea9cf3c272a31b24626a195975bd95 1282 misc optional live-build_3.0~a21-1.dsc
 f683ee2e661e2156c30761cd57f6f31f 1886786 misc optional live-build_3.0~a21.orig.tar.gz
 ca6f697fb711deeec129236e3746d11b 41818 misc optional live-build_3.0~a21-1.debian.tar.gz
 6943373d729a47b72268b218fc2a7a13 1130664 misc optional live-build_3.0~a21-1_all.deb
 5cf3d6ab881424a334e9b5722a908575 58300 misc optional live-build-cgi_3.0~a21-1_all.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iEYEARECAAYFAk32W4EACgkQ+C5cwEsrK54NVQCgp0cuhWAkaFXVrtkZZxFxwBY/
xtIAoLugbKZrYHyPzI66y4518odcJ3hG
=ANaa
-----END PGP SIGNATURE-----



--- End Message ---

Reply to: