Fix selection of Grub version.
This commit is contained in:
parent
4176622975
commit
20ca5135f1
|
@ -31,15 +31,18 @@ for f in System.map config vmlinuz kernel-genkernel initramfs; do
|
|||
done
|
||||
mount -o remount,ro -force /boot
|
||||
|
||||
# updating grub menu
|
||||
# Updating Grub config
|
||||
echo "Updating Grub menu"
|
||||
[ -f /boot/grub/grub.conf ] && \
|
||||
sed -i "s~\/boot\/vmlinuz-[0-9][^ ]*~\/boot\/vmlinuz-$REVISION~g;
|
||||
if [ `which grub2-mkconfig 2>/dev/null` ]; then
|
||||
[ -f /boot/grub/grub.cfg ] && grub2-mkconfig -o /boot/grub/grub.cfg
|
||||
[ -f /boot/grub2/grub.cfg ] && grub2-mkconfig -o /boot/grub2/grub.cfg
|
||||
else
|
||||
[ -f /boot/grub/grub.conf ] && \
|
||||
sed -i "s~\/boot\/vmlinuz-[0-9][^ ]*~\/boot\/vmlinuz-$REVISION~g;
|
||||
s~\/boot\/kernel-genkernel-`uname -m`-[0-9][^ ]*~\/boot\/kernel-genkernel-`uname -m`-$REVISION~g;
|
||||
s~\/boot\/initramfs-[0-9][^ ]*~\/boot\/initramfs-$REVISION.img~g" \
|
||||
/boot/grub/grub.conf
|
||||
|
||||
[ -f /boot/grub2/grub.cfg ] && grub2-mkconfig -o /boot/grub2/grub.cfg
|
||||
fi
|
||||
|
||||
# rm old sources
|
||||
cd /usr/src
|
||||
|
|
|
@ -99,13 +99,18 @@ else
|
|||
which dracut &>/dev/null && $NICE_CMD dracut --hostonly --force /boot/initramfs-$REVISION.img $REVISION
|
||||
fi
|
||||
|
||||
[ -f /boot/grub/grub.conf ] && \
|
||||
sed -i "s~\/boot\/vmlinuz-[0-9][^ ]*~\/boot\/vmlinuz-$REVISION~g;
|
||||
# Updating Grub config
|
||||
echo "Updating Grub menu"
|
||||
if [ `which grub2-mkconfig 2>/dev/null` ]; then
|
||||
[ -f /boot/grub/grub.cfg ] && grub2-mkconfig -o /boot/grub/grub.cfg
|
||||
[ -f /boot/grub2/grub.cfg ] && grub2-mkconfig -o /boot/grub2/grub.cfg
|
||||
else
|
||||
[ -f /boot/grub/grub.conf ] && \
|
||||
sed -i "s~\/boot\/vmlinuz-[0-9][^ ]*~\/boot\/vmlinuz-$REVISION~g;
|
||||
s~\/boot\/kernel-genkernel-`uname -m`-[0-9][^ ]*~\/boot\/kernel-genkernel-`uname -m`-$REVISION~g;
|
||||
s~\/boot\/initramfs-[0-9][^ ]*~\/boot\/initramfs-$REVISION.img~g" \
|
||||
/boot/grub/grub.conf
|
||||
|
||||
[ -f /boot/grub2/grub.cfg ] && grub2-mkconfig -o /boot/grub2/grub.cfg
|
||||
fi
|
||||
|
||||
echo "--------- Rebuilding kernel modules ---------"
|
||||
emerge -1v @module-rebuild
|
||||
|
|
Loading…
Reference in New Issue