From 1098227288c825f73dea0cc6ca86d076391ffcb6 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Thu, 5 Sep 2024 09:19:37 -0400 Subject: [PATCH] More help and have auto-install because it is convenient --- .../start-sysroot-vm.sh | 23 ++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/integrations/docker/images/stage-1/chip-build-crosscompile/start-sysroot-vm.sh b/integrations/docker/images/stage-1/chip-build-crosscompile/start-sysroot-vm.sh index 201dd3d3bac210..9966912066f0b7 100755 --- a/integrations/docker/images/stage-1/chip-build-crosscompile/start-sysroot-vm.sh +++ b/integrations/docker/images/stage-1/chip-build-crosscompile/start-sysroot-vm.sh @@ -7,9 +7,30 @@ # # sudo apt install qemu-system-arm virtinst libvirt-daemon # - set -e +while getopts "hi" opt; do + case $opt in + h) + echo "Usage: $0 [-h] [-i]" + echo " -h Displays this help message" + echo " -i Attempt to 'sudo apt-get install' required packages" + exit 0 + ;; + i) + echo "Installing required packages ..." + sudo apt-get install \ + genisoimage \ + libvirt-daemon \ + qemu-system-arm \ + qemu-utils \ + virtinst \ + whois \ + ; + ;; + esac +done + if ! which qemu-system-aarch64 >/dev/null; then echo "Cannot find 'qemu-system-aarch64'. Did you 'sudo apt-get install qemu-system-arm' ?" exit 1