3
3
# update-grub helper script.
4
# Copyright (C) 2006,2007 Free Software Foundation, Inc.
4
# Copyright (C) 2006,2007,2008 Free Software Foundation, Inc.
6
6
# GRUB is free software: you can redistribute it and/or modify
7
7
# it under the terms of the GNU General Public License as published by
16
16
# You should have received a copy of the GNU General Public License
17
17
# along with GRUB. If not, see <http://www.gnu.org/licenses/>.
19
if [ "x${GRUB_DISTRIBUTOR}" = "" ] ; then
20
exec_prefix=@exec_prefix@
22
. ${libdir}/grub/update-grub_lib
24
if [ "x${GRUB_DISTRIBUTOR}" = "x" ] ; then
22
27
OS="${GRUB_DISTRIBUTOR} GNU/Linux"
84
89
dirname=`dirname $linux`
85
90
grub_dirname=`echo ${dirname} | sed -e "s%^/boot%${GRUB_DRIVE_BOOT}%g"`
86
91
version=`echo $basename | sed -e "s,^[^0-9]*-,,g"`
92
alt_version=`echo $version | sed -e "s,\.old$,,g"`
95
for i in "initrd.img-${version}" "initrd-${version}.img" \
96
"initrd.img-${alt_version}" "initrd-${alt_version}.img"; do
97
if test -e "${dirname}/${i}" ; then
102
if test -n "${initrd}" ; then
103
echo "Found initrd image: ${dirname}/${initrd}" >&2
88
107
menuentry "${OS}, linux ${version}" {
89
108
linux ${grub_dirname}/${basename} root=${GRUB_DEVICE} ro ${GRUB_CMDLINE_LINUX}
91
if test -e ${dirname}/initrd.img-${version} ; then
92
echo "Found initrd image: ${dirname}/initrd.img-${version}" >&2
110
if test -n "${initrd}" ; then
94
initrd ${grub_dirname}/initrd.img-${version}
112
initrd ${grub_dirname}/${initrd}
101
120
menuentry "${OS}, linux ${version} (single-user mode)" {
102
121
linux ${grub_dirname}/${basename} root=${GRUB_DEVICE} ro single ${GRUB_CMDLINE_LINUX}
104
if test -e ${dirname}/initrd.img-${version} ; then
123
if test -n "${initrd}" ; then
106
initrd ${grub_dirname}/initrd.img-${version}
125
initrd ${grub_dirname}/${initrd}
112
132
list=`echo $list | tr ' ' '\n' | grep -vx $linux | tr '\n' ' '`