diff options
author | Treehugger Robot <android-test-infra-autosubmit@system.gserviceaccount.com> | 2024-03-05 16:06:26 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2024-03-05 16:06:26 +0000 |
commit | 1761ea99ca563f558919dfdaa25f9ae8c13cdef7 (patch) | |
tree | 79d95de647c1051b026f98efc4b24c9709d1920f | |
parent | f9a3e7f2d2591277204612da85b6f764a9127cd2 (diff) | |
parent | 3dabd6d494d0454b477cc678a5726f08533ec0a1 (diff) | |
download | cuttlefish-1761ea99ca563f558919dfdaa25f9ae8c13cdef7.tar.gz |
Merge "Support launching arm64 CF with a debug ramdisk image" into main am: 3dabd6d494
Original change: https://android-review.googlesource.com/c/device/google/cuttlefish/+/2984254
Change-Id: I1938a735ffb54aaf33f7890a1e029e5f2a6b44e0
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rwxr-xr-x | tools/launch_cvd_arm64_server.sh | 28 | ||||
-rwxr-xr-x | tools/launch_cvd_arm64_server_docker.sh | 1 |
2 files changed, 22 insertions, 7 deletions
diff --git a/tools/launch_cvd_arm64_server.sh b/tools/launch_cvd_arm64_server.sh index 60c7a4966..8bfea1fd3 100755 --- a/tools/launch_cvd_arm64_server.sh +++ b/tools/launch_cvd_arm64_server.sh @@ -17,19 +17,29 @@ color_cyan="\033[0;36m" color_plain="\033[0m" color_yellow="\033[0;33m" -# validate number of arguments to equal 3 -if [ "$#" -lt 2 ] || [ "$#" -gt 3 ]; then - echo "This script requires 2 mandatory and 1 optional parameters, server address, base instance number and optionally number of instances to invoke" +# validate number of arguments to between 2 and 4 +if [ "$#" -lt 2 ] || [ "$#" -gt 4 ]; then + echo "This script requires 2 mandatory and 2 optional parameters:" + echo "Mandatory: server address, base instance number." + echo "Optional: the number of instances to invoke, the path to a vendor debug ramdisk image." + echo "For example: ./launch_cvd_arm64_server.sh user@<ip> 10 1 ./vendor_boot-debug.img" exit 1 fi # map arguments to variables server=$1 base_instance_num=$2 -if [ "$#" -eq 3 ]; then - num_instances=$3 +if [ "$#" -gt 2 ]; then + num_instances=$3 else - num_instances=1 + num_instances=1 +fi +if [ "$#" -eq 4 ]; then + vendor_boot_debug_image=$4 + vendor_boot_debug_flag="--vendor_boot_image=$(basename $4)" +else + vendor_boot_debug_image="" + vendor_boot_debug_flag="" fi # set img_dir and cvd_host_tool_dir @@ -50,6 +60,10 @@ if [ -f $img_dir/required_images ]; then else rsync -aSvch --recursive $img_dir/bootloader $img_dir/*.img $server:~/$cvd_home_dir --info=progress2 fi +if [ ! -z "$vendor_boot_debug_image" ]; then + echo "use the debug ramdisk image: $vendor_boot_debug_image" + rsync -Svch $vendor_boot_debug_image $server:~/$cvd_home_dir --info=progress2 +fi # copy the cvd host package if [ -d $cvd_host_tool_dir/cvd-host_package ]; then @@ -79,7 +93,7 @@ instance_ids_flag="--base_instance_num=$base_instance_num \ --num_instances=$num_instances" echo -e "${color_cyan}Booting the cuttlefish instances${color_plain}" ssh $server \ - -t "cd ~/$cvd_home_dir && HOME=~/$cvd_home_dir bin/launch_cvd $instance_ids_flag $daemon_flag" + -t "cd ~/$cvd_home_dir && HOME=~/$cvd_home_dir bin/launch_cvd $instance_ids_flag $daemon_flag $vendor_boot_debug_flag" # Web UI port is 2443 instead 1443 because there could be a running operator in this machine as well. web_ui_port=2443 diff --git a/tools/launch_cvd_arm64_server_docker.sh b/tools/launch_cvd_arm64_server_docker.sh index 81354f20b..7bd520c85 100755 --- a/tools/launch_cvd_arm64_server_docker.sh +++ b/tools/launch_cvd_arm64_server_docker.sh @@ -123,6 +123,7 @@ ssh $server \ echo -e "Done" # start Cuttlefish instance on top of docker instance +# TODO(b/317942272): support starting the instance with an optional vendor boot debug image. echo -e "Starting Cuttlefish" ssh $server "curl -s -k -X POST $host_orchestrator_url/cvds \ -H 'Content-Type: application/json' \ |