diff --git a/debian/changelog b/debian/changelog index 92e87688c..2f042af9c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -27,6 +27,9 @@ grub2 (1.98+20100602-1) UNRELEASED; urgency=low installation media etc., without having to build-depend on grub-pc which isn't coinstallable with other platform variants and does invasive things in its postinst. + * Add grub-mkrescue patch from Thomas Schmitt to allow reducing the size + of xorriso-created images. Use this to ensure that + grub-rescue-floppy.img fits well within size limits (closes: #548320). -- Colin Watson Tue, 01 Jun 2010 15:54:54 +0100 diff --git a/debian/grub-rescue-pc.links b/debian/grub-rescue-pc.links index ece64706c..de8d12372 100644 --- a/debian/grub-rescue-pc.links +++ b/debian/grub-rescue-pc.links @@ -1,4 +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/grub-rescue-cdrom.iso usr/lib/grub-rescue/grub-rescue-floppy.img diff --git a/debian/patches/909_mkrescue_diet.diff b/debian/patches/909_mkrescue_diet.diff new file mode 100644 index 000000000..e645ec2a7 --- /dev/null +++ b/debian/patches/909_mkrescue_diet.diff @@ -0,0 +1,58 @@ +Description: Allow reducing size of xorriso-created rescue images + This lets us create smaller images that will fit on floppy disks. It has + been approved by the upstream maintainer but has not yet been applied. +Author: Thomas Schmitt +Origin: other, http://lists.gnu.org/archive/html/grub-devel/2010-05/msg00100.html +Forwarded: yes +Last-Update: 2010-06-02 + +Index: b/util/grub-mkrescue.in +=================================================================== +--- a/util/grub-mkrescue.in ++++ b/util/grub-mkrescue.in +@@ -40,6 +40,9 @@ + override_dir= + grub_mkimage=${bindir}/`echo grub-mkimage | sed ${transform}` + ++xorriso=xorriso ++diet=no ++ + # Usage: usage + # Print the usage. + usage () { +@@ -53,6 +56,8 @@ + --modules=MODULES pre-load specified modules MODULES + --rom-directory=DIR save rom images in DIR [optional] + --grub-mkimage=FILE use FILE as grub-mkimage ++ --xorriso=PROGFILE use PROGFILE as xorriso program [optional] ++ --diet apply size reducing measures [optional] + + $0 generates a bootable rescue image with specified source files or directories. + +@@ -83,6 +88,10 @@ + ;; + --grub-mkimage=*) + grub_mkimage=`echo "$option" | sed 's/--grub-mkimage=//'` ;; ++ --xorriso=*) ++ xorriso=`echo "${option}/" | sed 's/--xorriso=//'` ;; ++ --diet) ++ diet=yes ;; + -*) + echo "Unrecognized option \`$option'" 1>&2 + usage +@@ -267,7 +276,14 @@ + fi + + # build iso image +-xorriso -pathspecs on -as mkisofs ${grub_mkisofs_arguments} --protective-msdos-label -o ${output_image} -r ${iso9660_dir} ${source} ++if [ "${diet}" = yes ]; then ++ if [ -e "${output_image}" ]; then ++ rm "${output_image}" || exit 1 ++ fi ++ "${xorriso}" -report_about HINT -as mkisofs -graft-points -no-pad ${grub_mkisofs_arguments} --protective-msdos-label -r ${iso9660_dir} ${source} | cat >"${output_image}" ++else ++ "${xorriso}" -report_about HINT -as mkisofs -graft-points ${grub_mkisofs_arguments} --protective-msdos-label -o "${output_image}" -r ${iso9660_dir} ${source} ++fi + rm -rf ${iso9660_dir} + + rm -f ${embed_img} diff --git a/debian/patches/series b/debian/patches/series index 67964be3a..b67616d4e 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -7,3 +7,4 @@ 904_disable_floppies.diff 907_grub.cfg_400.diff 908_gfxpayload_keep_default.diff +909_mkrescue_diet.diff diff --git a/debian/rules b/debian/rules index aa1336c34..36cf8769a 100755 --- a/debian/rules +++ b/debian/rules @@ -114,12 +114,17 @@ build/stamps/build-grub-rescue-pc: build/stamps/build-grub-pc mkdir -p build/grub-rescue-pc/lib/grub rm -rf build/grub-rescue-pc/lib/grub/i386-pc cp -a build/grub-pc build/grub-rescue-pc/lib/grub/i386-pc - # save space, especially for floppy image - rm -rf build/grub-rescue-pc/lib/grub/i386-pc/po $(CURDIR)/build/grub-rescue-pc/grub-mkrescue \ --grub-mkimage=$(CURDIR)/build/grub-pc/grub-mkimage \ --output=$(CURDIR)/build/grub-rescue-pc/grub-rescue-cdrom.iso \ $(CURDIR)/build/grub-rescue-pc/rescue-disk + # save space for floppy image + rm -rf build/grub-rescue-pc/lib/grub/i386-pc/po + $(CURDIR)/build/grub-rescue-pc/grub-mkrescue \ + --grub-mkimage=$(CURDIR)/build/grub-pc/grub-mkimage \ + --output=$(CURDIR)/build/grub-rescue-pc/grub-rescue-floppy.img \ + --diet \ + $(CURDIR)/build/grub-rescue-pc/rescue-disk touch $@ install/grub-pc install/grub-efi-ia32 install/grub-efi-amd64 install/grub-ieee1275 install/grub-coreboot install/grub-emu install/grub-yeeloong::