mirror of
https://salsa.debian.org/kernel-team/initramfs-tools.git
synced 2026-01-26 15:39:08 +00:00
mkinitramfs: Support -h and --help options
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
This commit is contained in:
parent
c80032179c
commit
fc81f7f5f0
15
mkinitramfs
15
mkinitramfs
@ -13,7 +13,7 @@ export BUSYBOXDIR
|
||||
|
||||
usage()
|
||||
{
|
||||
cat >&2 << EOF
|
||||
cat << EOF
|
||||
|
||||
Usage: ${0} [OPTION]... -o outfile [version]
|
||||
|
||||
@ -26,10 +26,15 @@ Options:
|
||||
|
||||
See mkinitramfs(8) for further details.
|
||||
EOF
|
||||
}
|
||||
|
||||
usage_error()
|
||||
{
|
||||
usage >&2
|
||||
exit 2
|
||||
}
|
||||
|
||||
OPTIONS=$(getopt -o c:d:ko:r:v -n "$0" -- "$@")
|
||||
OPTIONS=$(getopt -o c:d:hko:r:v --long help -n "$0" -- "$@")
|
||||
|
||||
# Check for non-GNU getopt
|
||||
# shellcheck disable=SC2181
|
||||
@ -51,6 +56,10 @@ while true; do
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
-h|--help)
|
||||
usage
|
||||
exit 0
|
||||
;;
|
||||
-o)
|
||||
outfile="$2"
|
||||
shift 2
|
||||
@ -128,7 +137,7 @@ if [ -n "${UMASK:-}" ]; then
|
||||
fi
|
||||
|
||||
if [ -z "${outfile}" ]; then
|
||||
usage
|
||||
usage_error
|
||||
fi
|
||||
|
||||
touch "$outfile"
|
||||
|
||||
@ -16,6 +16,8 @@ mkinitramfs \- low-level tool for generating an initramfs image
|
||||
.IR root ]
|
||||
.RB [ \-v ]
|
||||
.RI [ version ]
|
||||
.br
|
||||
.BR mkinitramfs " " -h
|
||||
|
||||
.SH DESCRIPTION
|
||||
The
|
||||
@ -49,7 +51,6 @@ setting in
|
||||
\fB\-d \fI confdir
|
||||
Set an alternate configuration directory.
|
||||
|
||||
.TP
|
||||
.TP
|
||||
\fB\-k
|
||||
Keep the temporary directory used to make the image.
|
||||
@ -75,6 +76,10 @@ Set the verbose mode output.
|
||||
Set the kernel version of the initramfs image
|
||||
(defaults to the running kernel).
|
||||
|
||||
.TP
|
||||
\fB\-h\fR, \fB\-\-help\fR
|
||||
Display usage information and exit.
|
||||
|
||||
.SH ENVIRONMENT
|
||||
.B mkinitramfs
|
||||
honours the
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user