Blame SOURCES/0279-lsinitrd.sh-ignore-cat-write-error-Broken-pipe.patch

18971c
From 3cf4ec08e51c6b6c6d21d4b1cf67b98bb7878558 Mon Sep 17 00:00:00 2001
18971c
From: Harald Hoyer <harald@redhat.com>
18971c
Date: Fri, 3 Jul 2015 14:35:25 +0200
18971c
Subject: [PATCH] lsinitrd.sh: ignore "cat: write error: Broken pipe"
18971c
18971c
---
18971c
 lsinitrd.sh | 12 ++++++------
18971c
 1 file changed, 6 insertions(+), 6 deletions(-)
18971c
18971c
diff --git a/lsinitrd.sh b/lsinitrd.sh
18971c
index b086a635..88fe9834 100755
18971c
--- a/lsinitrd.sh
18971c
+++ b/lsinitrd.sh
18971c
@@ -116,7 +116,7 @@ extract_files()
18971c
     for f in ${!filenames[@]}; do
18971c
         [[ $nofileinfo ]] || echo "initramfs:/$f"
18971c
         [[ $nofileinfo ]] || echo "========================================================================"
18971c
-        $CAT $image | cpio --extract --verbose --quiet --to-stdout $f 2>/dev/null
18971c
+        $CAT $image 2>/dev/null | cpio --extract --verbose --quiet --to-stdout $f 2>/dev/null
18971c
         ((ret+=$?))
18971c
         [[ $nofileinfo ]] || echo "========================================================================"
18971c
         [[ $nofileinfo ]] || echo
18971c
@@ -126,7 +126,7 @@ extract_files()
18971c
 list_modules()
18971c
 {
18971c
     echo "dracut modules:"
18971c
-    $CAT "$image" | cpio --extract --verbose --quiet --to-stdout -- 'lib/dracut/modules.txt' 'usr/lib/dracut/modules.txt' 2>/dev/null
18971c
+    $CAT "$image" 2>/dev/null | cpio --extract --verbose --quiet --to-stdout -- 'lib/dracut/modules.txt' 'usr/lib/dracut/modules.txt' 2>/dev/null
18971c
     ((ret+=$?))
18971c
 }
18971c
 
18971c
@@ -134,9 +134,9 @@ list_files()
18971c
 {
18971c
     echo "========================================================================"
18971c
     if [ "$sorted" -eq 1 ]; then
18971c
-        $CAT "$image" | cpio --extract --verbose --quiet --list | sort -n -k5
18971c
+        $CAT "$image" 2>/dev/null | cpio --extract --verbose --quiet --list | sort -n -k5
18971c
     else
18971c
-        $CAT "$image" | cpio --extract --verbose --quiet --list | sort -k9
18971c
+        $CAT "$image" 2>/dev/null | cpio --extract --verbose --quiet --list | sort -k9
18971c
     fi
18971c
     ((ret+=$?))
18971c
     echo "========================================================================"
18971c
@@ -220,7 +220,7 @@ ret=0
18971c
 if (( ${#filenames[@]} > 0 )); then
18971c
     extract_files
18971c
 else
18971c
-    version=$($CAT "$image" | cpio --extract --verbose --quiet --to-stdout -- 'lib/dracut/dracut-*' 'usr/lib/dracut/dracut-*' 2>/dev/null)
18971c
+    version=$($CAT "$image" 2>/dev/null | cpio --extract --verbose --quiet --to-stdout -- 'lib/dracut/dracut-*' 'usr/lib/dracut/dracut-*' 2>/dev/null)
18971c
     ((ret+=$?))
18971c
     echo "Version: $version"
18971c
     echo
18971c
@@ -229,7 +229,7 @@ else
18971c
         echo "========================================================================"
18971c
     else
18971c
         echo -n "Arguments: "
18971c
-        $CAT "$image" | cpio --extract --verbose --quiet --to-stdout -- 'lib/dracut/build-parameter.txt' 'usr/lib/dracut/build-parameter.txt' 2>/dev/null
18971c
+        $CAT "$image" 2>/dev/null | cpio --extract --verbose --quiet --to-stdout -- 'lib/dracut/build-parameter.txt' 'usr/lib/dracut/build-parameter.txt' 2>/dev/null
18971c
         echo
18971c
         list_modules
18971c
         list_files