dracut/0572-lsinitrd-no-more-cat-write-error-Broken-pipe.patch
Daniel Molkentin b330414562 Accepting request 616866 from home:dmolkentin:branches:Base:System
- 40network: Fix static network setup (bsc#1091099)
  * adds 0571-40network-Fix-static-network-setup.patch
- lsinitrd: Fix cat: write error: Broken pipe error (bsc#1094603)
  * adds 0572-lsinitrd-no-more-cat-write-error-Broken-pipe.patch
  * adds 0573-lsinitrd.sh-quote-filename-in-extract_files.patch

OBS-URL: https://build.opensuse.org/request/show/616866
OBS-URL: https://build.opensuse.org/package/show/Base:System/dracut?expand=0&rev=352
2018-06-14 13:01:21 +00:00

45 lines
1.8 KiB
Diff

From b2e09d1d444e771493c26c576256f962bd8869f3 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Tue, 16 Jan 2018 12:14:15 +0100
Subject: [PATCH 1/2] lsinitrd: no more cat: write error: Broken pipe
silence the cat
---
lsinitrd.sh | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/lsinitrd.sh b/lsinitrd.sh
index 1e4d99ac..9c7a178b 100755
--- a/lsinitrd.sh
+++ b/lsinitrd.sh
@@ -120,7 +120,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
@@ -139,15 +139,14 @@ 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 "========================================================================"
}
-
if (( ${#filenames[@]} <= 0 )); then
echo "Image: $image: $(du -h $image | while read a b || [ -n "$a" ]; do echo $a;done)"
echo "========================================================================"
--
2.16.3