From: rindeal Date: Fri, 16 Aug 2024 00:16:57 +0000 (+0200) Subject: kernel-install: discard comments in cmdline files X-Git-Tag: v257-rc1~691 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=374aa1be7c7aee577ac4e6bf5ec6e4192c3c76a4;p=thirdparty%2Fsystemd.git kernel-install: discard comments in cmdline files It was quite a surprise to find my comments in a booted kernel cmdline. --- diff --git a/src/kernel-install/90-loaderentry.install.in b/src/kernel-install/90-loaderentry.install.in index c9ba111393f..832a82794ca 100755 --- a/src/kernel-install/90-loaderentry.install.in +++ b/src/kernel-install/90-loaderentry.install.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" ' '