Skip to content

Commit

Permalink
kernel-install: Try some more initrd variants in 90-loaderentry.install
Browse files Browse the repository at this point in the history
On CentOS/Fedora, dracut is configured to write the initrd to
/boot/initramfs-$KERNEL_VERSION...img so let's check for that as well
if no initrds were supplied.
  • Loading branch information
DaanDeMeyer committed Jul 29, 2024
1 parent 35c01ec commit b56920e
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/kernel-install/90-loaderentry.install.in
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,18 @@ mkdir -p "${LOADER_ENTRY%/*}" || {
have_initrd=yes
done

# Try "initrd", generated by dracut in its kernel-install hook, if no initrds were supplied
[ -z "$have_initrd" ] && [ -f "$ENTRY_DIR_ABS/initrd" ] && echo "initrd $ENTRY_DIR/initrd"
# Try a few variations that are generated by various initrd generators in their kernel-install hooks if
# no initrds were supplied.

if [ -z "$have_initrd" ] && [ -f "$ENTRY_DIR_ABS/initrd" ]; then
echo "initrd $ENTRY_DIR/initrd"
have_initrd=yes
fi

if [ -z "$have_initrd" ] && [ -f "$BOOT_ROOT/initramfs-$KERNEL_VERSION.img" ]; then
echo "initrd /initramfs-$KERNEL_VERSION.img"
have_initrd=yes
fi
:
} >"$LOADER_ENTRY" || {
echo "Error: could not create loader entry '$LOADER_ENTRY'." >&2
Expand Down

0 comments on commit b56920e

Please sign in to comment.