summaryrefslogtreecommitdiffstats
path: root/src/kernel-install/90-loaderentry.install.in
diff options
context:
space:
mode:
Diffstat (limited to 'src/kernel-install/90-loaderentry.install.in')
-rwxr-xr-xsrc/kernel-install/90-loaderentry.install.in20
1 files changed, 16 insertions, 4 deletions
diff --git a/src/kernel-install/90-loaderentry.install.in b/src/kernel-install/90-loaderentry.install.in
index 4ef6aca..c9ba111 100755
--- a/src/kernel-install/90-loaderentry.install.in
+++ b/src/kernel-install/90-loaderentry.install.in
@@ -79,8 +79,10 @@ elif [ -f /etc/kernel/cmdline ]; then
BOOT_OPTIONS="$(tr -s "$IFS" ' ' </etc/kernel/cmdline)"
elif [ -f /usr/lib/kernel/cmdline ]; then
BOOT_OPTIONS="$(tr -s "$IFS" ' ' </usr/lib/kernel/cmdline)"
-else
+elif ! systemd-detect-virt --container --quiet; then
BOOT_OPTIONS="$(tr -s "$IFS" '\n' </proc/cmdline | grep -ve '^BOOT_IMAGE=' -e '^initrd=' | tr '\n' ' ')"
+else
+ BOOT_OPTIONS=""
fi
BOOT_OPTIONS="${BOOT_OPTIONS% }"
@@ -194,7 +196,7 @@ mkdir -p "${LOADER_ENTRY%/*}" || {
echo "machine-id $MACHINE_ID"
fi
[ -n "$SORT_KEY" ] && echo "sort-key $SORT_KEY"
- echo "options $BOOT_OPTIONS"
+ [ -n "$BOOT_OPTIONS" ] && echo "options $BOOT_OPTIONS"
echo "linux $KERNEL_ENTRY"
[ -n "$DEVICETREE_ENTRY" ] && echo "devicetree $DEVICETREE_ENTRY"
@@ -205,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