Whamcloud - gitweb
b=21670 revert new version of find_linux_devel_paths
[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         if [ -x /sbin/update-modules.dep ]; then
35             /sbin/update-modules.dep -v %ver_str
36         else
37             /sbin/depmod -a -F /boot/System.map-%ver_str %ver_str
38         fi
39         cd /boot
40         /sbin/mkinitrd -k $image-%ver_str -i initrd-%ver_str $NOBOOTSPLASH
41
42         if [ -L /boot/initrd$SHORTNM -a \
43              "$(readlink /boot/initrd)" != initrd-%ver_str ]; then
44             mv /boot/initrd$SHORTNM /boot/initrd$SHORTNM.previous
45         fi  
46         if [ -e /boot/initrd-%ver_str ]; then
47             relink initrd-%ver_str /boot/initrd$SHORTNM
48         else
49             rm -f /boot/initrd$SHORTNM
50         fi
51     else
52         echo "please run mkinitrd as soon as your system is complete"
53     fi
54 fi
55
56 if [ "$YAST_IS_RUNNING" != instsys ]; then
57     # Notify boot loader that a new kernel image has been installed.
58     # (during initial installation the boot loader configuration does not
59     #  yet exist when the kernel is installed, but yast kicks the boot
60     #  loader itself later.)
61     if [ -x /sbin/new-kernel-pkg ]; then
62         /sbin/new-kernel-pkg %ver_str
63     elif [ -x /usr/lib/bootloader/bootloader_entry ]; then
64         # handle 10.2 and SLES10 SP1
65         /usr/lib/bootloader/bootloader_entry \
66             add \
67             %flavor \
68             %ver_str \
69             vmlinuz-%ver_str \
70             initrd-%ver_str
71     elif [ -x /sbin/update-bootloader ]; then
72         # handle 10.1 and SLES10 GA
73         /sbin/update-bootloader \
74             --add \
75             --image /boot/vmlinuz-%ver_str \
76             --initrd /boot/initrd-%ver_str
77         /sbin/update-bootloader --refresh
78     else
79         echo "You may need to setup and install the boot loader using the"
80         echo "available bootloader for your platform (e.g. grub, lilo, zipl, ...)."
81     fi
82 fi