Jump to content











Photo
- - - - -

noobie need to change title on grub2 also using grub4dos HD


  • Please log in to reply
29 replies to this topic

#26 ejames82

ejames82

    Member

  • Members
  • 39 posts
  •  
    United States

Posted 01 May 2016 - 05:09 AM

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



#27 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 01 May 2016 - 09:46 AM

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.

 

Yep :), still around and kickin' ;).

Thank you for the report, though it is sad :( (to me at least) to have confirmed that changing a simple line of text (I would presume that *anyone* might want or need to customize an actual boot entry title) has been made so difficult.

On the other hand the good news are that seemingly we weren't missing anything, as even the good Linux guys could not provide a simple way to solve the issue, the matter has been made senselessly complex, evidently "by design".

 

:duff:

Wonko



#28 ejames82

ejames82

    Member

  • Members
  • 39 posts
  •  
    United States

Posted 01 May 2016 - 01:33 PM

we both know that there are good things about grub2.  it does have its merits.  only about a week ago I patched a hard drive into a computer that already had a dual-boot hard drive, ran update-grub,  the new OS was detected and listed, and I was able to use all three OS's at my choosing.  it was amazing how little time I spent at it.  But to change the title on grub2's menu when it's combined with grub4dos, forget it.

 

I can feel pretty good about the fact that I followed a tutorial, understood what it said, and it didn't work.  I am inclined to think that the tutorial was flawed in some way.  I was given a workaround from old fred that said to edit the 40_custom file (his post is listed above).  maybe after I re-familiarize myself with the procedure I will give it another shot and take his suggestion, but as for right now, I feel grub4dos is the direction I should head.

 

I am pretty sure I will be back with more questions.  it was good talking with you.  and thanks.



#29 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 01 May 2016 - 02:19 PM

we both know that there are good things about grub2.  it does have its merits.  only about a week ago I patched a hard drive into a computer that already had a dual-boot hard drive, ran update-grub,  the new OS was detected and listed, and I was able to use all three OS's at my choosing.  it was amazing how little time I spent at it.  But to change the title on grub2's menu when it's combined with grub4dos, forget it.

Sure there are good things in GRUB2 :).

 

Point was not about it having not (quite a few) nice features, it was about having made its configuration extremely complex AND under-document it or failing to provide a script or tool capable of making it accessible to "common" users without having to learn the non-intuitive sintax of the scripting engine used.

 

One of the page you linked to:
https://help.ubuntu....ub2/CustomMenus

is one of the few available ones that explain in detail  :thumbsup:  the possibilities, still the procedure to have only a Custom menu, detailed in "Using Only a Custom Menu" is a 5 step process, with each step implying a number of rather complex actions, the same could be made with (say) a single directive like "-use-custom-menu" or "-no-dynamic-menu" or simpling making the upgrade-grub NOT automatically creating a new grub.cfg unless a specific switch/parameter was given, etc..

 

As I see it an evolution or improvement is when more features are easily accessible, not when such features are added without a convenient way to access them.

 

:duff:

Wonko



#30 ejames82

ejames82

    Member

  • Members
  • 39 posts
  •  
    United States

Posted 02 May 2016 - 03:33 PM

it's too bad that you couldn't have been involved in the project when grub2 was given birth.  then, that 'little more' would have been included.  

being the boot manager that comes with the most recent linux distros, grub2 loses the 'customizable' characteristic that linux brags about and is pretty much known for.  where windows hides the configuration files (like the windows registry, for example) and discourages the end user from touching them, linux almost invites the user to.

now, two things come to mind when I install a distro:

1. NOT installing grub, or removing it. 

2. installing grub4dos instead.






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users