summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Meadows <alan.meadows@gmail.com>2018-10-15 13:07:36 -0700
committerAlan Meadows <alan.meadows@gmail.com>2018-10-16 14:04:16 -0700
commit52ddfdcf4d1df54fdbc621d3ec411d8f85358406 (patch)
tree3ca12c116ace6020dd1c8b1b1ebcd6782b2a35f7
parent56521ab77c746b8e7de129160f8859e31bee9a3a (diff)
Add support for specific kernel package selection
by tagging a node with a tag of 'kernel_package' with a value of the explicit package name which will drive the curtin installer. Change-Id: I67c8395c30bcb538859947f7406a433fb18a981b
Notes
Notes (review): Code-Review+2: Scott Hussey <sthussey@att.com> Code-Review+2: Kaspars Skels <kaspars.skels@gmail.com> Workflow+1: Kaspars Skels <kaspars.skels@gmail.com> Verified+2: Zuul Submitted-by: Zuul Submitted-at: Thu, 18 Oct 2018 16:34:31 +0000 Reviewed-on: https://review.openstack.org/610720 Project: openstack/airship-maas Branch: refs/heads/master
-rw-r--r--images/maas-region-controller/2.3_kernel_package.patch27
-rw-r--r--images/maas-region-controller/Dockerfile2
2 files changed, 29 insertions, 0 deletions
diff --git a/images/maas-region-controller/2.3_kernel_package.patch b/images/maas-region-controller/2.3_kernel_package.patch
new file mode 100644
index 0000000..8ac56cd
--- /dev/null
+++ b/images/maas-region-controller/2.3_kernel_package.patch
@@ -0,0 +1,27 @@
1--- preseed.py 2018-10-15 12:52:41.611027184 -0700
2+++ preseed2.py 2018-10-16 13:42:51.824755746 -0700
3@@ -317,7 +317,23 @@
4 The BootResourceFile table contains a mapping between hwe kernels and
5 Ubuntu package names. If this mapping is missing we fall back to letting
6 Curtin figure out which kernel should be installed"""
7- kpackage = BootResource.objects.get_kpackage_for_node(node)
8+
9+ # determine if this node has kernel parameters applied by drydock
10+ kernel_opt_tag = "%s_kp" % (node.hostname)
11+ if kernel_opt_tag in node.tag_names():
12+
13+ # the tag exists, retrieve it
14+ kernel_opts = node.tags.get(name=kernel_opt_tag).kernel_opts
15+
16+ # parse the string and find our package param value
17+ # e.g. kernel_package=linux-image-4.15.0-34-generic
18+ kparams = kernel_opts.split()
19+ kdict = dict(kparam.split('=') for kparam in kparams)
20+ if 'kernel_package' in kdict:
21+ kpackage = kdict['kernel_package']
22+ else:
23+ kpackage = BootResource.objects.get_kpackage_for_node(node)
24+
25 if kpackage:
26 kernel_config = {
27 'kernel': {
diff --git a/images/maas-region-controller/Dockerfile b/images/maas-region-controller/Dockerfile
index ca9e078..e3174b2 100644
--- a/images/maas-region-controller/Dockerfile
+++ b/images/maas-region-controller/Dockerfile
@@ -56,8 +56,10 @@ RUN apt-get download maas-region-controller=$MAAS_VERSION && \
56# 2.3 workarounds 56# 2.3 workarounds
57COPY 2.3_proxy_port.patch /tmp/2.3_proxy_port.patch 57COPY 2.3_proxy_port.patch /tmp/2.3_proxy_port.patch
58COPY 2.3_route.patch /tmp/2.3_route.patch 58COPY 2.3_route.patch /tmp/2.3_route.patch
59COPY 2.3_kernel_package.patch /tmp/2.3_kernel_package.patch
59RUN cd /usr/lib/python3/dist-packages/maasserver && patch compose_preseed.py < /tmp/2.3_proxy_port.patch 60RUN cd /usr/lib/python3/dist-packages/maasserver && patch compose_preseed.py < /tmp/2.3_proxy_port.patch
60RUN cd /usr/lib/python3/dist-packages/maasserver && patch preseed_network.py < /tmp/2.3_route.patch 61RUN cd /usr/lib/python3/dist-packages/maasserver && patch preseed_network.py < /tmp/2.3_route.patch
62RUN cd /usr/lib/python3/dist-packages/maasserver && patch preseed.py < /tmp/2.3_kernel_package.patch
61 63
62COPY journalctl-to-tty.service /etc/systemd/system/journalctl-to-tty.service 64COPY journalctl-to-tty.service /etc/systemd/system/journalctl-to-tty.service
63RUN mkdir -p /etc/systemd/system/basic.target.wants ;\ 65RUN mkdir -p /etc/systemd/system/basic.target.wants ;\