]> git.wh0rd.org - home.git/blobdiff - .bin/cros-board
cros-board: update
[home.git] / .bin / cros-board
index e4a793bf6cfa5e0531015f54f50610f2a77c1f60..228ff2c47c949e21226312bdeb1ec45deddaf887 100755 (executable)
@@ -4,7 +4,6 @@ die() { eerror "$*"; exit 1; }
 set -e
 
 BASE="/mnt/host/source"
-d="${BASE}/src/scripts"
 BUILD_DIR="${BASE}/src/build"
 cd "${BASE}/src/scripts/"
 
@@ -27,7 +26,6 @@ Options:
   --autotest  Build & install autotest packages.
   --factory   Build factory packages & image.
   --nousepkg  Force build from source.
-  --vm        Create VM image.
 
   --clean     ?
 
@@ -60,7 +58,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 +69,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
@@ -105,7 +101,7 @@ rm -f "${IMAGES}"/log.*
 
 einfo "Log root: ${IMAGES}/log."
 
-run ./update_chroot --toolchain_boards=${BOARD}
+run update_chroot
 
 if ${ARG_CLEAN} || [[ ! -d ${BUILD} ]] ; then
        run sudo rm -rf "${BUILD}"
@@ -116,17 +112,16 @@ if ${ARG_CLEAN} || [[ ! -d ${BUILD} ]] ; then
        fi
 fi
 
-run ./build_packages \
+run cros build-packages \
        --board=${BOARD} \
        --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 base)"
+       $(tfe ${ARG_AUTOTEST} --{,no-}withautotest) \
+       $(tfe ${ARG_FACTORY} --{,no-}withfactory) \
+       $(tfe ${ARG_NOPKG} --{no-,}usepkg) \
+       $(tfe ${ARG_TEST} --{,no-}withtest)
+BUILD_IMG="cros build-image --board=${BOARD} --no-enable-rootfs-verification $(tfe ${ARG_TEST} test base)"
 run ${BUILD_IMG}
 
 IMG_TO_USB="cros flash --yes usb://${ARG_DEV} xbuddy://local/${BOARD}/latest/dev"
@@ -135,26 +130,16 @@ 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)
 
-BUILD_IMG="${d}/${BUILD_IMG#./}"
 cat <<EOF
 
 ### LIVE
 ${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
-#--kvm_cpu "max,vmx=on"
-
-https://dev.chromium.org/chromium-os/testing/running-smoke-suite-on-a-vm-image
+cros vm --board=${BOARD} --start --no-display --image-path=\${HOME}/chromiumos/src/build/images/${BOARD}/latest/chromiumos_test_image.bin
 
 /usr/local/autotest/bin/autologin.py
 
@@ -163,11 +148,10 @@ sudo -u chronos CROS_USER_ID_HASH="${CROS_USER_ID_HASH}" crosh
   vmc start termina  # might run twice
 
 ### RECOVERY
-${d}/mod_image_for_recovery.sh --board=${BOARD}
+~/chromiumos/src/scripts/mod_image_for_recovery.sh --board=${BOARD}
 ${IMG_TO_USB%/dev}/recovery
 
 ### FACTORY
 ${BUILD_IMG} --factory_install
 ${IMG_TO_USB} -i factory_install_shim.bin
-
 EOF