2011-07-25 07:01:42 +02:00
|
|
|
# Flag to trigger /etc/init.d/purge-kernels on next reboot (fate#312018)
|
2021-02-17 09:07:19 +01:00
|
|
|
# ... but avoid the first installion (bsc#1180058)
|
|
|
|
test $1 -gt 1 && touch /boot/do_purge_kernels
|
2011-07-25 07:01:42 +02:00
|
|
|
|
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
|
2021-08-21 10:03:17 +02:00
|
|
|
@USRMERGE@# compat stuff for /boot.
|
|
|
|
@USRMERGE@# if /boot is not a speparate partition we can just link the kernel
|
|
|
|
@USRMERGE@# there to save space. Otherwise copy.
|
|
|
|
@USRMERGE@if mountpoint -q /boot; then
|
|
|
|
@USRMERGE@ copy_or_link="cp -a"
|
|
|
|
@USRMERGE@else
|
|
|
|
@USRMERGE@ copy_or_link="ln -sf"
|
|
|
|
@USRMERGE@fi
|
|
|
|
@USRMERGE@# XXX: need to fix suse-module-tools for sysctl.conf and System.map
|
|
|
|
@USRMERGE@for x in @IMAGE@ sysctl.conf System.map; do
|
|
|
|
@USRMERGE@ if [ ! -e /boot/$x-@KERNELRELEASE@-@FLAVOR@ ]; then
|
|
|
|
@USRMERGE@ $copy_or_link ..@MODULESDIR@/$x /boot/$x-@KERNELRELEASE@-@FLAVOR@
|
|
|
|
@USRMERGE@ if [ -e @MODULESDIR@/.$x.hmac ]; then
|
|
|
|
@USRMERGE@ $copy_or_link ..@MODULESDIR@/.$x.hmac /boot/.$x-@KERNELRELEASE@-@FLAVOR@.hmac
|
|
|
|
@USRMERGE@ fi
|
|
|
|
@USRMERGE@ fi
|
|
|
|
@USRMERGE@done
|
2008-10-12 00:19:34 +02:00
|
|
|
|
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
|
2021-04-14 09:27:17 +02:00
|
|
|
wm2_rc=0
|
2008-10-14 18:16:00 +02:00
|
|
|
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
|
2021-04-14 09:27:17 +02:00
|
|
|
wm2_rc=$?
|
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
|
2021-04-14 09:27:17 +02:00
|
|
|
wm2_rc=-1
|
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
|
|
|
|
}
|
|
|
|
|
2021-04-14 09:27:17 +02:00
|
|
|
rc=0
|
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
|
2021-04-14 09:27:17 +02:00
|
|
|
rc=-1
|
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
|
2021-08-21 10:03:17 +02:00
|
|
|
if [ -e /boot/$initrd -o ! -e @MODULESDIR@ ] && \
|
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
|
2021-04-14 09:27:17 +02:00
|
|
|
rc=$?
|
2008-07-18 12:15:21 +02:00
|
|
|
else
|
|
|
|
message_install_bl
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
message_install_bl
|
|
|
|
fi
|
|
|
|
|
2021-04-14 09:27:17 +02:00
|
|
|
# check if something failed
|
|
|
|
[ $wm2_rc != 0 ] && exit $wm2_rc
|
|
|
|
exit $rc
|
|
|
|
|
2008-07-18 12:15:21 +02:00
|
|
|
# vim: set sts=4 sw=4 ts=8 noet:
|