summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Bächler <thomas@archlinux.org>2011-03-27 14:51:06 +0200
committerThomas Bächler <thomas@archlinux.org>2011-03-27 14:51:06 +0200
commitf1073c5460f2381c5a8d59eec808952e9ed47af8 (patch)
treef08bad330a9a310a4529bbff35b1739289f24fee
parent32b7402e28785fb1e6489db4c847a7a1a0a94f0a (diff)
downloadmkinitcpio-f1073c5460f2381c5a8d59eec808952e9ed47af8.tar.gz
mkinitcpio-f1073c5460f2381c5a8d59eec808952e9ed47af8.tar.xz
Improve compression in mkinitcpio
- Remove default -9 compression (FS#20954) - Make compressor options configurable - Add xz support and make sure xz uses crc32 checks
-rwxr-xr-xmkinitcpio4
-rw-r--r--mkinitcpio.conf8
2 files changed, 10 insertions, 2 deletions
diff --git a/mkinitcpio b/mkinitcpio
index b4497e2..31145d0 100755
--- a/mkinitcpio
+++ b/mkinitcpio
@@ -32,6 +32,7 @@ PRESETDIR="mkinitcpio.d"
QUIET="y"
SHOW_AUTOMODS="n"
COMPRESSION="gzip"
+COMPRESSION_OPTIONS=""
if [ ! $UID ]; then
UID=$(id -u)
@@ -283,7 +284,8 @@ status=0
if [ -n "${GENIMG}" ]; then
echo -n ":: Generating image '${GENIMG}'..."
shopt -s -o pipefail
- if ! /sbin/gen_init_cpio ${FILELIST} | ${COMPRESSION} -9 > "${GENIMG}"; then
+ [ ${COMPRESSION} = "xz" ] && COMPRESSION_OPTIONS="${COMPRESSION_OPTIONS} --check=crc32"
+ if ! /sbin/gen_init_cpio ${FILELIST} | ${COMPRESSION} ${COMPRESSION_OPTIONS} > "${GENIMG}"; then
echo "FAILED"
status=1
else
diff --git a/mkinitcpio.conf b/mkinitcpio.conf
index 781d64a..b229823 100644
--- a/mkinitcpio.conf
+++ b/mkinitcpio.conf
@@ -59,7 +59,13 @@ HOOKS="base udev autodetect pata scsi sata filesystems"
# COMPRESSION
# Use this to compress the initramfs image. With kernels earlier than
# 2.6.30, only gzip is supported, which is also the default. Newer kernels
-# support gzip, bzip2 and lzma.
+# support gzip, bzip2 and lzma. Kernels 2.6.38 and later support xz
+# compression.
#COMPRESSION="gzip"
#COMPRESSION="bzip2"
#COMPRESSION="lzma"
+#COMPRESSION="xz"
+
+# COMPRESSION_OPTIONS
+# Additional options for the compressor
+#COMPRESSION_OPTIONS=""