Page 4 of 24 FirstFirst ... 2345614 ... LastLast
Results 31 to 40 of 236

Thread: Grub 2 Title Tweaks Thread

  1. #31
    Join Date
    Nov 2005
    Beans
    50

    Re: Grub 2 Title Tweaks Thread

    Thanks drs305, got it working now:
    your code was almost right, and got me on the way:

    Code:
    if [[ "${LONGNAME}" = "Enter Exact Title You Just Copied" && "${DEVICE}" = "/dev/sda1" ]] ; then
    LONGNAME="Enter Desired New Title Here"
    elif [ -z "${LONGNAME}" ] ; then
    LONGNAME="${LABEL}"
    fi
    should be:
    Code:
    if [ "${LONGNAME}" = "Enter Exact Title You Just Copied" ] && [ "${DEVICE}" = "/dev/sda1" ] ; then
    LONGNAME="Enter Desired New Title Here"
    elif [ -z "${LONGNAME}" ] ; then
    LONGNAME="${LABEL}"
    fi
    (just a different use of the [ ] items.)

    Thanks!

    Dax

  2. #32
    Join Date
    Oct 2004
    Beans
    Hidden!

    Re: Grub 2 Title Tweaks Thread

    This looks helpful; maybe I will try again. On the other hand, it perfectly illustrates what a bloated pile of failure GRUB2 is. The HOWTO for changing the GRUB2 boot menu is almost as long as the HOWTO for setting up a LAMP server, and that is desperately sad.

  3. #33
    Join Date
    May 2007
    Beans
    3

    Thumbs down Re: Grub 2 Title Tweaks Thread

    Thanks for this (and other) postings about grub2. I had a bit of trouble with some of the code, to be exact: part 2D. The string comparison gave me some errors. The solution was to quote both the parts before and after the equal sign. For this part it would be as follows:

    (it's hard to see, but the changes (double quotes) are bold and underlined):

    Code:
            if [ "${nomemtest}" = "Memory" ] || [ "${nosingle}" = "single" ]; then
           continue 
        fi
    btw: I found the solution here:
    http://stackoverflow.com/questions/1...ing-comparison

  4. #34
    Join Date
    Jan 2007
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: Grub 2 Title Tweaks Thread

    Quote Originally Posted by alveola View Post
    Thanks for this (and other) postings about grub2. I had a bit of trouble with some of the code, to be exact: part 2D. The string comparison gave me some errors. The solution was to quote both the parts before and after the equal sign.
    Ok, thanks. I'm at a hotel so I'll change them now and play with them when I return home.
    Back to Xorg...

    Retired.

  5. #35
    Join Date
    May 2008
    Beans
    10
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: Grub 2 Title Tweaks Thread

    I'm trying to remove the (on /dev/sda2) string this brain dead piece of crap keeps adding but I searched 10_linux for the string ${DEVICE} and didn't find it. Any ideas?

  6. #36
    Join Date
    Jan 2007
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: Grub 2 Title Tweaks Thread

    Quote Originally Posted by deep64blue View Post
    I'm trying to remove the (on /dev/sda2) string this brain dead piece of crap keeps adding but I searched 10_linux for the string ${DEVICE} and didn't find it. Any ideas?
    The 10_linux script works on the system partition and doesn't attach the "(on /dev/sda4)" label to the menuentry.

    Most likely, you have another Linux installation on a different partition that is being detected by 30_os-prober. You can check by looking at /boot/grub/grub.cfg. The contents of this file are sectioned by the script that created it ("### BEGIN.... ). Find the menuentry which you want to change and then determine the section it is in. The section name is the same as the file you want to edit.
    Back to Xorg...

    Retired.

  7. #37
    Join Date
    Aug 2007
    Beans
    49

    Re: Grub 2 Title Tweaks Thread

    Wow, thanks for the great writeup. I'm a total newbie and I could follow it no problem!

    This is perhaps trivial, but
    Code:
    codename="`lsb_release -cs`"
    returns the codename in all lowercase. Would it be ridiculous to make it capitalize the first letter?

    Another very particular question:

    Would it be possible to use only the last part of the kernel version number to, for example, get an entry to read like "Ubuntu Karmic (-14)"

  8. #38
    Join Date
    Jan 2007
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: Grub 2 Title Tweaks Thread

    Quote Originally Posted by burgerearl View Post
    This is perhaps trivial, but
    Code:
    codename="`lsb_release -cs`"
    returns the codename in all lowercase. Would it be ridiculous to make it capitalize the first letter?
    Hey, I said this thread was for truly anal users, so all ridiculous is accepted!

    I worked with the 10-linux file, although you could modify them for use in the 30_os-prober file as well. I am referencing Section 1 of the first post. Under codename="`lsb_release -cs`" add this line:
    Codename="`echo $codename | tr [hjkl] [HJKL]`"
    It's a hack, but will translate hardy/jaunty/karmic/lucid into Hardy/Jaunty/Karmic/Lucid. There is obviously a better script, but this is simple and will work specifically for those names. Note you couldn't add an I for intrepid, since it would turn out IntrepId...

    Another very particular question:

    Would it be possible to use only the last part of the kernel version number to, for example, get an entry to read like "Ubuntu Karmic (-14)"
    To shorten to just the trailing digits (example -14), add this variable in the same place:
    short_version="(-`echo $version | cut -d "-" -f 2`)"
    If you want to see "-14-generic" use this:
    short_version="(-`echo $version | cut -d "-" -f 2-`)"
    Then change the original line:
    linux_entry "${OS}, Linux ${version}" \
    to:
    linux_entry "${Codename} ${shortversion}" \
    Combined, the two should produce results like these:
    Karmic (-14)
    Karmic (-14-generic)
    Last edited by drs305; November 24th, 2009 at 02:00 PM.
    Back to Xorg...

    Retired.

  9. #39
    Join Date
    Aug 2007
    Beans
    49

    Re: Grub 2 Title Tweaks Thread

    Perfect, that did exactly what I wanted. Thanks!

    To reduce my newbliness, what would this be called? Just scripting language, or....? Basically, I'm wondering what I should search for to teach myself some of the syntax.

  10. #40
    Join Date
    Jan 2007
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: Grub 2 Title Tweaks Thread

    Quote Originally Posted by burgerearl View Post
    Perfect, that did exactly what I wanted. Thanks!

    To reduce my newbliness, what would this be called? Just scripting language, or....? Basically, I'm wondering what I should search for to teach myself some of the syntax.
    If you look at the first line of the script files you will see most are bash. Some are sh. Everything I've tweaked has been with basic BASH scripting, and I'm talking very basic BASH. More complex BASH statements could be used in many of the examples but I've kept most of the tweaks simple.

    There are lots of BASH examples and tutorials floating around the internet.
    Back to Xorg...

    Retired.

Page 4 of 24 FirstFirst ... 2345614 ... LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •