summaryrefslogtreecommitdiffstats
path: root/lsinitcpio
diff options
context:
space:
mode:
authorDave Reisner <dreisner@archlinux.org>2013-09-03 01:16:58 +0200
committerDave Reisner <dreisner@archlinux.org>2013-09-07 16:04:21 +0200
commitb5927393d103af9b8b2da80e8636b8aa52f80755 (patch)
tree4f8713331520f5559a0375566d1e31d4b9ed51a6 /lsinitcpio
parent9c1a65a9c82080dec2e52d03613584bbc1340cf0 (diff)
downloadmkinitcpio-b5927393d103af9b8b2da80e8636b8aa52f80755.tar.gz
mkinitcpio-b5927393d103af9b8b2da80e8636b8aa52f80755.tar.xz
lsinitcpio: add support for lz4 compressed image
Note that this requires a very recent version of lz4 utilities as it uses lz4, and not the original lz4c tool, in order to be command line API compliant with other compression tools. See upstream discussions: https://code.google.com/p/lz4/issues/detail?id=83 Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Diffstat (limited to 'lsinitcpio')
-rwxr-xr-xlsinitcpio7
1 files changed, 6 insertions, 1 deletions
diff --git a/lsinitcpio b/lsinitcpio
index c1c5e21..5f19326 100755
--- a/lsinitcpio
+++ b/lsinitcpio
@@ -69,7 +69,7 @@ size_to_human() {
}
detect_filetype() {
- case $(hexdump -n 6 -e '"%c"' "$1") in
+ case $(hexdump -n 6 -e '"%c"' "$1") in
'070701')
# no compression
return
@@ -90,6 +90,11 @@ detect_filetype() {
return
fi
+ if [[ $(hexdump -n 4 -e '"%x"' "$1") == '184d2204' ]]; then
+ echo 'lz4'
+ return
+ fi
+
if [[ $(hexdump -n 3 -e '"%c"' "$1") == 'BZh' ]]; then
echo 'bzip2'
return