summaryrefslogtreecommitdiffstats
path: root/lsinitcpio
diff options
context:
space:
mode:
authorDave Reisner <dreisner@archlinux.org>2013-01-13 02:12:03 +0100
committerDave Reisner <dreisner@archlinux.org>2013-01-13 02:12:03 +0100
commit1fb67220211a6b49870107bff052623c51ecbffb (patch)
treefc47d210c401b916a8985d4eb6b3c88d3ba4d129 /lsinitcpio
parentbe1e0c6506ed892a7e8031d69b1a7110a79070d4 (diff)
downloadmkinitcpio-1fb67220211a6b49870107bff052623c51ecbffb.tar.gz
mkinitcpio-1fb67220211a6b49870107bff052623c51ecbffb.tar.xz
factor out kver detection to functions file
This leaves bash completion with a duplication, but this is intentional to avoid pulling in the entire functions file and worrying about pollution. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Diffstat (limited to 'lsinitcpio')
-rwxr-xr-xlsinitcpio5
1 files changed, 1 insertions, 4 deletions
diff --git a/lsinitcpio b/lsinitcpio
index 5984cf8..c4129d5 100755
--- a/lsinitcpio
+++ b/lsinitcpio
@@ -108,10 +108,7 @@ detect_filetype() {
fi
# still nothing? hrmm, maybe the user goofed and it's a kernel
- offt=$(hexdump -s 526 -n 2 -e '"%0d"' "$1")
- read kver _ < \
- <(dd if="$1" bs=1 count=127 skip=$(( offt + 0x200 )) 2>/dev/null)
- if [[ $kver =~ $kver_validator ]]; then
+ if kver "$1" >/dev/null; then
die '%s is a kernel image, not an initramfs image!' "$1"
fi