diff options
author | Ben Hutchings <ben@decadent.org.uk> | 2016-12-15 21:20:48 +0000 |
---|---|---|
committer | Ben Hutchings <ben@decadent.org.uk> | 2016-12-15 22:08:34 +0000 |
commit | 12744ebce67b6fd81e0722ac1f0057ef49f16158 (patch) | |
tree | fde454c529f0ebce28f1a869687084c8ce522cd0 /lsinitramfs | |
parent | f1f18a44fd2097818337f405ecc075ec5e232b8b (diff) |
unmkinitramfs: Rewrite command syntax
I'm not comfortable with unmkinitramfs passing through everything to
cpio, considering what a sharp tool cpio is. Instead of that,
recognise and pass through the few specific options that are
important.
Always pass --preserve-modification-time --no-absolute-filenames
--quiet.
Take the initramfs filename as a mandatory argument rather than
expecting a file on stdin, to be more consistent lsinitramfs and
mkinitramfs do.
Take an output directory as a mandatory argument (except when
listing), rather than extracting to the current directory.
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Diffstat (limited to 'lsinitramfs')
-rwxr-xr-x | lsinitramfs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lsinitramfs b/lsinitramfs index 14705ad..a96308d 100755 --- a/lsinitramfs +++ b/lsinitramfs @@ -12,7 +12,7 @@ if [ "$#" -eq 0 ] ; then exit 1 fi -cpio_args="--quiet --list" +umi_opts="--list" OPTIONS=`getopt -o hl --long help,long -n "$0" -- "$@"` # Check for non-GNU getopt @@ -27,7 +27,7 @@ while true; do exit 0 ;; -l|--long) - cpio_args="${cpio_args:+${cpio_args} --verbose}" + umi_opts="${umi_opts:+${umi_opts} --verbose}" shift ;; --) @@ -41,5 +41,5 @@ while true; do done for initramfs in "$@" ; do - unmkinitramfs $cpio_args < "$initramfs" + unmkinitramfs $umi_opts -- "$initramfs" done |