mirror of
https://github.com/dracutdevs/dracut.git
synced 2024-10-28 18:55:32 +03:00
lsinitrd: use xz with --single-stream, if available
The F16 installation image is two concatenated cpio images: [xz-compressed dracut initramfs][uncompressed cpio with /squashfs.img] So to show the contents, use xz with the "--single-stream" option. https://bugzilla.redhat.com/show_bug.cgi?id=742299
This commit is contained in:
parent
1fcf2d2f4a
commit
c96425c364
8
lsinitrd
8
lsinitrd
@ -36,12 +36,16 @@ image="${1:-/boot/initramfs-$(uname -r).img}"
|
|||||||
CAT=zcat
|
CAT=zcat
|
||||||
FILE_T=$(file "$image")
|
FILE_T=$(file "$image")
|
||||||
|
|
||||||
|
if echo "test"|xz|xz -dc --single-stream; then
|
||||||
|
XZ_SINGLE_STREAM="--single-stream"
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ "$FILE_T" =~ ": gzip compressed data" ]]; then
|
if [[ "$FILE_T" =~ ": gzip compressed data" ]]; then
|
||||||
CAT=zcat
|
CAT=zcat
|
||||||
elif [[ "$FILE_T" =~ ": xz compressed data" ]]; then
|
elif [[ "$FILE_T" =~ ": xz compressed data" ]]; then
|
||||||
CAT=xzcat
|
CAT="xzcat $XZ_SINGLE_STREAM"
|
||||||
elif [[ "$FILE_T" =~ ": XZ compressed data" ]]; then
|
elif [[ "$FILE_T" =~ ": XZ compressed data" ]]; then
|
||||||
CAT=xzcat
|
CAT="xzcat $XZ_SINGLE_STREAM"
|
||||||
elif [[ "$FILE_T" =~ ": data" ]]; then
|
elif [[ "$FILE_T" =~ ": data" ]]; then
|
||||||
CAT=lzcat
|
CAT=lzcat
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user