[SCM] live-build branch, debian-next, updated. debian/3.0_a20-1-7-g5d228a8

Daniel Baumann daniel at debian.org
Mon Jun 13 18:38:19 UTC 2011


The following commit has been merged in the debian-next branch:
commit 5d228a8e3ecc60bc481e8ad17d1687cc706de649
Author: Colin Watson <cjwatson at canonical.com>
Date:   Mon Jun 13 20:38:44 2011 +0200

    Add --initramfs-compression option (Closes: #627677).

diff --git a/functions/defaults.sh b/functions/defaults.sh
index 3bb9adc..4379704 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 ac5fc0b..d3cc962 100644
--- a/manpages/en/lb_config.1
+++ b/manpages/en/lb_config.1
@@ -107,6 +107,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]
@@ -349,6 +351,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 33c24d6..2ad85d3 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 c9c60be..d8813b5 100755
--- a/scripts/build/lb_config
+++ b/scripts/build/lb_config
@@ -78,6 +78,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\
@@ -150,7 +151,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-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:,
@@ -314,6 +315,11 @@ Local_arguments ()
 				shift 2
 				;;
 
+			--initramfs-compression)
+				LB_INITRAMFS_COMPRESSION="${2}"
+				shift 2
+				;;
+
 			--initsystem)
 				LB_INITSYSTEM="${2}"
 				shift 2
@@ -939,6 +945,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}"

-- 
live-build



More information about the debian-live-changes mailing list