summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/build/lb_chroot_hacks25
-rwxr-xr-xscripts/build/lb_config12
2 files changed, 36 insertions, 1 deletions
diff --git a/scripts/build/lb_chroot_hacks b/scripts/build/lb_chroot_hacks
index 33c24d679..2ad85d3b3 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 c9c60bebd..d8813b523 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}"