Package: ipxe
Version: 1.0.0+git-2.149b50-1
Followup-For: Bug #626238
User: [email protected]
Usertags: origin-ubuntu precise ubuntu-patch
In Ubuntu, the attached patch was applied to achieve the following:
* Provide a new binary package, grub-ipxe - for ipxe usage via grub.
- LP: #814038, Closes #626238
Thanks for considering the patch.
-- System Information:
Debian Release: wheezy/sid
APT prefers oneiric-updates
APT policy: (500, 'oneiric-updates'), (500, 'oneiric-security'), (500,
'oneiric')
Architecture: amd64 (x86_64)
Kernel: Linux 3.0.0-12-generic (SMP w/2 CPU cores)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
=== modified file 'debian/control'
--- debian/control 2011-08-18 13:34:38 +0000
+++ debian/control 2011-10-17 09:02:25 +0000
@@ -25,3 +25,16 @@
This package provides boot code for all supported network cards in one
binary, in several bootable formats, and also many boot ROMs to be
embedded in various network cards.
+
+Package: grub-ipxe
+Architecture: all
+Suggests: grub-pc (>= 1.96)
+Depends: ${misc:Depends}, ipxe
+Description: Network booting from GRUB using iPXE
+ iPXE is network boot firmware. It supports a variety of network cards,
+ including some wireless cards, and variety of network protocols (traditional
+ DHCP, BOOTP and TFTP and also HTTP, iSCSI, SAN via FCoE and Infiniband). It
+ supports scripting.
+ .
+ This package adds a menu entry to grub2 for network booting using iPXE.
+
=== added file 'debian/grub-ipxe.install'
--- debian/grub-ipxe.install 1970-01-01 00:00:00 +0000
+++ debian/grub-ipxe.install 2011-10-17 09:02:25 +0000
@@ -0,0 +1,2 @@
+debian/grub.d/25_ipxe etc/grub.d
+src/bin/ipxe.lkrn /boot
=== added file 'debian/grub-ipxe.postinst'
--- debian/grub-ipxe.postinst 1970-01-01 00:00:00 +0000
+++ debian/grub-ipxe.postinst 2011-10-17 09:02:25 +0000
@@ -0,0 +1,10 @@
+#!/bin/sh
+# Calls update-grub for the new ipxe entry to show up in the grub menu.
+set -e
+
+if [ -e /boot/grub/grub.cfg ] && which update-grub >/dev/null 2>&1
+then
+ update-grub || true
+fi
+
+#DEBHELPER#
=== added file 'debian/grub-ipxe.postrm'
--- debian/grub-ipxe.postrm 1970-01-01 00:00:00 +0000
+++ debian/grub-ipxe.postrm 2011-10-17 09:02:25 +0000
@@ -0,0 +1,14 @@
+#!/bin/sh
+# Calls update-grub for the new ipxe entry to show up in the grub menu.
+set -e
+
+if [ "${1}" = "remove" ]
+then
+
+ if [ -e /boot/grub/grub.cfg ] && which update-grub >/dev/null 2>&1
+ then
+ update-grub || true
+ fi
+fi
+
+#DEBHELPER#
=== added directory 'debian/grub.d'
=== added file 'debian/grub.d/25_ipxe'
--- debian/grub.d/25_ipxe 1970-01-01 00:00:00 +0000
+++ debian/grub.d/25_ipxe 2011-10-17 09:02:25 +0000
@@ -0,0 +1,42 @@
+#!/bin/sh
+set -e
+
+if [ -f /usr/lib/grub/grub-mkconfig_lib ]; then
+ . /usr/lib/grub/grub-mkconfig_lib
+ LX=linux16
+elif [ -f /usr/lib/grub/update-grub_lib ]; then
+ . /usr/lib/grub/update-grub_lib
+ LX=linux
+else
+ # no grub file, so we notify and exit gracefully
+ echo "Cannot find grub config file, exiting." >&2
+ exit 0
+fi
+
+# We can't cope with loop-mounted devices here.
+case ${GRUB_DEVICE_BOOT} in
+ /dev/loop/*|/dev/loop[0-9]) exit 0 ;;
+esac
+
+# iPXE is only supported on x86
+case $(dpkg --print-architecture) in
+ *i386|*amd64) ;;
+ *) exit 0 ;;
+esac
+
+prepare_boot_cache="$(prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} | sed
-e "s/^/\t/")"
+
+IPXE=/boot/ipxe.lkrn
+
+if test -e "$IPXE" ; then
+ IPXEPATH=$( make_system_path_relative_to_its_root "$IPXE" )
+ echo "Found iPXE image : $IPXEPATH" >&2
+ cat << EOF
+menuentry "Network boot (iPXE)" {
+EOF
+ printf '%s\n' "${prepare_boot_cache}"
+ cat << EOF
+ $LX $IPXEPATH
+}
+EOF
+fi
=== modified file 'debian/rules'
--- debian/rules 2011-04-11 19:35:36 +0000
+++ debian/rules 2011-10-17 09:02:25 +0000
@@ -8,7 +8,7 @@
dh $@
override_dh_auto_build:
- make -C src V=1 NO_WERROR=1 all allbaseroms bin/ipxe.pxe
+ make -C src V=1 NO_WERROR=1 all allbaseroms bin/ipxe.pxe bin/ipxe.lkrn
override_dh_auto_clean:
make -C src veryclean