2011-07-25 07:01:42 +02:00
|
|
|
# Flag to trigger /etc/init.d/purge-kernels on next reboot (fate#312018)
|
|
|
|
touch /boot/do_purge_kernels
|
|
|
|
|
2008-10-12 00:19:34 +02:00
|
|
|
suffix=
|
2016-06-26 16:47:43 +02:00
|
|
|
if test "@FLAVOR@" = "vanilla"; then
|
|
|
|
suffix=-@FLAVOR@
|
|
|
|
fi
|
2008-10-12 00:19:34 +02:00
|
|
|
for x in /boot/@IMAGE@ /boot/initrd; do
|
|
|
|
rm -f $x$suffix
|
2009-05-20 10:59:36 +02:00
|
|
|
ln -s ${x##*/}-@KERNELRELEASE@-@FLAVOR@ $x$suffix
|
2008-10-12 00:19:34 +02:00
|
|
|
done
|
|
|
|
|
2019-07-10 11:03:09 +02:00
|
|
|
# Add symlinks of compatible modules to /lib/modules/$krel/weak-updates/,
|
2008-10-14 18:16:00 +02:00
|
|
|
# run depmod and mkinitrd
|
|
|
|
wm2=/usr/lib/module-init-tools/weak-modules2
|
|
|
|
if [ -x $wm2 ]; then
|
|
|
|
if [ @BASE_PACKAGE@ = 1 ]; then
|
2009-05-20 10:59:36 +02:00
|
|
|
/bin/bash -${-/e/} $wm2 --add-kernel @KERNELRELEASE@-@FLAVOR@
|
2008-10-14 18:16:00 +02:00
|
|
|
else
|
2008-10-16 14:49:50 +02:00
|
|
|
nvr=@SUBPACKAGE@-@RPM_VERSION_RELEASE@
|
2009-05-20 10:59:36 +02:00
|
|
|
rpm -ql $nvr | /bin/bash -${-/e/} $wm2 --add-kernel-modules @KERNELRELEASE@-@FLAVOR@
|
2008-10-16 14:49:50 +02:00
|
|
|
fi
|
2009-08-26 22:31:04 +02:00
|
|
|
else
|
2019-07-10 11:03:09 +02:00
|
|
|
echo "$wm2 does not exist, please run depmod and mkinitrd manually" >&2
|
2008-07-18 12:15:21 +02:00
|
|
|
fi
|
|
|
|
|
|
|
|
message_install_bl () {
|
|
|
|
echo "You may need to setup and install the boot loader using the"
|
|
|
|
echo "available bootloader for your platform (e.g. grub, lilo, zipl, ...)."
|
|
|
|
}
|
|
|
|
|
|
|
|
run_bootloader () {
|
|
|
|
if [ -f /etc/sysconfig/bootloader ] &&
|
|
|
|
[ -f /boot/grub/menu.lst -o \
|
|
|
|
-f /etc/lilo.conf -o \
|
|
|
|
-f /etc/elilo.conf -o \
|
2014-08-18 08:02:31 +02:00
|
|
|
-f /etc/zipl.conf -o \
|
|
|
|
-f /etc/default/grub ]
|
2008-07-18 12:15:21 +02:00
|
|
|
then
|
|
|
|
return 0
|
|
|
|
else
|
|
|
|
return 1
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2008-10-14 18:16:00 +02:00
|
|
|
if [ -f /etc/fstab -a ! -e /.buildenv ] ; then
|
2008-07-18 12:15:21 +02:00
|
|
|
# only run the bootloader if the usual bootloader configuration
|
|
|
|
# files are there -- this is different on every architecture
|
2009-05-20 10:59:36 +02:00
|
|
|
initrd=initrd-@KERNELRELEASE@-@FLAVOR@
|
2015-02-12 08:04:40 +01:00
|
|
|
if [ @FLAVOR@ = rt ]; then
|
|
|
|
default=force-default
|
|
|
|
fi
|
2009-05-20 10:59:36 +02:00
|
|
|
if [ -e /boot/$initrd -o ! -e /lib/modules/@KERNELRELEASE@-@FLAVOR@ ] && \
|
2008-10-12 00:19:34 +02:00
|
|
|
run_bootloader ; then
|
2008-10-16 14:49:50 +02:00
|
|
|
[ -e /boot/$initrd ] || initrd=
|
2008-07-18 12:15:21 +02:00
|
|
|
if [ -x /usr/lib/bootloader/bootloader_entry ]; then
|
|
|
|
/usr/lib/bootloader/bootloader_entry \
|
|
|
|
add \
|
|
|
|
@FLAVOR@ \
|
2009-05-20 10:59:36 +02:00
|
|
|
@KERNELRELEASE@-@FLAVOR@ \
|
|
|
|
@IMAGE@-@KERNELRELEASE@-@FLAVOR@ \
|
2015-02-12 08:04:40 +01:00
|
|
|
$initrd \
|
|
|
|
$default
|
2008-07-18 12:15:21 +02:00
|
|
|
else
|
|
|
|
message_install_bl
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
message_install_bl
|
|
|
|
fi
|
|
|
|
|
|
|
|
# vim: set sts=4 sw=4 ts=8 noet:
|