From dd5fec2826f8cf9dc84968bb0befd8616cf6c068 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Thu, 7 Feb 2019 14:54:52 -0500 Subject: [PATCH] cros-board: update scripts --- .bin/cros-board | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/.bin/cros-board b/.bin/cros-board index b8c8e59..e6743ce 100755 --- a/.bin/cros-board +++ b/.bin/cros-board @@ -35,8 +35,20 @@ Options: EOF } +find_first_removable() { + local d + cd /sys/block + for d in sd? ; do + if [[ $(cat "${d}/removable" 2>/dev/null) == "1" ]]; then + echo "/dev/${d}" + return 0 + fi + done + return 0 +} + ARG_CLEAN=false -ARG_DEV="/dev/sdd" +ARG_DEV="$(find_first_removable)" ARG_DEV_USER=false ARG_PRETEND=false ARG_NOPKG=false @@ -129,14 +141,14 @@ ${IMG_TO_USB} ### KVM ${d}/image_to_vm.sh --board=${BOARD} --from=../build/images/${BOARD}/latest ${d}/image_to_vm.sh --board=${BOARD} --from=../build/images/${BOARD}/latest --test_image -~/chromiumos/src/scripts/bin/cros_start_vm --no_graphics --image_path=\${HOME}/chromiumos/src/build/images/${BOARD}/latest/chromiumos_qemu_image.bin --kvm_cpu "max,vmx=on" -qemu-system-x86_64 -enable-kvm -cpu max,vmx=on -m 1024 -vga std -net nic,model=virtio -net user,hostfwd=tcp::9222-:22 -hda ~/chromiumos/src/build/images/${BOARD}/latest/chromiumos_qemu_image.bin +~/chromiumos/chromite/bin/cros_vm --start --no-display --image-path=\${HOME}/chromiumos/src/build/images/${BOARD}/latest/chromiumos_qemu_image.bin +#--kvm_cpu "max,vmx=on" https://dev.chromium.org/chromium-os/testing/running-smoke-suite-on-a-vm-image /usr/local/autotest/bin/autologin.py -export CROS_USER_ID_HASH=$(ls /home/user/) +export CROS_USER_ID_HASH=\$(ls /home/user/) sudo -u chronos CROS_USER_ID_HASH="${CROS_USER_ID_HASH}" crosh vmc start termina # might run twice -- 2.39.5