mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-04-29 04:04:45 +00:00
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:
parent
978b13c9e8
commit
3f7cf7ae67
@ -474,6 +474,7 @@ set_dax_header() {
|
|||||||
|
|
||||||
main() {
|
main() {
|
||||||
[ "$(id -u)" -eq 0 ] || die "$0: must be run as root"
|
[ "$(id -u)" -eq 0 ] || die "$0: must be run as root"
|
||||||
|
[ "$#" -eq 0 ] && usage && return 0
|
||||||
|
|
||||||
# variables that can be overwritten by environment variables
|
# variables that can be overwritten by environment variables
|
||||||
local agent_bin="${AGENT_BIN:-kata-agent}"
|
local agent_bin="${AGENT_BIN:-kata-agent}"
|
||||||
|
@ -441,7 +441,7 @@ build_rootfs_distro()
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# Used to create a minimal directory tree where the agent can be instaleld.
|
# Used to create a minimal directory tree where the agent can be installed.
|
||||||
# This is used when a distro is not specified.
|
# This is used when a distro is not specified.
|
||||||
prepare_overlay()
|
prepare_overlay()
|
||||||
{
|
{
|
||||||
@ -624,6 +624,8 @@ EOT
|
|||||||
|
|
||||||
parse_arguments()
|
parse_arguments()
|
||||||
{
|
{
|
||||||
|
[ "$#" -eq 0 ] && usage && return 0
|
||||||
|
|
||||||
while getopts a:hlo:r:t: opt
|
while getopts a:hlo:r:t: opt
|
||||||
do
|
do
|
||||||
case $opt in
|
case $opt in
|
||||||
|
Loading…
Reference in New Issue
Block a user