[Bug 1402042] Re: console= parameters need to be added before -- on kernel cmdline
Scott Moser
smoser at ubuntu.com
Tue Jul 7 15:44:53 UTC 2015
** Description changed:
+ === Begin SRU Information ===
+ [Description]
+ In kernel version 3.15, the linux kernel began ignoring command line options that come after a '--' on the kernel command line.
+
Kernel documentation at https://www.kernel.org/doc/Documentation/kernel-parameters.txt says:
- | The kernel parses parameters from the kernel command line up to "--";
- | if it doesn't recognize a parameter and it doesn't contain a '.', the
- | parameter gets passed to init: parameters with '=' go into init's
- | environment, others are passed as command line arguments to init.
- | Everything after "--" is passed as an argument to init.
+ | The kernel parses parameters from the kernel command line up to "--";
+ | if it doesn't recognize a parameter and it doesn't contain a '.', the
+ | parameter gets passed to init: parameters with '=' go into init's
+ | environment, others are passed as command line arguments to init.
+ | Everything after "--" is passed as an argument to init.
+
+ This change of behavior collided with Ubuntu installer's usage (both d-i
+ and curtin). The installers would copy arguments after '--' to the
+ installed system.
+
+ For example, booting an installer with:
+ kernelarg1 arg2 arg3=bar -- console=ttyS1,115200
+ would result in the installed system having 'console=ttyS1,115200' on the command line.
+
+ The problem is then that if you're booting a kernel > 3.15 for your
+ installer (which is the case for trusty-hwe-u or utopic onward) the
+ 'console=' flag will not be paid attention to in the install
+ environment.
+
+ The solution used by d-i was to modify its token to be '---' or '--'.
+ This solution has been implmented in curtin also.
+
+ MAAS has used '--' in the past, but will now need to use '---'.
+ However, maas can't simply use '---' as that would result in un-patched
+ installers not copying the parameters over to the installed system. The
+ install environment would get them, but not the installed environment.
+
+ [Impact]
+ The impact is that when booting an installer with a command line like:
+ kernelarg1 arg2 arg3=bar -- console=ttyS1,115200
+
+ the output does not go to the console. Other kernel command line
+ parameters are also ignored, console= is just the most immediately
+ obvious.
+
+ [Regression Potential]
+ The fix in curtin and in d-i honor both '--' or '---', so chance of regression is low.
+
+ The fix in MAAS is relatively ignorant as it does not make its decision
+ to use '---' or '--' based on what it is installing. The decision would
+ be hard to make as it would require knowing the version of debian-
+ installer-utils was to be used.
+
+ With the change in place in MAAS, the failure case would show itself as
+ arguments not being copied to the installed system.
+
+ [Other Info]
+ To do this properly, we really need to hold the change in MAAS until all expected installers have the fix.
+
+ Since MAAS uses curtin as the default installer in current trunk and 1.8 branches, we've made curtin expose the information of which token to use to MAAS. That does mean that d-i would broken until all SRUs are done.
+ === End SRU Information ===
+
+ === Original Bug Report ===
+ Kernel documentation at https://www.kernel.org/doc/Documentation/kernel-parameters.txt says:
+ | The kernel parses parameters from the kernel command line up to "--";
+ | if it doesn't recognize a parameter and it doesn't contain a '.', the
+ | parameter gets passed to init: parameters with '=' go into init's
+ | environment, others are passed as command line arguments to init.
+ | Everything after "--" is passed as an argument to init.
In my experience that was never true, and I can reproduce the kernel paying
attention to a command line like:
- -- root=LABEL=cloudimg-rootfs ro console=ttyS0
+ -- root=LABEL=cloudimg-rootfs ro console=ttyS0
and the system booting fine, and with data ton ttyS0 on a 3.13 (trusty)
kernel.
The fun begins a 3.16 (utopic/hwe-u) where the kernel documentation
quoted above seems to be valid.
Currently maas is takes global command line parameters (as set via 'maas
admin set-config name=kernel_opts value="console=ttyS0"') and places
them after a '--' in during commissioning and curtin install (and i
believe d-i install).
The end result is that setting console=ttyS0 as kernel parameters does
not work with 3.16 in the commissioning and install environment.
Curtin (in following with convention I believe to be true in 'd-i' )
will copy parameters after a '--' to the installed system. So, the
installed system works fine, but the install and commissioning is
'blind'.
There are 2 solutions here:
- a.) put kernel flags twice (both before and after a '--')
- this could in the future make systemd unhappy as those would then turn into flags to systemd.
- b.) put kernel flags only before and find another way to pass to curtin or d-i
+ a.) put kernel flags twice (both before and after a '--')
+ this could in the future make systemd unhappy as those would then turn into flags to systemd.
+ b.) put kernel flags only before and find another way to pass to curtin or d-i
Joy.
** Also affects: debian-installer-utils (Ubuntu)
Importance: Undecided
Status: New
** Changed in: debian-installer-utils (Ubuntu)
Status: New => Fix Released
** Also affects: debian-installer-utils (Ubuntu Utopic)
Importance: Undecided
Status: New
** Also affects: debian-installer-utils (Ubuntu Trusty)
Importance: Undecided
Status: New
** Also affects: debian-installer-utils (Ubuntu Wily)
Importance: Undecided
Status: Fix Released
** Also affects: debian-installer-utils (Ubuntu Precise)
Importance: Undecided
Status: New
** Also affects: debian-installer-utils (Ubuntu Vivid)
Importance: Undecided
Status: New
** Also affects: maas (Ubuntu)
Importance: Undecided
Status: New
** Also affects: curtin
Importance: Undecided
Status: New
** Changed in: curtin
Importance: Undecided => Medium
** Changed in: curtin
Status: New => Confirmed
** Also affects: curtin (Ubuntu)
Importance: Undecided
Status: New
** Changed in: curtin (Ubuntu Precise)
Status: New => Won't Fix
** No longer affects: curtin (Ubuntu Precise)
** Changed in: curtin (Ubuntu Utopic)
Importance: Undecided => Medium
** Changed in: curtin (Ubuntu Utopic)
Status: New => Won't Fix
** Changed in: curtin (Ubuntu Vivid)
Importance: Undecided => Medium
** Changed in: curtin (Ubuntu Vivid)
Status: New => Confirmed
** Changed in: curtin (Ubuntu Wily)
Importance: Undecided => High
** Changed in: curtin (Ubuntu Wily)
Status: New => Confirmed
** Changed in: curtin (Ubuntu Trusty)
Importance: Undecided => High
** Changed in: curtin (Ubuntu Trusty)
Status: New => Confirmed
--
You received this bug notification because you are a member of Ubuntu
Server Team, which is subscribed to maas in Ubuntu.
https://bugs.launchpad.net/bugs/1402042
Title:
console= parameters need to be added before -- on kernel cmdline
To manage notifications about this bug go to:
https://bugs.launchpad.net/curtin/+bug/1402042/+subscriptions
More information about the Ubuntu-server-bugs
mailing list