Browse Source

Merge pull request #100 from d-hatayama/suppress_broken_pipe

lsinitrd: Suppress "cat: write error: Broken pipe"
master
Harald Hoyer 9 years ago
parent
commit
fac92cfbad
  1. 31
      lsinitrd.sh

31
lsinitrd.sh

@ -176,38 +176,35 @@ case $bin in
;; ;;
esac esac


CAT=$({ if [[ $SKIP ]] ; then
if [[ $SKIP ]]; then bin="$($SKIP "$image" | { read -N 6 bin && echo "$bin" ; })"
$SKIP "$image" else
else read -N 6 bin < "$image"
cat "$image" fi
fi } | { case $bin in
read -N 6 bin
case $bin in
$'\x1f\x8b'*) $'\x1f\x8b'*)
echo "zcat --" CAT="zcat --"
;; ;;
BZh*) BZh*)
echo "bzcat --" CAT="bzcat --"
;; ;;
$'\x71\xc7'*|070701) $'\x71\xc7'*|070701)
echo "cat --" CAT="cat --"
;; ;;
$'\x02\x21'*) $'\x02\x21'*)
echo "lz4 -d -c" CAT="lz4 -d -c"
;; ;;
$'\x89'LZO$'\0'*) $'\x89'LZO$'\0'*)
echo "lzop -d -c" CAT="lzop -d -c"
;; ;;
*) *)
if echo "test"|xz|xzcat --single-stream >/dev/null 2>&1; then if echo "test"|xz|xzcat --single-stream >/dev/null 2>&1; then
echo "xzcat --single-stream --" CAT="xzcat --single-stream --"
else else
echo "xzcat --" CAT="xzcat --"
fi fi
;; ;;
esac esac
})


skipcpio() skipcpio()
{ {

Loading…
Cancel
Save