Ok,
In response to my own question... I figured it out. It doesn't look like a sync is
calling "generate_bootcfg" at all... and instead this is just being handled in
pxegen.write_templates instead. I modified that method to handle scraping the
"real" boot.cfg to grab the modules. Here's a patch... though I'm a
python hack. It works, but you may want to clean it up:
--- pxegen.py 2014-02-18 22:49:55.749451747 -0600
+++ pxegen.py.new 2014-02-18 22:50:33.479452153 -0600
@@ -814,6 +814,12 @@
blended = utils.blender(self.api, False, obj)
+ if obj.os_version.startswith("esxi5"):
+ realbootcfg =
open(os.path.join(os.path.dirname(obj.kernel),'boot.cfg')).read()
+ bootmodules = re.findall(r'modules=(.*)',realbootcfg)
+ for modules in bootmodules:
+ blended['esx_modules'] = modules.replace('/','')
+
ksmeta = blended.get("ks_meta",{})
try:
del blended["ks_meta"]
Thanks,
Andy Speagle
From: Speagle , Andy
Sent: Tuesday, February 18, 2014 5:27 PM
To: 'cobbler-devel(a)lists.fedorahosted.org'
Subject: ESXi 5.x boot.cfg issues
Hi Jörgen,
I've been working on getting ESXi 5.x ISOs imported into Cobbler and this seems to
work well. However, this doesn't work well for those cases where new or updated
drivers or software has been injected into the ISO via VMware's PowerCLI mechanism for
this. The reason for this is that the bootcfg*.template files have a hard-coded list of
modules that are used to create the cobbler-boot.cfg file. This list of modules should
instead be scraped from the real boot.cfg that's part of the ISO in order to cover the
case where things have been injected into the stock ISO.
The only place this appears to be handled is by the "generate_bootcfg" method in
pxegen.py ... but, I'm having some trouble getting this functionality to work.
I added this little bit of code to "generate_bootcfg" in pxegen.py ...
realbootcfg =
open(os.path.join(os.path.dirname(distro.kernel),'boot.cfg')).read()
bootmodules = re.findall(r'modules=(.*)',realbootcfg)
for modules in bootmodules:
blended['esx_modules'] = modules.replace('/','')
And replaced the hard-coded modules in /etc/cobbler/pxe/bootcfg_esxi55.template with
$esx_modules
But... something's not quite right, it's not seeing that I set
blended['esx_modules'] ... so, perhaps the generate_bootcfg method isn't where
this work is done...
Could you offer some insight, please?
Thanks,
Andy Speagle