diff -rupN cobbler-2.0.7-orig/cobbler/action_buildiso.py cobbler-2.0.7/cobbler/action_buildiso.py
--- cobbler-2.0.7-orig/cobbler/action_buildiso.py 2015-09-07 08:32:49.197852179 -0400
+++ cobbler-2.0.7/cobbler/action_buildiso.py 2015-09-07 08:33:42.301458113 -0400
@@ -45,6 +45,9 @@ TIMEOUT 200
TOTALTIMEOUT 6000
ONTIMEOUT local
+"""
+
+LOCAL_HDD_HEADER = HEADER + """
LABEL local
MENU LABEL (local)
MENU DEFAULT
@@ -86,7 +89,7 @@ class BuildIso:
return str(self.distctr)
- def generate_netboot_iso(self,imagesdir,isolinuxdir,profiles=None,systems=None,exclude_dns=None,force_server=None):
+ def generate_netboot_iso(self,imagesdir,isolinuxdir,profiles=None,systems=None,exclude_dns=None,force_server=None,no_local_hdd=None):
self.logger.info("copying kernels and initrds for profiles")
# copy all images in included profiles to images dir
for profile in self.api.profiles():
@@ -131,7 +134,11 @@ class BuildIso:
self.logger.info("generating a isolinux.cfg")
isolinuxcfg = os.path.join(isolinuxdir, "isolinux.cfg")
cfg = open(isolinuxcfg, "w+")
- cfg.write(HEADER) # fixme, use template
+ header_written = True
+ if not no_local_hdd:
+ cfg.write(LOCAL_HDD_HEADER) # fixme, use template
+ else:
+ header_written = False
self.logger.info("generating profile list")
#sort the profiles
@@ -156,6 +163,10 @@ class BuildIso:
data["server"] = force_server
distname = self.make_shorter(dist.name)
+ if not header_written:
+ cfg.write(HEADER.replace('local', profile.name))
+ header_written = True
+
cfg.write("\n")
cfg.write("LABEL %s\n" % profile.name)
cfg.write(" MENU LABEL %s\n" % profile.name)
@@ -197,7 +197,8 @@ class BuildIso:
if systems is not None:
self.logger.info("generating system list")
- cfg.write("\nMENU SEPARATOR\n")
+ if header_written:
+ cfg.write("\nMENU SEPARATOR\n")
#sort the systems
system_list = [system for system in self.systems]
@@ -222,6 +223,10 @@ class BuildIso:
data["server"] = force_server
distname = self.make_shorter(dist.name)
+ if not header_written:
+ cfg.write(HEADER.replace('local', system.name))
+ header_written = True
+
cfg.write("\n")
cfg.write("LABEL %s\n" % system.name)
cfg.write(" MENU LABEL %s\n" % system.name)
@@ -295,6 +300,9 @@ class BuildIso:
cfg.write(append_line)
+ if not header_written:
+ cfg.write(HEADER)
+
self.logger.info("done writing config")
cfg.write("\n")
cfg.write("MENU END\n")
@@ -375,7 +386,7 @@ class BuildIso:
return
- def run(self,iso=None,tempdir=None,profiles=None,systems=None,distro=None,standalone=None,source=None,exclude_dns=None,force_server=None):
+ def run(self,iso=None,tempdir=None,profiles=None,systems=None,distro=None,standalone=None,source=None,exclude_dns=None,force_server=None,no_local_hdd=None):
# the distro option is for stand-alone builds only
if not standalone and distro is not None:
@@ -446,7 +457,7 @@ class BuildIso:
if standalone:
self.generate_standalone_iso(imagesdir,isolinuxdir,distro,source)
else:
- self.generate_netboot_iso(imagesdir,isolinuxdir,profiles,systems,exclude_dns,force_server)
+ self.generate_netboot_iso(imagesdir,isolinuxdir,profiles,systems,exclude_dns,force_server,no_local_hdd)
# removed --quiet
cmd = "mkisofs -o %s -r -b isolinux/isolinux.bin -c isolinux/boot.cat" % iso
diff -rupN cobbler-2.0.7-orig/cobbler/api.py cobbler-2.0.7/cobbler/api.py
--- cobbler-2.0.7-orig/cobbler/api.py 2015-09-07 08:32:49.197852179 -0400
+++ cobbler-2.0.7/cobbler/api.py 2015-09-07 08:34:50.453735488 -0400
@@ -748,10 +748,10 @@ class BootAPI:
# ==========================================================================
- def build_iso(self,iso=None,profiles=None,systems=None,tempdir=None,distro=None,standalone=None,source=None, exclude_dns=None, logger=None, force_server=None):
+ def build_iso(self,iso=None,profiles=None,systems=None,tempdir=None,distro=None,standalone=None,source=None, exclude_dns=None, logger=None, force_server=None, no_local_hdd=None):
builder = action_buildiso.BuildIso(self._config, logger=logger)
return builder.run(
- iso=iso, profiles=profiles, systems=systems, tempdir=tempdir, distro=distro, standalone=standalone, source=source, exclude_dns=exclude_dns, force_server=force_server
+ iso=iso, profiles=profiles, systems=systems, tempdir=tempdir, distro=distro, standalone=standalone, source=source, exclude_dns=exclude_dns, force_server=force_server,no_local_hdd=no_local_hdd
)
# ==========================================================================
diff -rupN cobbler-2.0.7-orig/cobbler/cli.py cobbler-2.0.7/cobbler/cli.py
--- cobbler-2.0.7-orig/cobbler/cli.py 2015-09-07 08:32:49.198852228 -0400
+++ cobbler-2.0.7/cobbler/cli.py 2015-09-07 08:35:19.491150220 -0400
@@ -323,6 +323,7 @@ class BootCLI:
self.parser.add_option("--source", dest="source", help="(OPTIONAL) used with --standalone to specify a source for the distribution files")
self.parser.add_option("--exclude-dns", dest="exclude_dns", action="store_true", help="(OPTIONAL) prevents addition of name server addresses to the kernel boot options")
self.parser.add_option("--force-server", dest="force_server", help="(OPTIONAL) when kickstarting get required files from the given server instead of the default (may be given as IP Address or FQDN of the server). Useful when kickstarting through a proxy.")
+ self.parser.add_option("--no-local-hdd", dest="no_local_hdd", action="store_true", help="(OPTIONAL) removes option to boot from local hdd, keeps only kickstart profiles in boot menu")
(options, args) = self.parser.parse_args()
task_id = self.start_task("buildiso",options)
diff -rupN cobbler-2.0.7-orig/cobbler/remote.py cobbler-2.0.7/cobbler/remote.py
--- cobbler-2.0.7-orig/cobbler/remote.py 2015-09-07 08:32:49.198852228 -0400
+++ cobbler-2.0.7/cobbler/remote.py 2015-09-07 08:35:49.765636882 -0400
@@ -153,7 +153,8 @@ class CobblerXMLRPCInterface:
self.options.get("source",None),
self.options.get("exclude_dns",False),
self.logger,
- self.options.get("force_server",None)
+ self.options.get("force_server",None),
+ self.options.get("no_local_hdd",False)
)
def on_done(self):
if self.options.get("iso","") == "/var/www/cobbler/pub/generated.iso":