help-grub
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

embedding for a custom config path?


From: k2011gen
Subject: embedding for a custom config path?
Date: Sun, 09 Jan 2011 22:47:03 -0500

I'm trying to get grub2 to use a config (final menu) file on a fat partition 
where I can edit it from any OS.  With grub-legacy and the fat partition being 
(hd0,5) this was easy with the install command ending with  

".... p  (hd0,5)/boot/mystuff/menu.grb"

This is what I'm trying to duplicate with grub2. 



I think this might be the line in grub-install that invokes grub-mkimage. 

   grub_mkimage=${bindir}/`echo grub-mkimage | sed ${transform}`

Section 5.3 "Embedding a configuration file into GRUB" says to use the -c 
option like so

-c, --config=FILE
    embed FILE as boot config

to embed a "pointer" file in the (core.img?) image. Kind of roundabout but it 
looks like it's the only game in town for this.



If this "pointer" file to be embeded were 

"/boot/grub/user/embedthis.txt" 

then how would I need to modify the above mkimage line in grub-install to make 
it embed?


 
The example for this pointer file to be embeded is given in the manual as 

search.fs_label grub root
 if [ -e /boot/grub/example/test1.cfg ]; then
   set prefix=($root)/boot/grub
   configfile /boot/grub/example/test1.cfg
 else
  if [ -e /boot/grub/example/test2.cfg ]; then
   set prefix=($root)/boot/grub
   configfile /boot/grub/example/test2.cfg
   else
     echo "Could not find an example configuration file!"
  fi
 fi

and this is where the actual desired config file is "pointed to". How would I 
need to change this example if the argument for configfile will be  
"/anywhere/whateverpartition/mymenu.grub2"?

Initially I'd be tempted to insert just

  configfile  /anywhere/whateverpartition/mymenu.grub2

and nothing else.


Eventually I'll learn to use grub-mkimage directly but for now with my limited 
familiarity I'll just use grub-install. 



TIA






reply via email to

[Prev in Thread] Current Thread [Next in Thread]