]> git.ipfire.org Git - thirdparty/systemd.git/blame - src/kernel-install/00-entry-directory.install
treewide: more portable bash shebangs
[thirdparty/systemd.git] / src / kernel-install / 00-entry-directory.install
CommitLineData
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
5COMMAND="$1"
6KERNEL_VERSION="$2"
7ENTRY_DIR_ABS="$3"
8KERNEL_IMAGE="$4"
9INITRD_OPTIONS_START="5"
10
11if ! [[ $KERNEL_INSTALL_MACHINE_ID ]]; then
12 exit 0
13fi
14
15if [[ $COMMAND != add ]]; then
16 exit 0
17fi
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.
22MACHINE_ID_DIR="${ENTRY_DIR_ABS%/*}"
23if ! [ -d "$MACHINE_ID_DIR" ]; then
24 exit 0
25fi
26
27if [ "$KERNEL_INSTALL_VERBOSE" -gt 0 ]; then
28 echo "+mkdir -v -p $ENTRY_DIR_ABS"
29 exec mkdir -v -p "$ENTRY_DIR_ABS"
30else
31 exec mkdir -p "$ENTRY_DIR_ABS"
32fi