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
### 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