summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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=""