This patch will allow you to specify
initrd=/path/under/tftpboot/driverdisk.img in kernel_options and it will
append that to the existing initrd.
Here is an example with:
Kernel Options : {'initrd': '/dd/rhel5/test.img'}
default linux
prompt 0
timeout 100
label linux
kernel /images/RHEL5.5-Server-x86_64/vmlinuz
ipappend 2
append
initrd=/images/RHEL5.5-Server-x86_64/initrd.img,/dd/rhel5/test.img
ksdevice=bootif kssendmac
ks=http://127.0.0.1/cblr/svc/op/ks/system/hostname.example.domain
and without:
Kernel Options : {}
default linux
prompt 0
timeout 100
label linux
kernel /images/RHEL5.5-Server-x86_64/vmlinuz
ipappend 2
append initrd=/images/RHEL5.5-Server-x86_64/initrd.img
ksdevice=bootif kssendmac
ks=http://127.0.0.1/cblr/svc/op/ks/system/hostname.example.domain
>From 7fa4bd6667e23f0c972e156980f0f7c920df4398 Mon Sep 17 00:00:00 2001
From: Bill Peck <[email protected]>
Date: Fri, 11 Feb 2011 18:13:57 -0500
Subject: [PATCH] Supports an additional initrd from kernel_options.
---
cobbler/pxegen.py | 16 ++++++++++------
1 files changed, 10 insertions(+), 6 deletions(-)
diff --git a/cobbler/pxegen.py b/cobbler/pxegen.py
index 2295a06..a4d9566 100644
--- a/cobbler/pxegen.py
+++ b/cobbler/pxegen.py
@@ -616,7 +616,7 @@ class PXEGen:
append_line = "append initrd=%s" % (metadata["initrd_path"])
else:
append_line = "append "
- append_line = "%s %s" % (append_line, kernel_options)
+ append_line = "%s%s" % (append_line, kernel_options)
if arch.startswith("ppc") or arch.startswith("s390"):
# remove the prefix "append"
# TODO: this looks like it's removing more than append, really
@@ -663,15 +663,19 @@ class PXEGen:
"""
if system is not None:
- blended = utils.blender(self.api, True, system)
+ blended = utils.blender(self.api, False, system)
elif profile is not None:
- blended = utils.blender(self.api, True, profile)
+ blended = utils.blender(self.api, False, profile)
else:
- blended = utils.blender(self.api, True, image)
+ blended = utils.blender(self.api, False, image)
- kopts = blended.get("kernel_options", "")
+ append_line = ""
+ kopts = blended.get("kernel_options", dict())
+ # support additional initrd= entries in kernel options.
+ if "initrd" in kopts:
+ append_line = ",%s" % kopts.pop("initrd")
hkopts = utils.hash_to_string(kopts)
- append_line = "%s" % hkopts
+ append_line = "%s %s" % (append_line, hkopts)
# FIXME - the append_line length limit is architecture specific
# TODO: why is this checked here, before we finish adding everything?
if len(append_line) >= 255:
--
1.7.2.3
_______________________________________________
cobbler-devel mailing list
[email protected]
https://fedorahosted.org/mailman/listinfo/cobbler-devel