From 972e96ea688c6286c00ebd6db8b932257d85c45f Mon Sep 17 00:00:00 2001 From: Wei Liu Date: Wed, 14 Jul 2021 18:29:02 +0000 Subject: [PATCH] scripts: honour --volumes in cmd_shell It is useful to mount custom volumes sometimes. Signed-off-by: Wei Liu --- scripts/dev_cli.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/scripts/dev_cli.sh b/scripts/dev_cli.sh index 5b31f3f03..69774e7f7 100755 --- a/scripts/dev_cli.sh +++ b/scripts/dev_cli.sh @@ -198,6 +198,7 @@ cmd_help() { echo "" echo " shell" echo " Run the development container into an interactive, privileged BASH shell." + echo " --volumes Hash separated volumes to be exported. Example --volumes /mnt:/mnt#/myvol:/myvol" echo "" echo " help" echo " Display this help message." @@ -499,10 +500,24 @@ cmd_build-container() { } cmd_shell() { + while [ $# -gt 0 ]; do + case "$1" in + "-h"|"--help") { cmd_help; exit 1; } ;; + "--volumes") + shift + arg_vols="$1" + ;; + "--") { shift; break; } ;; + *) + ;; + esac + shift + done ensure_build_dir if [ $(uname -m) = "x86_64" ]; then ensure_latest_ctr fi + process_volumes_args say_warn "Starting a privileged shell prompt as root ..." say_warn "WARNING: Your $CLH_ROOT_DIR folder will be bind-mounted in the container under $CTR_CLH_ROOT_DIR" $DOCKER_RUNTIME run \