* [PATCH] Add grub-mkrescue --exclude option
@ 2007-11-20 19:37 Christian Franke
2007-12-06 12:04 ` Robert Millan
0 siblings, 1 reply; 3+ messages in thread
From: Christian Franke @ 2007-11-20 19:37 UTC (permalink / raw)
To: grub-devel
[-- Attachment #1: Type: text/plain, Size: 195 bytes --]
This adds an option to exclude specific modules from the rescue image.
Christian
2007-11-20 Christian Franke <franke@computer.org>
* util/i386/pc/grub-mkrescue.in: Add option --exclude.
[-- Attachment #2: grub2-mkrescue-exclude.patch --]
[-- Type: text/x-patch, Size: 1304 bytes --]
--- grub2.orig/util/i386/pc/grub-mkrescue.in 2007-07-22 01:32:32.000000000 +0200
+++ grub2/util/i386/pc/grub-mkrescue.in 2007-11-19 23:26:53.625000000 +0100
@@ -42,6 +42,7 @@
-h, --help print this message and exit
-v, --version print the version information and exit
--modules=MODULES pre-load specified modules MODULES
+ --exclude=MODULES don't pre-load specified modules MODULES
--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)
@@ -67,6 +68,8 @@
exit 0 ;;
--modules=*)
modules=`echo "$option" | sed 's/--modules=//'` ;;
+ --exclude=*)
+ exclude=`echo "$option" | sed 's/--exclude=//'` ;;
--pkglibdir=*)
input_dir=`echo "$option" | sed 's/--pkglibdir=//'` ;;
--grub-mkimage=*)
@@ -103,6 +106,18 @@
modules=`cd ${input_dir}/ && ls *.mod`
fi
+if [ "x${exclude}" != "x" ] ; then
+ all_modules="${modules}"
+ modules=
+ for m in ${all_modules} ; do
+ inc=t
+ for e in ${exclude} ; do
+ [ "$e" == "$m" ] && { inc=f; break; }
+ done
+ [ $inc == t ] && modules="$modules $m"
+ done
+fi
+
if [ "x${image_type}" = "xfloppy" ] ; then
floppy_image=${output_image}
else
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] Add grub-mkrescue --exclude option
2007-11-20 19:37 [PATCH] Add grub-mkrescue --exclude option Christian Franke
@ 2007-12-06 12:04 ` Robert Millan
2007-12-06 12:34 ` Christian Franke
0 siblings, 1 reply; 3+ messages in thread
From: Robert Millan @ 2007-12-06 12:04 UTC (permalink / raw)
To: The development of GRUB 2
On Tue, Nov 20, 2007 at 08:37:50PM +0100, Christian Franke wrote:
> This adds an option to exclude specific modules from the rescue image.
Do you want this because of the ata module ? Inclussion of ata.mod at this
point is IMO a bug. If that's your only reason for wanting this feature, I'd
rather exclude ata.mod instead (but in that case, we'd have to figure out how
to allow user to include it in case she _wants_ to).
--
Robert Millan
<GPLv2> I know my rights; I want my phone call!
<DRM> What use is a phone call, if you are unable to speak?
(as seen on /.)
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Add grub-mkrescue --exclude option
2007-12-06 12:04 ` Robert Millan
@ 2007-12-06 12:34 ` Christian Franke
0 siblings, 0 replies; 3+ messages in thread
From: Christian Franke @ 2007-12-06 12:34 UTC (permalink / raw)
To: The development of GRUB 2
Robert Millan wrote:
> On Tue, Nov 20, 2007 at 08:37:50PM +0100, Christian Franke wrote:
> > This adds an option to exclude specific modules from the rescue
> > image.
> >
>
> Do you want this because of the ata module ? Inclussion of ata.mod at
> this point is IMO a bug. If that's your only reason for wanting this
> feature, I'd rather exclude ata.mod instead (but in that case, we'd
> have to figure out how to allow user to include it in case she _wants_
> to).
The necessary exclusion of the ata.mod was actually the reason to
provide this patch. But it also may be useful to track down module
related problems in the future. It is more convenient to use if you want
to exclude a few modules for some reason.
Christian
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2007-12-06 12:35 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-20 19:37 [PATCH] Add grub-mkrescue --exclude option Christian Franke
2007-12-06 12:04 ` Robert Millan
2007-12-06 12:34 ` Christian Franke
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.