]> git.wh0rd.org Git - home.git/commitdiff
cros-board: update
authorMike Frysinger <vapier@gentoo.org>
Tue, 7 Feb 2017 17:11:45 +0000 (12:11 -0500)
committerMike Frysinger <vapier@gentoo.org>
Tue, 7 Feb 2017 17:11:45 +0000 (12:11 -0500)
.bin/cros-board

index 71694380e9c06ab7026bd7a87adcdee666d7679d..fc6008f4d6d075b53ca3aeee003741b597ac0e64 100755 (executable)
@@ -5,15 +5,38 @@ set -e
 
 cd "${HOME}/trunk/src/scripts/"
 
-: ${BOARD:=`cat .default_board 2>/dev/null`}
+: "${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 <<EOF
+Usage: cros-board [options]
+
+Build for the board listed in \${BOARD} (current: ${BOARD}).
+Normally only builds a dev image.
+
+Options:
+  -t          Build test packages & image
+  --autotest  Build & install autotest packages.
+  --factory   Build factory packages & image.
+  --nousepkg  Force build from source.
+
+  --clean     ?
+
+  -Y          Write image to ${ARG_DEV} w/out prompting.
+  -y <dev>    Write image to <dev> 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
@@ -32,7 +55,7 @@ while [[ $# -ne 0 ]] ; do
        --nousepkg) ARG_NOPKG=true;;
        --autotest) ARG_AUTOTEST=true;;
        --factory) ARG_FACTORY=true;;
-       -h) exec sed -n '/^while/,/^done/p' "$0";;
+       -h) usage;;
        *) echo "unknown opt: $*"; exit 1;;
        esac
        shift
@@ -106,7 +129,7 @@ ${IMG_TO_USB}
 ${d}/image_to_vm.sh --board=${BOARD} --from=../build/images/${BOARD}/latest
 ${d}/image_to_vm.sh --board=${BOARD} --from=../build/images/${BOARD}/latest --test_image
 ~/chromiumos/src/scripts/bin/cros_start_vm --no_graphics --image_path=\${HOME}/chromiumos/src/build/images/${BOARD}/latest/chromiumos_qemu_image.bin
-kvm -m 1024 -vga std -net nic,model=virtio -net user,hostfwd=tcp::9222-:22 -hda ~/chromiumos/src/build/images/${BOARD}/latest/chromiumos_qemu_image.bin
+qemu-system-x86_64 -enable-kvm -m 1024 -vga std -net nic,model=virtio -net user,hostfwd=tcp::9222-:22 -hda ~/chromiumos/src/build/images/${BOARD}/latest/chromiumos_qemu_image.bin
 
 ### RECOVERY
 ${d}/mod_image_for_recovery.sh --board=${BOARD}