mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2025-01-12 23:51:49 +00:00
scripts: Don't download container on help invocations
Delay downloading the container until it is being used. Fixes: #2065 Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
parent
58009af85d
commit
b8342ebeb4
@ -235,6 +235,12 @@ cmd_build() {
|
|||||||
esac
|
esac
|
||||||
shift
|
shift
|
||||||
done
|
done
|
||||||
|
|
||||||
|
ensure_build_dir
|
||||||
|
if [ $(uname -m) = "x86_64" ]; then
|
||||||
|
ensure_latest_ctr
|
||||||
|
fi
|
||||||
|
|
||||||
process_volumes_args
|
process_volumes_args
|
||||||
if [[ "$hypervisor" != "kvm" ]]; then
|
if [[ "$hypervisor" != "kvm" ]]; then
|
||||||
die "Hypervisor value must be kvm"
|
die "Hypervisor value must be kvm"
|
||||||
@ -269,6 +275,11 @@ cmd_build() {
|
|||||||
cmd_clean() {
|
cmd_clean() {
|
||||||
cargo_args=("$@")
|
cargo_args=("$@")
|
||||||
|
|
||||||
|
ensure_build_dir
|
||||||
|
if [ $(uname -m) = "x86_64" ]; then
|
||||||
|
ensure_latest_ctr
|
||||||
|
fi
|
||||||
|
|
||||||
$DOCKER_RUNTIME run \
|
$DOCKER_RUNTIME run \
|
||||||
--user "$(id -u):$(id -g)" \
|
--user "$(id -u):$(id -g)" \
|
||||||
--workdir "$CTR_CLH_ROOT_DIR" \
|
--workdir "$CTR_CLH_ROOT_DIR" \
|
||||||
@ -324,6 +335,11 @@ cmd_tests() {
|
|||||||
fi
|
fi
|
||||||
set -- "$@" '--hypervisor' $hypervisor
|
set -- "$@" '--hypervisor' $hypervisor
|
||||||
|
|
||||||
|
ensure_build_dir
|
||||||
|
if [ $(uname -m) = "x86_64" ]; then
|
||||||
|
ensure_latest_ctr
|
||||||
|
fi
|
||||||
|
|
||||||
process_volumes_args
|
process_volumes_args
|
||||||
target="$(uname -m)-unknown-linux-${libc}"
|
target="$(uname -m)-unknown-linux-${libc}"
|
||||||
cflags=""
|
cflags=""
|
||||||
@ -433,6 +449,11 @@ cmd_build-container() {
|
|||||||
shift
|
shift
|
||||||
done
|
done
|
||||||
|
|
||||||
|
ensure_build_dir
|
||||||
|
if [ $(uname -m) = "x86_64" ]; then
|
||||||
|
ensure_latest_ctr
|
||||||
|
fi
|
||||||
|
|
||||||
BUILD_DIR=/tmp/cloud-hypervisor/container/
|
BUILD_DIR=/tmp/cloud-hypervisor/container/
|
||||||
|
|
||||||
mkdir -p $BUILD_DIR
|
mkdir -p $BUILD_DIR
|
||||||
@ -450,6 +471,10 @@ cmd_build-container() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
cmd_shell() {
|
cmd_shell() {
|
||||||
|
ensure_build_dir
|
||||||
|
if [ $(uname -m) = "x86_64" ]; then
|
||||||
|
ensure_latest_ctr
|
||||||
|
fi
|
||||||
say_warn "Starting a privileged shell prompt as root ..."
|
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"
|
say_warn "WARNING: Your $CLH_ROOT_DIR folder will be bind-mounted in the container under $CTR_CLH_ROOT_DIR"
|
||||||
$DOCKER_RUNTIME run \
|
$DOCKER_RUNTIME run \
|
||||||
@ -496,9 +521,5 @@ ok_or_die "Unknown command: $1. Please use \`$0 help\` for help."
|
|||||||
cmd=cmd_$1
|
cmd=cmd_$1
|
||||||
shift
|
shift
|
||||||
|
|
||||||
ensure_build_dir
|
|
||||||
if [ $(uname -m) = "x86_64" ]; then
|
|
||||||
ensure_latest_ctr
|
|
||||||
fi
|
|
||||||
|
|
||||||
$cmd "$@"
|
$cmd "$@"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user