<term><filename>/proc/cmdline</filename></term>
<listitem>
<para>Specifies the kernel command line to use. The first of the files that is found will be used.
- When running in a container, <filename>/proc/cmdline</filename> is ignored.
- <varname>$KERNEL_INSTALL_CONF_ROOT</varname> may be used to override the search path; see below for
- details.</para>
+ Lines starting with the <literal>#</literal> character are ignored. When running in a container,
+ <filename>/proc/cmdline</filename> is ignored. <varname>$KERNEL_INSTALL_CONF_ROOT</varname> may be
+ used to override the search path; see below for details.</para>
<xi:include href="version-info.xml" xpointer="v198"/>
</listitem>
def kernel_cmdline_base() -> list[str]:
path = input_file_location('cmdline')
if path:
- return path.read_text().split()
+ # Filter out commented out lines from cmdline.
+ lines = path.read_text().splitlines()
+ return [opt
+ for line in lines
+ if not line.startswith('#')
+ for opt in line.split()]
# If we read /proc/cmdline, we need to do some additional filtering.
options = Path('/proc/cmdline').read_text().split()
echo 'buzy image' >"$D/sources/linux"
echo 'the initrd' >"$D/sources/initrd"
echo 'the-token' >"$D/sources/entry-token"
-echo 'opt1 opt2' >"$D/sources/cmdline"
+
+cat >"$D/sources/cmdline" <<EOF
+opt1
+# commented line
+opt2
+EOF
cat >"$D/sources/install.conf" <<EOF
layout=bls