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
|
done
|
||||||
mount -o remount,ro -force /boot
|
mount -o remount,ro -force /boot
|
||||||
|
|
||||||
# updating grub menu
|
# Updating Grub config
|
||||||
echo "Updating Grub menu"
|
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 ] && \
|
[ -f /boot/grub/grub.conf ] && \
|
||||||
sed -i "s~\/boot\/vmlinuz-[0-9][^ ]*~\/boot\/vmlinuz-$REVISION~g;
|
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\/kernel-genkernel-`uname -m`-[0-9][^ ]*~\/boot\/kernel-genkernel-`uname -m`-$REVISION~g;
|
||||||
s~\/boot\/initramfs-[0-9][^ ]*~\/boot\/initramfs-$REVISION.img~g" \
|
s~\/boot\/initramfs-[0-9][^ ]*~\/boot\/initramfs-$REVISION.img~g" \
|
||||||
/boot/grub/grub.conf
|
/boot/grub/grub.conf
|
||||||
|
fi
|
||||||
[ -f /boot/grub2/grub.cfg ] && grub2-mkconfig -o /boot/grub2/grub.cfg
|
|
||||||
|
|
||||||
# rm old sources
|
# rm old sources
|
||||||
cd /usr/src
|
cd /usr/src
|
||||||
|
|
|
@ -99,13 +99,18 @@ else
|
||||||
which dracut &>/dev/null && $NICE_CMD dracut --hostonly --force /boot/initramfs-$REVISION.img $REVISION
|
which dracut &>/dev/null && $NICE_CMD dracut --hostonly --force /boot/initramfs-$REVISION.img $REVISION
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# 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 ] && \
|
[ -f /boot/grub/grub.conf ] && \
|
||||||
sed -i "s~\/boot\/vmlinuz-[0-9][^ ]*~\/boot\/vmlinuz-$REVISION~g;
|
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\/kernel-genkernel-`uname -m`-[0-9][^ ]*~\/boot\/kernel-genkernel-`uname -m`-$REVISION~g;
|
||||||
s~\/boot\/initramfs-[0-9][^ ]*~\/boot\/initramfs-$REVISION.img~g" \
|
s~\/boot\/initramfs-[0-9][^ ]*~\/boot\/initramfs-$REVISION.img~g" \
|
||||||
/boot/grub/grub.conf
|
/boot/grub/grub.conf
|
||||||
|
fi
|
||||||
[ -f /boot/grub2/grub.cfg ] && grub2-mkconfig -o /boot/grub2/grub.cfg
|
|
||||||
|
|
||||||
echo "--------- Rebuilding kernel modules ---------"
|
echo "--------- Rebuilding kernel modules ---------"
|
||||||
emerge -1v @module-rebuild
|
emerge -1v @module-rebuild
|
||||||
|
|
Loading…
Reference in New Issue