14cf53fb7b
Signed-off-by: Anselme, Schubert (sa246v) <sa246v@att.com> Change-Id: If5fffa59f547d4b19d7c0f086204800e9144d952
32 lines
1.2 KiB
Diff
32 lines
1.2 KiB
Diff
diff --git a/src/maasserver/preseed.py b/src/maasserver/preseed.py
|
|
index c692969..c20facf 100644
|
|
--- a/src/maasserver/preseed.py
|
|
+++ b/src/maasserver/preseed.py
|
|
@@ -250,7 +250,26 @@ def compose_curtin_kernel_preseed(node):
|
|
if node.get_osystem() == "custom":
|
|
return []
|
|
|
|
+ # previous logic to retrieve kpackage parameter
|
|
kpackage = BootResource.objects.get_kpackage_for_node(node)
|
|
+
|
|
+ # determine if thie node has kernel parameters applied by drydock
|
|
+ # and override kpackage if we discover the right properties
|
|
+ kernel_opt_tag = "%s_kp" % (node.hostname)
|
|
+ if kernel_opt_tag in node.tag_names():
|
|
+
|
|
+ # the tag exists, retrieve it
|
|
+ kernel_opts = node.tags.get(name=kernel_opt_tag).kernel_opts
|
|
+
|
|
+ # parse the string and find our package param value
|
|
+ # e.g. kernel_package=linux-image-4.15.0-34-generic
|
|
+ kparams = kernel_opts.split()
|
|
+ kdict = dict(
|
|
+ kparam.split("=", 1) for kparam in kparams if "=" in kparam
|
|
+ )
|
|
+ if "kernel_package" in kdict:
|
|
+ kpackage = kdict["kernel_package"]
|
|
+
|
|
if kpackage:
|
|
kernel_config = {"kernel": {"package": kpackage, "mapping": {}}}
|
|
return [yaml.safe_dump(kernel_config)]
|