diff options
author | Dave Reisner <dreisner@archlinux.org> | 2012-12-22 19:09:10 +0100 |
---|---|---|
committer | Dave Reisner <dreisner@archlinux.org> | 2013-01-12 20:31:29 +0100 |
commit | 9d65344fba27ab87f019fa9071fcea0985c190f7 (patch) | |
tree | 554790f8375d60d8906c8c22a64b0320dd721313 | |
parent | 3e18e3d923f0353ceb9a407b63f16222d609b5ee (diff) | |
download | mkinitcpio-9d65344fba27ab87f019fa9071fcea0985c190f7.tar.gz mkinitcpio-9d65344fba27ab87f019fa9071fcea0985c190f7.tar.xz |
lsinitcpio: abort on unknown file formats
Specficially, abort when a user tries to run lsinitcpio on a kernel
image.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
-rwxr-xr-x | lsinitcpio | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -241,11 +241,16 @@ esac # read compression type case $(file -Lb "$_image") in - @(data|LZMA)*) _compress=lzma ;; + 'Linux kernel'*) + die '%s is a kernel image, not an initramfs image!' "$_image" ;; + data*|LZMA*) _compress=lzma ;; gzip*) _compress=gzip ;; bzip2*) _compress=bzip2 ;; lzop*) _compress=lzop ;; XZ*) _compress=xz ;; + 'ASCII cpio'*) : ;; + *) + die 'Unexpected file type. Are you sure this is an initramfs?' "$_image" ;; esac if (( _optanalyze )); then |