]>
Commit | Line | Data |
---|---|---|
ff12a795 | 1 | #!/usr/bin/env bash |
cf73f650 ZJS |
2 | # -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- |
3 | # ex: ts=8 sw=4 sts=4 et filetype=sh | |
4 | ||
5 | COMMAND="$1" | |
6 | KERNEL_VERSION="$2" | |
7 | ENTRY_DIR_ABS="$3" | |
8 | KERNEL_IMAGE="$4" | |
9 | INITRD_OPTIONS_START="5" | |
10 | ||
11 | if ! [[ $KERNEL_INSTALL_MACHINE_ID ]]; then | |
12 | exit 0 | |
13 | fi | |
14 | ||
15 | if [[ $COMMAND != add ]]; then | |
16 | exit 0 | |
17 | fi | |
18 | ||
19 | # If the boot dir exists (e.g. $ESP/<machine-id>), | |
20 | # create the entry directory ($ESP/<machine-id>/<kernel-version>). | |
21 | # This is the only function of this plugin. | |
22 | MACHINE_ID_DIR="${ENTRY_DIR_ABS%/*}" | |
23 | if ! [ -d "$MACHINE_ID_DIR" ]; then | |
24 | exit 0 | |
25 | fi | |
26 | ||
27 | if [ "$KERNEL_INSTALL_VERBOSE" -gt 0 ]; then | |
28 | echo "+mkdir -v -p $ENTRY_DIR_ABS" | |
29 | exec mkdir -v -p "$ENTRY_DIR_ABS" | |
30 | else | |
31 | exec mkdir -p "$ENTRY_DIR_ABS" | |
32 | fi |