Whamcloud - gitweb
Branch b1_4
[fs/lustre-release.git] / build / suse-post.sh
1 if [ -f /boot/vmlinuz-%ver_str ]; then
2     image=vmlinuz
3 elif [ -f /boot/image-%ver_str ]; then
4     image=image
5 elif [ -f /boot/vmlinux-%ver_str ]; then
6     image=vmlinux
7 else
8     # nothing to do (UML kernels for example).
9     exit 0
10 fi
11
12 case %ver_str in
13     (*xen*|*um*)
14         NOBOOTSPLASH="-s off"
15         SHORTNM=%ver_str
16         SHORTNM=-${SHORTNM##*-}
17         ;;
18     (*)
19         unset NOBOOTSPLASH
20         unset SHORTNM
21         ;;
22 esac    
23
24 # If we have old symlinks, rename them to *.previous
25 if [ -L /boot/$image$SHORTNM -a \
26     "$(readlink /boot/$image$SHORTNM)" != $image-%ver_str ]; then
27         mv /boot/$image$SHORTNM /boot/$image$SHORTNM.previous
28 fi
29 relink $image-%ver_str /boot/$image$SHORTNM
30
31 if test "$YAST_IS_RUNNING" != instsys ; then
32     if [ -f /etc/fstab ]; then
33         echo Setting up /lib/modules/%ver_str
34         /sbin/update-modules.dep -v %ver_str
35         cd /boot
36         /sbin/mkinitrd -k $image-%ver_str -i initrd-%ver_str $NOBOOTSPLASH
37
38         if [ -L /boot/initrd$SHORTNM -a \
39              "$(readlink /boot/initrd)" != initrd-%ver_str ]; then
40             mv /boot/initrd$SHORTNM /boot/initrd$SHORTNM.previous
41         fi  
42         if [ -e /boot/initrd-%ver_str ]; then
43             relink initrd-%ver_str /boot/initrd$SHORTNM
44         else
45             rm -f /boot/initrd$SHORTNM
46         fi
47     else
48         echo "please run mkinitrd as soon as your system is complete"
49     fi
50 fi
51
52 if [ "$YAST_IS_RUNNING" != instsys -a -x /sbin/new-kernel-pkg ]; then
53     # Notify boot loader that a new kernel image has been installed.
54     # (during initial installation the boot loader configuration does not
55     #  yet exist when the kernel is installed, but yast kicks the boot
56     #  loader itself later.)
57     /sbin/new-kernel-pkg %ver_str
58 fi