summaryrefslogtreecommitdiffstats
path: root/master/debian/mkrescue_diet.patch
blob: 57246b2e71a822fa80571ca5ccc3b7539b28a23e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
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 <scdbackup@gmx.net>
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
@@ -44,6 +44,7 @@
 grub_mkimage=${bindir}/`echo grub-mkimage | sed ${transform}`
 
 xorriso=xorriso
+diet=no
 
 # Usage: usage
 # Print the usage.
@@ -59,6 +60,7 @@
   --rom-directory=DIR     save rom images in DIR [optional]
   --xorriso=FILE          use FILE as xorriso [optional]
   --grub-mkimage=FILE     use FILE as grub-mkimage
+  --diet                  apply size reducing measures [optional]
 
 $self generates a bootable rescue image with specified source files, source
 directories, or mkisofs options listed by: xorriso -as mkisofs -help
@@ -133,6 +135,9 @@
     --xorriso=*)
         xorriso=`echo "${option}/" | sed 's/--xorriso=//'` ;;
 
+    --diet)
+	diet=yes ;;
+
     *)
 	source="${source} ${option} $@"; break ;;
     esac
@@ -307,7 +312,14 @@
 fi
 
 # build iso image
-"${xorriso}" -as mkisofs -graft-points ${grub_mkisofs_arguments} --protective-msdos-label -o ${output_image} -r ${iso9660_dir} --sort-weight 0 / --sort-weight 1 /boot ${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} --sort-weight 0 / --sort-weight 1 /boot ${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} --sort-weight 0 / --sort-weight 1 /boot ${source}
+fi
 rm -rf ${iso9660_dir}
 
 rm -f ${embed_img}