]> git.wh0rd.org Git - home.git/commitdiff
cros-board: update scripts
authorMike Frysinger <vapier@gentoo.org>
Thu, 7 Feb 2019 19:54:52 +0000 (14:54 -0500)
committerMike Frysinger <vapier@gentoo.org>
Thu, 7 Feb 2019 19:54:52 +0000 (14:54 -0500)
.bin/cros-board

index b8c8e5973f0cc8257a7e09784609152b3443bfe6..e6743cee0a914d9ada14657da3cab609b0ebea39 100755 (executable)
@@ -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