Skip to contentSkip to conversation

GSoC #01 grub-mkrescue i386-pc multiple overlays

PATCH In review Colin D Bennett 3 participants 6 messages Aug 31, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 GSoC #01 grub-mkrescue i386-pc multiple overlays

This is the first of many patches that I will be posting of my Google Summer of Code 2008 work on GRUB.

This patch adds support to the 'grub-mkrescue' command on the i386-pc platform for specifying multiple '--overlay' options. Each --overlay option will result in the later overlays potentially overriding the earlier ones if file names are the same.

Regards,
Colin

2008-08-30 Colin D Bennett <[email protected]>

* util/i386/pc/grub-mkrescue.in: Support multiple overlay directories.

=== modified file 'util/i386/pc/grub-mkrescue.in'

i386/pc/grub-mkrescue.in +5 -4
@@ -71,7 +71,7 @@
     --modules=*)
 	modules=`echo "$option" | sed 's/--modules=//'` ;;
     --overlay=*)
-	overlay=`echo "$option" | sed 's/--overlay=//'` ;;
+	overlay=${overlay}${overlay:+ }`echo "$option" | sed 's/--overlay=//'` ;;
     --pkglibdir=*)
 	input_dir=`echo "$option" | sed 's/--pkglibdir=//'` ;;
     --grub-mkimage=*)
@@ -124,9 +124,10 @@
   echo "insmod $i"
 done > ${aux_dir}/boot/grub/grub.cfg
 
-if test "x$overlay" = x ; then : ; else
-  cp -dpR ${overlay}/* ${aux_dir}/
-fi
+for d in ${overlay}; do
+  echo "Overlaying $d"
+  cp -dpR "${d}"/* "${aux_dir}"/
+done
 
 if [ "x${image_type}" = xfloppy -o "x${emulation}" = xfloppy ] ; then
   # build memdisk
#1 lore raw
Quoted 2 lines · Colin D Bennett

This is the first of many patches that I will be posting of my Google Summer of Code 2008 work on GRUB.

Hi Colin,

Thanks for your patches so far. I don't think we can handle them all before you go to your holiday but we will try to be a bit more flexible this time, so if there is not big fixes to be made, we do them and commit them.

Thanks again for your work for GSoC 2008. I hope we can integrated this feature as soon as possible so others can also enjoy what it brings.

Thanks,
Vesa Jääskeläinen

#2 lore raw
Quoted 10 lines · On Sun, 31 Aug 2008 12:32:59 +0300 Vesa Jääskeläinen <[email protected]> wrote:
Quoted 2 lines · Colin D Bennett

This is the first of many patches that I will be posting of my Google Summer of Code 2008 work on GRUB.

Hi Colin,

Thanks for your patches so far. I don't think we can handle them all before you go to your holiday but we will try to be a bit more flexible this time, so if there is not big fixes to be made, we do them and commit them.

OK. I'll try to get as much as possible posted before I go, at least. If, after review, it is determined that some things need to be done differently, I can make minor fixes in the next couple days, or when I get back I can tackle somewhat larger changes.

Quoted 6 lines

Thanks again for your work for GSoC 2008. I hope we can integrated this feature as soon as possible so others can also enjoy what it brings.

Thanks,
Vesa Jääskeläinen

It's been a great experience working on GRUB with you all, and I also look forward to seeing the code integrated into GRUB's mainline and getting more people testing it.

Regards,
Colin

#3 lore raw
In reply to Colin D Bennett
Quoted 16 lines · Colin D Bennett

=== modified file 'util/i386/pc/grub-mkrescue.in'

i386/pc/grub-mkrescue.in +1 -1
@@ -71,7 +71,7 @@
     --modules=*)
 	modules=`echo "$option" | sed 's/--modules=//'` ;;
     --overlay=*)
-	overlay=`echo "$option" | sed 's/--overlay=//'` ;;
+	overlay=${overlay}${overlay:+ }`echo "$option" | sed 's/--overlay=//'` ;;
     --pkglibdir=*)
 	input_dir=`echo "$option" | sed 's/--pkglibdir=//'` ;;
     --grub-mkimage=*)
@@ -124,9 +124,10 @@
   echo "insmod $i"
 done > ${aux_dir}/boot/grub/grub.cfg
 

i386/pc/grub-mkrescue.in line 133

Quoted 10 lines
i386/pc/grub-mkrescue.in +4 -3
-if test "x$overlay" = x ; then : ; else
-  cp -dpR ${overlay}/* ${aux_dir}/
-fi
+for d in ${overlay}; do
+  echo "Overlaying $d"
+  cp -dpR "${d}"/* "${aux_dir}"/
+done
 
 if [ "x${image_type}" = xfloppy -o "x${emulation}" = xfloppy ] ; then
   # build memdisk

Hi,

I'd suggest mentioning in --help that --overlay can be specified multiple times.

Signature · 5 lines
Robert Millan

  The DRM opt-in fallacy: "Your data belongs to us. We will decide when (and
  how) you may access your data; but nobody's threatening your freedom: we
  still allow you to remove your data and not access it at all."
#4 lore raw

PATCH 1/1 GSoC #01 grub-mkrescue i386-pc multiple overlays (v2)

Quoted 4 lines · On Sun, 31 Aug 2008 15:49:45 +0200 Robert Millan <[email protected]> wrote:

Hi,

I'd suggest mentioning in --help that --overlay can be specified multiple times.

It is so. New patch attached.

Regards,
Colin

2008-08-30 Colin D Bennett <[email protected]>

* util/i386/pc/grub-mkrescue.in: Support multiple overlay directories.

=== modified file 'util/i386/pc/grub-mkrescue.in'

i386/pc/grub-mkrescue.in +6 -4
@@ -43,6 +43,7 @@
   -v, --version           print the version information and exit
   --modules=MODULES       pre-load specified modules MODULES
   --overlay=DIR           overlay directory DIR in the memdisk image
+                          (may be specified multiple times)
   --pkglibdir=DIR         use images from directory DIR instead of ${pkglibdir}
   --grub-mkimage=FILE     use FILE as grub-mkimage
   --image-type=TYPE       select floppy or cdrom (default)
@@ -71,7 +72,7 @@
     --modules=*)
 	modules=`echo "$option" | sed 's/--modules=//'` ;;
     --overlay=*)
-	overlay=`echo "$option" | sed 's/--overlay=//'` ;;
+	overlay=${overlay}${overlay:+ }`echo "$option" | sed 's/--overlay=//'` ;;
     --pkglibdir=*)
 	input_dir=`echo "$option" | sed 's/--pkglibdir=//'` ;;
     --grub-mkimage=*)
@@ -124,9 +125,10 @@
   echo "insmod $i"
 done > ${aux_dir}/boot/grub/grub.cfg
 
-if test "x$overlay" = x ; then : ; else
-  cp -dpR ${overlay}/* ${aux_dir}/
-fi
+for d in ${overlay}; do
+  echo "Overlaying $d"
+  cp -dpR "${d}"/* "${aux_dir}"/
+done
 
 if [ "x${image_type}" = xfloppy -o "x${emulation}" = xfloppy ] ; then
   # build memdisk
#5 lore raw

Re: [PATCH] GSoC #01 grub-mkrescue i386-pc multiple overlays (v2)

Quoted 9 lines · Colin D Bennett
Quoted 4 lines · On Sun, 31 Aug 2008 15:49:45 +0200 Robert Millan <[email protected]> wrote:

Hi,

I'd suggest mentioning in --help that --overlay can be specified multiple times.

It is so. New patch attached.

Thanks! I checked this in.

Signature · 5 lines
Robert Millan

  The DRM opt-in fallacy: "Your data belongs to us. We will decide when (and
  how) you may access your data; but nobody's threatening your freedom: we
  still allow you to remove your data and not access it at all."