This commit is contained in:
illiliti 2020-03-03 19:45:55 +03:00
parent a464d0731d
commit e668de5b25

View File

@ -28,13 +28,13 @@ usage() {
cat << EOF cat << EOF
usage: $0 [options] usage: $0 [options]
-o, --output <file> output file -o, --output <file> set initramfs image path
-c, --config <file> config file -c, --config <file> set config file path
-m, --moddir <dir> drivers directory -m, --moddir <dir> specify drivers directory
-k, --kernel <ver> kernel version -k, --kernel <ver> set kernel version
-F, --files <dir> files directory -F, --files <dir> specify files directory
-d, --debug 0|1 debug mode -d, --debug enable debug mode
-f, --force 0|1 overwrite existing initramfs image -f, --force overwrite existing initramfs image
EOF EOF
} }
@ -63,12 +63,12 @@ parse_args() {
shift 2 shift 2
;; ;;
-d | --debug) -d | --debug)
_debug="${2:?}" _debug=1
shift 2 shift 1
;; ;;
-f | --force) -f | --force)
_force="${2:?}" _force=1
shift 2 shift 1
;; ;;
-h | --help) -h | --help)
usage usage
@ -434,7 +434,7 @@ create_initramfs() {
# TODO add uncompressed option # TODO add uncompressed option
# check if image already exist # check if image already exist
[ ! "$force" = 1 ] && [ -e "$initramfs" ] && [ "$force" = 0 ] && [ -e "$initramfs" ] &&
msg warn "looks like you already have initramfs image" msg warn "looks like you already have initramfs image"
( (