[Bug 1402042] Re: console= parameters need to be added before -- on kernel cmdline

MAAS Lander 1402042 at bugs.launchpad.net
Thu Jul 9 20:24:16 UTC 2015


** Changed in: maas/trunk
       Status: Triaged => Fix Committed

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to debian-installer-utils in
Ubuntu.
https://bugs.launchpad.net/bugs/1402042

Title:
  console= parameters need to be added before -- on kernel cmdline

Status in The curt installer:
  Fix Committed
Status in MAAS:
  Fix Committed
Status in MAAS 1.7 series:
  Triaged
Status in MAAS 1.8 series:
  New
Status in MAAS trunk series:
  Fix Committed
Status in curtin package in Ubuntu:
  Confirmed
Status in debian-installer-utils package in Ubuntu:
  Fix Released
Status in maas package in Ubuntu:
  New
Status in debian-installer-utils source package in Precise:
  In Progress
Status in maas source package in Precise:
  New
Status in curtin source package in Trusty:
  Confirmed
Status in debian-installer-utils source package in Trusty:
  In Progress
Status in maas source package in Trusty:
  New
Status in curtin source package in Utopic:
  Won't Fix
Status in debian-installer-utils source package in Utopic:
  In Progress
Status in maas source package in Utopic:
  New
Status in curtin source package in Vivid:
  Confirmed
Status in debian-installer-utils source package in Vivid:
  Fix Released
Status in maas source package in Vivid:
  New
Status in curtin source package in Wily:
  Confirmed
Status in debian-installer-utils source package in Wily:
  Fix Released
Status in maas source package in Wily:
  New
Status in Debian:
  Fix Released

Bug description:
  === 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.

  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

  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

  Joy.

To manage notifications about this bug go to:
https://bugs.launchpad.net/curtin/+bug/1402042/+subscriptions



More information about the foundations-bugs mailing list