You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

62 lines
2.9 KiB

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