X-Git-Url: https://git.wh0rd.org/?a=blobdiff_plain;f=.bin%2Fcros-board;h=e9ff570a99cff7e5f2a794a8ffaf40f0f02e3f7a;hb=d828d9042713b4f0b2968f974073de1f4456a3cc;hp=3836746255c6f72d614befaf5777a17f243551f0;hpb=5a4df9c998b98264c51c4a44e7f3586a229549a7;p=home.git diff --git a/.bin/cros-board b/.bin/cros-board index 3836746..e9ff570 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 } @@ -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,23 @@ 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 <