1 if [ -L /boot/vmlinux ]; then
3 elif [ -L /boot/vmlinuz ]; then
5 elif [ -L /boot/image ]; then
8 # nothing to do (UML kernels for example).
15 SHORTNM=-${SHORTNM##*-}
22 if [ "$(readlink /boot/$image$SHORTNM)" = $image-%ver_str ]; then
23 # This may be the last kernel RPM on the system, or it may
24 # be an update. In both of those cases the symlinks will
25 # eventually be correct. Only if this kernel
26 # is removed and other kernel rpms remain installed,
27 # find the most recent of the remaining kernels, and make
28 # the symlinks point to it. This makes sure that the boot
29 # manager will always have a kernel to boot in its default
32 for img in $(cd /boot ; ls -dt $image-*$SHORTNM); do
33 initrd=initrd-${img#*-}
34 if [ -f /boot/$img -a -f /boot/$initrd ]; then
35 relink $img /boot/${img%%%%-*}$SHORTNM
36 relink $initrd /boot/${initrd%%%%-*}$SHORTNM
38 # Notify the boot loader that a new kernel image is active.
39 if [ -x /sbin/new-kernel-pkg ]; then
40 /sbin/new-kernel-pkg $(/sbin/get_kernel_version /boot/$img)
48 # remove the bootloader entry for the kernel being removed
49 if [ -x /usr/lib/bootloader/bootloader_entry ]; then
50 # handle 10.2 and SLES10 SP1
51 /usr/lib/bootloader/bootloader_entry \
57 elif [ -x /sbin/update-bootloader ]; then
58 # handle 10.1 and SLES10 GA
59 /sbin/update-bootloader --image /boot/vmlinuz-%ver_str \
60 --initrd /boot/initrd-%ver_str \
62 /sbin/update-bootloader --refresh
65 # Check whether there is a .previous link to the image we're about
66 # to remove or to the image we point the new symlink to (so .previous
67 # would be identical to the current symlink)
68 case "$(readlink /boot/$image$SHORTNM.previous)" in
69 $image-%ver_str|$(readlink /boot/$image$SHORTNM))
70 rm -f /boot/$image$SHORTNM.previous ;;
72 case "$(readlink /boot/initrd$SHORTNM.previous)" in
73 initrd-%ver_str|$(readlink /boot/initrd$SHORTNM))
74 rm -f /boot/initrd$SHORTNM.previous ;;
77 rm -f /boot/initrd-%ver_str