Page 11 of 24 FirstFirst ... 91011121321 ... LastLast
Results 101 to 110 of 236

Thread: Grub 2 Title Tweaks Thread

  1. #101
    Join Date
    Jan 2007
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: Grub 2 Title Tweaks Thread

    Quote Originally Posted by n1ght5t4lk3r View Post
    I can say that its almost likely the issue, since I followed the directions and to start ended up with no change in the name I desired to change, but then after the above quoted reply I dropped the "(on /dev/sda1)" or in my case sda2, and it worked perfectly.
    Since at least 2 users experienced the same problem I've gone back to the original post and emphasized that the title does not include the "on /dev/sdXX" portion.

    Thanks for the feedback!
    GRUB2

    Retired.

  2. #102
    Join Date
    Aug 2006
    Beans
    Hidden!

    Re: Grub 2 Title Tweaks Thread

    Quote Originally Posted by k3lt01 View Post
    This begs the question of: Why is GRUB being displayed anyway on a machine that probably only has one OS on it? Or am I missing something here?
    The laptop also had Jaunty on it, as a slightly desperate solution to getting it to fix itself up onto the available network, using a disk we had handy. Then we tried 10.04 Lucid again. It was not a good day

  3. #103
    Join Date
    May 2008
    Location
    0032
    Beans
    68
    Distro
    Xubuntu 10.04 Lucid Lynx

    Re: Grub 2 Title Tweaks Thread

    First - my apologies for not having replied sooner; I have more than one (or two) computer(s), and I try to use them all regulary, which means I don't use this PC, with Ubuntu, every day/time.

    -oo-

    Whatever I try, I don't seem to get "Windows Vista (loader) (on /dev/sda1)" changed into "Windows XP Home"

    Here is my original 30_os-prober file
    (Do you really need the entire file? All 260 lines?
    It's Chinese to me (I see GNU/Linux is not for the average Windows user I mean, just look how much "trouble" a n00b like me has with changing one, small, single word ("Vista")...)

    Code:
    #! /bin/sh -e
    
    # grub-mkconfig helper script.
    # Copyright (C) 2006,2007,2008,2009  Free Software Foundation, Inc.
    #
    # GRUB is free software: you can redistribute it and/or modify
    # it under the terms of the GNU General Public License as published by
    # the Free Software Foundation, either version 3 of the License, or
    # (at your option) any later version.
    #
    # GRUB is distributed in the hope that it will be useful,
    # but WITHOUT ANY WARRANTY; without even the implied warranty of
    # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    # GNU General Public License for more details.
    #
    # You should have received a copy of the GNU General Public License
    # along with GRUB.  If not, see <http://www.gnu.org/licenses/>.
    
    prefix=/usr
    exec_prefix=${prefix}
    libdir=${exec_prefix}/lib
    
    . ${libdir}/grub/grub-mkconfig_lib
    
    found_other_os=
    
    adjust_timeout () {
      if [ "x${found_other_os}" = "x" ] ; then
        if [ "x${GRUB_HIDDEN_TIMEOUT}" != "x" ] ; then
          if [ "x${GRUB_HIDDEN_TIMEOUT_QUIET}" = "xtrue" ] ; then
    	verbose=
          else
    	verbose=" --verbose"
          fi
    
          if [ "x${GRUB_HIDDEN_TIMEOUT}" = "x0" ] ; then
    	cat <<EOF
    if [ \${timeout} != -1 ]; then
      if keystatus; then
        if keystatus --shift; then
          set timeout=-1
        else
          set timeout=0
        fi
      else
        if sleep$verbose --interruptible 3 ; then
          set timeout=0
        fi
      fi
    fi
    EOF
          else
    	cat << EOF
    if [ \${timeout} != -1 ]; then
      if sleep$verbose --interruptible ${GRUB_HIDDEN_TIMEOUT} ; then
        set timeout=0
      fi
    fi
    EOF
          fi
        fi
      fi
    }
    
    if [ "x${GRUB_DISABLE_OS_PROBER}" = "xtrue" ]; then
      adjust_timeout
      exit 0
    fi
    
    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
    
    osx_entry() {
            cat << EOF
    menuentry "${LONGNAME} (${2}-bit) (on ${DEVICE})" {
    EOF
    	save_default_entry | sed -e "s/^/\t/"
    	prepare_grub_to_access_device ${DEVICE} | sed -e "s/^/\t/"
    	cat << EOF
            insmod ${GRUB_VIDEO_BACKEND}
            set do_resume=0
            if [ /var/vm/sleepimage -nt10 / ]; then
               if xnu_resume /var/vm/sleepimage; then
                 set do_resume=1
               fi
            fi
            if [ \$do_resume == 0 ]; then
               xnu_uuid ${OSXUUID} uuid
               if [ -f /Extra/DSDT.aml ]; then
                  acpi -e /Extra/DSDT.aml
               fi
               $1 /mach_kernel boot-uuid=\${uuid} rd=*uuid
               if [ /System/Library/Extensions.mkext -nt /System/Library/Extensions ]; then
                  xnu_mkext /System/Library/Extensions.mkext
               else
                  xnu_kextdir /System/Library/Extensions
               fi
               if [ -f /Extra/Extensions.mkext ]; then
                  xnu_mkext /Extra/Extensions.mkext
               fi
               if [ -d /Extra/Extensions ]; then
                  xnu_kextdir /Extra/Extensions
               fi
               if [ -f /Extra/devprop.bin ]; then
                  xnu_devprop_load /Extra/devprop.bin
               fi
               if [ -f /Extra/splash.jpg ]; then
                  insmod jpeg
                  xnu_splash /Extra/splash.jpg
               fi
               if [ -f /Extra/splash.png ]; then
                  insmod png
                  xnu_splash /Extra/splash.png
               fi
               if [ -f /Extra/splash.tga ]; then
                  insmod tga
                  xnu_splash /Extra/splash.tga
               fi
            fi
    }
    EOF
    }
    
    for OS in ${OSPROBED} ; do
      DEVICE="`echo ${OS} | cut -d ':' -f 1`"
      LONGNAME="`echo ${OS} | cut -d ':' -f 2 | tr '^' ' '`"
      LABEL="`echo ${OS} | cut -d ':' -f 3 | tr '^' ' '`"
      BOOT="`echo ${OS} | cut -d ':' -f 4`"
    
      if [ -z "${LONGNAME}" ] ; then
        LONGNAME="${LABEL}"
      fi
    
      if [ "${LONGNAME}" = "Windows Vista (loader) (on /dev/sda1)" ] ; then
    
      echo "Found ${LONGNAME} on ${DEVICE}" >&2
      found_other_os=1
    
      case ${BOOT} in
        chain)
    
          cat << EOF
    menuentry "${LONGNAME} (on ${DEVICE})" {
    EOF
          save_default_entry | sed -e "s/^/\t/"
          prepare_grub_to_access_device ${DEVICE} | sed -e "s/^/\t/"
    
          case ${LONGNAME} in
    	Windows\ Vista*|Windows\ 7*)
    	;;
    	*)
    	  cat << EOF
    	drivemap -s (hd0) \${root}
    EOF
    	;;
          esac
    
          cat <<EOF
    	chainloader +1
    }
    EOF
        ;;
        linux)
          LINUXPROBED="`linux-boot-prober ${DEVICE} 2> /dev/null | tr ' ' '^' | paste -s -d ' '`"
          prepare_boot_cache=
    
          for LINUX in ${LINUXPROBED} ; do
            LROOT="`echo ${LINUX} | cut -d ':' -f 1`"
            LBOOT="`echo ${LINUX} | cut -d ':' -f 2`"
            LLABEL="`echo ${LINUX} | cut -d ':' -f 3 | tr '^' ' '`"
            LKERNEL="`echo ${LINUX} | cut -d ':' -f 4`"
            LINITRD="`echo ${LINUX} | cut -d ':' -f 5`"
            LPARAMS="`echo ${LINUX} | cut -d ':' -f 6- | tr '^' ' '`"
    
            if [ -z "${LLABEL}" ] ; then
              LLABEL="${LONGNAME}"
            fi
    
    	if [ "${LROOT}" != "${LBOOT}" ]; then
    	  LKERNEL="${LKERNEL#/boot}"
    	  LINITRD="${LINITRD#/boot}"
    	fi
    
            cat << EOF
    menuentry "${LLABEL} (on ${DEVICE})" {
    EOF
    	save_default_entry | sed -e "s/^/\t/"
    	if [ -z "${prepare_boot_cache}" ]; then
    	  prepare_boot_cache="$(prepare_grub_to_access_device ${LBOOT} | sed -e "s/^/\t/")"
    	fi
    	printf '%s\n' "${prepare_boot_cache}"
    	cat <<  EOF
    	linux ${LKERNEL} ${LPARAMS}
    EOF
            if [ -n "${LINITRD}" ] ; then
              cat << EOF
    	initrd ${LINITRD}
    EOF
            fi
            cat << EOF
    }
    EOF
          done
        ;;
        macosx)
          OSXUUID="`grub-probe --target=fs_uuid --device ${DEVICE} 2> /dev/null`"
          osx_entry xnu_kernel 32
          osx_entry xnu_kernel64 64
        ;;
        hurd)
          cat << EOF
    menuentry "${LONGNAME} (on ${DEVICE})" {
    EOF
          save_default_entry | sed -e "s/^/\t/"
          prepare_grub_to_access_device ${DEVICE} | sed -e "s/^/\t/"
          grub_device="`${grub_probe} --device ${DEVICE} --target=drive`"
          mach_device="`echo "${grub_device}" | tr -d '()' | tr , s`"
          grub_fs="`${grub_probe} --device ${DEVICE} --target=fs`"
          case "${grub_fs}" in
    	*fs)	hurd_fs="${grub_fs}" ;;
    	*)	hurd_fs="${grub_fs}fs" ;;
          esac
          cat << EOF
    	multiboot /boot/gnumach.gz root=device:${mach_device}
    	module /hurd/${hurd_fs}.static ${hurd_fs} --readonly \\
    			--multiboot-command-line='\${kernel-command-line}' \\
    			--host-priv-port='\${host-port}' \\
    			--device-master-port='\${device-port}' \\
    			--exec-server-task='\${exec-task}' -T typed '\${root}' \\
    			'\$(task-create)' '\$(task-resume)'
    	module /lib/ld.so.1 exec /hurd/exec '\$(exec-task=task-create)'
    }
    EOF
        ;;
        *)
          echo "  ${LONGNAME} is not yet supported by grub-mkconfig." >&2
        ;;
      esac
    done
    
    adjust_timeout
    Registered Linux User #495429
    --
    AMD Athlon64 4000+ :: Asus A8V Deluxe :: 4 x 512 MB RAM :: Geforce 6600GT :: Xubuntu 10.04/Linux MInt 13 "Mate"/Windows XP Home

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

    Re: Grub 2 Title Tweaks Thread

    Quote Originally Posted by Skara Brae View Post
    Whatever I try, I don't seem to get "Windows Vista (loader) (on /dev/sda1)" changed into "Windows XP Home"
    Skara Brae,

    Your 30_os-prober is a bit different than the one I am working with. It already has a direct entry for "Windows Vista" which makes it likely this file was modified and not the original. But that's okay. We should be able to make one change to get it to say "XP". The green text is the modified area. The red is the title change.

    Make sure you have a copy of your original 30_os-prober file (and that it is unexecutable), then copy this file into /etc/grub.d/ to replace it.

    Code:
    #! /bin/sh -e
    
    # grub-mkconfig helper script.
    # Copyright (C) 2006,2007,2008,2009  Free Software Foundation, Inc.
    #
    # GRUB is free software: you can redistribute it and/or modify
    # it under the terms of the GNU General Public License as published by
    # the Free Software Foundation, either version 3 of the License, or
    # (at your option) any later version.
    #
    # GRUB is distributed in the hope that it will be useful,
    # but WITHOUT ANY WARRANTY; without even the implied warranty of
    # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    # GNU General Public License for more details.
    #
    # You should have received a copy of the GNU General Public License
    # along with GRUB.  If not, see <http://www.gnu.org/licenses/>.
    
    prefix=/usr
    exec_prefix=${prefix}
    libdir=${exec_prefix}/lib
    
    . ${libdir}/grub/grub-mkconfig_lib
    
    found_other_os=
    
    adjust_timeout () {
      if [ "x${found_other_os}" = "x" ] ; then
        if [ "x${GRUB_HIDDEN_TIMEOUT}" != "x" ] ; then
          if [ "x${GRUB_HIDDEN_TIMEOUT_QUIET}" = "xtrue" ] ; then
    	verbose=
          else
    	verbose=" --verbose"
          fi
    
          if [ "x${GRUB_HIDDEN_TIMEOUT}" = "x0" ] ; then
    	cat <<EOF
    if [ \${timeout} != -1 ]; then
      if keystatus; then
        if keystatus --shift; then
          set timeout=-1
        else
          set timeout=0
        fi
      else
        if sleep$verbose --interruptible 3 ; then
          set timeout=0
        fi
      fi
    fi
    EOF
          else
    	cat << EOF
    if [ \${timeout} != -1 ]; then
      if sleep$verbose --interruptible ${GRUB_HIDDEN_TIMEOUT} ; then
        set timeout=0
      fi
    fi
    EOF
          fi
        fi
      fi
    }
    
    if [ "x${GRUB_DISABLE_OS_PROBER}" = "xtrue" ]; then
      adjust_timeout
      exit 0
    fi
    
    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
    
    osx_entry() {
            cat << EOF
    menuentry "${LONGNAME} (${2}-bit) (on ${DEVICE})" {
    EOF
    	save_default_entry | sed -e "s/^/\t/"
    	prepare_grub_to_access_device ${DEVICE} | sed -e "s/^/\t/"
    	cat << EOF
            insmod ${GRUB_VIDEO_BACKEND}
            set do_resume=0
            if [ /var/vm/sleepimage -nt10 / ]; then
               if xnu_resume /var/vm/sleepimage; then
                 set do_resume=1
               fi
            fi
            if [ \$do_resume == 0 ]; then
               xnu_uuid ${OSXUUID} uuid
               if [ -f /Extra/DSDT.aml ]; then
                  acpi -e /Extra/DSDT.aml
               fi
               $1 /mach_kernel boot-uuid=\${uuid} rd=*uuid
               if [ /System/Library/Extensions.mkext -nt /System/Library/Extensions ]; then
                  xnu_mkext /System/Library/Extensions.mkext
               else
                  xnu_kextdir /System/Library/Extensions
               fi
               if [ -f /Extra/Extensions.mkext ]; then
                  xnu_mkext /Extra/Extensions.mkext
               fi
               if [ -d /Extra/Extensions ]; then
                  xnu_kextdir /Extra/Extensions
               fi
               if [ -f /Extra/devprop.bin ]; then
                  xnu_devprop_load /Extra/devprop.bin
               fi
               if [ -f /Extra/splash.jpg ]; then
                  insmod jpeg
                  xnu_splash /Extra/splash.jpg
               fi
               if [ -f /Extra/splash.png ]; then
                  insmod png
                  xnu_splash /Extra/splash.png
               fi
               if [ -f /Extra/splash.tga ]; then
                  insmod tga
                  xnu_splash /Extra/splash.tga
               fi
            fi
    }
    EOF
    }
    
    for OS in ${OSPROBED} ; do
      DEVICE="`echo ${OS} | cut -d ':' -f 1`"
      LONGNAME="`echo ${OS} | cut -d ':' -f 2 | tr '^' ' '`"
      LABEL="`echo ${OS} | cut -d ':' -f 3 | tr '^' ' '`"
      BOOT="`echo ${OS} | cut -d ':' -f 4`"
    
      if [ -z "${LONGNAME}" ] ; then
        LONGNAME="${LABEL}"
      fi
    
    
    
      if [ "${LONGNAME}" = "Windows Vista (loader)" ] ; then
    LONGNAME="Windows XP"
      fi
    
      echo "Found ${LONGNAME} on ${DEVICE}" >&2
      found_other_os=1
    
      case ${BOOT} in
        chain)
    
          cat << EOF
    menuentry "${LONGNAME} (on ${DEVICE})" {
    EOF
          save_default_entry | sed -e "s/^/\t/"
          prepare_grub_to_access_device ${DEVICE} | sed -e "s/^/\t/"
    
          case ${LONGNAME} in
            Windows\ Vista*|Windows\ 7*)
    	;;
    	*)
    	  cat << EOF
    	drivemap -s (hd0) \${root}
    EOF
    	;;
          esac
    
          cat <<EOF
    	chainloader +1
    }
    EOF
    
        ;;
        linux)
          LINUXPROBED="`linux-boot-prober ${DEVICE} 2> /dev/null | tr ' ' '^' | paste -s -d ' '`"
          prepare_boot_cache=
    
          for LINUX in ${LINUXPROBED} ; do
            LROOT="`echo ${LINUX} | cut -d ':' -f 1`"
            LBOOT="`echo ${LINUX} | cut -d ':' -f 2`"
            LLABEL="`echo ${LINUX} | cut -d ':' -f 3 | tr '^' ' '`"
            LKERNEL="`echo ${LINUX} | cut -d ':' -f 4`"
            LINITRD="`echo ${LINUX} | cut -d ':' -f 5`"
            LPARAMS="`echo ${LINUX} | cut -d ':' -f 6- | tr '^' ' '`"
    
            if [ -z "${LLABEL}" ] ; then
              LLABEL="${LONGNAME}"
            fi
    
    	if [ "${LROOT}" != "${LBOOT}" ]; then
    	  LKERNEL="${LKERNEL#/boot}"
    	  LINITRD="${LINITRD#/boot}"
    	fi
    
            cat << EOF
    menuentry "${LLABEL} (on ${DEVICE})" {
    EOF
    	save_default_entry | sed -e "s/^/\t/"
    	if [ -z "${prepare_boot_cache}" ]; then
    	  prepare_boot_cache="$(prepare_grub_to_access_device ${LBOOT} | sed -e "s/^/\t/")"
    	fi
    	printf '%s\n' "${prepare_boot_cache}"
    	cat <<  EOF
    	linux ${LKERNEL} ${LPARAMS}
    EOF
            if [ -n "${LINITRD}" ] ; then
              cat << EOF
    	initrd ${LINITRD}
    EOF
            fi
            cat << EOF
    }
    EOF
          done
        ;;
        macosx)
          OSXUUID="`grub-probe --target=fs_uuid --device ${DEVICE} 2> /dev/null`"
          osx_entry xnu_kernel 32
          osx_entry xnu_kernel64 64
        ;;
        hurd)
          cat << EOF
    menuentry "${LONGNAME} (on ${DEVICE})" {
    EOF
          save_default_entry | sed -e "s/^/\t/"
          prepare_grub_to_access_device ${DEVICE} | sed -e "s/^/\t/"
          grub_device="`${grub_probe} --device ${DEVICE} --target=drive`"
          mach_device="`echo "${grub_device}" | tr -d '()' | tr , s`"
          grub_fs="`${grub_probe} --device ${DEVICE} --target=fs`"
          case "${grub_fs}" in
    	*fs)	hurd_fs="${grub_fs}" ;;
    	*)	hurd_fs="${grub_fs}fs" ;;
          esac
          cat << EOF
    	multiboot /boot/gnumach.gz root=device:${mach_device}
    	module /hurd/${hurd_fs}.static ${hurd_fs} --readonly \\
    			--multiboot-command-line='\${kernel-command-line}' \\
    			--host-priv-port='\${host-port}' \\
    			--device-master-port='\${device-port}' \\
    			--exec-server-task='\${exec-task}' -T typed '\${root}' \\
    			'\$(task-create)' '\$(task-resume)'
    	module /lib/ld.so.1 exec /hurd/exec '\$(exec-task=task-create)'
    }
    EOF
        ;;
        *)
          echo "  ${LONGNAME} is not yet supported by grub-mkconfig." >&2
        ;;
      esac
    done
    
    adjust_timeout
    Run "sudo update-grub" and hopefully you will see "Windows XP" as it finds your 'other' OS.
    GRUB2

    Retired.

  5. #105
    Join Date
    Sep 2008
    Beans
    4

    Re: Grub 2 Title Tweaks Thread

    i did grub timeout = 0

    then i can not see my ubuntu boot loader

    machine is directly boot to windows

    how can i change it back grub timeout = 2

    please help me

    thanks
    Nyi

  6. #106
    Join Date
    May 2008
    Location
    0032
    Beans
    68
    Distro
    Xubuntu 10.04 Lucid Lynx

    Re: Grub 2 Title Tweaks Thread

    *Skara Brae reporting back in...*

    Yes!

    drs305, I copied the coloured text in 'your' 30_os-prober into mine: now it says "Windows XP Home" instead of Windows Vista (I added the "Home").

    I only added those few lines (and commented out another part) and that's it? Why couldn't I do that myself??
    Well, don't we feel foolish...

    Quote Originally Posted by drs305 View Post
    Skara Brae,

    Your 30_os-prober is a bit different than the one I am working with. It already has a direct entry for "Windows Vista" which makes it likely this file was modified and not the original.
    I did not change anything in my original 30_os-prober (I didn't even know about the new GRUB version), so it was the original. If I had changed it, then I would have mentioned that, of course: no use messing something up and then asking for help on a forum, while not telling that I would have messed up.

    In any case, now the GRUB menu on my machine looks the way it should be. XP is not Vista, and I kind of am a perfectionist

    drs305,
    I thank you very much.

    -oo-

    I still have Windows, because there are a few Windows-only programs that I really don't want to be without (like "PhotoPAINT" from COREL; The GIMP is _no_ alternative, I'd rather work with MS Paint than with The GIMP, no offense). Those few programs are the only reason why I still have "Wintendo" (as a guy from IT at work calls it).

    Microsoft Windows is the most unreliable thing I have ever worked with in my entire life. I "hate" it. What a difference (both) GNU/Linux and OS X are.
    Registered Linux User #495429
    --
    AMD Athlon64 4000+ :: Asus A8V Deluxe :: 4 x 512 MB RAM :: Geforce 6600GT :: Xubuntu 10.04/Linux MInt 13 "Mate"/Windows XP Home

  7. #107
    Join Date
    Aug 2008
    Beans
    543

    Re: Grub 2 Title Tweaks Thread

    Very nice guide. Thx for writing this.

  8. #108
    Join Date
    May 2007
    Location
    The New Forest
    Beans
    Hidden!
    Distro
    Xubuntu Development Release

    Re: Grub 2 Title Tweaks Thread

    Quote Originally Posted by nyihtut100 View Post
    i did grub timeout = 0

    then i can not see my ubuntu boot loader

    machine is directly boot to windows

    how can i change it back grub timeout = 2

    please help me

    thanks
    Nyi
    Press shift while grub loads so you see the menu again - choose ubuntu -
    Code:
    gksudo gedit /etc/default/grub
    Do the changes - save and close then run

    Code:
    sudo update-grub
    https://help.ubuntu.com/community/Gr...ing%20GRUB%202
    Forum Social IRC Channel
    Xubuntu IRC Support
    Xubuntu Support

    Please do not PM me about Registration issues without having been asked to. I will tell you to post here

  9. #109
    Join Date
    Jun 2009
    Beans
    24
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: Grub 2 Title Tweaks Thread

    Well, I seem to have hit a snag. I want my GRUB2 menu to have two entries: One that says simply "Ubuntu" and one that says "Windows 7"

    I've got the one that says "Windows 7" down pat.


    But the one that should say "Ubuntu" says "Ubuntu, with Linux false"

    Can anyone help me figure it out?

    Currently, my 10_linux script looks like this:

    Code:
    #! /bin/sh -e
    
    # grub-mkconfig helper script.
    # Copyright (C) 2006,2007,2008,2009,2010  Free Software Foundation, Inc.
    #
    # GRUB is free software: you can redistribute it and/or modify
    # it under the terms of the GNU General Public License as published by
    # the Free Software Foundation, either version 3 of the License, or
    # (at your option) any later version.
    #
    # GRUB is distributed in the hope that it will be useful,
    # but WITHOUT ANY WARRANTY; without even the implied warranty of
    # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    # GNU General Public License for more details.
    #
    # You should have received a copy of the GNU General Public License
    # along with GRUB.  If not, see <http://www.gnu.org/licenses/>.
    
    prefix=/usr
    exec_prefix=${prefix}
    bindir=${exec_prefix}/bin
    libdir=${exec_prefix}/lib
    . ${libdir}/grub/grub-mkconfig_lib
    
    export TEXTDOMAIN=grub
    export TEXTDOMAINDIR=@LOCALEDIR@
    
    CLASS="--class gnu-linux --class gnu --class os"
    
    if [ "x${GRUB_DISTRIBUTOR}" = "x" ] ; then
      OS=GNU/Linux
    else
      OS="${GRUB_DISTRIBUTOR}"
      CLASS="--class $(echo ${GRUB_DISTRIBUTOR} | tr '[A-Z]' '[a-z]' | cut -d' ' -f1) ${CLASS}"
    fi
    
    # loop-AES arranges things so that /dev/loop/X can be our root device, but
    # the initrds that Linux uses don't like that.
    case ${GRUB_DEVICE} in
      /dev/loop/*|/dev/loop[0-9])
        GRUB_DEVICE=`losetup ${GRUB_DEVICE} | sed -e "s/^[^(]*(\([^)]\+\)).*/\1/"`
        # We can't cope with devices loop-mounted from files here.
        case ${GRUB_DEVICE} in
          /dev/*) ;;
          *) exit 0 ;;
        esac
      ;;
    esac
    
    if [ "x${GRUB_DEVICE_UUID}" = "x" ] || [ "x${GRUB_DISABLE_LINUX_UUID}" = "xtrue" ] \
        || ! test -e "/dev/disk/by-uuid/${GRUB_DEVICE_UUID}" \
        || [ "`grub-probe -t abstraction --device ${GRUB_DEVICE} | sed -e 's,.*\(lvm\).*,\1,'`" = "lvm"  ] ; then
      LINUX_ROOT_DEVICE=${GRUB_DEVICE}
    else
      LINUX_ROOT_DEVICE=UUID=${GRUB_DEVICE_UUID}
    fi
    
    # add crashkernel option if we have the required tools
    if [ -x "/usr/bin/makedumpfile" ] && [ -x "/sbin/kexec" ]; then
        GRUB_CMDLINE_EXTRA="$GRUB_CMDLINE_EXTRA crashkernel=384M-2G:64M,2G-:128M"
    fi
    
    linux_entry ()
    {
      os="$1"
      version="$2"
      recovery="$3"
      args="$4"
      if ${recovery} ; then
        title="$(gettext_quoted "%s, with Linux %s (recovery mode)")"
      else
        title="$(gettext_quoted "%s, with Linux %s")"
      fi
      printf "menuentry '${title}' ${CLASS} {\n" "${os}" "${version}"
      cat << EOF
    	recordfail
    EOF
      save_default_entry | sed -e "s/^/\t/"
    
      if [ "x$GRUB_GFXPAYLOAD_LINUX" != x ]; then
    	  cat << EOF
    	set gfxpayload=$GRUB_GFXPAYLOAD_LINUX
    EOF
      fi
    
      if [ -z "${prepare_boot_cache}" ]; then
        prepare_boot_cache="$(prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} | sed -e "s/^/\t/")"
      fi
      printf '%s\n' "${prepare_boot_cache}"
      if [ "x$5" != "xquiet" ]; then
        cat << EOF
    	echo	'$(printf "$(gettext_quoted "Loading Linux %s ...")" ${version})'
    EOF
      fi
      cat << EOF
    	linux	${rel_dirname}/${basename} root=${linux_root_device_thisversion} ro ${args}
    EOF
      if [ "x$5" != "xquiet" ]; then
        cat << EOF
    	echo	'$(gettext_quoted "Loading initial ramdisk ...")'
    EOF
      fi
      if test -n "${initrd}" ; then
        cat << EOF
    	initrd	${rel_dirname}/${initrd}
    EOF
      fi
      cat << EOF
    }
    EOF
    }
    
    list=`for i in /boot/vmlinu[xz]-* /vmlinu[xz]-* ; do
            if grub_file_is_not_garbage "$i" ; then echo -n "$i " ; fi
          done`
    prepare_boot_cache=
    
    while [ "x$list" != "x" ] ; do
      linux=`version_find_latest $list`
      echo "Found linux image: $linux" >&2
      basename=`basename $linux`
      dirname=`dirname $linux`
      rel_dirname=`make_system_path_relative_to_its_root $dirname`
      version=`echo $basename | sed -e "s,^[^0-9]*-,,g"`
      alt_version=`echo $version | sed -e "s,\.old$,,g"`
      linux_root_device_thisversion="${LINUX_ROOT_DEVICE}"
    # User-added variable
      codename="`lsb_release -cs`"
      codename="`echo $codename | tr [hjkl] [HJKL]`"
      version_no_generic="`echo ${version} | cut -d "-" -f 1-2`"
    
      initrd=
      for i in "initrd.img-${version}" "initrd-${version}.img" \
    	   "initrd-${version}" "initrd.img-${alt_version}" \
    	   "initrd-${alt_version}.img" "initrd-${alt_version}"; do
        if test -e "${dirname}/${i}" ; then
          initrd="$i"
          break
        fi
      done
      if test -n "${initrd}" ; then
        echo "Found initrd image: ${dirname}/${initrd}" >&2
      else
        # "UUID=" magic is parsed by initrds.  Since there's no initrd, it can't work here.
        linux_root_device_thisversion=${GRUB_DEVICE}
      fi
    
      linux_entry "${OS}" false\
          "${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_EXTRA} ${GRUB_CMDLINE_LINUX_DEFAULT}" \
          quiet
      if [ "x${GRUB_DISABLE_LINUX_RECOVERY}" != "xtrue" ]; then
        linux_entry "${OS}" true\
    	"single ${GRUB_CMDLINE_LINUX}"
      fi
    
      list=`echo $list | tr ' ' '\n' | grep -vx $linux | tr '\n' ' '`
    done

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

    Re: Grub 2 Title Tweaks Thread

    Added: Go to Post 112 for the solution to ssaint04's request.

    I imported your 10_linux file into my system and ran update-grub. It generated an error message about "quiet" but the problem really lies in this line:
    linux_entry "${OS}" false\
    Change it to the following, adding a space between false and \. Then run "sudo update-grub" and see if that fixes things for you:
    linux_entry "${OS}" false \
    Last edited by drs305; June 20th, 2010 at 05:56 PM.
    GRUB2

    Retired.

Page 11 of 24 FirstFirst ... 91011121321 ... 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
  •