| 1 | #!/bin/shscip-shell filesystem . . `/bin/sh`. |
| 2 | # Copyright 2012 The ChromiumOS Authors |
| 3 | # Use of this source code is governed by a BSD-style license that can be |
| 4 | # found in the LICENSE file. |
| 5 | |
| 6 | alertscip-shell shell coreboot 25.09+dfsg-1 alert().() { |
| 7 | echoscip-shell system . . echo. "$*" >&2 |
| 8 | } |
| 9 | |
| 10 | diescip-shell shell coreboot 25.09+dfsg-1 die().() { |
| 11 | alertscip-shell shell coreboot 25.09+dfsg-1 alert(). "ERROR: $*" |
| 12 | exit 1 |
| 13 | } |
| 14 | |
| 15 | case "$(crossystem fwid 2>/dev/nullscip-shell filesystem . . `/dev/null`. || truescip-shell system . . true.)" in |
| 16 | Mario.* ) |
| 17 | diescip-shell shell coreboot 25.09+dfsg-1 die(). "Sorry, your platform does not support booting from USB." |
| 18 | ;; |
| 19 | |
| 20 | Alex.* | ZGB.* ) |
| 21 | # For these legacy platforms, we need to re-flash firmware to get USB boot. |
| 22 | chromeos-firmwareupdate --mode=todev || diescip-shell shell coreboot 25.09+dfsg-1 die(). "Failed to enable USB boot." |
| 23 | ;; |
| 24 | |
| 25 | "" ) |
| 26 | diescip-shell shell coreboot 25.09+dfsg-1 die(). "Sorry, your firmware does not look like ChromeOS firmware." |
| 27 | ;; |
| 28 | |
| 29 | * ) |
| 30 | crossystem dev_boot_usb=1 2>/dev/nullscip-shell filesystem . . `/dev/null`. || diescip-shell shell coreboot 25.09+dfsg-1 die(). "Failed to enable USB boot." |
| 31 | echoscip-shell system . . echo. " |
| 32 | SUCCESS: Booting any self-signed kernel from SSD/USB/SDCard slot is enabled. |
| 33 | |
| 34 | Insert bootable media into USB / SDCard slot and press Ctrl-U in developer |
| 35 | screen to boot your self-signed image. |
| 36 | " |
| 37 | ;; |
| 38 | esac |