All of lore.kernel.org
 help / color / mirror / Atom feed
* customizing grub-mkrecue images
@ 2009-01-17  3:14 Neal H. Walfield
  2009-01-17  4:51 ` Colin D Bennett
  0 siblings, 1 reply; 3+ messages in thread
From: Neal H. Walfield @ 2009-01-17  3:14 UTC (permalink / raw)
  To: grub-devel

Hi,

grub-mkrescue is quite useful, however, I'd like to be able to
customize the image it creates a bit more than it currently supports.
In particular, I'd like to load another config file at boot time.  The
attached patch enables this by way of a new option, --configfile.

A more general solution to the customization problem would be to load
a config file at image compilation time.  This could be used to solve
my problem.  However, as it is an additional level of indirection,
perhaps both options would be useful.

Thoughts?

Thanks,
Neal

2009-01-17  Neal H. Walfield  <neal@gnu.org>

	* util/i386/pc/grub-mkrescue.in: Add new option --configfile.  If
	not the set and not the empty string, load it from the generated
	config file on boot.

Index: util/i386/pc/grub-mkrescue.in
===================================================================
--- util/i386/pc/grub-mkrescue.in	(revision 1946)
+++ util/i386/pc/grub-mkrescue.in	(working copy)
@@ -49,6 +49,7 @@
   --image-type=TYPE       select floppy or cdrom (default)
   --emulation=TYPE        select El Torito boot emulation type floppy
                           or none (default) (cdrom only)
+  --configfile=FILE       config file to load (default: none)
 
 grub-mkimage generates a bootable rescue image of the specified type.
 
@@ -93,6 +94,9 @@
             echo "Unknown emulation type \`$emulation'" 1>&2
             exit 1 ;;
         esac ;;
+    --configfile=*)
+    	configfile=`echo "$option" | sed 's/--configfile=//'`
+        ;;
     -*)
 	echo "Unrecognized option \`$option'" 1>&2
 	usage
@@ -121,9 +125,15 @@
   ${aux_dir}/boot/grub/
 
 modules="biosdisk `cat ${input_dir}/partmap.lst` ${modules}"
-for i in ${modules} ; do
-  echo "insmod $i"
-done > ${aux_dir}/boot/grub/grub.cfg
+{
+  for i in ${modules} ; do
+    echo "insmod $i"
+  done
+  if test x$configfile != x
+  then
+    echo "configfile $configfile"
+  fi
+} > ${aux_dir}/boot/grub/grub.cfg
 
 for d in ${overlay}; do
   echo "Overlaying $d"



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: customizing grub-mkrecue images
  2009-01-17  3:14 customizing grub-mkrecue images Neal H. Walfield
@ 2009-01-17  4:51 ` Colin D Bennett
  2009-02-07 21:16   ` Robert Millan
  0 siblings, 1 reply; 3+ messages in thread
From: Colin D Bennett @ 2009-01-17  4:51 UTC (permalink / raw)
  To: The development of GRUB 2; +Cc: neal

[-- Attachment #1: Type: text/plain, Size: 1072 bytes --]

On Sat, 17 Jan 2009 04:14:45 +0100
"Neal H. Walfield" <neal@walfield.org> wrote:

> Hi,
> 
> grub-mkrescue is quite useful, however, I'd like to be able to
> customize the image it creates a bit more than it currently supports.
> In particular, I'd like to load another config file at boot time.  The
> attached patch enables this by way of a new option, --configfile.
> 
> A more general solution to the customization problem would be to load
> a config file at image compilation time.  This could be used to solve
> my problem.  However, as it is an additional level of indirection,
> perhaps both options would be useful.
> 
> Thoughts?

You can already do this with the --overlay=DIR option.  I do this to
add fonts, images, and graphical menu themes to the resulting ISO image
in addition to my custom grub.cfg.

Your option --configfile option does make the case when you only want
to include your own grub.cfg file easier, by not requiring you to
create a directory hierarchy of DIR/boot/grub/ to contain grub.cfg
first.

Regards,
Colin

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: customizing grub-mkrecue images
  2009-01-17  4:51 ` Colin D Bennett
@ 2009-02-07 21:16   ` Robert Millan
  0 siblings, 0 replies; 3+ messages in thread
From: Robert Millan @ 2009-02-07 21:16 UTC (permalink / raw)
  To: The development of GRUB 2; +Cc: neal

On Fri, Jan 16, 2009 at 08:51:45PM -0800, Colin D Bennett wrote:
> On Sat, 17 Jan 2009 04:14:45 +0100
> "Neal H. Walfield" <neal@walfield.org> wrote:
> 
> > Hi,
> > 
> > grub-mkrescue is quite useful, however, I'd like to be able to
> > customize the image it creates a bit more than it currently supports.
> > In particular, I'd like to load another config file at boot time.  The
> > attached patch enables this by way of a new option, --configfile.
> > 
> > A more general solution to the customization problem would be to load
> > a config file at image compilation time.  This could be used to solve
> > my problem.  However, as it is an additional level of indirection,
> > perhaps both options would be useful.
> > 
> > Thoughts?
> 
> You can already do this with the --overlay=DIR option.  I do this to
> add fonts, images, and graphical menu themes to the resulting ISO image
> in addition to my custom grub.cfg.
> 
> Your option --configfile option does make the case when you only want
> to include your own grub.cfg file easier, by not requiring you to
> create a directory hierarchy of DIR/boot/grub/ to contain grub.cfg
> first.

I don't like the current interface very much, but --configfile sounds too
ad-hoc (if we go this way we could end up adding --fontfile et al).

How about an option that adds an arbitrary file to $prefix ?

-- 
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."



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-02-07 21:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-17  3:14 customizing grub-mkrecue images Neal H. Walfield
2009-01-17  4:51 ` Colin D Bennett
2009-02-07 21:16   ` Robert Millan

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.