← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~smoser/maas/kernel-cmdline-cleanup into lp:maas

 

Scott Moser has proposed merging lp:~smoser/maas/kernel-cmdline-cleanup into lp:maas.

Requested reviews:
  MAAS Maintainers (maas-maintainers)

For more details, see:
https://code.launchpad.net/~smoser/maas/kernel-cmdline-cleanup/+merge/124226

cleanup of kernel command line arguments, add iscsi_inititator param

This generally cleans up the parameters that we pass on the kernel command
line.

ephemeral/commissioning:
 * add iscsi_initiator: this was always supposed to be required, but 12.04
   initramfs seem to work without it, so we didn't have it. 12.10 fail
   to configure the iscsi target in the initramfs without it.
 * change url= to cloud-config-url=<preseed_url>
   This was really just re-named to cloud-config-url. cloud-init supports
   both 'url=' and 'cloud-config-url', but cloud-config-url is preferable
   as it is obviously more explicit in purpose.
 * change ip=dhcp to ip=dhcp::::<hostname>
   LP: #1046405 has more information, but this is how you would specify
   that the initramfs's dhcp client should specify hostname
 * add overlayroot=tmpfs
   cloud images for quantal now use the overlayroot package to accomplish
   read-only root. 12.04 images used a un-packaged earlier version that
   was hard-coded in the images to on. 12.10 and later need a kernel param
   to enable it.

move to install specific:
 netcfg/choose_interface, domain, text, priority, auto, locale

common:
 * add to intel: 'console=tty1 console=ttyS0'.
   This should log kernel messages to both serial console and graphical
   console if it is present. Note, the kernel assigns /dev/console to
       the last valid argument.
     * add 'nomodeset' to not switch video mode
     * remove 'suite'. Nothing that I am aware of reads this.

Other:
 * add 'SAY' of the kernel cmdline.  At least in testing with kvm
   and -curses, this is very helpful as it goes to wherever the bios
   console is, and you can see it even if 'console=ttyS0' is given
   and the kernel's log of that information goes elsewhere.

-- 
https://code.launchpad.net/~smoser/maas/kernel-cmdline-cleanup/+merge/124226
Your team MAAS Maintainers is requested to review the proposed merge of lp:~smoser/maas/kernel-cmdline-cleanup into lp:maas.
=== modified file 'src/provisioningserver/kernel_opts.py'
--- src/provisioningserver/kernel_opts.py	2012-09-03 11:31:04 +0000
+++ src/provisioningserver/kernel_opts.py	2012-09-13 15:19:53 +0000
@@ -60,18 +60,6 @@
     return "auto url=%s" % preseed_url
 
 
-def compose_suite_opt(release):
-    return "suite=%s" % release
-
-
-def compose_hostname_opt(hostname):
-    return "hostname=%s" % hostname
-
-
-def compose_domain_opt(domain):
-    return "domain=%s" % domain
-
-
 def compose_locale_opt():
     locale = 'en_US'
     return "locale=%s" % locale
@@ -81,7 +69,6 @@
     return [
         'log_host=%s' % log_host,
         'log_port=%d' % 514,
-        'text priority=%s' % 'critical',
         ]
 
 
@@ -127,19 +114,37 @@
 def compose_purpose_opts(params):
     """Return the list of the purpose-specific kernel options."""
     if params.purpose == "commissioning":
+        # these are kernel parameters read by ephemeral
+        # read by open-iscsi initramfs code
         return [
+            # read by open-iscsi initramfs code
             "iscsi_target_name=%s:%s" % (
                 ISCSI_TARGET_NAME_PREFIX,
                 get_ephemeral_name(params.release, params.arch)),
-            "ip=dhcp",
-            "ro root=LABEL=cloudimg-rootfs",
             "iscsi_target_ip=%s" % params.fs_host,
             "iscsi_target_port=3260",
+            "iscsi_initiator=%s" % params.hostname,
+            # read by klibc 'ipconfig' in initramfs
+            "ip=::::%s" % params.hostname,
+            # cloud-images have this filesystem label
+            "ro root=LABEL=cloudimg-rootfs",
+            # read by overlayroot package
+            "overlayroot=tmpfs",
+            # read by cloud-init
+            "cloud-config-url=%s" % params.preseed_url,
             ]
     else:
+        # these are options used by the debian installer
         return [
-            "netcfg/choose_interface=auto"
-            ]
+            # read by debian installer
+            "netcfg/choose_interface=auto",
+            "hostname=%s" % params.hostname,
+            "domain=%s" % params.domain,
+            "text priority=%s" % "critical",
+            "auto",
+            "url=%s" % params.preseed_url,
+            compose_locale_opt(),
+        ]
 
 
 def compose_arch_opts(params):
@@ -147,7 +152,8 @@
     if (params.arch, params.subarch) == ("armhf", "highbank"):
         return ["console=ttyAMA0"]
     else:
-        return []
+        # on intel, send kernel output to both console and ttyS0
+        return ["console=tty1 console=ttyS0"]
 
 
 def compose_kernel_command_line_new(params):
@@ -155,17 +161,11 @@
 
     :type params: `KernelParameters`.
     """
-    options = [
-        compose_initrd_opt(
-            params.arch, params.subarch,
-            params.release, params.purpose),
-        compose_preseed_opt(params.preseed_url),
-        compose_suite_opt(params.release),
-        compose_hostname_opt(params.hostname),
-        compose_domain_opt(params.domain),
-        compose_locale_opt(),
-        ]
+    options = ["nomodeset"]
     options += compose_purpose_opts(params)
+    # Note: logging opts are not respected by ephemeral images, so
+    #       these are actually "purpose_opts" but were left generic
+    #       as it would be nice to have.
     options += compose_logging_opts(params.log_host)
     options += compose_arch_opts(params)
     return ' '.join(options)

=== modified file 'src/provisioningserver/pxe/config.commissioning.template'
--- src/provisioningserver/pxe/config.commissioning.template	2012-08-30 10:42:56 +0000
+++ src/provisioningserver/pxe/config.commissioning.template	2012-09-13 15:19:53 +0000
@@ -6,6 +6,7 @@
 
 LABEL amd64
   SAY Booting (amd64) under MAAS direction...
+  SAY {{kernel_params(arch="amd64") | kernel_command}}
   KERNEL {{kernel_params(arch="amd64") | kernel_path }}
   INITRD {{kernel_params(arch="amd64") | initrd_path }}
   APPEND {{kernel_params(arch="amd64") | kernel_command}}
@@ -13,6 +14,7 @@
 
 LABEL i386
   SAY Booting (i386) under MAAS direction...
+  SAY {{kernel_params(arch="i386") | kernel_command}}
   KERNEL {{kernel_params(arch="i386") | kernel_path }}
   INITRD {{kernel_params(arch="i386") | initrd_path }}
   APPEND {{kernel_params(arch="i386") | kernel_command}}

=== modified file 'src/provisioningserver/pxe/config.template'
--- src/provisioningserver/pxe/config.template	2012-08-30 10:42:56 +0000
+++ src/provisioningserver/pxe/config.template	2012-09-13 15:19:53 +0000
@@ -2,6 +2,7 @@
 
 LABEL execute
   SAY Booting under MAAS direction...
+  SAY {{kernel_params | kernel_command}}
   KERNEL {{kernel_params | kernel_path }}
   INITRD {{kernel_params | initrd_path }}
   APPEND {{kernel_params | kernel_command}}


Follow ups