[Ocfs2-commits] smushran commits r3071 - branches/ocfs2-1.2/vendor/rhel5

svn-commits at oss.oracle.com svn-commits at oss.oracle.com
Tue Nov 20 14:45:43 PST 2007


Author: smushran
Date: 2007-11-20 14:45:42 -0800 (Tue, 20 Nov 2007)
New Revision: 3071

Modified:
   branches/ocfs2-1.2/vendor/rhel5/Vendor.make
   branches/ocfs2-1.2/vendor/rhel5/kernel.guess
   branches/ocfs2-1.2/vendor/rhel5/ocfs2.spec-generic.in
Log:
ocfs2: Build packages for -debug kernels introduced in EL5.1

Signed-off-by: jlbec

Modified: branches/ocfs2-1.2/vendor/rhel5/Vendor.make
===================================================================
--- branches/ocfs2-1.2/vendor/rhel5/Vendor.make	2007-11-20 22:44:43 UTC (rev 3070)
+++ branches/ocfs2-1.2/vendor/rhel5/Vendor.make	2007-11-20 22:45:42 UTC (rev 3071)
@@ -9,7 +9,15 @@
 	SPECVER="$@"; \
 		SPECVER="$${SPECVER#*ocfs2-}"; \
 		SPECVER="$${SPECVER%.spec}"; \
-		sed -e 's/@@KVER@@/'$${SPECVER}'/' -e 's/@@PKG_VERSION@@/'$(PKG_VERSION)'/' -e 's/@@DONT_STRIP@@/'$(DONT_STRIP)'/' < $< > $@
+		SUBVER="$${SPECVER#2.6.18-}"; \
+		SUBVER="$${SUBVER%%.*}"; \
+		if [ "$${SUBVER}" -lt 53 ]; \
+		then \
+			DEBUG=0; \
+		else \
+			DEBUG=1; \
+		fi; \
+		sed -e 's/@@KVER@@/'$${SPECVER}'/' -e 's/@@PKG_VERSION@@/'$(PKG_VERSION)'/' -e 's/@@DEBUG@@/'$${DEBUG}'/' -e 's/@@DONT_STRIP@@/'$(DONT_STRIP)'/' < $< > $@
 
 rhel5_%_srpm: dist $(TOPDIR)/vendor/rhel5/ocfs2-%.spec
 	rpmbuild -bs --define "_sourcedir $(TOPDIR)" --define "_srcrpmdir $(TOPDIR)" $(TOPDIR)/vendor/rhel5/ocfs2-$(patsubst rhel5_%_srpm,%,$@).spec

Modified: branches/ocfs2-1.2/vendor/rhel5/kernel.guess
===================================================================
--- branches/ocfs2-1.2/vendor/rhel5/kernel.guess	2007-11-20 22:44:43 UTC (rev 3070)
+++ branches/ocfs2-1.2/vendor/rhel5/kernel.guess	2007-11-20 22:45:42 UTC (rev 3071)
@@ -17,11 +17,11 @@
 # a very simple type list :-)
 #
 RHEL5_KERNEL_TYPES="
-    i686:,PAE,xen
-    x86_64:,xen
-    ia64:,xen
-    ppc64:
-    s390x:
+    i686:,PAE,xen,debug
+    x86_64:,xen,debug
+    ia64:,xen,debug
+    ppc64:,debug
+    s390x:,debug
 "
 
 
@@ -42,6 +42,9 @@
     *xen)
         echo "xen"
         ;;
+    *debug)
+        echo "debug"
+        ;;
     *)
         echo ""
         ;;
@@ -130,6 +133,15 @@
     ARCH="$2"
     TYPELIST="$3"
 
+    SUBVER="${KVER#2.6.18-}"
+    SUBVER="${SUBVER%%.*}"
+
+    # Red Hat introduced the "debug" type in 53.el5. Anything older can ignore it.
+    if [ $SUBVER -lt 53 ]
+    then
+        TYPELIST="${TYPELIST%,debug}"
+    fi
+
     typelist="${TYPELIST#$ARCH:}"
     while :
     do

Modified: branches/ocfs2-1.2/vendor/rhel5/ocfs2.spec-generic.in
===================================================================
--- branches/ocfs2-1.2/vendor/rhel5/ocfs2.spec-generic.in	2007-11-20 22:44:43 UTC (rev 3070)
+++ branches/ocfs2-1.2/vendor/rhel5/ocfs2.spec-generic.in	2007-11-20 22:45:42 UTC (rev 3071)
@@ -12,29 +12,35 @@
 %define builddef        1
 %define buildpae        0
 %define buildxen        0
+%define builddebug	0
 
 %ifarch i686
 %define karch		i686
 %define buildpae        1
 %define buildxen        1
+%define builddebug	@@DEBUG@@
 %endif
 
 %ifarch x86_64
 %define karch		x86_64
 %define buildxen        1
+%define builddebug	@@DEBUG@@
 %endif
 
 %ifarch ia64
 %define karch		ia64
 %define buildxen        1
+%define builddebug	@@DEBUG@@
 %endif
 
 %ifarch ppc64
 %define karch		ppc64
+%define builddebug	@@DEBUG@@
 %endif
 
 %ifarch s390x
 %define karch		s390x
+%define builddebug	@@DEBUG@@
 %endif
 
 %define dont_strip	@@DONT_STRIP@@
@@ -101,6 +107,22 @@
 %endif
 
 
+%if %{builddebug}
+%package -n ocfs2-%{kver}debug
+Summary: The Oracle Cluster File System 2 for the debug kernel.
+Group: System Environment/Kernel
+Provides: ocfs2 = %{version}
+Requires: kernel-debug = %{kver}
+Requires: ocfs2-tools >= %{tools_ver}
+BuildRequires: kernel-debug-devel = %{kver}
+AutoReqProv: no
+
+%description -n ocfs2-%{kver}debug
+OCFS2 is the Oracle Cluster Filesystem 2.  This package is compiled for
+the debug kernel.
+%endif
+
+
 %prep
 %setup -n ocfs2-%{version}
 
@@ -195,6 +217,25 @@
 make clean
 %endif
 
+%if %{builddebug}
+local_configure "%{kver}debug"
+
+make V=0 GENERIC_DELETE_INODE_NOT_TRUNCATES=1
+make DESTDIR="$RPM_BUILD_ROOT" INSTALL_MOD_PATH='$(DESTDIR)' install
+
+# 2.6 kbuild can't do this install nicely
+EXTRA_MODLIB="${RPM_BUILD_ROOT}/lib/modules/%{kver}debug/extra/"
+INST_MODLIB="${RPM_BUILD_ROOT}/lib/modules/%{kver}debug/kernel"
+for i in ocfs2/ ocfs2/dlm/ ocfs2/cluster/
+do
+	mkdir -p "${INST_MODLIB}/fs/$i"
+	mv "${EXTRA_MODLIB}"/$i/ocfs2*.ko "${INST_MODLIB}/fs/$i"
+	rm -f "${EXTRA_MODLIB}"/$i/*.ko
+done
+strip_modules "${INST_MODLIB}"
+make clean
+%endif
+
 %install
 # We don't do anything here, but it is required to force RPM
 # magic behaviors ... thanks guys.
@@ -229,7 +270,19 @@
 /lib/modules/%{kver}xen/kernel/fs
 %endif
 
+%if %{builddebug}
+%post -n ocfs2-%{kver}debug
+depmod -ae %{kver}debug
+
+%files -n ocfs2-%{kver}debug
+%defattr(-,root,root)
+/lib/modules/%{kver}debug/kernel/fs
+%endif
+
 %changelog
+* Mon Nov 12 2007 Sunil Mushran <sunil.mushran at oracle.com>
+- Add support to build modules for kernel-debug for RHEL5
+
 * Thu Apr 12 2007 Sunil Mushran <sunil.mushran at oracle.com>
 - Add PAE and xen for RHEL5
 




More information about the Ocfs2-commits mailing list