enable_dev_usb_boot 969 B

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