Hi,
In an attempt to boot a virtual QEMU-KVM system from the local hard
drive using a PXE menu entry, I've come up with the following;
Add chain.c32 to the cobbler distribution.
chain.c32 is particularly useful when you are using qemu(-kvm)
where the BIOS isn't capable of switching boot devices. In these
cases, using "localboot 0" will just restart the PXE boot. With
chain.c32 though, you can use the following snippet in
/etc/cobbler/pxe/pxelocal.template to boot from the local hard-
drive:
label local
menu label Boot from local harddrive
kernel chain.c32
append hd0 0
where "hd0" is the hard drive number (use fd0 for floppy, etc.),
and 0 is the partition number.
Attached is a patch that adds chain.c32 to cobbler (just like menu.c32),
but if applied, you will need to copy /usr/lib/syslinux/chain.c32 to
loaders/chain.c32 manually (as binary foo does not show in git patches).
Kind regards,
Jeroen van Meeuwen
-kanarip
commit 9c7c90788b8b11db0ac8b6d54022ec2cfc1a971f
Author: Jeroen van Meeuwen (Fedora Unity) <[EMAIL PROTECTED]>
Date: Mon Dec 8 12:30:21 2008 +0100
Add chain.c32 to the cobbler distribution.
chain.c32 is particularly useful when you are using qemu(-kvm)
where the BIOS isn't capable of switching boot devices. In these
cases, using "localboot 0" will just restart the PXE boot. With
chain.c32 though, you can use the following snippet in
/etc/cobbler/pxe/pxelocal.template to boot from the local hard-
drive:
label local
menu label Boot from local harddrive
kernel chain.c32
append hd0 0
where "hd0" is the hard drive number (use fd0 for floppy, etc.),
and 0 is the partition number.
diff --git a/cobbler.spec b/cobbler.spec
index e7ab7ae..fabab34 100644
--- a/cobbler.spec
+++ b/cobbler.spec
@@ -257,6 +257,7 @@ test "x$RPM_BUILD_ROOT" != "x" && rm -rf $RPM_BUILD_ROOT
%config(noreplace) /var/lib/cobbler/snippets/func_register_if_enabled
%config(noreplace) /var/lib/cobbler/snippets/download_config_files
%config(noreplace) /var/lib/cobbler/snippets/koan_environment
+/var/lib/cobbler/chain.c32
/var/lib/cobbler/elilo-3.8-ia64.efi
/var/lib/cobbler/menu.c32
/var/lib/cobbler/yaboot-1.3.14
diff --git a/cobbler/pxegen.py b/cobbler/pxegen.py
index f4f2152..ef327ee 100644
--- a/cobbler/pxegen.py
+++ b/cobbler/pxegen.py
@@ -81,6 +81,9 @@ class PXEGen:
# copy memtest only if we find it
utils.copyfile_pattern('/boot/memtest*', dst, require_match=False)
+ # copy chain.c32 (particularly useful in virt. environments)
+ utils.copyfile_pattern('/var/lib/cobbler/chain.c32', dst)
+
# copy elilo which we include for IA64 targets
utils.copyfile_pattern('/var/lib/cobbler/elilo-3.8-ia64.efi', dst)
diff --git a/loaders/chain.c32 b/loaders/chain.c32
new file mode 100644
index 0000000..a786280
Binary files /dev/null and b/loaders/chain.c32 differ
diff --git a/setup.py b/setup.py
index c1bc561..951e094 100644
--- a/setup.py
+++ b/setup.py
@@ -194,6 +194,7 @@ if __name__ == "__main__":
(libpath, ['config/version']),
# bootloaders and syslinux support files
+ (libpath, ['loaders/chain.c32']),
(libpath, ['loaders/elilo-3.8-ia64.efi']),
(libpath, ['loaders/menu.c32']),
(libpath, ['loaders/yaboot-1.3.14']),
diff --git a/templates/pxelocal.template b/templates/pxelocal.template
index bc42214..763b607 100644
--- a/templates/pxelocal.template
+++ b/templates/pxelocal.template
@@ -4,6 +4,19 @@ TIMEOUT 0
TOTALTIMEOUT 0
ONTIMEOUT local
+# When using qemu(-kvm), the emulated BIOS may not be capable of
+# switching to another boot device using "localboot 0".
+#
+# If you're using qemu(-kvm), and find this to be a problem, use
+# the following snippet:
+#
+# label local
+# kernel chain.c32
+# append hd0 0
+#
+# where "hd0 0" is the hard drive number and partition.
+#
+
LABEL local
LOCALBOOT 0
_______________________________________________
cobbler mailing list
[email protected]
https://fedorahosted.org/mailman/listinfo/cobbler