From: Mike Frysinger Date: Thu, 7 Feb 2019 19:54:52 +0000 (-0500) Subject: cros-board: update scripts X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=dd5fec2826f8cf9dc84968bb0befd8616cf6c068;p=home.git cros-board: update scripts --- 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