[Ocfs2-commits] jlbec commits r3019 - in branches/ocfs2-1.2: . vendor vendor/sles9 vendor/suse-kmp

svn-commits at oss.oracle.com svn-commits at oss.oracle.com
Thu May 3 16:45:12 PDT 2007


Author: jlbec
Date: 2007-05-03 16:45:10 -0700 (Thu, 03 May 2007)
New Revision: 3019

Added:
   branches/ocfs2-1.2/vendor/suse-kmp/
   branches/ocfs2-1.2/vendor/suse-kmp/Makefile
   branches/ocfs2-1.2/vendor/suse-kmp/Vendor.make
   branches/ocfs2-1.2/vendor/suse-kmp/ocfs2.spec-generic.in
   branches/ocfs2-1.2/vendor/suse-kmp/rpmarch.guess
   branches/ocfs2-1.2/vendor/suse-kmp/vendor.guess
Modified:
   branches/ocfs2-1.2/configure.in
   branches/ocfs2-1.2/vendor/Makefile
   branches/ocfs2-1.2/vendor/sles9/vendor.guess
Log:
From: Jeff Mahoney <jeffm at suse.com>

Starting with SLE 10 and openSUSE 10.2, the "right" way of building
kernel modules for SUSE Linux systems is via the kernel module package
(KMP) mechanism.

This automates much of what the scripts and specfiles do now in a standard
manner, building kernel modules for every installed kernel for which
source can be found.

The attached patch changes the definition of "sles9" to mean "any
release starting with sles9 that doesn't support building KMPs. The only
difference between the sles9 and suse-kmp vendor.guess is the logic on
what to do if the suse_kernel_module_package macro is found or not. SLES10
systems included the macro with the rpm package.  Later versions include
the macro as part of the kernel-source package.

With the KMP infrastructure, if allowed, 'make packages' should work
without even running configure since it runs configure for each kernel
it builds against.

Signed-off-by: smushran



Modified: branches/ocfs2-1.2/configure.in
===================================================================
--- branches/ocfs2-1.2/configure.in	2007-05-03 21:17:30 UTC (rev 3018)
+++ branches/ocfs2-1.2/configure.in	2007-05-03 23:45:10 UTC (rev 3019)
@@ -292,4 +292,5 @@
 vendor/rhel4/ocfs2.spec-generic
 vendor/sles9/ocfs2.spec-generic
 vendor/rhel5/ocfs2.spec-generic
+vendor/suse-kmp/ocfs2.spec-generic
 ])

Modified: branches/ocfs2-1.2/vendor/Makefile
===================================================================
--- branches/ocfs2-1.2/vendor/Makefile	2007-05-03 21:17:30 UTC (rev 3018)
+++ branches/ocfs2-1.2/vendor/Makefile	2007-05-03 23:45:10 UTC (rev 3019)
@@ -2,6 +2,6 @@
 
 include $(TOPDIR)/Preamble.make
 
-SUBDIRS = ax2 rhel4 sles9 rhel5
+SUBDIRS = ax2 rhel4 sles9 rhel5 suse-kmp
 
 include $(TOPDIR)/Postamble.make

Modified: branches/ocfs2-1.2/vendor/sles9/vendor.guess
===================================================================
--- branches/ocfs2-1.2/vendor/sles9/vendor.guess	2007-05-03 21:17:30 UTC (rev 3018)
+++ branches/ocfs2-1.2/vendor/sles9/vendor.guess	2007-05-03 23:45:10 UTC (rev 3019)
@@ -1,13 +1,22 @@
 #!/bin/sh
 
+# Test whether we can use kernel module packages or not
+
 if [ ! -f /etc/SuSE-release ]
 then
     exit 1
 fi
 
-if [ "`rpm -qf /etc/SuSE-release --qf '%{VERSION}' 2>/dev/null`" != "9" ]
+SUSE_RELEASE="`rpm -qf /etc/SuSE-release --qf "%{VERSION}" 2> /dev/null`"
+
+if [ "$SUSE_RELEASE" -lt 9 ]; then
+	exit 1
+fi
+
+HAS_KMP="`rpm --showrc | grep suse_kernel_module_package 2> /dev/null`"
+if [ -n "$HAS_KMP" ]
 then
-    exit 1
+   exit 1
 fi
 
 exit 0

Added: branches/ocfs2-1.2/vendor/suse-kmp/Makefile
===================================================================
--- branches/ocfs2-1.2/vendor/suse-kmp/Makefile	2007-05-03 21:17:30 UTC (rev 3018)
+++ branches/ocfs2-1.2/vendor/suse-kmp/Makefile	2007-05-03 23:45:10 UTC (rev 3019)
@@ -0,0 +1,11 @@
+TOPDIR = ../..
+
+include $(TOPDIR)/Preamble.make
+
+DIST_FILES = 			\
+	ocfs2.spec-generic.in	\
+	rpmarch.guess		\
+	Vendor.make		\
+	vendor.guess
+
+include $(TOPDIR)/Postamble.make

Added: branches/ocfs2-1.2/vendor/suse-kmp/Vendor.make
===================================================================
--- branches/ocfs2-1.2/vendor/suse-kmp/Vendor.make	2007-05-03 21:17:30 UTC (rev 3018)
+++ branches/ocfs2-1.2/vendor/suse-kmp/Vendor.make	2007-05-03 23:45:10 UTC (rev 3019)
@@ -0,0 +1,21 @@
+#
+# SUSE KMPs (SLE10+, 10.2+)
+#
+
+TOOLSARCH = $(shell $(TOPDIR)/vendor/suse-kmp/rpmarch.guess tools $(TOPDIR))
+MODULEARCH = $(shell $(TOPDIR)/vendor/suse-kmp/rpmarch.guess module $(TOPDIR))
+
+
+$(TOPDIR)/vendor/suse-kmp/ocfs2.spec: $(TOPDIR)/vendor/suse-kmp/ocfs2.spec-generic
+	SPECVER="$@"; \
+		SPECVER="$${SPECVER#*ocfs2-}"; \
+		SPECVER="$${SPECVER%.spec}"; \
+		sed -e 's/@DIST_VERSION@/'$(DIST_VERSION)'/' -e 's/@@PKG_VERSION@@/'$(PKG_VERSION)'/' < $< > $@
+
+srpm: dist $(TOPDIR)/vendor/suse-kmp/ocfs2.spec
+	rpmbuild -bs --define "_sourcedir $(TOPDIR)" --define "_srcrpmdir $(TOPDIR)" $(TOPDIR)/vendor/suse-kmp/ocfs2.spec
+
+rpms: srpm
+	rpmbuild --rebuild $(MODULEARCH) ocfs2-$(DIST_VERSION)-$(PKG_VERSION).src.rpm
+
+packages: rpms

Added: branches/ocfs2-1.2/vendor/suse-kmp/ocfs2.spec-generic.in
===================================================================
--- branches/ocfs2-1.2/vendor/suse-kmp/ocfs2.spec-generic.in	2007-05-03 21:17:30 UTC (rev 3018)
+++ branches/ocfs2-1.2/vendor/suse-kmp/ocfs2.spec-generic.in	2007-05-03 23:45:10 UTC (rev 3019)
@@ -0,0 +1,57 @@
+Summary: The Oracle Cluster Filesystem 2 (ocfs2)
+Name: ocfs2
+Version: @DIST_VERSION@
+Release: @@PKG_VERSION@@
+License: GPL
+Group: System/Kernel
+Source: ocfs2-%{version}.tar.gz
+URL: http://oss.oracle.com/projects/ocfs2/
+Distribution: Oracle
+Vendor: Oracle
+Packager: Joel Becker <joel.becker at oracle.com>
+Provides: ocfs2 = %{version}
+AutoReqProv: no
+Requires: ocfs2-tools >= %{tools_ver}
+BuildRoot:      %{_tmppath}/%{name}-%{version}-build
+%suse_kernel_module_package -n ocfs2 um kdump debug
+
+%description
+The Oracle Cluster Filesystem 2 (ocfs2) kernel modules.
+
+%package KMP
+Summary: The Oracle Cluster Filesystem 2 (ocfs2)
+Group: System/Kernel
+
+%description KMP
+The Oracle Cluster Filesystem 2 (ocfs2) kernel modules.
+
+%prep
+%setup
+set -- *
+mkdir source
+mv "$@" source/
+mkdir obj
+
+%build
+for flavor in %flavors_to_build; do
+	rm -rf obj/$flavor
+	cp -r source obj/$flavor
+	cd obj/$flavor
+	./configure --with-kernel-source=/usr/src/linux --with-kernel=/usr/src/linux-obj/%_target_cpu/$flavor
+	make
+	cd ../..
+done
+
+%install
+export INSTALL_MOD_PATH=$RPM_BUILD_ROOT
+export INSTALL_MOD_DIR=updates
+for flavor in %flavors_to_build; do
+	(cd obj/$flavor ; make install)
+done
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%changelog
+* Fri Apr 13 2007 - jeffm at suse.com
+- Initial version to use SUSE KMP infrastructure

Added: branches/ocfs2-1.2/vendor/suse-kmp/rpmarch.guess
===================================================================
--- branches/ocfs2-1.2/vendor/suse-kmp/rpmarch.guess	2007-05-03 21:17:30 UTC (rev 3018)
+++ branches/ocfs2-1.2/vendor/suse-kmp/rpmarch.guess	2007-05-03 23:45:10 UTC (rev 3019)
@@ -0,0 +1,70 @@
+#! /bin/sh
+
+mode="$1"
+srcdir="$2"
+
+host_cpu=
+
+QUERYFILE=/etc/SuSE-release
+
+if test -n "$QUERYFILE"; then
+  host_cpu="`rpm -qf $QUERYFILE --queryformat \"%{ARCH}\"`"
+fi
+
+if test -z "$host_cpu" -o "$host_cpu" = "noarch" ; then
+  host_alias=`$srcdir/config.guess`
+  host=`$srcdir/config.sub $host_alias`
+  host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+fi
+
+case "$host_cpu" in
+  x86_64|ia64|s390x)
+    TOOLSARCH="$host_cpu"
+    ;;
+  i386|i486|i586|i686|i786|k6|k7)
+    TOOLSARCH="i386"
+    ;;
+  ppc|ppc64|ppciseries|ppcpseries|ppc64iseries|ppc64pseries|powerpc|powerpc64)
+    TOOLSARCH="ppc64"
+    ;;
+  *)
+    echo "rpmarch.guess: Warning: unknown RPM CPU architecture: $host_cpu" >&2
+    TOOLSARCH=""
+    ;;
+esac
+
+# Only a few of these need to be overwritten from RPM's default
+case "$host_cpu" in
+  i586)
+    MODULEARCH="$host_cpu"
+    ;;
+  i386|i686)
+    MODULEARCH="i586"
+    ;;
+  ppc|ppc64|ppciseries|ppcpseries|ppc64iseries|ppc64pseries|powerpc|powerpc64)
+    MODULEARCH="ppc64"
+    ;;
+  *)
+    MODULEARCH=""
+    ;;
+esac
+
+case "$mode" in
+  module)
+    if [ -n "$MODULEARCH" ] ; then
+      echo "--target $MODULEARCH"
+    fi
+    ;;
+  tools)
+    if [ -n "$TOOLSARCH" ] ; then
+      echo "--target $TOOLSARCH"
+    fi
+    ;;
+  *)
+    echo "rpmarch.guess: Invalid mode: $mode" >&2
+    echo "error"
+    exit 1
+    ;;
+esac
+
+exit 0


Property changes on: branches/ocfs2-1.2/vendor/suse-kmp/rpmarch.guess
___________________________________________________________________
Name: svn:executable
   + *

Added: branches/ocfs2-1.2/vendor/suse-kmp/vendor.guess
===================================================================
--- branches/ocfs2-1.2/vendor/suse-kmp/vendor.guess	2007-05-03 21:17:30 UTC (rev 3018)
+++ branches/ocfs2-1.2/vendor/suse-kmp/vendor.guess	2007-05-03 23:45:10 UTC (rev 3019)
@@ -0,0 +1,22 @@
+#!/bin/sh
+
+# Test whether we can use kernel module packages or not
+
+if [ ! -f /etc/SuSE-release ]
+then
+    exit 1
+fi
+
+SUSE_RELEASE="`rpm -qf /etc/SuSE-release --qf "%{VERSION}" 2> /dev/null`"
+
+if [ "$SUSE_RELEASE" -lt 9 ]; then
+	exit 1
+fi
+
+HAS_KMP="`rpm --showrc | grep suse_kernel_module_package 2> /dev/null`"
+if [ -z "$HAS_KMP" ]
+then
+   exit 1
+fi
+
+exit 0


Property changes on: branches/ocfs2-1.2/vendor/suse-kmp/vendor.guess
___________________________________________________________________
Name: svn:executable
   + *




More information about the Ocfs2-commits mailing list