]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
dracut: add "--check=crc32" to xz compression
authorHarald Hoyer <harald@redhat.com>
Wed, 16 Mar 2011 20:17:26 +0000 (21:17 +0100)
committerHarald Hoyer <harald@redhat.com>
Wed, 16 Mar 2011 20:17:26 +0000 (21:17 +0100)
As mentioned in kernel/Documentation/xz.txt:

...
Notes on compression options

  Since the XZ Embedded supports only streams with no integrity check
  or CRC32, make sure that you don't use some other integrity check
  type when encoding files that are supposed to be decoded by the
  kernel. With liblzma, you need to use either LZMA_CHECK_NONE or
  LZMA_CHECK_CRC32 when encoding. With the xz command line tool, use
  --check=none or --check=crc32.

  Using CRC32 is strongly recommended unless there is some other layer
  which will verify the integrity of the uncompressed data anyway.
...

dracut

diff --git a/dracut b/dracut
index 2ae7f8caa7d7b1ab610f47894b7207b46cefa21f..10e86d0e719ac5106f8199fb88e0d1d06b51b986 100755 (executable)
--- a/dracut
+++ b/dracut
@@ -214,7 +214,7 @@ while (($# > 0)); do
         -i|--include)  push include_src "$2"; push include_target "$3"; shift 2;;
         --bzip2)       [[ $compress != cat ]] && compress="bzip2 -9";;
         --lzma)        [[ $compress != cat ]] && compress="lzma -9";;
-        --xz)          [[ $compress != cat ]] && compress="xz -9";;
+        --xz)          [[ $compress != cat ]] && compress="xz --check=crc32";;
         --no-compress) compress="cat";;
         --gzip)        if [[ $compress != cat ]]; then
             type pigz > /dev/null 2>&1 && compress="pigz -9" || \