tuckprodigy
May 7th, 2011, 05:17 PM
I have several kernel versions showing up in my GRUB menu that I can't seem to remove. They aren't causing any trouble, I would just like that menu to be cleaner and would appreciate any help you may be able to provide. To the best I can tell, I'm not that proficient a linux user, it appears the old kernel versions are not "installed", but still show up in the grub menu so there must be entries somewhere or something?
I have tried the following:
1. Synaptic Package manager - I've marked all linux-image and linux-header entries for complete removal. When I go back into the package manager they are indeed unchecked as being not installed. I have rebooted though and the entries are still present in the GRUB menu
2. Ubuntu Tweak - I cleared all package, cache and config stuff because it all appeared to be just noise. There was nothing in the kernel section at this time to remove so it appears that Ubuntu Tweak assumed they were in fact removed.
3. Tried StartUp manager - not much help here. Gives me a drop down with default operating system options, but all that is listed is my current kernel version, recovery mode, memtest and my windows OS.
4. Tried some terminal stuff - "sudo apt-get remove --purge 2.6.35-22-Generic" returned the following text:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'linux-backports-modules-alsa-2.6.35-22-generic' for regex '2.6.35-22-Generic'
Note, selecting 'linux-image-2.6.35-22-generic' for regex '2.6.35-22-Generic'
Note, selecting 'linux-backports-modules-alsa-2.6.35-22-generic-pae' for regex '2.6.35-22-Generic'
Note, selecting 'linux-image-2.6.35-22-generic-pae' for regex '2.6.35-22-Generic'
Note, selecting 'linux-headers-lbm-2.6.35-22-generic' for regex '2.6.35-22-Generic'
Note, selecting 'linux-headers-lbm-2.6.35-22-generic-pae' for regex '2.6.35-22-Generic'
Note, selecting 'linux-backports-modules-net-2.6.35-22-generic' for regex '2.6.35-22-Generic'
Note, selecting 'linux-backports-modules-net-2.6.35-22-generic-pae' for regex '2.6.35-22-Generic'
Note, selecting 'linux-backports-modules-wireless-2.6.35-22-generic' for regex '2.6.35-22-Generic'
Note, selecting 'linux-backports-modules-wireless-2.6.35-22-generic-pae' for regex '2.6.35-22-Generic'
Note, selecting 'linux-headers-2.6.35-22-generic' for regex '2.6.35-22-Generic'
Note, selecting 'linux-headers-2.6.35-22-generic-pae' for regex '2.6.35-22-Generic'
Package linux-backports-modules-alsa-2.6.35-22-generic is not installed, so not removed
Package linux-backports-modules-alsa-2.6.35-22-generic-pae is not installed, so not removed
Package linux-backports-modules-net-2.6.35-22-generic is not installed, so not removed
Package linux-backports-modules-net-2.6.35-22-generic-pae is not installed, so not removed
Package linux-backports-modules-wireless-2.6.35-22-generic is not installed, so not removed
Package linux-backports-modules-wireless-2.6.35-22-generic-pae is not installed, so not removed
Package linux-headers-lbm-2.6.35-22-generic is not installed, so not removed
Package linux-headers-lbm-2.6.35-22-generic-pae is not installed, so not removed
Package linux-headers-2.6.35-22-generic is not installed, so not removed
Package linux-headers-2.6.35-22-generic-pae is not installed, so not removed
Package linux-image-2.6.35-22-generic is not installed, so not removed
Package linux-image-2.6.35-22-generic-pae is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 11 not upgraded.
5. Editing grub files - first off, this file only shows my current kernel version - 2.6.35-28-generic and recovery. this is my grub.cfg file:
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#
### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
set have_grubenv=true
load_env
fi
set default="0"
if [ "${prev_saved_entry}" ]; then
set saved_entry="${prev_saved_entry}"
save_env saved_entry
set prev_saved_entry=
save_env prev_saved_entry
set boot_once=true
fi
function savedefault {
if [ -z "${boot_once}" ]; then
saved_entry="${chosen}"
save_env saved_entry
fi
}
function recordfail {
set recordfail=1
if [ -n "${have_grubenv}" ]; then if [ -z "${boot_once}" ]; then save_env recordfail; fi; fi
}
function load_video {
insmod vbe
insmod vga
}
insmod part_msdos
insmod ext2
set root='(hd0,msdos3)'
search --no-floppy --fs-uuid --set f87ab903-1d8e-4e7c-b896-b094495b82b3
if loadfont /usr/share/grub/unicode.pf2 ; then
set gfxmode=1280x1024
load_video
insmod gfxterm
fi
terminal_output gfxterm
insmod part_msdos
insmod ext2
set root='(hd0,msdos3)'
search --no-floppy --fs-uuid --set f87ab903-1d8e-4e7c-b896-b094495b82b3
set locale_dir=($root)/boot/grub/locale
set lang=en
insmod gettext
if [ "${recordfail}" = 1 ]; then
set timeout=-1
else
set timeout=10
fi
### END /etc/grub.d/00_header ###
### BEGIN /etc/grub.d/05_debian_theme ###
set menu_color_normal=white/black
set menu_color_highlight=black/light-gray
### END /etc/grub.d/05_debian_theme ###
### BEGIN /etc/grub.d/10_linux ###
menuentry 'Ubuntu, with Linux 2.6.35-28-generic' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod part_msdos
insmod ext2
set root='(hd0,msdos3)'
search --no-floppy --fs-uuid --set f87ab903-1d8e-4e7c-b896-b094495b82b3
linux /boot/vmlinuz-2.6.35-28-generic root=UUID=f87ab903-1d8e-4e7c-b896-b094495b82b3 ro quiet vga=795 quiet splash
initrd /boot/initrd.img-2.6.35-28-generic
}
menuentry 'Ubuntu, with Linux 2.6.35-28-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod part_msdos
insmod ext2
set root='(hd0,msdos3)'
search --no-floppy --fs-uuid --set f87ab903-1d8e-4e7c-b896-b094495b82b3
echo 'Loading Linux 2.6.35-28-generic ...'
linux /boot/vmlinuz-2.6.35-28-generic root=UUID=f87ab903-1d8e-4e7c-b896-b094495b82b3 ro single quiet vga=795
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-2.6.35-28-generic
}
### END /etc/grub.d/10_linux ###
### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###
### BEGIN /etc/grub.d/20_memtest86+ ###
menuentry "Memory test (memtest86+)" {
insmod part_msdos
insmod ext2
set root='(hd0,msdos3)'
search --no-floppy --fs-uuid --set f87ab903-1d8e-4e7c-b896-b094495b82b3
linux16 /boot/memtest86+.bin
}
menuentry "Memory test (memtest86+, serial console 115200)" {
insmod part_msdos
insmod ext2
set root='(hd0,msdos3)'
search --no-floppy --fs-uuid --set f87ab903-1d8e-4e7c-b896-b094495b82b3
linux16 /boot/memtest86+.bin console=ttyS0,115200n8
}
### END /etc/grub.d/20_memtest86+ ###
### BEGIN /etc/grub.d/30_os-prober ###
menuentry "Windows Vista (loader) (on /dev/sda2)" {
insmod part_msdos
insmod ntfs
set root='(hd0,msdos2)'
search --no-floppy --fs-uuid --set a4c8892ec888ffb2
chainloader +1
}
### END /etc/grub.d/30_os-prober ###
### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###
### BEGIN /etc/grub.d/41_custom ###
if [ -f $prefix/custom.cfg ]; then
source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###
This is my grub.d file that I DID edit to read the following - my edits were made to the last entries but this caused no changes at all:
\#! /bin/sh
set -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=${prefix}/share/locale
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}" \
|| uses_abstraction "${GRUB_DEVICE}" 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/"
# Use ELILO's generic "efifb" when it's known to be available.
# FIXME: We need an interface to select vesafb in case efifb can't be used.
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
}
for ver in /boot/vmlinu[zx]-* ; do
list="$ver"
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}"
initrd=
for i in "initrd.img-${version}" "initrd-${version}.img" \
"initrd-${version}" "initramfs-${version}.img" \
"initrd.img-${alt_version}" "initrd-${alt_version}.img" \
"initrd-${alt_version}" "initramfs-${alt_version}.img"; 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} 10.10 Maverick Meerkat" \
"${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_EXTRA} ${GRUB_CMDLINE_LINUX_DEFAULT}" \
quiet
if [ "x${GRUB_DISABLE_LINUX_RECOVERY}" != "xtrue" ]; then
linux_entry "${OS} 10.10 Maverick Meerkat" \
"single ${GRUB_CMDLINE_LINUX}"
fi
list=`echo $list | tr ' ' '\n' | grep -vx $linux | tr '\n' ' '`
done
I'm sorry for the novel, but I have been going crazy about this for a while. There are no system problems so this is purely aesthetic, but at this point it's a matter of principle because I have spent so much time with this. Any thoughts? Am I doomed to have a sloppy GRUB menu?
Thanks for any help you can give!
I have tried the following:
1. Synaptic Package manager - I've marked all linux-image and linux-header entries for complete removal. When I go back into the package manager they are indeed unchecked as being not installed. I have rebooted though and the entries are still present in the GRUB menu
2. Ubuntu Tweak - I cleared all package, cache and config stuff because it all appeared to be just noise. There was nothing in the kernel section at this time to remove so it appears that Ubuntu Tweak assumed they were in fact removed.
3. Tried StartUp manager - not much help here. Gives me a drop down with default operating system options, but all that is listed is my current kernel version, recovery mode, memtest and my windows OS.
4. Tried some terminal stuff - "sudo apt-get remove --purge 2.6.35-22-Generic" returned the following text:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'linux-backports-modules-alsa-2.6.35-22-generic' for regex '2.6.35-22-Generic'
Note, selecting 'linux-image-2.6.35-22-generic' for regex '2.6.35-22-Generic'
Note, selecting 'linux-backports-modules-alsa-2.6.35-22-generic-pae' for regex '2.6.35-22-Generic'
Note, selecting 'linux-image-2.6.35-22-generic-pae' for regex '2.6.35-22-Generic'
Note, selecting 'linux-headers-lbm-2.6.35-22-generic' for regex '2.6.35-22-Generic'
Note, selecting 'linux-headers-lbm-2.6.35-22-generic-pae' for regex '2.6.35-22-Generic'
Note, selecting 'linux-backports-modules-net-2.6.35-22-generic' for regex '2.6.35-22-Generic'
Note, selecting 'linux-backports-modules-net-2.6.35-22-generic-pae' for regex '2.6.35-22-Generic'
Note, selecting 'linux-backports-modules-wireless-2.6.35-22-generic' for regex '2.6.35-22-Generic'
Note, selecting 'linux-backports-modules-wireless-2.6.35-22-generic-pae' for regex '2.6.35-22-Generic'
Note, selecting 'linux-headers-2.6.35-22-generic' for regex '2.6.35-22-Generic'
Note, selecting 'linux-headers-2.6.35-22-generic-pae' for regex '2.6.35-22-Generic'
Package linux-backports-modules-alsa-2.6.35-22-generic is not installed, so not removed
Package linux-backports-modules-alsa-2.6.35-22-generic-pae is not installed, so not removed
Package linux-backports-modules-net-2.6.35-22-generic is not installed, so not removed
Package linux-backports-modules-net-2.6.35-22-generic-pae is not installed, so not removed
Package linux-backports-modules-wireless-2.6.35-22-generic is not installed, so not removed
Package linux-backports-modules-wireless-2.6.35-22-generic-pae is not installed, so not removed
Package linux-headers-lbm-2.6.35-22-generic is not installed, so not removed
Package linux-headers-lbm-2.6.35-22-generic-pae is not installed, so not removed
Package linux-headers-2.6.35-22-generic is not installed, so not removed
Package linux-headers-2.6.35-22-generic-pae is not installed, so not removed
Package linux-image-2.6.35-22-generic is not installed, so not removed
Package linux-image-2.6.35-22-generic-pae is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 11 not upgraded.
5. Editing grub files - first off, this file only shows my current kernel version - 2.6.35-28-generic and recovery. this is my grub.cfg file:
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#
### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
set have_grubenv=true
load_env
fi
set default="0"
if [ "${prev_saved_entry}" ]; then
set saved_entry="${prev_saved_entry}"
save_env saved_entry
set prev_saved_entry=
save_env prev_saved_entry
set boot_once=true
fi
function savedefault {
if [ -z "${boot_once}" ]; then
saved_entry="${chosen}"
save_env saved_entry
fi
}
function recordfail {
set recordfail=1
if [ -n "${have_grubenv}" ]; then if [ -z "${boot_once}" ]; then save_env recordfail; fi; fi
}
function load_video {
insmod vbe
insmod vga
}
insmod part_msdos
insmod ext2
set root='(hd0,msdos3)'
search --no-floppy --fs-uuid --set f87ab903-1d8e-4e7c-b896-b094495b82b3
if loadfont /usr/share/grub/unicode.pf2 ; then
set gfxmode=1280x1024
load_video
insmod gfxterm
fi
terminal_output gfxterm
insmod part_msdos
insmod ext2
set root='(hd0,msdos3)'
search --no-floppy --fs-uuid --set f87ab903-1d8e-4e7c-b896-b094495b82b3
set locale_dir=($root)/boot/grub/locale
set lang=en
insmod gettext
if [ "${recordfail}" = 1 ]; then
set timeout=-1
else
set timeout=10
fi
### END /etc/grub.d/00_header ###
### BEGIN /etc/grub.d/05_debian_theme ###
set menu_color_normal=white/black
set menu_color_highlight=black/light-gray
### END /etc/grub.d/05_debian_theme ###
### BEGIN /etc/grub.d/10_linux ###
menuentry 'Ubuntu, with Linux 2.6.35-28-generic' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod part_msdos
insmod ext2
set root='(hd0,msdos3)'
search --no-floppy --fs-uuid --set f87ab903-1d8e-4e7c-b896-b094495b82b3
linux /boot/vmlinuz-2.6.35-28-generic root=UUID=f87ab903-1d8e-4e7c-b896-b094495b82b3 ro quiet vga=795 quiet splash
initrd /boot/initrd.img-2.6.35-28-generic
}
menuentry 'Ubuntu, with Linux 2.6.35-28-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod part_msdos
insmod ext2
set root='(hd0,msdos3)'
search --no-floppy --fs-uuid --set f87ab903-1d8e-4e7c-b896-b094495b82b3
echo 'Loading Linux 2.6.35-28-generic ...'
linux /boot/vmlinuz-2.6.35-28-generic root=UUID=f87ab903-1d8e-4e7c-b896-b094495b82b3 ro single quiet vga=795
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-2.6.35-28-generic
}
### END /etc/grub.d/10_linux ###
### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###
### BEGIN /etc/grub.d/20_memtest86+ ###
menuentry "Memory test (memtest86+)" {
insmod part_msdos
insmod ext2
set root='(hd0,msdos3)'
search --no-floppy --fs-uuid --set f87ab903-1d8e-4e7c-b896-b094495b82b3
linux16 /boot/memtest86+.bin
}
menuentry "Memory test (memtest86+, serial console 115200)" {
insmod part_msdos
insmod ext2
set root='(hd0,msdos3)'
search --no-floppy --fs-uuid --set f87ab903-1d8e-4e7c-b896-b094495b82b3
linux16 /boot/memtest86+.bin console=ttyS0,115200n8
}
### END /etc/grub.d/20_memtest86+ ###
### BEGIN /etc/grub.d/30_os-prober ###
menuentry "Windows Vista (loader) (on /dev/sda2)" {
insmod part_msdos
insmod ntfs
set root='(hd0,msdos2)'
search --no-floppy --fs-uuid --set a4c8892ec888ffb2
chainloader +1
}
### END /etc/grub.d/30_os-prober ###
### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###
### BEGIN /etc/grub.d/41_custom ###
if [ -f $prefix/custom.cfg ]; then
source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###
This is my grub.d file that I DID edit to read the following - my edits were made to the last entries but this caused no changes at all:
\#! /bin/sh
set -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=${prefix}/share/locale
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}" \
|| uses_abstraction "${GRUB_DEVICE}" 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/"
# Use ELILO's generic "efifb" when it's known to be available.
# FIXME: We need an interface to select vesafb in case efifb can't be used.
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
}
for ver in /boot/vmlinu[zx]-* ; do
list="$ver"
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}"
initrd=
for i in "initrd.img-${version}" "initrd-${version}.img" \
"initrd-${version}" "initramfs-${version}.img" \
"initrd.img-${alt_version}" "initrd-${alt_version}.img" \
"initrd-${alt_version}" "initramfs-${alt_version}.img"; 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} 10.10 Maverick Meerkat" \
"${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_EXTRA} ${GRUB_CMDLINE_LINUX_DEFAULT}" \
quiet
if [ "x${GRUB_DISABLE_LINUX_RECOVERY}" != "xtrue" ]; then
linux_entry "${OS} 10.10 Maverick Meerkat" \
"single ${GRUB_CMDLINE_LINUX}"
fi
list=`echo $list | tr ' ' '\n' | grep -vx $linux | tr '\n' ' '`
done
I'm sorry for the novel, but I have been going crazy about this for a while. There are no system problems so this is purely aesthetic, but at this point it's a matter of principle because I have spent so much time with this. Any thoughts? Am I doomed to have a sloppy GRUB menu?
Thanks for any help you can give!