| 1 | #!/bin/sh |
| 2 | set -eu |
| 3 | |
| 4 | . /usr/share/debconf/confmodule |
| 5 | |
| 6 | log() { |
| 7 | logger -t "depthcharge-tools-installer" "$@" |
| 8 | } |
| 9 | |
| 10 | error () { |
| 11 | log "$@" |
| 12 | exit 1 |
| 13 | } |
| 14 | |
| 15 | # Check if we have a board override. |
| 16 | db_get depthcharge-tools-installer/board |
| 17 | if [ -n "${RET:-}" ]; then |
| 18 | log "Pretending this is a ChromeOS board '$RET'." |
| 19 | exit 0 |
| 20 | fi |
| 21 | |
| 22 | # ChromeOS firmware injects one of these values into the cmdline based |
| 23 | # on which boot mechanism is used. |
| 24 | if ! grep "cros_secure" /proc/cmdline >/dev/null 2>&1; then |
| 25 | error "Not installing to non-ChromeOS board." |
| 26 | fi |