kas-container: add support to set log-level

This patch forwards the log-level parameter from kas-container to kas
inside the container. For backward compatibility, the -d parameter is
deprecated but kept and also forwarded as-is to kas. By that, a more recent
kas-container script can still be used to run an older kas container.

Signed-off-by: Felix Moessbauer <felix.moessbauer@siemens.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
This commit is contained in:
Felix Moessbauer 2023-05-03 16:53:38 +02:00 committed by Jan Kiszka
parent 522a2422c4
commit 4015a6b384

View File

@ -57,7 +57,8 @@ usage()
printf "%b" "--runtime-args\t\tAdditional arguments to pass to the " \ printf "%b" "--runtime-args\t\tAdditional arguments to pass to the " \
"container runtime\n" "container runtime\n"
printf "%b" "\t\t\tfor running the build.\n" printf "%b" "\t\t\tfor running the build.\n"
printf "%b" "-d\t\t\tPrint debug output.\n" printf "%b" "-d\t\t\tPrint debug output (deprecated, use -l debug).\n"
printf "%b" "-l, --log-level\t\tSet log level (default=info).\n"
printf "%b" "-v\t\t\tSame as -d (deprecated).\n" printf "%b" "-v\t\t\tSame as -d (deprecated).\n"
printf "%b" "--version\t\tprint program version.\n" printf "%b" "--version\t\tprint program version.\n"
printf "%b" "--ssh-dir\t\tDirectory containing SSH configurations.\n" printf "%b" "--ssh-dir\t\tDirectory containing SSH configurations.\n"
@ -265,6 +266,13 @@ while [ $# -gt 0 ]; do
KAS_OPTIONS_DIRECT="${KAS_OPTIONS_DIRECT} -d" KAS_OPTIONS_DIRECT="${KAS_OPTIONS_DIRECT} -d"
shift 1 shift 1
;; ;;
-l | --log-level)
if [ "$2" = "debug" ]; then
KAS_VERBOSE=1
fi
KAS_OPTIONS_DIRECT="${KAS_OPTIONS_DIRECT} -l $2"
shift 2
;;
--version) --version)
echo "$(basename "$0") $KAS_IMAGE_VERSION_DEFAULT" echo "$(basename "$0") $KAS_IMAGE_VERSION_DEFAULT"
exit 0 exit 0