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).
12 if [ "$(readlink /boot/$image)" = $image-%ver_str ]; then
13 # This may be the last kernel RPM on the system, or it may
14 # be an update. In both of those cases the symlinks will
15 # eventually be correct. Only if this kernel
16 # is removed and other kernel rpms remain installed,
17 # find the most recent of the remaining kernels, and make
18 # the symlinks point to it. This makes sure that the boot
19 # manager will always have a kernel to boot in its default
22 for image in $(cd /boot ; ls -dt $image-*); do
23 initrd=initrd-${image#*-}
24 if [ -f /boot/$image -a -f /boot/$initrd ]; then
25 relink $image /boot/${image%%%%-*}
26 relink $initrd /boot/${initrd%%%%-*}
33 # Created in the other kernel's %post
34 case "$(readlink /boot/$image.previous)" in
35 $image-%ver_str|$(readlink /boot/$image))
36 rm -f /boot/$image.previous ;;
38 case "$(readlink /boot/initrd.previous)" in
39 initrd-%ver_str|$(readlink /boot/initrd))
40 rm -f /boot/initrd.previous ;;
43 rm -f /boot/initrd-%ver_str