Hi all,
Currently with Cobbler, we use yaboot to netboot ppc machines. This
works well, but has some limitations on IBM hardware, in particular we
can (relatively) easily hit a size limit on the transferred file size,
particularly for the initrd of recent distributions [1].
One solution to this issue I came up with was to use GRUB2 to netboot
instead. I'd like to know what others things of this and see if I can
get some help solving some open problems:
1) Providing the GRUB2 binary? Currently, I rely on someone having
already run `grub2-mknetdir --net-diretory=/var/lib/tftpboot` on the
Cobbler system. This puts the appropriate netboot binary and GRUB2
modules in /var/lib/tftpboot/boot/grub2/powerpc-ieee1275. This is
obviously sub-optimal. Should I add a `cobbler check` line for this?
Also, GRUB2 is very modular, which complicates the process of copying
the bootloader into the boot location. It seems easier to just leave it
alone, but cf. 3) below.
2) How to determine when to use GRUB2 vs. yaboot? GRUB2 support was
added in FC18. Should I toggle off the os_version as I've done below?
This list is going to grow, I expect, so what is the best way to go
about tracking it? I also am curious if perhaps we can actually use
GRUB2 everywhere now that it's supported, and can just remove yaboot
support -- or make it an option of one or the other, perhaps. Note, and
perhaps this is obvious, this is only for the netbooting process and
does not determine what bootloader is installed. I've not yet gone back
and tested older distributions yet.
3) How to clean-up GRUB2 directory? Currently, yaboot's config files are
cleaned by calling rmtree_contents on /var/lib/tftpboot/etc -- this
unconditionally clears out all of the contents. GRUB2's machine-specific
configuration files, though, live in /var/lib/tftpboot/boot/grub2 and
clearing that directory out would also remove the GRUB2 modules.
I suppose we could also re-copy these on sync, but that seems like a lot
of churn potentially.
Here's what I have so far, it's pretty small & minimal pending some
input on the above...
diff --git a/cobbler/modules/manage_isc.py b/cobbler/modules/manage_isc.py
index 5409cfb..801561d 100644
--- a/cobbler/modules/manage_isc.py
+++ b/cobbler/modules/manage_isc.py
@@ -91,6 +91,7 @@ class IscManager:
dhcp_tags = { "default": {} }
elilo = "/elilo-3.6-ia64.efi"
yaboot = "/yaboot"
+ grub2 = "/boot/grub2/powerpc-ieee1275/core.elf"
for system in self.systems:
if not system.is_management_supported(cidr_ok=False):
@@ -163,7 +164,11 @@ class IscManager:
if distro.arch == "ia64":
interface["filename"] = elilo
elif distro.arch.startswith("ppc"):
- interface["filename"] = yaboot
+ if distro.os_version.startswith("fedora18") or
distro.os_version.startswith("fedora19"):
+ # Assumes grub2-mknetdir has already been run
+ interface["filename"] = grub2
+ else:
+ interface["filename"] = yaboot
dhcp_tag = interface["dhcp_tag"]
if dhcp_tag == "":
diff --git a/cobbler/pxegen.py b/cobbler/pxegen.py
index 64e8e35..c92dc08 100644
--- a/cobbler/pxegen.py
+++ b/cobbler/pxegen.py
@@ -272,7 +272,11 @@ class PXEGen:
elif working_arch.startswith("ppc"):
# Determine filename for system-specific yaboot.conf
filename = "%s" % utils.get_config_filename(system,
interface=name).lower()
- f2 = os.path.join(self.bootloc, "etc", filename)
+ if distro.os_version.startswith("fedora18") or
distro.os_version.startswith("fedora19"):
+ filename = "grub.cfg-" + filename
+ f2 = os.path.join(self.bootloc, "boot/grub2", filename)
+ else:
+ f2 = os.path.join(self.bootloc, "etc", filename)
# Link to the yaboot binary
f3 = os.path.join(self.bootloc, "ppc", filename)
@@ -553,7 +557,10 @@ class PXEGen:
elif arch == "ia64":
template =
os.path.join(self.settings.pxe_template_dir,"pxesystem_ia64.template")
elif arch.startswith("ppc"):
- template =
os.path.join(self.settings.pxe_template_dir,"pxesystem_ppc.template")
+ if distro.os_version.startswith("fedora18") or
distro.os_version.startswith("fedora19"):
+ template =
os.path.join(self.settings.pxe_template_dir,"grub2_pxe_ppc.template")
+ else:
+ template =
os.path.join(self.settings.pxe_template_dir,"pxesystem_ppc.template")
elif arch.startswith("arm"):
template =
os.path.join(self.settings.pxe_template_dir,"pxesystem_arm.template")
elif distro and distro.os_version.startswith("esxi"):
diff --git a/templates/pxe/grub2_pxe_ppc.template b/templates/pxe/grub2_pxe_ppc.template
new file mode 100644
index 0000000..bc0bb9c
--- /dev/null
+++ b/templates/pxe/grub2_pxe_ppc.template
@@ -0,0 +1,7 @@
+set timeout 0
+menuentry 'install' {
+ echo "Loading install kernel..."
+ linux $kernel_path $append_line
+ echo "Loading initrd..."
+ initrd $initrd_path
+}
[1] On POWER machines, what actually happens is not only the yaboot
binary gets tftp'd via the system firmware (aka SMS), but the kernel and
initrd are as well. GRUB2 in contrast does the tftp'ing itself.