]> git.wh0rd.org - home.git/blobdiff - .bin/cros-board
git-rewrite-authors: silence rewrite warning+delay
[home.git] / .bin / cros-board
index 58a7870a53ea6c27007cca3104b6e09e58c50fcc..066804f2ee1f634d1664b88f17ae48fff92deb13 100755 (executable)
@@ -27,7 +27,6 @@ Options:
   --autotest  Build & install autotest packages.
   --factory   Build factory packages & image.
   --nousepkg  Force build from source.
-  --vm        Create VM image.
 
   --clean     ?
 
@@ -60,7 +59,6 @@ ARG_AUTOTEST=false
 ARG_FACTORY=false
 ARG_VERBOSE=false
 ARG_TEST=false
-ARG_VM=false
 while [[ $# -ne 0 ]] ; do
        case $1 in
        --clean) ARG_CLEAN=true;;
@@ -72,7 +70,6 @@ while [[ $# -ne 0 ]] ; do
        --nousepkg) ARG_NOPKG=true;;
        --autotest) ARG_AUTOTEST=true;;
        --factory) ARG_FACTORY=true;;
-       --vm) ARG_VM=true;;
        -h) usage;;
        *) echo "unknown opt: $*"; exit 1;;
        esac
@@ -110,7 +107,7 @@ run ./update_chroot --toolchain_boards=${BOARD}
 if ${ARG_CLEAN} || [[ ! -d ${BUILD} ]] ; then
        run sudo rm -rf "${BUILD}"
        run setup_board --board=${BOARD} --skip-chroot-upgrade
-       if [ $? -ne 0 ] ; then
+       if [[ $? -ne 0 ]] ; then
                run sudo rm -rf "${BUILD}"
                exit 1
        fi
@@ -121,11 +118,12 @@ run ./build_packages \
        --nowithdebug \
        --nowithrevdeps \
        --skip-chroot-upgrade \
+       --autosetgov \
        $(tfe ${ARG_AUTOTEST} --{,no}withautotest) \
        $(tfe ${ARG_FACTORY} --{,no}withfactory) \
        $(tfe ${ARG_NOPKG} --{no,}usepkg) \
        $(tfe ${ARG_TEST} --{,no}withtest)
-BUILD_IMG="./build_image --board=${BOARD} --noenable_rootfs_verification $(tfe ${ARG_TEST} test) dev"
+BUILD_IMG="./build_image --board=${BOARD} --noenable_rootfs_verification $(tfe ${ARG_TEST} test base)"
 run ${BUILD_IMG}
 
 IMG_TO_USB="cros flash --yes usb://${ARG_DEV} xbuddy://local/${BOARD}/latest/dev"
@@ -134,11 +132,6 @@ if ${ARG_DEV_USER} ; then
        sync &
 fi
 
-IMG_TO_VM=( ${d}/image_to_vm.sh --board=${BOARD} --from=${BUILD_DIR}/images/${BOARD}/latest --test_image )
-if ${ARG_VM} ; then
-       run "${IMG_TO_VM[@]}"
-fi
-
 cd "${IMAGES}"
 rm -rf $(ls -td1R `find -mindepth 1 -maxdepth 1 -type d` | sed -e 1d -e 2d)
 
@@ -149,8 +142,7 @@ cat <<EOF
 ${IMG_TO_USB}
 
 ### KVM
-${IMG_TO_VM[*]}
-~/chromiumos/chromite/bin/cros_vm --start --no-display --image-path=\${HOME}/chromiumos/src/build/images/${BOARD}/latest/chromiumos_qemu_image.bin
+~/chromiumos/chromite/bin/cros_vm --board=${BOARD} --start --no-display --image-path=\${HOME}/chromiumos/src/build/images/${BOARD}/latest/chromiumos_test_image.bin
 #--kvm_cpu "max,vmx=on"
 
 https://dev.chromium.org/chromium-os/testing/running-smoke-suite-on-a-vm-image