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 # Check whether there is a .previous link to the image we're about
49 # to remove or to the image we point the new symlink to (so .previous
50 # would be identical to the current symlink)
51 case "$(readlink /boot/$image$SHORTNM.previous)" in
52 $image-%ver_str|$(readlink /boot/$image$SHORTNM))
53 rm -f /boot/$image$SHORTNM.previous ;;
55 case "$(readlink /boot/initrd$SHORTNM.previous)" in
56 initrd-%ver_str|$(readlink /boot/initrd$SHORTNM))
57 rm -f /boot/initrd$SHORTNM.previous ;;
60 rm -f /boot/initrd-%ver_str