[[ -f /etc/os-release ]] && . /etc/os-release
if ! [[ $ID ]]; then
echo "Can't determine the name of your distribution. Please create /etc/os-release." >&2
- echo "See http://www.freedesktop.org/software/systemd/man/os-release.html" >&2
+ echo "See man:os-release(5)" >&2
exit 1
fi
[[ -f /etc/machine-id ]] && read MACHINE_ID < /etc/machine-id
if ! [[ $MACHINE_ID ]]; then
echo "Can't determine your machine id. Please create /etc/machine-id!" >&2
- echo "See http://www.freedesktop.org/software/systemd/man/machine-id.html" >&2
+ echo "See man:machine-id(5)" >&2
exit 1
fi
} >&2
}
-if ! ( [[ $COMMAND ]] && [[ $KERNEL_VERSION ]] && [[ $KERNEL_IMAGE ]] ); then
+if ! ( [[ $COMMAND ]] && [[ $KERNEL_VERSION ]] ); then
usage
exit 1
fi
-BOOT_DIR="$MACHINE_ID/$KERNEL_VERSION"
-BOOT_DIR_ABS="/boot/$BOOT_DIR"
-LOADER_ENTRY="/boot/loader/entries/${ID}-${KERNEL_VERSION}-${MACHINE_ID}.conf"
+BOOT_DIR="/${MACHINE_ID}/${KERNEL_VERSION}"
+BOOT_DIR_ABS="/boot${BOOT_DIR}"
+LOADER_ENTRY="/boot/loader/entries/${MACHINE_ID}-${KERNEL_VERSION}.conf"
ret=0
dropindirs_sort()
case "$COMMAND" in
add)
+ if [[ -z $KERNEL_IMAGE ]]; then
+ usage
+ exit 1
+ fi
mkdir -p "$BOOT_DIR_ABS" || exit 1
for f in "${PLUGINS[@]}"; do