hello,
below I have listed all of the feedback I received. two lines across indicates a different website, and one line represents a different reply on the same website.
a special thanks to old fred for his in-depth and well-organized reply.
I have decided that my time would be better spent learning more about grub4dos than grub2. just my opinion.
I hope some person benefits from what is written here, and thanks to everybody.
----------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------
If you don't update Grub a lot, just manually enter the title you want in grub.cfg. Yes, if you run update-grub it will revert but...
As far as the code, the if test is obviously failing - perhaps there are trailing spaces in LONGNAME? I used to write a lot of code in XBase and the "$" operator was priceless. Rather than matching a string exactly, the $ operator looked to see if the text fragment was contained within the target...
----------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------
Best not to edit scripts, over the years the locations in different versions of grub2 change.
I prefer to copy boot stanza to 40_custom and then you can edit at will. Once you confirm it works ok, you then can turn off os-prober. If later you want to use os-prober to find a boot stanza for a new install just turn it back on.
How to: Create a Customized GRUB2 Screen that is Maintenance Free.- Cavsfan
https://help.ubuntu.....tomGrub2Screen
https://help.ubuntu....ub2/CustomMenus
One way to fix the descriptions is to move the windows entries to 40_custom and edit at will.
http://askubuntu.com..../659910#659910
Copy the entries from this:
sudo cp -a /boot/grub/grub.cfg /boot/grub/grub.cfg.backup
gedit /boot/grub/grub.cfg
Copy them to and edit to have only entries or descriptions you want:
gksudo gedit /etc/grub.d/40_custom
Then do:
sudo update-grub
If you want it first in grub menu make it 06_custom (do not add entries to both)
or a new file that will be first in the menu
sudo cp -a /etc/grub.d/40_custom /etc/grub.d/06_custom
sudo chmod 755 /etc/grub.d/06_custom
sudo cp -a /boot/grub/grub.cfg /boot/grub/grub.cfg.backup
In /etc/default/grub I added this line for os-prober:
sudo cp -a /boot/grub/grub.cfg /boot/grub/grub.cfg.backup
gksudo gedit /etc/default/grub
GRUB_DISABLE_OS_PROBER=true
or
sudo sed -i '$a GRUB_DISABLE_OS_PROBER=true' /etc/default/grub
or
turn off executable bit
sudo chmod a-x /etc/grub.d/30_os-prober
sudo update-grub
----------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------
So i guess this seems obvious, but did you run grub-mkconfig after these changes?
----------------------------------------------------------------------------------------------------------
hello grail,
I have never heard of such a thing, so the answer is no.
thanks for the reply, and I will let you know if it works.
----------------------------------------------------------------------------------------------------------
Usually it would need to specify the target with -o :
grub-mkconfig -o /boot/grub/grub.cfg
----------------------------------------------------------------------------------------------------------
all "/etc/grub.d/30_os-prober" dose is tell " grub-mkconfig " HOW to make the " /boot/grub/grub.cfg " file
after you edit 30_os-prober you still have to make a NEW grub.cfg that reflects the changes you made
----------------------------------------------------------------------------------------------------------
Quote:
Usually it would need to specify the target with -o :
grub-mkconfig -o /boot/grub/grub.cfg
Yes, but the grub needs to be grub2, thus:
Code:
grub2-mkconfig -o /boot/grub2/grub.cfg
And this is for an MBR BIOS, not EFI.
----------------------------------------------------------------------------------------------------------
Quote:
Originally Posted by tomwest View Post
Yes, but the grub needs to be grub2
Depends on the distro. I have seen Centos with grub2, Ubuntu with grub.
----------------------------------------------------------------------------------------------------------
Change this
Code:
if [ "${LONGNAME}" = "Microsoft Windows XP Professional (on /dev/sda1)" ] ; then
to
Code:
if [ "${LONGNAME}" = "Microsoft Windows XP Professional" ] ; then
to get rid of (on /dev/sda1), in the section that looks like this
Code:
found_other_os=1
onstr="$(gettext_printf "(on s)" "${DEVICE}")"
cat << EOF
menuentry '$(echo "${LONGNAME} $onstr" | grub_quote)' --class windows --class os \$menuentry_id_option 'osprober-chain-$(grub_get_device_id "${DEVICE}")' {
EOF
change
Code:
onstr="$(gettext_printf "(on %s)" "${DEVICE}")"
to
Code:
onstr="$(gettext_printf "")"
----------------------------------------------------------------------------------------------------------
...in addition to what all others said,
Code:
# if [ -z "${LONGNAME}" ] ; then
# LONGNAME="${LABEL}"
# fi
if [ "${LONGNAME}" = "Microsoft Windows XP Professional (on /dev/sda1)" ] ; then
LONGNAME="choose between xp pro and tinycore"
elif [ -z "${LONGNAME}" ] ; then
LONGNAME="${LABEL}"
fi
the logic is wrong. you're checking LONGNAME for the "microsoft windows..." string before it has been assigned to LONGNAME.
really it should look like this:
Code:
if [ -z "${LONGNAME}" ] ; then
LONGNAME="${LABEL}"
fi
if [ "${LONGNAME}" =~ *"Microsoft Windows XP Professional"* ] ; then
LONGNAME="choose between xp pro and tinycore"
fi
(i haven't tested the bit after '=~'. source)
----------------------------------------------------------------------------------------------------------
...in addition to what all others said,
Code:
# if [ -z "${LONGNAME}" ] ; then
# LONGNAME="${LABEL}"
# fi
if [ "${LONGNAME}" = "Microsoft Windows XP Professional (on /dev/sda1)" ] ; then
LONGNAME="choose between xp pro and tinycore"
elif [ -z "${LONGNAME}" ] ; then
LONGNAME="${LABEL}"
fi
the logic is wrong. you're checking LONGNAME for the "microsoft windows..." string before it has been assigned to LONGNAME.
really it should look like this:
Code:
if [ -z "${LONGNAME}" ] ; then
LONGNAME="${LABEL}"
fi
if [ "${LONGNAME}" =~ *"Microsoft Windows XP Professional"* ] ; then
LONGNAME="choose between xp pro and tinycore"
fi
(i haven't tested the bit after '=~'. source)
----------------------------------------------------------------------------------------------------------
Quote:
Originally Posted by tomwest View Post
And this is for an MBR BIOS, not EFI.
Why not? Got EFI boot here and everything works fine...
----------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------
Quote Originally Posted by ejames82 View Post
I have looked it over a dozen times. I can't see where I have done anything wrong. it appears to be correct.
No, it is not.
You should leave out the " (on /dev/sda1)" part.
From your own quote:
3. Copy the exact title you wish to change (Example: Microsoft Windows XP Home Edition ) and place it between the quotes in the first line below. Note the title does not include the portion "(on /dev/sdXX)"
----------------------------------------------------------------------------------------------------------
NB we have moved to BunsenLabs forums. (The Crunchbang forums will become read-only soon). You can register there and post your questions.
In this case I think you want to edit the title at the top of the grub screen? What you are trying to do is edit the titles of the menu entries (I'm not sure exactly)
To edit the grub theme, then have a read of Grub theme elements, and look for
title-text Specifies the text to display at the top center of the screen as a title.
wonko, I hope you are still around and I hope you are well. it's hard to find time. I put alot of hours in at my job. I wish I could visit more often.
ejames82