~ubuntu-branches/ubuntu/saucy/maas/saucy-updates

« back to all changes in this revision

Viewing changes to src/provisioningserver/kernel_opts.py

  • Committer: Package Import Robot
  • Author(s): Andres Rodriguez, Julian Edwards, Raphaël Badin, Jeroen Vermeulen, Andres Rodriguez, Robie Basak, Scott Moser, Diogo Matsubara
  • Date: 2012-10-08 13:10:23 UTC
  • mfrom: (1.1.18)
  • mto: This revision was merged to the branch mainline in revision 21.
  • Revision ID: package-import@ubuntu.com-20121008131023-68glibh0pbqrgtfq
Tags: 0.1+bzr1223+dfsg-0ubuntu1
* New upstream release. (LP: #1062518)

[ Julian Edwards ]
* Split packaging of 'maas' into maas-{region,cluster}-controller
  - debian/control: Update accordingly.
  - debian/*.install: Move files accordingly
  - debian/*.{postinst,postrm,preinst}: Move files accordingly.
* Ensure isc-dhcp-server is disabled when installing maas-dhcp.
* Ensure maas-dns creates the maas user before trying to chown files.
* Make maas-cluster-controller autoconfigure itself when upgrading from the
  old maas package. (LP: #1059416)
* Add missing prerm file for maas-cluster-controller so that .pyc files
  are cleaned up. (LP: #1059973)

[ Raphaël Badin ]
* Install maas_local_celeryconfig.py in /etc/maas and symlink to
  /usr/share/maas.
* debian/maas.postinst: Create rabbitmq celery user/vhost.
* debian/maas.postinst: Update BROKER_URL in maas_local_celeryconfig.py.
* Use maas_local_celeryconfig_cluster.py as the local celery
  configuration file for the cluster worker.
* debian/maas-region-controller.maas-region-celery.upstart: Add region
  worker upstart script.
* Rename cluster worker upstart script into
  maas-cluster-controller.maas-clluster-celery.upstart.
* maas-cluster-controller.maas-celery.upstart: use "celeryconfig_cluster"
  as the Celery config module.
* debian/maas-common.install: Install celeryconfig_common.py.
* debian/maas-cluster-controller.install: Install celeryconfig_cluster.py.
* debian/maas-region-controller.install: Install celeryconfig.py.
* Split celery config into cluster and region configs.
* Add region celeryd upstart config.
* Define CELERY_CONFIG_MODULE in
  maas-cluster-controller.maas-cluster-celery.upstart

[ Jeroen Vermeulen ]
* Make maas_local_celery_config.py non-world readable.
* Make maas_local_celeryconfig_cluster.py non-world readable.
* Set root:maas ownership of local cluster config only *after*
  the maas user/group have been created

[ Andres Rodriguez ]
* debian/maas.postinst:
  - Always restart apache2.
  - Handle upgrades for new upstream release.
  - Handle upgrades for celery rabbitmq worker.
* Add binary package to install client tool.
  - debian/extras/maas-cli: Add binary.
  - debian/maas-cli.install: Add. Install maascli and apiclient.
  - debian/control: Add binary package.
* debian/control:
  - Depends on freeipmi-tools instead of ipmitool.
  - Conflicts/Replaces on maas for python-maas-client.
  - Depends on python-netifaces, python-lxml.
* Add python-maas-client binary package:
  - debian/python-maas-client.install: Add. Install 'apiclient' python module.
  - debian/control: Add package. python-django-maas and maas-cli now
    Depend on it.
* debian/rules: Install maas-dhcp-server upstart job.
* debian/maas.postrm: Remove celery worker rabbitmq user and host.
* debian/extras/99-maas-sudoers: Add for maas-dhcp-server upstart job
  instead of isc-dhcp-server (LP: #1055951)
* debian/maas-region-controller.postinst: Cleanup upgrade rules.
* debian/maas-cluster-controller.postinst: Fix 'local' usage.
* debian/maas-common.install: Install celeryconfig in appropriate location.
* debian/maas-cluster-controller.postrm: Add and delete maas user.
* debian/maas-dhcp.postinst: Stop isc-dhcp-server not isc_dhcp_server.
* debian/maas-region-controller.postinst:
  - Always update passwords on upgrade. No longer check versioning. (LP: #1060094).
  - Add MAAS server to allowed mirror in squid-deb-proxy
  - Source dbconfig conf file for maas-region-controller on upgrade because
    it writes a new config file and no longer preservers the previous password.
* debian/maas-cluster-controller.maas-cluster-celery.upstart: Remove set{uid/gid}.
* debian/maas-region-controller.install: Install maas-import-squashfs
* Handle removal of non existant files (LP: #1059556):
  - debian/maintscript: Added to handle removal of conffiles.
  - debian/control: Add Pre-depends and bump debhelper version.
* update po files for the templates.
* debian/extras/99-maas: Install in usr/share/maas/conf and symlink to the
  appropriate etc dir.
* debian/maas-cluster-controller.config: Source debconf at the beginning of the
  script. (LP: #1063857)
* debian/patches/99-temporary-fix-constraints.patch: Fix constraints maaping
  when deploying with juju. Temporary until it gets merged upstream

[ Robie Basak ]
* Add maas-cluster-controller dependency on uuid-runtime, needed for uuidgen
  by postinst.

[ Scott Moser ]
* debian/maas-dhcp.{install,apparmor,postrm} install apparmor profile into
  /etc/apparmor.d/dhcpd.d (LP: #1049177), and update apparmor profile for
  /usr/sbin/dhcpd on install/remove
* get the ip address for the dhcp server in config

[ Diogo Matsubara ]
* Add initial tests to be run by autotests:
  - debian/control: XS-Testsuite: autopkgtest
  - debian/tests/control: Add
  - debian/tests/maas-package-test: Add
  - tests/maas-integration.py: Add

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
 
12
12
__metaclass__ = type
13
13
__all__ = [
14
 
    'compose_kernel_command_line_new',
 
14
    'compose_kernel_command_line',
15
15
    'KernelParameters',
16
16
    ]
17
17
 
19
19
import os
20
20
 
21
21
from provisioningserver.config import Config
22
 
from provisioningserver.pxe.tftppath import compose_image_path
23
22
from provisioningserver.utils import parse_key_value_file
24
23
 
25
24
 
47
46
    __call__ = KernelParametersBase._replace
48
47
 
49
48
 
50
 
def compose_initrd_opt(arch, subarch, release, purpose):
51
 
    path = "%s/initrd.gz" % compose_image_path(arch, subarch, release, purpose)
52
 
    return "initrd=%s" % path
53
 
 
54
 
 
55
49
def compose_preseed_opt(preseed_url):
56
50
    """Compose a kernel option for preseed URL.
57
51
 
58
52
    :param preseed_url: The URL from which a preseed can be fetched.
59
53
    """
 
54
    # See https://help.ubuntu.com/12.04/installation-guide
 
55
    #   /i386/preseed-using.html#preseed-auto
60
56
    return "auto url=%s" % preseed_url
61
57
 
62
58
 
63
 
def compose_suite_opt(release):
64
 
    return "suite=%s" % release
65
 
 
66
 
 
67
 
def compose_hostname_opt(hostname):
68
 
    return "hostname=%s" % hostname
69
 
 
70
 
 
71
 
def compose_domain_opt(domain):
72
 
    return "domain=%s" % domain
73
 
 
74
 
 
75
59
def compose_locale_opt():
76
60
    locale = 'en_US'
77
61
    return "locale=%s" % locale
81
65
    return [
82
66
        'log_host=%s' % log_host,
83
67
        'log_port=%d' % 514,
84
 
        'text priority=%s' % 'critical',
85
68
        ]
86
69
 
87
70
 
124
107
    return name
125
108
 
126
109
 
 
110
def compose_hostname_opts(params):
 
111
    """Return list of hostname/domain options based on `params`.
 
112
 
 
113
    The domain is omitted if `params` does not include it.
 
114
    """
 
115
    options = [
 
116
        'hostname=%s' % params.hostname,
 
117
        ]
 
118
    if params.domain is not None:
 
119
        options.append('domain=%s' % params.domain)
 
120
    return options
 
121
 
 
122
 
127
123
def compose_purpose_opts(params):
128
124
    """Return the list of the purpose-specific kernel options."""
129
125
    if params.purpose == "commissioning":
 
126
        # These are kernel parameters read by the ephemeral environment.
130
127
        return [
 
128
            # Read by the open-iscsi initramfs code.
131
129
            "iscsi_target_name=%s:%s" % (
132
130
                ISCSI_TARGET_NAME_PREFIX,
133
131
                get_ephemeral_name(params.release, params.arch)),
134
 
            "ip=dhcp",
135
 
            "ro root=LABEL=cloudimg-rootfs",
136
132
            "iscsi_target_ip=%s" % params.fs_host,
137
133
            "iscsi_target_port=3260",
 
134
            "iscsi_initiator=%s" % params.hostname,
 
135
            # Read by cloud-initramfs-dyn-netconf and klibc's ipconfig
 
136
            # in the initramfs.
 
137
            "ip=::::%s:BOOTIF" % params.hostname,
 
138
            # cloud-images have this filesystem label.
 
139
            "ro root=LABEL=cloudimg-rootfs",
 
140
            # Read by overlayroot package.
 
141
            "overlayroot=tmpfs",
 
142
            # Read by cloud-init.
 
143
            "cloud-config-url=%s" % params.preseed_url,
138
144
            ]
139
145
    else:
 
146
        # These are options used by the Debian Installer.
140
147
        return [
141
 
            "netcfg/choose_interface=auto"
142
 
            ]
 
148
            "netcfg/choose_interface=auto",
 
149
            # Use the text installer, display only critical messages.
 
150
            "text priority=critical",
 
151
            compose_preseed_opt(params.preseed_url),
 
152
            compose_locale_opt(),
 
153
            ] + compose_hostname_opts(params)
143
154
 
144
155
 
145
156
def compose_arch_opts(params):
147
158
    if (params.arch, params.subarch) == ("armhf", "highbank"):
148
159
        return ["console=ttyAMA0"]
149
160
    else:
150
 
        return []
151
 
 
152
 
 
153
 
def compose_kernel_command_line_new(params):
 
161
        # On Intel send kernel output to both console and ttyS0.
 
162
        return ["console=tty1", "console=ttyS0"]
 
163
 
 
164
 
 
165
def compose_kernel_command_line(params):
154
166
    """Generate a line of kernel options for booting `node`.
155
167
 
156
168
    :type params: `KernelParameters`.
157
169
    """
158
 
    options = [
159
 
        compose_initrd_opt(
160
 
            params.arch, params.subarch,
161
 
            params.release, params.purpose),
162
 
        compose_preseed_opt(params.preseed_url),
163
 
        compose_suite_opt(params.release),
164
 
        compose_hostname_opt(params.hostname),
165
 
        compose_domain_opt(params.domain),
166
 
        compose_locale_opt(),
167
 
        ]
 
170
    options = []
 
171
    # nomodeset prevents video mode switching.
 
172
    options += ["nomodeset"]
168
173
    options += compose_purpose_opts(params)
 
174
    # Note: logging opts are not respected by ephemeral images, so
 
175
    #       these are actually "purpose_opts" but were left generic
 
176
    #       as it would be nice to have.
169
177
    options += compose_logging_opts(params.log_host)
170
178
    options += compose_arch_opts(params)
171
179
    return ' '.join(options)