On 07/22/2010 12:28 PM, Dan McGhee wrote:
The glitch, which I documented in my other Grub thread, using the
statement "Grub sees only my new LFS build and not my other stuff,"
really has relevance for only those who want a multi-boot system. I
have one. Although I manually entered a grub.cfg entry for that
"other popular (?) operating system," I was frustrated that
grub-mkconfig didn't behave like I've seen it in Ubuntu.
The path to investigate took me to this statement in the Grub manual:
"'GRUB_DISABLE_OS_PROBER'
Normally, grub-mkconfig will try to use the external *_os-prober
program, if
installed,_* to discover other operating systems installed on the same
system and
generate appropriate menu entries for them." [The emphasis is mine.]
Closer inspection of /etc/grub.d/30_os-prober revealed:
if [ -z "`which os-prober 2> /dev/null`" -o -z "`which
linux-boot-prober 2> /dev/null`" ] ; then
# missing os-prober and/or linux-boot-prober
adjust_timeout
exit 0
fi
OSPROBED="`os-prober | tr ' ' '^' | paste -s -d ' '`"
if [ -z "${OSPROBED}" ] ; then
# empty os-prober output, nothing doing
adjust_timeout
exit 0
fi
This script will "bail out" with no output other than "Begin...End,"
if os-prober is not installed or doesn't do anything. This is what
led me to believe that Grub was operating incorrectly.
I discovered using 'find' that os-prober was not on my LFS build, but
that it was in Ubuntu. Although referenced in the manual and "called"
in the script, it is not a Gnu or Grub thing. It came from the Debian
installer and there is a discussion and the ability to download it at
this location <http://joey.kitenet.net/code/os-prober/>
I don't have a report on success or failure on using this in LFS yet.
There is no install target in the makefile and the documentation makes
the install non-intuitive. I'm using my Ubuntu as a guide and was
brute forcing with 'mkdir' and 'cp,' when I realized that I need to
brush up on how to use 'install.' It might make it easier.
os-prober also has a "linux-boot-prober" that will look across device
boundaries for other linux distributions. I know that there are many
different ways to get the menu entries and look for other distros to
put in the grub menu. I'm lazy and just want grub-mkconfig to see
everything.
If all goes well, maybe it's "write a hint" time.
Dan
And something else I missed until I just tested os-prober. On a shiny
new LFS build without "which" installed 30_os-prober will also fail.
Dan
--
http://linuxfromscratch.org/mailman/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/lfs/faq.html
Unsubscribe: See the above information page