X-Git-Url: https://git.wh0rd.org/?a=blobdiff_plain;f=.bin%2Fcros-board;h=b8c8e5973f0cc8257a7e09784609152b3443bfe6;hb=93639020c1977093207dd0489fed06ead1d412a0;hp=5e9cb242a949882b1900f2f1211ce2d28702ea10;hpb=eecfe1d659c49ee06835b2c481c858d1388915f2;p=home.git diff --git a/.bin/cros-board b/.bin/cros-board index 5e9cb24..b8c8e59 100755 --- a/.bin/cros-board +++ b/.bin/cros-board @@ -3,20 +3,45 @@ die() { eerror "$*"; exit 1; } set -e -cd ${HOME}/trunk/src/scripts/ +cd "${HOME}/trunk/src/scripts/" +: "${BOARD:="$(cat .default_board 2>/dev/null)"}" if [[ -z ${BOARD} ]] ; then die "missing BOARD" fi IMAGES="${HOME}/trunk/src/build/images/${BOARD}" BUILD="/build/${BOARD}" +usage() { + exec cat < Write image to w/out prompting. + + -p Pretend -- show commands that would be run. + -v Verbose -- send command output to stdout. +EOF +} + ARG_CLEAN=false -ARG_DEV="/dev/sdc" +ARG_DEV="/dev/sdd" ARG_DEV_USER=false ARG_PRETEND=false ARG_NOPKG=false ARG_AUTOTEST=false +ARG_FACTORY=false ARG_VERBOSE=false ARG_TEST=false while [[ $# -ne 0 ]] ; do @@ -29,7 +54,8 @@ while [[ $# -ne 0 ]] ; do -t) ARG_TEST=true;; --nousepkg) ARG_NOPKG=true;; --autotest) ARG_AUTOTEST=true;; - -h) exec sed -n '/^while/,/^done/p' "$0";; + --factory) ARG_FACTORY=true;; + -h) usage;; *) echo "unknown opt: $*"; exit 1;; esac shift @@ -49,7 +75,7 @@ run() { piperet eend $? || exit $? else - einfo "$*" + echo "$*" fi set -e } @@ -61,7 +87,7 @@ rm -f "${IMAGES}"/log.* einfo "Log root: ${IMAGES}/log." -run ./update_chroot +run ./update_chroot --toolchain_boards=${BOARD} if ${ARG_CLEAN} || [[ ! -d ${BUILD} ]] ; then run sudo rm -rf "${BUILD}" @@ -75,14 +101,16 @@ fi run ./build_packages \ --board=${BOARD} \ --nowithdebug \ + --nowithrevdeps \ --skip_chroot_upgrade \ $(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" run ${BUILD_IMG} -IMG_TO_USB="./image_to_usb.sh --board=${BOARD} -y --to=${ARG_DEV}" +IMG_TO_USB="cros flash --yes usb://${ARG_DEV} xbuddy://local/${BOARD}/latest/dev" if ${ARG_DEV_USER} ; then run ${IMG_TO_USB} sync & @@ -91,18 +119,30 @@ fi cd "${IMAGES}" rm -rf $(ls -td1R `find -mindepth 1 -maxdepth 1 -type d` | sed -e 1d -e 2d) +d="~/trunk/src/scripts" +BUILD_IMG="${d}/${BUILD_IMG#./}" cat <