-
Notifications
You must be signed in to change notification settings - Fork 0
/
boot
executable file
·51 lines (33 loc) · 912 Bytes
/
boot
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/bin/bash -eu
readonly SCRIPT_NAME="$(basename "$0")"
readonly SCRIPT_DIR="$(dirname "$(realpath "$0")")"
source "$SCRIPT_DIR"/lib/boot.sh
source "$SCRIPT_DIR"/lib/package.sh
usage() {
die <<EOM
Usage: $SCRIPT_NAME [OPTION]... MEDIA
Boots MEDIA in a generic 64-bit ARM machine.
MEDIA can be generated with the 'package' command.
Options:
-h print this help message
Environment variables:
MENUCONFIG if defined, configure kernel before building
Sample invocation:
$0 gentoo.rpi4.img # boot the gentoo.rpi4.img image
EOM
}
while getopts :hd OPTION; do
case $OPTION in
h) usage ;;
\?) usage ;;
esac
done
shift $((OPTIND-1))
(( $# == 1 )) || usage
readonly MEDIA="$1"
test -f "$MEDIA" || die "File not found: $MEDIA"
parse-media-name
[ -f profiles/"$PROFILE".sh ] || die "unsupported profile '$PROFILE'"
source profiles/"$PROFILE".sh
cd "$SCRIPT_DIR"
boot