Whamcloud - gitweb
b=8080
[fs/lustre-release.git] / build / lustre-kernel-2.4.spec.in
index d91abd3..1477916 100644 (file)
@@ -185,6 +185,11 @@ Source25: suse-functions.sh
 Source26: suse-post.sh
 Source27: suse-postun.sh
 Source28: suse-trigger-script.sh.in
+Source29: sles8-post.sh
+Source30: sles8-postun.sh
+Source31: sles8-pre.sh
+Source32: sles8-update_INITRD_MODULES.sh
+Source33: sles8-update_rcfile_setting.sh
 
 %package source
 Summary: The source code for the Linux kernel.
@@ -387,15 +392,33 @@ popd >/dev/null
 for flavor in "" smp bigmem bigsmp pseries64 BOOT jensen ; do
        for when in pre preun post postun ; do
                script="${when}${flavor}.sh"
-               echo "if [ -f /etc/SuSE-release ] ; then" > ${script}
+               cat %{SOURCE25} %{SOURCE32} %{SOURCE33} > ${script}
+               echo "if [ -d /etc/susehelp.d ] ; then" >> ${script}
                sed -e "s/@when@/$when/g" -e "s^%ver_str^%{KVERREL}${flavor}^g" %{SOURCE28} >> ${script}
-               cat %{SOURCE25} >> ${script}
                case $when in
+                       pre)
+                               echo "if [ ! -f /etc/modprobe.conf ] ; then" >> ${script}
+                               cat %{SOURCE31} >> ${script}
+                               echo "fi" >> ${script}
+                               ;;
                        post)
+                               # /sbin/update-modules.dep compares when the modules were built, rather
+                               # than installed, so force modules.dep to be recreated
+                               echo "rm -f /lib/modules/%{KVERREL}${flavor}/modules.dep" >> ${script}
+                               echo "if [ -f /etc/modprobe.conf ] ; then" >> ${script}                 
                                sed -e "s^%ver_str^%{KVERREL}${flavor}^g" %{SOURCE26} >> ${script}
+
+                               echo "else" >> ${script}
+                               sed -e "s^%ver_str^%{KVERREL}${flavor}^g" -e "s^%%{cfg_name}^${flavor}^g" %{SOURCE29} >> ${script}
+                               echo "fi" >> ${script}
                                ;;
                        postun)
+                               echo "if [ -f /etc/modprobe.conf ] ; then" >> ${script}                 
                                sed -e "s^%ver_str^%{KVERREL}${flavor}^g" %{SOURCE27} >> ${script}
+
+                               echo "else" >> ${script}                        
+                               sed -e "s^%ver_str^%{KVERREL}${flavor}^g" %{SOURCE30} >> ${script}
+                               echo "fi" >> ${script}
                                ;;
                esac
                echo "exit 0; fi" >> ${script}
@@ -415,7 +438,11 @@ EOF
 [ -x /usr/sbin/module_upgrade ] && /usr/sbin/module_upgrade
 [ -x /sbin/mkkerneldoth ] && /sbin/mkkerneldoth
 if [ -x /sbin/new-kernel-pkg ] ; then
-        /sbin/new-kernel-pkg --mkinitrd --depmod --install %{KVERREL}${flavor}
+       if /sbin/new-kernel-pkg 2>&1 | grep package >/dev/null ; then
+               PACKAGE_ARG="--package kernel-${flavor}"
+       fi
+        /sbin/new-kernel-pkg $PACKAGE_ARG --mkinitrd --depmod \
+               --install %{KVERREL}${flavor}
 fi
 EOF
                                ;;
@@ -451,7 +478,9 @@ EOF
 /boot/efi/redhat/%{kernel_glob}${flavor}
 %endif
 %if %{linux26}
+%if %{susebuild}
 /boot/Kerntypes-%{KVERREL}${flavor}
+%endif
 /boot/symvers-%{KVERREL}-%{_target_cpu}${flavor}.gz
 %endif
 EOF
@@ -509,11 +538,7 @@ BuildKernel()
        --kerneldir $RPM_SOURCE_DIR \
        -j $RPM_BUILD_NCPUS \
        --destdir $RPM_BUILD_ROOT \
-       -- --enable-modules \
-       --disable-doc --disable-tests \
-       --disable-utils --disable-liblustre \
-       --sysconfdir=%{_sysconfdir} \
-       --mandir=%{_mandir} \
+       -- --disable-tests \
        @CONFIGURE_FLAGS@
 }
 
@@ -579,7 +604,7 @@ BuildKernel
 %endif
 
 %if %{buildbase}
-BuildLustre
+BuildLustre
 %endif
 
 popd >/dev/null
@@ -590,8 +615,6 @@ pushd lustre >/dev/null
 # specific
 for i in $RPM_BUILD_ROOT/lib/modules/* ; do
   rm -f $i/modules.*
-  rm -f $i/build
-  ln -sf ../../../usr/src/linux-%{KVERREL} $i/build
 %ifarch %{ntplarchs}
   # remove legacy pcmcia symlink that's no longer useful
   rm -rf $i/pcmcia
@@ -829,8 +852,8 @@ rm -rf $RPM_BUILD_ROOT
 if [ ! -e /dev/obd ]; then
    mknod /dev/obd c 10 241
 fi
-if [ ! -e /dev/portals ]; then
-   mknod /dev/portals c 10 240
+if [ ! -e /dev/lnet ]; then
+   mknod /dev/lnet c 10 240
 fi
 if [ -f /etc/init.d/lustre ] ; then
        /sbin/chkconfig --add lustre
@@ -937,7 +960,7 @@ fi
 %endif
 
 %if %{buildpseries64}
-%files bigsmp -f kernelpseries64.files
+%files pseries64 -f kernelpseries64.files
 %endif
 
 %if %{buildbigmem}
@@ -949,41 +972,5 @@ fi
 %endif
 
 %if %{buildbase}
-
 %files source -f kernel-source.files
-
-%files doc
-%defattr(-,root,root)
-%doc lustre/linux/Documentation/*
-
-%files -n lustre-lite-utils
-%defattr(-, root, root)
-%doc lustre/COPYING lustre/lustre/BUGS lustre/ChangeLog lustre/README lustre/lustre/doc/lustre.pdf
-/sbin/*
-/usr/sbin/*
-/usr/bin/*
-/usr/lib/lustre/python
-@ENABLE_INIT_SCRIPTS@/etc/init.d/lustre
-@ENABLE_INIT_SCRIPTS@/etc/init.d/lustrefs
-/usr/include/lustre/*
-/usr/include/portals/*
-/usr/include/linux/*
-/usr/lib/lib*.a
-/usr/share/man/man?/*
-
-#%files -n lustre-doc
-#%defattr(-, root, root)
-#/usr/share/doc/lustre/COPYING
-#/usr/share/doc/lustre/lustre.pdf
-#/usr/share/doc/lustre/COPYING
-
-/usr/share/lustre/examples
-
-%files -n lustre-ldap
-%defattr(-, root, root)
-/etc/openldap/slapd-lustre.conf
-/etc/openldap/schema/lustre.schema
-/usr/share/lustre/lustre2ldif.xsl
-/usr/share/lustre/top.ldif
-
-%endif # %{buildbase}
+%endif