diff --git a/share/efi.tmpl b/share/efi.tmpl index add28ee3..1350ebc8 100644 --- a/share/efi.tmpl +++ b/share/efi.tmpl @@ -11,7 +11,9 @@ install boot/grub/splash.xpm.gz ${EFIBOOTDIR} ## actually make the EFI images ${make_efiboot("images/efiboot.img")} -${make_efiboot("images/macboot.img", imgtype="apple")} +%if domacboot: + ${make_efiboot("images/macboot.img", imgtype="apple")} +%endif ## This is kinda gross, but then... so's EFI. <%def name="make_efiboot(img, include_kernel=False, disk=False, imgtype='default')"> diff --git a/share/x86.tmpl b/share/x86.tmpl index ceeac8fe..db19bdf0 100644 --- a/share/x86.tmpl +++ b/share/x86.tmpl @@ -53,7 +53,10 @@ hardlink ${KERNELDIR}/initrd.img ${BOOTDIR} <% efiarch = 'X64' if basearch=='x86_64' else 'IA32' efigraft="EFI/BOOT={0}/EFI/BOOT".format(outroot) - for img in ("images/efiboot.img", "images/macboot.img"): + images = ["images/efiboot.img"] + if domacboot: + images.append("images/macboot.img") + for img in images: efiargs += " -eltorito-alt-boot -e {0} -no-emul-boot".format(img) efigraft += " {0}={1}/{0}".format(img,outroot) efihybrid="--uefi --mac" diff --git a/src/pylorax/__init__.py b/src/pylorax/__init__.py index 2133d604..64924cec 100644 --- a/src/pylorax/__init__.py +++ b/src/pylorax/__init__.py @@ -130,7 +130,7 @@ class Lorax(BaseLoraxClass): def run(self, ybo, product, version, release, variant="", bugurl="", isfinal=False, workdir=None, outputdir=None, buildarch=None, volid=None, - remove_temp=False): + domacboot=True, remove_temp=False): assert self._configured @@ -246,7 +246,7 @@ class Lorax(BaseLoraxClass): treebuilder = TreeBuilder(product=self.product, arch=self.arch, inroot=installroot, outroot=self.outputdir, runtime=runtime, isolabel=isolabel, - templatedir=templatedir) + domacboot=domacboot, templatedir=templatedir) logger.info("rebuilding initramfs images") dracut_args=["--xz", "--add", "anaconda", "--omit", "plymouth", diff --git a/src/pylorax/treebuilder.py b/src/pylorax/treebuilder.py index 50fb1f94..8641768b 100644 --- a/src/pylorax/treebuilder.py +++ b/src/pylorax/treebuilder.py @@ -151,14 +151,14 @@ class RuntimeBuilder(object): class TreeBuilder(object): '''Builds the arch-specific boot images. inroot should be the installtree root (the newly-built runtime dir)''' - def __init__(self, product, arch, inroot, outroot, runtime, isolabel, templatedir=None): + def __init__(self, product, arch, inroot, outroot, runtime, isolabel, domacboot=True, templatedir=None): # NOTE: if you pass an arg named "runtime" to a mako template it'll # clobber some mako internal variables - hence "runtime_img". self.vars = DataHolder(arch=arch, product=product, runtime_img=runtime, runtime_base=basename(runtime), inroot=inroot, outroot=outroot, basearch=arch.basearch, libdir=arch.libdir, - isolabel=isolabel, udev=udev_escape) + isolabel=isolabel, udev=udev_escape, domacboot=domacboot) self._runner = LoraxTemplateRunner(inroot, outroot, templatedir=templatedir) self._runner.defaults = self.vars self.templatedir = templatedir diff --git a/src/sbin/lorax b/src/sbin/lorax index 31b8df15..998f25ff 100755 --- a/src/sbin/lorax +++ b/src/sbin/lorax @@ -74,6 +74,8 @@ def main(args): help="build architecture", metavar="STRING") optional.add_option("--volid", default=None, help="volume id", metavar="STRING") + optional.add_option("--nomacboot", help="", + action="store_false", default=True, dest="domacboot") # add the option groups to the parser parser.add_option_group(required) @@ -126,7 +128,7 @@ def main(args): lorax.run(yb, opts.product, opts.version, opts.release, opts.variant, opts.bugurl, opts.isfinal, workdir=tempdir, outputdir=outputdir, buildarch=opts.buildarch, - volid=opts.volid, remove_temp=True) + volid=opts.volid, domacboot=opts.domacboot, remove_temp=True) def get_yum_base_object(installroot, repositories, mirrorlists=[],