osbuilder: show usage if no options/arguments specified

Now if no options/arguments specified, the shell scripts will return an error:

ERROR: Invalid rootfs directory: ''

This commit will show usage if no options/arguments specified.

Fixes: #3256

Signed-off-by: bin <bin@hyper.sh>
This commit is contained in:
bin
2021-12-13 16:10:55 +08:00
parent 978b13c9e8
commit 3f7cf7ae67
2 changed files with 4 additions and 1 deletions

View File

@@ -474,6 +474,7 @@ set_dax_header() {
main() {
[ "$(id -u)" -eq 0 ] || die "$0: must be run as root"
[ "$#" -eq 0 ] && usage && return 0
# variables that can be overwritten by environment variables
local agent_bin="${AGENT_BIN:-kata-agent}"