1 rm -f /boot/initrd-%ver_str # created in %post -- clean up.
3 if [ "$(readlink /boot/vmlinuz)" = "vmlinuz-%ver_str" -o \
4 "$(readlink /boot/initrd)" = "initrd-%ver_str" ]; then
5 # This may be the last kernel RPM on the system, or it may
6 # be an update. In both of those cases the symlinks will
7 # eventually be correct. On the other hand, if this kernel
8 # is removed and other kernel rpms remain installed,
9 # find the most recent of the remaining kernels, and make
10 # the symlinks point to it. This makes sure that the boot
11 # manager will always have a kernel to boot in its default
13 for vmlinuz in $(cd /boot ; ls -dt vmlinuz-*); do
14 version="${vmlinuz#vmlinuz-}"
15 initrd="initrd-$version"
16 if [ -f "/boot/$vmlinuz" -a -f "/boot/$initrd" ]; then
17 relink "$vmlinuz" /boot/vmlinuz
18 relink "$initrd" /boot/initrd