Blame 0053-lsinitrd-use-xz-with-single-stream-if-available.patch

Harald Hoyer 83ebbb
From c96425c3647d1d5e7110ac369056df79a6024e1d Mon Sep 17 00:00:00 2001
Harald Hoyer 83ebbb
From: Harald Hoyer <harald@redhat.com>
Harald Hoyer 83ebbb
Date: Mon, 23 Jan 2012 10:34:03 +0100
Harald Hoyer 83ebbb
Subject: [PATCH] lsinitrd: use xz with --single-stream, if available
Harald Hoyer 83ebbb
Harald Hoyer 83ebbb
The F16 installation image is two concatenated cpio images:
Harald Hoyer 83ebbb
[xz-compressed dracut initramfs][uncompressed cpio with /squashfs.img]
Harald Hoyer 83ebbb
Harald Hoyer 83ebbb
So to show the contents, use xz with the "--single-stream" option.
Harald Hoyer 83ebbb
Harald Hoyer 83ebbb
https://bugzilla.redhat.com/show_bug.cgi?id=742299
Harald Hoyer 83ebbb
---
Harald Hoyer 83ebbb
 lsinitrd |    8 ++++++--
Harald Hoyer 83ebbb
 1 files changed, 6 insertions(+), 2 deletions(-)
Harald Hoyer 83ebbb
Harald Hoyer 83ebbb
diff --git a/lsinitrd b/lsinitrd
Harald Hoyer 83ebbb
index ad7ece9..1d953b7 100755
Harald Hoyer 83ebbb
--- a/lsinitrd
Harald Hoyer 83ebbb
+++ b/lsinitrd
Harald Hoyer 83ebbb
@@ -36,12 +36,16 @@ image="${1:-/boot/initramfs-$(uname -r).img}"
Harald Hoyer 83ebbb
 CAT=zcat
Harald Hoyer 83ebbb
 FILE_T=$(file "$image")
Harald Hoyer 83ebbb
 
Harald Hoyer 83ebbb
+if echo "test"|xz|xz -dc --single-stream; then
Harald Hoyer 83ebbb
+    XZ_SINGLE_STREAM="--single-stream"
Harald Hoyer 83ebbb
+fi
Harald Hoyer 83ebbb
+
Harald Hoyer 83ebbb
 if [[ "$FILE_T" =~ ": gzip compressed data" ]]; then
Harald Hoyer 83ebbb
     CAT=zcat
Harald Hoyer 83ebbb
 elif [[ "$FILE_T" =~ ": xz compressed data" ]]; then
Harald Hoyer 83ebbb
-    CAT=xzcat
Harald Hoyer 83ebbb
+    CAT="xzcat $XZ_SINGLE_STREAM"
Harald Hoyer 83ebbb
 elif [[ "$FILE_T" =~ ": XZ compressed data" ]]; then
Harald Hoyer 83ebbb
-    CAT=xzcat
Harald Hoyer 83ebbb
+    CAT="xzcat $XZ_SINGLE_STREAM"
Harald Hoyer 83ebbb
 elif [[ "$FILE_T" =~ ": data" ]]; then
Harald Hoyer 83ebbb
     CAT=lzcat
Harald Hoyer 83ebbb
 fi