mirror of
https://github.com/morgan9e/systemd
synced 2026-04-14 08:25:20 +09:00
kernel-install: discard comments in cmdline files
It was quite a surprise to find my comments in a booted kernel cmdline.
This commit is contained in:
@@ -73,12 +73,12 @@ SORT_KEY="$IMAGE_ID"
|
||||
|
||||
if [ -n "$KERNEL_INSTALL_CONF_ROOT" ]; then
|
||||
if [ -f "$KERNEL_INSTALL_CONF_ROOT/cmdline" ]; then
|
||||
BOOT_OPTIONS="$(tr -s "$IFS" ' ' <"$KERNEL_INSTALL_CONF_ROOT/cmdline")"
|
||||
BOOT_OPTIONS="$(grep -Gv '^\s*#' "$KERNEL_INSTALL_CONF_ROOT/cmdline" | tr -s "$IFS" ' ')"
|
||||
fi
|
||||
elif [ -f /etc/kernel/cmdline ]; then
|
||||
BOOT_OPTIONS="$(tr -s "$IFS" ' ' </etc/kernel/cmdline)"
|
||||
BOOT_OPTIONS="$(grep -Gv '^\s*#' /etc/kernel/cmdline | tr -s "$IFS" ' ')"
|
||||
elif [ -f /usr/lib/kernel/cmdline ]; then
|
||||
BOOT_OPTIONS="$(tr -s "$IFS" ' ' </usr/lib/kernel/cmdline)"
|
||||
BOOT_OPTIONS="$(grep -Gv '^\s*#' /usr/lib/kernel/cmdline | tr -s "$IFS" ' ')"
|
||||
elif ! systemd-detect-virt --container --quiet; then
|
||||
BOOT_OPTIONS="$(tr -s "$IFS" '\n' </proc/cmdline | grep -ve '^BOOT_IMAGE=' -e '^initrd=' | tr '\n' ' ')"
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user