set -e
BASE="/mnt/host/source"
-d="${BASE}/src/scripts"
BUILD_DIR="${BASE}/src/build"
cd "${BASE}/src/scripts/"
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}"
fi
fi
-run build_packages \
+run cros build-packages \
--board=${BOARD} \
--nowithdebug \
--nowithrevdeps \
$(tfe ${ARG_FACTORY} --{,no-}withfactory) \
$(tfe ${ARG_NOPKG} --{no-,}usepkg) \
$(tfe ${ARG_TEST} --{,no-}withtest)
-BUILD_IMG="build_image --board=${BOARD} --no-enable-rootfs-verification $(tfe ${ARG_TEST} test base)"
+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"
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
-~/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
+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
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