[Oracleasm-commits] jlbec commits r312 - in trunk: . include kernel tools vendor/common vendor/redhat vendor/suse

svn-commits at oss.oracle.com svn-commits at oss.oracle.com
Thu Nov 3 19:34:35 CST 2005


Author: jlbec
Date: 2005-11-03 19:34:32 -0600 (Thu, 03 Nov 2005)
New Revision: 312

Added:
   trunk/tools/devmap.c
   trunk/tools/devmap.h
Modified:
   trunk/configure.in
   trunk/include/asmerror.h
   trunk/kernel/oracleasm.c
   trunk/rpmarch.guess
   trunk/tools/Makefile
   trunk/tools/asmscan.c
   trunk/tools/asmtool.c
   trunk/vendor/common/oracleasm-support.spec.in
   trunk/vendor/common/oracleasm.init
   trunk/vendor/redhat/oracleasm-2.6.9-EL.spec-generic.in
   trunk/vendor/suse/oracleasm-2.6.5.spec-generic.in
Log:

o kernel/oracleasm.c: Set ASM_LOCAL_ERROR where appropriate.
o rpmarch.guess, configure.in: Fixup PPC64 detection.
o include/asmerror.h: Make ASM_ERR_NODEV a positive error, and make
  the old value ASM_ERR_NODEV_OLD for compatibility.
o vendor/*/*.spec: Fix configuration for PPC correctness.
o vendor/common/oracleasm.init: Fix an error reporting bug.
o tools/devmap.[ch]: Use /proc/devices to discover device types.
o tools/asmtool.c: Use devmap to allow MD and device-mapper devices.
o tools/asmscan.c: Improve the backoff when racing hotplug.
o tools/Makefile: Add devmap.



Modified: trunk/configure.in
===================================================================
--- trunk/configure.in	2005-09-07 23:03:58 UTC (rev 311)
+++ trunk/configure.in	2005-11-04 01:34:32 UTC (rev 312)
@@ -94,14 +94,14 @@
 if test -z "$TOOLSARCH"
 then
     case "$host_cpu" in
-    x86_64|i386|ppc|ia64)
+    x86_64|ia64|s390x)
         TOOLSARCH="$host_cpu"
         ;;
-    i686|i586|i486)
+    i386|i686|i586|i486)
         TOOLSARCH="i386"
         ;;
-    ppc64|ppciseries|ppcpseries|ppc64iseries|ppc64pseries|powerpc|powerpc64)
-        TOOLSARCH="ppc"
+    ppc|ppc64|ppciseries|ppcpseries|ppc64iseries|ppc64pseries|powerpc|powerpc64)
+        TOOLSARCH="ppc64"
         ;;
     *)
         AC_MSG_RESULT([not found])
@@ -110,7 +110,7 @@
     esac
 fi
 case "$TOOLSARCH" in
-x86_64|ia64)
+x86_64|ia64|ppc64)
     MODULEARCH="$TOOLSARCH"
     ;;
 ppc)
@@ -158,12 +158,12 @@
 saved_CFLAGS="$CFLAGS"
 CFLAGS="$CFLAGS $M64"
 
+AC_CHECK_SIZEOF(unsigned long)
+
 if test ! -f "$KERNELINC/linux/autoconf.h"; then
   AC_MSG_ERROR(No configured kernel include tree found)
 fi
 
-AC_CHECK_SIZEOF(unsigned long)
-
 AC_MSG_CHECKING([for kernel module symbol versions])
 AC_EGREP_CPP(kernel_has_modversions,
 [#include <linux/autoconf.h>

Modified: trunk/include/asmerror.h
===================================================================
--- trunk/include/asmerror.h	2005-09-07 23:03:58 UTC (rev 311)
+++ trunk/include/asmerror.h	2005-11-04 01:34:32 UTC (rev 312)
@@ -12,6 +12,8 @@
  * MODIFIED   (YYYY/MM/DD)
  *      2004/01/02 - Joel Becker <joel.becker at oracle.com>
  *              Initial LGPL header.
+ *      2005/09/14 - Joel Becker <joel.becker at oracle.com>
+ *              Make NODEV a nonfatal error.
  *
  * Copyright (c) 2002-2004 Oracle Corporation.  All rights reserved.
  *
@@ -71,7 +73,7 @@
 {
     ASM_ERR_INSTALL     = -5,   /* Driver not installed */
     ASM_ERR_FAULT       = -4,   /* Invalid address */
-    ASM_ERR_NODEV       = -3,   /* Invalid device */
+    ASM_ERR_NODEV_OLD   = -3,   /* Old invalid device */
     ASM_ERR_BADIID      = -2,   /* Invalid IID */
     ASM_ERR_INVAL       = -1,   /* Invalid argument */
     ASM_ERR_NONE        = 0,    /* No error */
@@ -79,6 +81,7 @@
     ASM_ERR_NOMEM	= 2,	/* Out of memory */
     ASM_ERR_IO          = 3,    /* I/O error */
     ASM_ERR_DSCVR       = 4,    /* Bad discovery string */
+    ASM_ERR_NODEV       = 5,    /* Invalid device */
 };
 
 #endif  /* _ASMERROR_H */

Modified: trunk/kernel/oracleasm.c
===================================================================
--- trunk/kernel/oracleasm.c	2005-09-07 23:03:58 UTC (rev 311)
+++ trunk/kernel/oracleasm.c	2005-11-04 01:34:32 UTC (rev 312)
@@ -1087,6 +1087,7 @@
 		default:
 			dprintk("ASM: Invalid error of %d!\n", err);
 			r->r_error = ASM_ERR_INVAL;
+			r->r_status |= ASM_LOCAL_ERROR;
 			break;
 
 		case 0:
@@ -1094,6 +1095,7 @@
 
 		case -EFAULT:
 			r->r_error = ASM_ERR_FAULT;
+			r->r_status |= ASM_LOCAL_ERROR;
 			break;
 
 		case -EIO:
@@ -1102,6 +1104,7 @@
 
 		case -ENODEV:
 			r->r_error = ASM_ERR_NODEV;
+			r->r_status |= ASM_LOCAL_ERROR;
 			break;
 
 		case -ENOMEM:
@@ -1111,6 +1114,7 @@
 
 		case -EINVAL:
 			r->r_error = ASM_ERR_INVAL;
+			r->r_status |= ASM_LOCAL_ERROR;
 			break;
 	}
 

Modified: trunk/rpmarch.guess
===================================================================
--- trunk/rpmarch.guess	2005-09-07 23:03:58 UTC (rev 311)
+++ trunk/rpmarch.guess	2005-11-04 01:34:32 UTC (rev 312)
@@ -25,14 +25,14 @@
 fi
 
 case "$host_cpu" in
-  x86_64|ppc|ia64|s390x)
-    TOOLSARCH=""
+  x86_64|ia64|s390x)
+    TOOLSARCH="$host_cpu"
     ;;
   i386|i486|i586|i686|i786|k6|k7)
     TOOLSARCH="i386"
     ;;
-  ppc64|ppciseries|ppcpseries|ppc64iseries|ppc64pseries|powerpc|powerpc64)
-    TOOLSARCH="ppc"
+  ppc|ppc64|ppciseries|ppcpseries|ppc64iseries|ppc64pseries|powerpc|powerpc64)
+    TOOLSARCH="ppc64"
     ;;
   *)
     echo "rpmarch.guess: Warning: unknown RPM CPU architecture: $host_cpu" >&2
@@ -48,6 +48,9 @@
   i386)
     MODULEARCH="i686"
     ;;
+  ppc|ppc64|ppciseries|ppcpseries|ppc64iseries|ppc64pseries|powerpc|powerpc64)
+    MODULEARCH="ppc64"
+    ;;
   *)
     MODULEARCH=""
     ;;

Modified: trunk/tools/Makefile
===================================================================
--- trunk/tools/Makefile	2005-09-07 23:03:58 UTC (rev 311)
+++ trunk/tools/Makefile	2005-11-04 01:34:32 UTC (rev 312)
@@ -3,7 +3,6 @@
 include $(TOPDIR)/Preamble.make
 
 SBIN_PROGRAMS = asmtool asmscan
-SBIN_EXTRA = oracleasm_debug_link
 
 VERSION_FLAGS = -DVERSION="\"${VERSION}\""
 CPPFLAGS += -DLINUX ${VERSION_FLAGS} $(DEFS)
@@ -11,10 +10,10 @@
 
 INCLUDES = -I. -I$(TOPDIR)/include
 
-ASMTOOL_SOURCES = asmtool.c
+ASMTOOL_SOURCES = asmtool.c devmap.c
 ASMSCAN_SOURCES = asmscan.c
 
-LOCAL_HEADERS = list.h
+LOCAL_HEADERS = list.h devmap.h
 HEADERS =					\
 	$(TOPDIR)/include/linux/asmdisk.h	\
 	$(TOPDIR)/include/linux/asmmanager.h
@@ -22,8 +21,15 @@
 ASMTOOL_OBJECTS = $(subst .c,.o,$(ASMTOOL_SOURCES))
 ASMSCAN_OBJECTS = $(subst .c,.o,$(ASMSCAN_SOURCES))
 
-DIST_FILES = $(ASMTOOL_SOURCES) $(ASMSCAN_SOURCES) $(LOCAL_HEADERS)
+DIST_FILES = $(ASMTOOL_SOURCES) $(ASMSCAN_SOURCES) $(LOCAL_HEADERS) \
+	oracleasm_debug_link
 
+INSTALL_RULES += install-debug-link
+
+install-debug-link:
+	$(SHELL) $(TOPDIR)/mkinstalldirs $(DESTDIR)$(exec_prefix)/lib/oracleasm
+	$(INSTALL_PROGRAM) oracleasm_debug_link $(DESTDIR)$(exec_prefix)/lib/oracleasm
+
 asmtool: $(ASMTOOL_OBJECTS)
 	$(LINK)
 

Modified: trunk/tools/asmscan.c
===================================================================
--- trunk/tools/asmscan.c	2005-09-07 23:03:58 UTC (rev 311)
+++ trunk/tools/asmscan.c	2005-11-04 01:34:32 UTC (rev 312)
@@ -844,20 +844,21 @@
     int delay = 1;
 
     /*
-     * This is a backoff of three tries:
+     * This is a backoff of four tries:
      *
      * try1
      * sleep 1
      * try2 
+     * sleep 3
+     * try3
      * sleep 5
-     * try3
      * fail
      */
     do {
         rc = check_device_is_disk(manager, device, disk_name);
         if (rc == -ENOENT) {
             sleep(delay);
-            delay += 4;
+            delay += 2;
         }
     } while ((rc == -ENOENT) && (delay < 6));
 

Modified: trunk/tools/asmtool.c
===================================================================
--- trunk/tools/asmtool.c	2005-09-07 23:03:58 UTC (rev 311)
+++ trunk/tools/asmtool.c	2005-11-04 01:34:32 UTC (rev 312)
@@ -54,6 +54,7 @@
 #include "linux/asmmanager.h"
 
 #include "list.h"
+#include "devmap.h"
 
 
 /*
@@ -66,9 +67,8 @@
 
 /* Kernel ABI ioctls for testing disks */
 #define HDIO_GETGEO             0x0301
-#define LOOP_GET_STATUS64       0x4C05
-#define LOOP_GET_STATUS         0x4C03
 
+
 struct hd_geometry {
     unsigned char heads;
     unsigned char sectors;
@@ -153,7 +153,7 @@
 static void print_usage(int rc);
 static void print_version();
 static int device_is_partition(int fd);
-static int device_is_loopback(int fd);
+static int device_needs_partition(int fd);
 static int open_disk(const char *disk_name);
 static int read_disk(int fd, ASMHeaderInfo *ahi);
 static int write_disk(int fd, ASMHeaderInfo *ahi);
@@ -260,17 +260,20 @@
     return !!geo.start;
 }  /* device_is_partition() */
 
-static int device_is_loopback(int fd)
+static int device_needs_partition(int fd)
 {
-    int rc;
-    char buf[1024];
+    if (device_is_block(fd, "loop"))
+        return 0;
 
-    rc = ioctl(fd, LOOP_GET_STATUS64, buf);
-    if (rc)
-        rc = ioctl(fd, LOOP_GET_STATUS, buf);
-    return !rc;
-}  /* device_is_loopback() */
+    if (device_is_block(fd, "md"))
+        return 0;
 
+    if (device_is_block(fd, "device-mapper"))
+        return 0;
+
+    return 1;
+}
+
 static int open_disk(const char *disk_name)
 {
     int fd, rc;
@@ -953,7 +956,7 @@
     fd = rc;
 
     rc = -EINVAL;
-    if (!device_is_loopback(fd) && !device_is_partition(fd) && attrs->mark)
+    if (attrs->mark && !device_is_partition(fd) && device_needs_partition(fd))
     {
         fprintf(stderr, 
                 "asmtool: Device \"%s\" is not a partition\n",

Added: trunk/tools/devmap.c
===================================================================
--- trunk/tools/devmap.c	2005-09-07 23:03:58 UTC (rev 311)
+++ trunk/tools/devmap.c	2005-11-04 01:34:32 UTC (rev 312)
@@ -0,0 +1,261 @@
+/*
+ * NAME
+ *	devtype.c - Scan system device types.
+ *
+ * AUTHOR
+ * 	Joel Becker <joel.becker at oracle.com>
+ *
+ * DESCRIPTION
+ *      Simple code to check Linux device types.
+ *
+ * MODIFIED   (YYYY/MM/DD)
+ *      2005/10/24 - Joel Becker <joel.becker at oracle.com>
+ *              This file created.
+ *
+ * Copyright (c) 2002-2005 Oracle Corporation.  All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public
+ * License, version 2 as published by the Free Software Foundation.
+ * 
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ * 
+ * You should have recieved a copy of the GNU General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 021110-1307, USA.
+ */
+
+#define _LARGEFILE_SOURCE
+#define _LARGEFILE64_SOURCE
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <errno.h>
+#include <limits.h>
+
+#include "devmap.h"
+
+#define CHAR_TEXT "Character devices:"
+#define BLOCK_TEXT "Block devices:"
+
+struct devmap {
+    char *m_name;
+    unsigned int m_major;
+    struct devmap *m_next;
+};
+
+static struct devmap *char_list = NULL;
+static struct devmap *block_list = NULL;
+
+static void free_major_map_list(struct devmap **map)
+{
+    struct devmap *tmp;
+    while (*map)
+    {
+        tmp = *map;
+        *map = tmp->m_next;
+
+        free(tmp->m_name);
+        free(tmp);
+    }
+}
+
+static void free_major_map(void)
+{
+    free_major_map_list(&char_list);
+    free_major_map_list(&block_list);
+}
+
+static int load_major_map(void)
+{
+    static int loaded = 0;
+    int rc;
+    unsigned int major;
+    char *buffer;
+    char *name;
+    struct devmap *map;
+    struct devmap **list = NULL;
+    FILE *f;
+
+    if (loaded)
+        return 0;
+    
+    buffer = (char *)malloc(sizeof(char) * (PATH_MAX + 1));
+    if (!buffer)
+        return -ENOMEM;
+
+    name = (char *)malloc(sizeof(char) * (PATH_MAX + 1));
+    if (!name)
+    {
+        free(buffer);
+        return -ENOMEM;
+    }
+
+    f = fopen64("/proc/devices", "r");
+    if (!f)
+    {
+        rc = -errno;
+        goto out_free;
+    }
+
+    while (1)
+    {
+        rc = 0;
+        if ((fgets(buffer, PATH_MAX + 1, f)) == NULL)
+            break;
+
+        if (!strncmp(buffer, CHAR_TEXT, strlen(CHAR_TEXT)))
+        {
+            list = &char_list;
+            continue;
+        }
+
+        if (!strncmp(buffer, BLOCK_TEXT, strlen(BLOCK_TEXT)))
+        {
+            list = &block_list;
+            continue;
+        }
+
+        name[0] = '\0';
+        major = 0;
+
+        /* If /proc/devices changes, fix */
+        if (sscanf(buffer, "%u %99[^ \t\n]", &major, name) < 2)
+            continue;
+
+        if (!list)
+            continue;
+
+        //fprintf(stdout, "Device %s: %u\n", name, major);
+        map = malloc(sizeof(struct devmap));
+        if (!map)
+        {
+            rc = -ENOMEM;
+            goto out_free_list;
+        }
+        map->m_name = strdup(name);
+        if (!map->m_name)
+        {
+            rc = -ENOMEM;
+            goto out_free_list;
+        }
+        map->m_major = major;
+        map->m_next = *list;
+        *list = map;
+    }
+
+    fclose(f);
+
+    loaded = 1;
+
+out_free:
+    free(name);
+    free(buffer);
+
+    return rc;
+
+out_free_list:
+    free_major_map();
+    goto out_free;
+}
+
+static const char *lookup_device(struct devmap *map, unsigned int major)
+{
+    while (map)
+    {
+        if (map->m_major == major)
+            return map->m_name;
+
+        map = map->m_next;
+    }
+
+    return NULL;
+}
+
+const char *lookup_char_device(unsigned int major)
+{
+    if (load_major_map())
+        return NULL;
+
+    return lookup_device(char_list, major);
+}
+
+const char *lookup_block_device(unsigned int major)
+{
+    if (load_major_map())
+        return NULL;
+
+    return lookup_device(block_list, major);
+}
+
+int device_is_char(int fd, const char *type)
+{
+    int rc;
+    struct stat64 stat_buf;
+    const char *test_type;
+
+    rc = fstat64(fd, &stat_buf);
+    if (rc)
+        return 0;
+
+    if (!S_ISCHR(stat_buf.st_mode))
+        return 0;
+
+    test_type = lookup_char_device(major(stat_buf.st_rdev));
+    if (test_type && !strcmp(type, test_type))
+        return 1;
+
+    return 0;
+}
+
+int device_is_block(int fd, const char *type)
+{
+    int rc;
+    struct stat64 stat_buf;
+    const char *test_type;
+
+    rc = fstat64(fd, &stat_buf);
+    if (rc)
+        return 0;
+
+    if (!S_ISBLK(stat_buf.st_mode))
+        return 0;
+
+    test_type = lookup_block_device(major(stat_buf.st_rdev));
+    if (test_type && !strcmp(type, test_type))
+        return 1;
+
+    return 0;
+}
+
+#ifdef DEBUG_EXE
+int main(int argc, char *argv[])
+{
+    int rc, i; 
+    char *name;
+
+    rc = load_major_map();
+    if (rc)
+        perror("foo");
+    else
+    {
+        for (i = 1; i < argc; i++)
+        {
+            name = lookup_block_device(atoi(argv[i]));
+            if (name)
+                fprintf(stdout, "%s:%20s\n", name, argv[i]);
+        }
+    }
+
+    free_major_map();
+
+    return rc;
+}
+#endif  /* DEBUG_EXE */

Added: trunk/tools/devmap.h
===================================================================
--- trunk/tools/devmap.h	2005-09-07 23:03:58 UTC (rev 311)
+++ trunk/tools/devmap.h	2005-11-04 01:34:32 UTC (rev 312)
@@ -0,0 +1,70 @@
+/*
+ * NAME
+ *	devmap.h - Linux device type mappings.
+ *
+ * AUTHOR
+ * 	Joel Becker <joel.becker at oracle.com>
+ *
+ * DESCRIPTION
+ *      This is simple code to determine a device's driver.
+ *
+ * MODIFIED   (YYYY/MM/DD)
+ *      2005/10/24 - Joel Becker <joel.becker at oracle.com>
+ *              Initial code.
+ *
+ * Copyright (c) 2002-2005 Oracle Corporation.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *      - Redistributions of source code must retain the above
+ *        copyright notice, this list of conditions and the following
+ *        disclaimer.
+ *      - Redistributions in binary form must reproduce the above
+ *        copyright notice, this list of conditions and the following
+ *        disclaimer in the documentation and/or other materials
+ *        provided with the distribution.
+ *      - Neither the name of Oracle Corporation nor the names of its
+ *        contributors may be used to endorse or promote products
+ *        derived from this software without specific prior written
+ *        permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Alternatively, the contents of this file may be used under the terms
+ * of the GNU General Public License version 2 (the "GPL") distributed
+ * with this softwarere in the file COPYING.GPL, in which case the
+ * provisions of the GPL are applicable instead of the above. 
+ *
+ * If you wish to allow the use of your version of this file only under
+ * the terms of the GPL and not to allow others to use your version of
+ * this file under the license above, indicate your decision by deleting
+ * the provisions above and replace them with the notice and other
+ * provisions required by the GPL.  If you do not delete the provisions
+ * above, a recipient may use your version of this file under the above
+ * license or the GPL.
+ */
+
+
+
+#ifndef _DEVMAP_H
+#define _DEVMAP_H
+
+const char *lookup_char_device(unsigned int major);
+const char *lookup_block_device(unsigned int major);
+int device_is_char(int fd, const char *type);
+int device_is_block(int fd, const char *type);
+
+#endif  /* _DEVMAP_H */

Modified: trunk/vendor/common/oracleasm-support.spec.in
===================================================================
--- trunk/vendor/common/oracleasm-support.spec.in	2005-09-07 23:03:58 UTC (rev 311)
+++ trunk/vendor/common/oracleasm-support.spec.in	2005-11-04 01:34:32 UTC (rev 312)
@@ -40,7 +40,21 @@
 
 
 %build
-%configure --sbindir=/usr/sbin
+./configure					\
+	--prefix=%{_prefix}			\
+	--exec-prefix=%{_exec_prefix}		\
+	--bindir=%{_bindir}			\
+	--sbindir=%{_sbindir}			\
+	--sysconfdir=%{_sysconfdir}		\
+	--datadir=%{_datadir}			\
+	--includedir=%{_includedir}		\
+	--libdir=%{_libdir}			\
+	--libexecdir=%{_libexecdir}		\
+	--localstatedir=%{_localstatedir}	\
+	--sharedstatedir=%{_sharedstatedir}	\
+	--mandir=%{_mandir}			\
+	--infodir=%{_infodir}			\
+	--sbindir=/usr/sbin
 
 cd tools
 make
@@ -70,6 +84,7 @@
 %defattr(-,root,root)
 /usr/sbin/asmtool
 /usr/sbin/asmscan
+%attr(0755,root,root) /usr/lib/oracleasm/oracleasm_debug_link
 %attr(0755,root,root) /etc/init.d/oracleasm
 %config /etc/sysconfig/oracleasm
 

Modified: trunk/vendor/common/oracleasm.init
===================================================================
--- trunk/vendor/common/oracleasm.init	2005-09-07 23:03:58 UTC (rev 311)
+++ trunk/vendor/common/oracleasm.init	2005-11-04 01:34:32 UTC (rev 312)
@@ -126,7 +126,7 @@
     then
         return
     fi
-    failure_status ${REASON}
+    failure_status "${REASON}"
     exit 1
 }
 

Modified: trunk/vendor/redhat/oracleasm-2.6.9-EL.spec-generic.in
===================================================================
--- trunk/vendor/redhat/oracleasm-2.6.9-EL.spec-generic.in	2005-09-07 23:03:58 UTC (rev 311)
+++ trunk/vendor/redhat/oracleasm-2.6.9-EL.spec-generic.in	2005-11-04 01:34:32 UTC (rev 312)
@@ -10,16 +10,18 @@
 
 # Turn on's and off's
 %define buildup		1
-%define buildsmp	1
-%define buildhugemem	1
+%define buildsmp	0
+%define buildhugemem	0
 
 %ifarch i686
 %define karch		i686
+%define buildsmp	1
+%define buildhugemem	1
 %endif
 
 %ifarch x86_64
 %define karch		x86_64
-%define buildhugemem	0
+%define buildsmp	1
 %endif
 
 %ifarch ia32e
@@ -28,11 +30,17 @@
 
 %ifarch ia64
 %define karch		ia64
-%define buildsmp	0
-%define buildhugemem	0
 %endif
 
+%ifarch ppc64
+%define karch		ppc64
+%endif
 
+%ifarch s390x
+%define karch		s390x
+%endif
+
+
 # This must be changed to the minimum ABI compat kernel version expected
 %define base		2.6.9
 %define sver		%{generic}
@@ -40,6 +48,8 @@
 
 # The minimum -support package required for the kernel bits.
 %define support_ver     2.0.0
+# Minimum oracleasmlib version that supports positive ASM_ERR_NODEV.
+%define min_enodev	2.0.1
 
 Summary: The Oracle Automatic Storage Management library driver.
 Name: oracleasm-%{kver}
@@ -56,6 +66,7 @@
 AutoReqProv: no
 Requires: kernel = %{kver}
 Requires: oracleasm-support >= %{support_ver}
+Conflicts: oracleasmlib < %{min_enodev}
 BuildRequires: kernel-devel = %{kver}
 
 
@@ -74,6 +85,7 @@
 Provides: oracleasm = %{version}
 Requires: kernel-smp = %{kver}
 Requires: oracleasm-support >= %{support_ver}
+Conflicts: oracleasmlib < %{min_enodev}
 BuildRequires: kernel-smp-devel = %{kver}
 
 %description -n oracleasm-%{kver}smp
@@ -90,6 +102,7 @@
 AutoReqProv: no
 Requires: kernel-hugemem = %{kver}
 Requires: oracleasm-support >= %{support_ver}
+Conflicts: oracleasmlib < %{min_enodev}
 BuildRequires: kernel-hugemem-devel = %{kver}
 
 %description -n oracleasm-%{kver}hugemem
@@ -105,9 +118,28 @@
 
 %build
 
+local_configure()
+{
+	./configure					\
+		--prefix=%{_prefix}			\
+		--exec-prefix=%{_exec_prefix}		\
+		--bindir=%{_bindir}			\
+		--sbindir=%{_sbindir}			\
+		--sysconfdir=%{_sysconfdir}		\
+		--datadir=%{_datadir}			\
+		--includedir=%{_includedir}		\
+		--libdir=%{_libdir}			\
+		--libexecdir=%{_libexecdir}		\
+		--localstatedir=%{_localstatedir}	\
+		--sharedstatedir=%{_sharedstatedir}	\
+		--mandir=%{_mandir}			\
+		--infodir=%{_infodir}			\
+		--with-kernel="$1"
+}
+
 %if %{buildup}
 KPATH="/usr/src/kernels/%{kver}-%{karch}"
-%configure --with-kernel="${KPATH}"
+local_configure "${KPATH}"
 
 make QUIET=1
 make DESTDIR="$RPM_BUILD_ROOT" INSTALL_MOD_PATH='$(DESTDIR)' install 
@@ -123,7 +155,7 @@
 
 %if %{buildsmp}
 KPATH="/usr/src/kernels/%{kver}-smp-%{karch}"
-%configure --with-kernel="${KPATH}"
+local_configure "${KPATH}"
 
 make QUIET=1
 make DESTDIR="$RPM_BUILD_ROOT" INSTALL_MOD_PATH='$(DESTDIR)' install 
@@ -139,7 +171,7 @@
 
 %if %{buildhugemem}
 KPATH="/usr/src/kernels/%{kver}-hugemem-%{karch}"
-%configure --with-kernel="${KPATH}"
+local_configure "${KPATH}"
 
 make QUIET=1
 make DESTDIR="$RPM_BUILD_ROOT" INSTALL_MOD_PATH='$(DESTDIR)' install 

Modified: trunk/vendor/suse/oracleasm-2.6.5.spec-generic.in
===================================================================
--- trunk/vendor/suse/oracleasm-2.6.5.spec-generic.in	2005-09-07 23:03:58 UTC (rev 311)
+++ trunk/vendor/suse/oracleasm-2.6.5.spec-generic.in	2005-11-04 01:34:32 UTC (rev 312)
@@ -39,9 +39,11 @@
 %define buildsn2		1
 %endif
 
-%ifarch ppc
-%define karch ppc
+%ifarch ppc64
+%define karch ppc64
 
+%define builddefault		0
+%define buildsmp		0
 %define buildbigsmp		0
 %define buildiseries64		1
 %define buildpmac64		1
@@ -58,7 +60,7 @@
 %endif
 
 %ifarch s390x
-%define karch s390x
+%define karch s390
 
 %define builddefault		0
 %define buildsmp		0
@@ -74,6 +76,8 @@
 
 # The minimum -support package required for the kernel bits.
 %define support_ver     2.0.0
+# Minimum oracleasmlib version that supports positive ASM_ERR_NODEV.
+%define min_enodev	2.0.1
 
 Summary: The Oracle Automatic Storage Management library driver.
 Name: oracleasm-%{kver}
@@ -90,6 +94,7 @@
 AutoReqProv: no
 Requires: kernel-default = %{kver}
 Requires: oracleasm-support >= %{support_ver}
+Conflicts: oracleasmlib < %{min_enodev}
 BuildRequires: kernel-source = %{kver}, kernel-syms = %{kver}
 
 
@@ -108,6 +113,7 @@
 Provides: oracleasm = %{version}
 Requires: kernel-default = %{kver}
 Requires: oracleasm-support >= %{support_ver}
+Conflicts: oracleasmlib < %{min_enodev}
 BuildRequires: kernel-source = %{kver}, kernel-syms = %{kver}
 
 %description default
@@ -140,6 +146,7 @@
 AutoReqProv: no
 Requires: kernel-bigsmp = %{kver}
 Requires: oracleasm-support >= %{support_ver}
+Conflicts: oracleasmlib < %{min_enodev}
 BuildRequires: kernel-source = %{kver}, kernel-syms = %{kver}
 
 %description bigsmp
@@ -156,6 +163,7 @@
 AutoReqProv: no
 Requires: kernel-64k-pagesize = %{kver}
 Requires: oracleasm-support >= %{support_ver}
+Conflicts: oracleasmlib < %{min_enodev}
 BuildRequires: kernel-source = %{kver}, kernel-syms = %{kver}
 
 %description 64k-pagesize
@@ -172,6 +180,7 @@
 AutoReqProv: no
 Requires: kernel-sn2 = %{kver}
 Requires: oracleasm-support >= %{support_ver}
+Conflicts: oracleasmlib < %{min_enodev}
 BuildRequires: kernel-source = %{kver}, kernel-syms = %{kver}
 
 %description sn2
@@ -188,6 +197,7 @@
 AutoReqProv: no
 Requires: kernel-iseries64 = %{kver}
 Requires: oracleasm-support >= %{support_ver}
+Conflicts: oracleasmlib < %{min_enodev}
 BuildRequires: kernel-source = %{kver}, kernel-syms = %{kver}
 
 %description iseries64
@@ -204,6 +214,7 @@
 AutoReqProv: no
 Requires: kernel-pmac64 = %{kver}
 Requires: oracleasm-support >= %{support_ver}
+Conflicts: oracleasmlib < %{min_enodev}
 BuildRequires: kernel-source = %{kver}, kernel-syms = %{kver}
 
 %description pmac64
@@ -220,6 +231,7 @@
 AutoReqProv: no
 Requires: kernel-pseries64 = %{kver}
 Requires: oracleasm-support >= %{support_ver}
+Conflicts: oracleasmlib < %{min_enodev}
 BuildRequires: kernel-source = %{kver}, kernel-syms = %{kver}
 
 %description pseries64
@@ -236,6 +248,7 @@
 AutoReqProv: no
 Requires: kernel-s390 = %{kver}
 Requires: oracleasm-support >= %{support_ver}
+Conflicts: oracleasmlib < %{min_enodev}
 BuildRequires: kernel-source = %{kver}, kernel-syms = %{kver}
 
 %description s390
@@ -252,6 +265,7 @@
 AutoReqProv: no
 Requires: kernel-s390x = %{kver}
 Requires: oracleasm-support >= %{support_ver}
+Conflicts: oracleasmlib < %{min_enodev}
 BuildRequires: kernel-source = %{kver}, kernel-syms = %{kver}
 
 %description s390x
@@ -267,9 +281,28 @@
 
 %build
 
+local_configure()
+{
+	./configure					\
+		--prefix=%{_prefix}			\
+		--exec-prefix=%{_exec_prefix}		\
+		--bindir=%{_bindir}			\
+		--sbindir=%{_sbindir}			\
+		--sysconfdir=%{_sysconfdir}		\
+		--datadir=%{_datadir}			\
+		--includedir=%{_includedir}		\
+		--libdir=%{_libdir}			\
+		--libexecdir=%{_libexecdir}		\
+		--localstatedir=%{_localstatedir}	\
+		--sharedstatedir=%{_sharedstatedir}	\
+		--mandir=%{_mandir}			\
+		--infodir=%{_infodir}			\
+		--with-kernel="$1"
+}
+
 %if %{builddefault}
 KPATH="/usr/src/linux-%{kver}-obj/%{karch}/default"
-%configure --with-kernel="${KPATH}"
+local_configure "${KPATH}"
 make QUIET=1
 make DESTDIR="$RPM_BUILD_ROOT" INSTALL_MOD_PATH='$(DESTDIR)' install 
 
@@ -284,7 +317,7 @@
 
 %if %{buildsmp}
 KPATH="/usr/src/linux-%{kver}-obj/%{karch}/smp"
-%configure --with-kernel="${KPATH}"
+local_configure "${KPATH}"
 make QUIET=1
 make DESTDIR="$RPM_BUILD_ROOT" INSTALL_MOD_PATH='$(DESTDIR)' install 
 
@@ -299,7 +332,7 @@
 
 %if %{buildbigsmp}
 KPATH="/usr/src/linux-%{kver}-obj/%{karch}/bigsmp"
-%configure --with-kernel="${KPATH}"
+local_configure "${KPATH}"
 make QUIET=1
 make DESTDIR="$RPM_BUILD_ROOT" INSTALL_MOD_PATH='$(DESTDIR)' install 
 
@@ -314,7 +347,7 @@
 
 %if %{build64kpagesize}
 KPATH="/usr/src/linux-%{kver}-obj/%{karch}/64k-pagesize"
-%configure --with-kernel="${KPATH}"
+local_configure "${KPATH}"
 make QUIET=1
 make DESTDIR="$RPM_BUILD_ROOT" INSTALL_MOD_PATH='$(DESTDIR)' install 
 
@@ -329,7 +362,7 @@
 
 %if %{buildsn2}
 KPATH="/usr/src/linux-%{kver}-obj/%{karch}/sn2"
-%configure --with-kernel="${KPATH}"
+local_configure "${KPATH}"
 make QUIET=1
 make DESTDIR="$RPM_BUILD_ROOT" INSTALL_MOD_PATH='$(DESTDIR)' install 
 
@@ -344,7 +377,7 @@
 
 %if %{buildiseries64}
 KPATH="/usr/src/linux-%{kver}-obj/%{karch}/iseries64"
-%configure --with-kernel="${KPATH}"
+local_configure "${KPATH}"
 make QUIET=1
 make DESTDIR="$RPM_BUILD_ROOT" INSTALL_MOD_PATH='$(DESTDIR)' install 
 
@@ -359,7 +392,7 @@
 
 %if %{buildpmac64}
 KPATH="/usr/src/linux-%{kver}-obj/%{karch}/pmac64"
-%configure --with-kernel="${KPATH}"
+local_configure "${KPATH}"
 make QUIET=1
 make DESTDIR="$RPM_BUILD_ROOT" INSTALL_MOD_PATH='$(DESTDIR)' install 
 
@@ -374,7 +407,7 @@
 
 %if %{buildpseries64}
 KPATH="/usr/src/linux-%{kver}-obj/%{karch}/pseries64"
-%configure --with-kernel="${KPATH}"
+local_configure "${KPATH}"
 make QUIET=1
 make DESTDIR="$RPM_BUILD_ROOT" INSTALL_MOD_PATH='$(DESTDIR)' install 
 
@@ -389,7 +422,7 @@
 
 %if %{builds390}
 KPATH="/usr/src/linux-%{kver}-obj/%{karch}/s390"
-%configure --with-kernel="${KPATH}"
+local_configure "${KPATH}"
 make QUIET=1
 make DESTDIR="$RPM_BUILD_ROOT" INSTALL_MOD_PATH='$(DESTDIR)' install 
 
@@ -404,7 +437,7 @@
 
 %if %{builds390x}
 KPATH="/usr/src/linux-%{kver}-obj/%{karch}/s390x"
-%configure --with-kernel="${KPATH}"
+local_configure "${KPATH}"
 make QUIET=1
 make DESTDIR="$RPM_BUILD_ROOT" INSTALL_MOD_PATH='$(DESTDIR)' install 
 



More information about the Oracleasm-commits mailing list