Source: grub2
Version: 2.02~beta2-22+deb8u1
Severity: wishlist

Dear maintainers,

I suggest that you add the creation of a package named
grub-rescue-efi-amd64, equivalent to grub-rescue-pc.

I have attached a patch which does this. It applies to the current version
in jessie security. The resulting package grub-rescue-efi-amd64, in
contrast to grub-rescue-pc, contains neither a floppy image nor a link
from grub-rescue-usb.img to grub-rescue-cdrom.iso, because a floppy has
not enough capacity (efi.img is 2.9 MB) and booting from USB did not work.

Regards
  Christoph
diff -Naur grub2-2.02~beta2/debian/control grub2-2.02~beta2-efi/debian/control
--- grub2-2.02~beta2/debian/control	2015-12-14 14:13:16.000000000 +0100
+++ grub2-2.02~beta2-efi/debian/control	2016-03-11 11:30:11.000000000 +0100
@@ -337,6 +337,17 @@
  EFI-AMD64 architecture, such as the one provided by Intel Macs (that is, unless
  a BIOS interface has been activated).
 
+Package: grub-rescue-efi-amd64
+Architecture: i386 kopensolaris-i386 amd64 kfreebsd-amd64
+Depends: ${misc:Depends}
+Multi-Arch: foreign
+Description: GRUB bootable rescue image, version 2 (EFI-AMD64 version)
+ This package contains a GRUB rescue image that has been built for use
+ with the EFI-AMD64 architecture, such as the one provided by Intel Macs
+ (that is, unless a BIOS interface has been activated).
+ .
+  - grub-rescue-cdrom.iso: El Torito CDROM image.
+
 Package: grub-efi-ia64-bin
 Architecture: any-ia64
 Depends: ${shlibs:Depends}, ${misc:Depends}, grub-common (= ${binary:Version})
diff -Naur grub2-2.02~beta2/debian/grub-rescue-efi-amd64.install grub2-2.02~beta2-efi/debian/grub-rescue-efi-amd64.install
--- grub2-2.02~beta2/debian/grub-rescue-efi-amd64.install	1970-01-01 01:00:00.000000000 +0100
+++ grub2-2.02~beta2-efi/debian/grub-rescue-efi-amd64.install	2016-03-09 10:24:19.000000000 +0100
@@ -0,0 +1 @@
+obj/grub-rescue-efi-amd64/grub-rescue-cdrom.iso	usr/lib/grub-rescue-efi-amd64
diff -Naur grub2-2.02~beta2/debian/grub-rescue-efi-amd64.README.Debian grub2-2.02~beta2-efi/debian/grub-rescue-efi-amd64.README.Debian
--- grub2-2.02~beta2/debian/grub-rescue-efi-amd64.README.Debian	1970-01-01 01:00:00.000000000 +0100
+++ grub2-2.02~beta2-efi/debian/grub-rescue-efi-amd64.README.Debian	2016-03-11 11:23:37.000000000 +0100
@@ -0,0 +1,11 @@
+grub-rescue-efi-amd64
+~~~~~~~~~~~~~~~~~~~~~
+
+How to test the image with qemu (package ovmf must be installed):
+
+  qemu -cdrom /usr/lib/grub-rescue-efi-amd64/grub-rescue-cdrom.iso
+
+How to write the image to bootable media:
+
+  sudo wodim /usr/lib/grub-rescue-efi-amd64/grub-rescue-cdrom.iso
+  # or just use your favourite CD burning program
diff -Naur grub2-2.02~beta2/debian/grub-rescue-pc.install grub2-2.02~beta2-efi/debian/grub-rescue-pc.install
--- grub2-2.02~beta2/debian/grub-rescue-pc.install	2015-12-14 14:13:16.000000000 +0100
+++ grub2-2.02~beta2-efi/debian/grub-rescue-pc.install	2016-03-08 16:29:01.000000000 +0100
@@ -1,2 +1,2 @@
-obj/grub-rescue-pc/grub-rescue-cdrom.iso	usr/lib/grub-rescue
-obj/grub-rescue-pc/grub-rescue-floppy.img	usr/lib/grub-rescue
+obj/grub-rescue-pc/grub-rescue-cdrom.iso	usr/lib/grub-rescue-pc
+obj/grub-rescue-pc/grub-rescue-floppy.img	usr/lib/grub-rescue-pc
diff -Naur grub2-2.02~beta2/debian/grub-rescue-pc.links grub2-2.02~beta2-efi/debian/grub-rescue-pc.links
--- grub2-2.02~beta2/debian/grub-rescue-pc.links	2015-12-12 19:05:07.000000000 +0100
+++ grub2-2.02~beta2-efi/debian/grub-rescue-pc.links	2016-03-08 16:30:42.000000000 +0100
@@ -1,3 +1,3 @@
 # Truth would be uselessly confusing for users.  Let's give 'em what they
 # wanted instead.
-usr/lib/grub-rescue/grub-rescue-cdrom.iso	usr/lib/grub-rescue/grub-rescue-usb.img
+usr/lib/grub-rescue-pc/grub-rescue-cdrom.iso	usr/lib/grub-rescue-pc/grub-rescue-usb.img
diff -Naur grub2-2.02~beta2/debian/grub-rescue-pc.README.Debian grub2-2.02~beta2-efi/debian/grub-rescue-pc.README.Debian
--- grub2-2.02~beta2/debian/grub-rescue-pc.README.Debian	2015-12-12 19:05:07.000000000 +0100
+++ grub2-2.02~beta2-efi/debian/grub-rescue-pc.README.Debian	2016-03-09 10:17:20.000000000 +0100
@@ -3,20 +3,20 @@
 
 How to test the images with qemu:
 
-  qemu -fda /usr/lib/grub-rescue/grub-rescue-floppy.img
+  qemu -fda /usr/lib/grub-rescue-pc/grub-rescue-floppy.img
 
-  qemu -cdrom /usr/lib/grub-rescue/grub-rescue-cdrom.iso
+  qemu -cdrom /usr/lib/grub-rescue-pc/grub-rescue-cdrom.iso
 
-  qemu -hda /usr/lib/grub-rescue/grub-rescue-usb.img
+  qemu -hda /usr/lib/grub-rescue-pc/grub-rescue-usb.img
 
 How to write the images to bootable media:
 
-  sudo dd if=/usr/lib/grub-rescue/grub-rescue-floppy.img of=/dev/fd0 bs=32k
+  sudo dd if=/usr/lib/grub-rescue-pc/grub-rescue-floppy.img of=/dev/fd0 bs=32k
 
-  sudo wodim /usr/lib/grub-rescue/grub-rescue-cdrom.iso
+  sudo wodim /usr/lib/grub-rescue-pc/grub-rescue-cdrom.iso
   # or just use your favourite CD burning program
 
-  sudo dd if=/usr/lib/grub-rescue/grub-rescue-usb.img of=DEVICE bs=32k
+  sudo dd if=/usr/lib/grub-rescue-pc/grub-rescue-usb.img of=DEVICE bs=32k
   # where DEVICE is something like /dev/sdb, corresponding to your USB
   # stick's device name; be VERY CAREFUL that this is the correct device as
   # otherwise you could destroy data on your hard disk!
diff -Naur grub2-2.02~beta2/debian/rules grub2-2.02~beta2-efi/debian/rules
--- grub2-2.02~beta2/debian/rules	2015-12-14 14:13:16.000000000 +0100
+++ grub2-2.02~beta2-efi/debian/rules	2016-03-08 16:39:41.000000000 +0100
@@ -40,7 +40,7 @@
 # and build stages). EXTRA_PACKAGES do not build grub but may depend on a
 # REAL_PACKAGE (and therefore only have a build stage)
 REAL_PACKAGES = grub-common grub-emu grub-pc grub-coreboot grub-efi-ia32 grub-efi-amd64 grub-efi-ia64 grub-efi-arm grub-efi-arm64 grub-ieee1275 grub-firmware-qemu grub-uboot grub-xen grub-yeeloong
-EXTRA_PACKAGES = grub-rescue-pc grub-xen-host
+EXTRA_PACKAGES = grub-rescue-efi-amd64 grub-rescue-pc grub-xen-host
 
 ifneq (,$(filter i386 amd64,$(DEB_HOST_ARCH_CPU)))
 COMMON_PLATFORM := pc
@@ -239,6 +239,20 @@
 		-o $(CURDIR)/obj/$(package)/grub.bin
 	touch $@
 
+debian/stamps/build-grub-rescue-efi-amd64: debian/stamps/build-grub-efi-amd64
+	mkdir -p obj/grub-rescue-efi-amd64/rescue-disk/boot/grub
+	cp docs/grub.cfg obj/grub-rescue-efi-amd64/rescue-disk/boot/grub/
+	rm -rf obj/grub-rescue-efi-amd64/grub-core
+	cp -a obj/grub-efi-amd64/grub-core obj/grub-rescue-efi-amd64/grub-core
+	cp -a obj/grub-efi-amd64/unicode.pf2 obj/grub-rescue-efi-amd64/
+	pkgdatadir=$(CURDIR)/obj/grub-rescue-efi-amd64 \
+		obj/grub-efi-amd64/grub-mkrescue \
+		--directory=$(CURDIR)/obj/grub-rescue-efi-amd64/grub-core \
+		--locale-directory=$(CURDIR)/obj/grub-rescue-efi-amd64/grub-core/po \
+		--output=$(CURDIR)/obj/grub-rescue-efi-amd64/grub-rescue-cdrom.iso \
+		$(CURDIR)/obj/grub-rescue-efi-amd64/rescue-disk
+	touch $@
+
 debian/stamps/build-grub-rescue-pc: debian/stamps/build-grub-pc
 	mkdir -p obj/grub-rescue-pc/rescue-disk/boot/grub
 	cp docs/grub.cfg obj/grub-rescue-pc/rescue-disk/boot/grub/
@@ -401,7 +415,7 @@
 endif
 
 override_dh_install:
-	dh_install -pgrub2 -pgrub-linuxbios -pgrub-efi -pgrub-rescue-pc -pgrub-firmware-qemu -pgrub-xen-host
+	dh_install -pgrub2 -pgrub-linuxbios -pgrub-efi -pgrub-rescue-efi-amd64 -pgrub-rescue-pc -pgrub-firmware-qemu -pgrub-xen-host
 	dh_install -pgrub-common -pgrub2-common -pgrub-theme-starfield -pgrub-mount-udeb --sourcedir=debian/tmp-grub-$(COMMON_PLATFORM)
 	rm -f debian/grub2-common/usr/share/info/dir*
 	rm -f debian/grub-theme-starfield/usr/share/grub/themes/starfield/COPYING.CC-BY-SA-3.0
@@ -430,8 +444,8 @@
 endif
 
 override_dh_installdocs:
-	dh_installdocs -pgrub-common -pgrub-rescue-pc -pgrub-firmware-qemu -pgrub-xen-host -A AUTHORS NEWS README THANKS TODO
-	dh_installdocs -Ngrub-common -Ngrub-rescue-pc -Ngrub-firmware-qemu -Ngrub-xen-host --link-doc=grub-common
+	dh_installdocs -pgrub-common -pgrub-rescue-efi-amd64 -pgrub-rescue-pc -pgrub-firmware-qemu -pgrub-xen-host -A AUTHORS NEWS README THANKS TODO
+	dh_installdocs -Ngrub-common -Ngrub-rescue-efi-amd64 -Ngrub-rescue-pc -Ngrub-firmware-qemu -Ngrub-xen-host --link-doc=grub-common
 
 ifeq ($(FLICKER_FREE_BOOT),yes)
 override_dh_installinit:

Reply via email to