summaryrefslogtreecommitdiff
path: root/src/kernel-install/90-loaderentry.install
diff options
context:
space:
mode:
Diffstat (limited to 'src/kernel-install/90-loaderentry.install')
-rw-r--r--src/kernel-install/90-loaderentry.install10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/kernel-install/90-loaderentry.install b/src/kernel-install/90-loaderentry.install
index e5fb232f35..75dd5a1b7d 100644
--- a/src/kernel-install/90-loaderentry.install
+++ b/src/kernel-install/90-loaderentry.install
@@ -83,7 +83,9 @@ cp "$KERNEL_IMAGE" "$BOOT_DIR_ABS/linux" &&
exit 1
}
-for initrd in "${@:${INITRD_OPTIONS_START}}"; do
+INITRD_OPTIONS=( "${@:${INITRD_OPTIONS_START}}" )
+
+for initrd in "${INITRD_OPTIONS[@]}"; do
if [[ -f "${initrd}" ]]; then
initrd_basename="$(basename ${initrd})"
cp "${initrd}" "$BOOT_DIR_ABS/${initrd_basename}" &&
@@ -95,6 +97,10 @@ for initrd in "${@:${INITRD_OPTIONS_START}}"; do
fi
done
+# If no initrd option is supplied, fallback to "initrd" which is
+# the name used by dracut when generating it in its kernel-install hook
+[[ ${#INITRD_OPTIONS[@]} == 0 ]] && INITRD_OPTIONS=( initrd )
+
mkdir -p "${LOADER_ENTRY%/*}" || {
echo "Could not create loader entry directory '${LOADER_ENTRY%/*}'." >&2
exit 1
@@ -106,7 +112,7 @@ mkdir -p "${LOADER_ENTRY%/*}" || {
echo "machine-id $MACHINE_ID"
echo "options ${BOOT_OPTIONS[*]}"
echo "linux $BOOT_DIR/linux"
- for initrd in "${@:${INITRD_OPTIONS_START}}"; do
+ for initrd in "${INITRD_OPTIONS[@]}"; do
[[ -f $BOOT_DIR_ABS/$(basename ${initrd}) ]] && \
echo "initrd $BOOT_DIR/$(basename ${initrd})"
done