* util/grub.d/10_linux.in: Refactor search for initrd. Add
support for initrd names used in Fedora.
This commit is contained in:
parent
fc6e896cc5
commit
942391998a
2 changed files with 23 additions and 5 deletions
|
@ -1,3 +1,8 @@
|
|||
2007-12-19 Pavel Roskin <proski@gnu.org>
|
||||
|
||||
* util/grub.d/10_linux.in: Refactor search for initrd. Add
|
||||
support for initrd names used in Fedora.
|
||||
|
||||
2007-12-26 Bean <bean123ch@gmail.com>
|
||||
|
||||
* conf/common.rmk (pkgdata_MODULES): Add cpio.mod.
|
||||
|
|
|
@ -84,30 +84,43 @@ while [ "x$list" != "x" ] ; do
|
|||
dirname=`dirname $linux`
|
||||
grub_dirname=`echo ${dirname} | sed -e "s%^/boot%${GRUB_DRIVE_BOOT}%g"`
|
||||
version=`echo $basename | sed -e "s,^[^0-9]*-,,g"`
|
||||
|
||||
initrd=
|
||||
for i in "initrd.img-${version}" "initrd-${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
|
||||
fi
|
||||
|
||||
cat << EOF
|
||||
menuentry "${OS}, linux ${version}" {
|
||||
linux ${grub_dirname}/${basename} root=${GRUB_DEVICE} ro ${GRUB_CMDLINE_LINUX}
|
||||
EOF
|
||||
if test -e ${dirname}/initrd.img-${version} ; then
|
||||
echo "Found initrd image: ${dirname}/initrd.img-${version}" >&2
|
||||
if test -n "${initrd}" ; then
|
||||
cat << EOF
|
||||
initrd ${grub_dirname}/initrd.img-${version}
|
||||
initrd ${grub_dirname}/${initrd}
|
||||
EOF
|
||||
fi
|
||||
cat << EOF
|
||||
}
|
||||
EOF
|
||||
|
||||
cat << EOF
|
||||
menuentry "${OS}, linux ${version} (single-user mode)" {
|
||||
linux ${grub_dirname}/${basename} root=${GRUB_DEVICE} ro single ${GRUB_CMDLINE_LINUX}
|
||||
EOF
|
||||
if test -e ${dirname}/initrd.img-${version} ; then
|
||||
if test -n "${initrd}" ; then
|
||||
cat << EOF
|
||||
initrd ${grub_dirname}/initrd.img-${version}
|
||||
initrd ${grub_dirname}/${initrd}
|
||||
EOF
|
||||
fi
|
||||
cat << EOF
|
||||
}
|
||||
EOF
|
||||
|
||||
list=`echo $list | tr ' ' '\n' | grep -vx $linux | tr '\n' ' '`
|
||||
done
|
||||
|
|
Loading…
Reference in a new issue