summaryrefslogtreecommitdiff
path: root/scripts/build/lb_chroot_hacks
diff options
context:
space:
mode:
authorColin Watson <cjwatson@canonical.com>2011-06-13 20:38:44 +0200
committerDaniel Baumann <daniel@debian.org>2011-06-13 20:38:44 +0200
commit5d228a8e3ecc60bc481e8ad17d1687cc706de649 (patch)
treeb106ca42d4764c2abe33d7d6ef7d6fa1fab1f76f /scripts/build/lb_chroot_hacks
parentd5510c99100303d73c00dd59907aeda83594d3b5 (diff)
downloadvyos-live-build-5d228a8e3ecc60bc481e8ad17d1687cc706de649.tar.gz
vyos-live-build-5d228a8e3ecc60bc481e8ad17d1687cc706de649.zip
Add --initramfs-compression option (Closes: #627677).
Diffstat (limited to 'scripts/build/lb_chroot_hacks')
-rwxr-xr-xscripts/build/lb_chroot_hacks25
1 files changed, 25 insertions, 0 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