summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--utility/Makefile5
-rwxr-xr-xutility/enable_dev_usb_boot38
2 files changed, 43 insertions, 0 deletions
diff --git a/utility/Makefile b/utility/Makefile
index f3808987..68e09413 100644
--- a/utility/Makefile
+++ b/utility/Makefile
@@ -42,6 +42,7 @@ TARGET_NAMES = $(AU_TARGETS) \
dev_make_keypair \
dev_sign_file \
dev_debug_vboot \
+ enable_dev_usb_boot \
vbutil_what_keys
ifeq ($(MINIMAL),)
@@ -165,6 +166,10 @@ ${BUILD_ROOT}/dev_debug_vboot: dev_debug_vboot
cp -f $< $@
chmod +x $@
+${BUILD_ROOT}/enable_dev_usb_boot: enable_dev_usb_boot
+ cp -f $< $@
+ chmod +x $@
+
${BUILD_ROOT}/vbutil_what_keys: vbutil_what_keys
cp -f $< $@
chmod +x $@
diff --git a/utility/enable_dev_usb_boot b/utility/enable_dev_usb_boot
new file mode 100755
index 00000000..8cf16bab
--- /dev/null
+++ b/utility/enable_dev_usb_boot
@@ -0,0 +1,38 @@
+#!/bin/sh
+# Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+alert() {
+ echo "$*" >&2
+}
+
+die() {
+ alert "ERROR: $*"
+ exit 1
+}
+
+case "$(crossystem fwid 2>/dev/null || true)" in
+ Mario.* )
+ die "Sorry, your platform does not support booting from USB."
+ ;;
+
+ Alex.* | ZGB.* )
+ # For these legacy platforms, we need to re-flash firmware to get USB boot.
+ chromeos-firmwareupdate --mode=todev || die "Failed to enable USB boot."
+ ;;
+
+ "" )
+ die "Sorry, your firmware does not look like ChromeOS firmware."
+ ;;
+
+ * )
+ crossystem dev_boot_usb=1 2>/dev/null || die "Failed to enable USB boot."
+ echo "
+ SUCCESS: Booting any self-signed kernel from SSD/USB/SDCard slot is enabled.
+
+ Insert bootable media into USB / SDCard slot and press Ctrl-U in developer
+ screen to boot your self-signed image.
+ "
+ ;;
+esac