linux-gpl-only-tests-20060813
authorDerrick Brashear <shadow@dementia.org>
Sun, 13 Aug 2006 17:45:48 +0000 (17:45 +0000)
committerDerrick Brashear <shadow@dementia.org>
Sun, 13 Aug 2006 17:45:48 +0000 (17:45 +0000)
don't try to use gpl-only kernel symbols

acinclude.m4
src/afs/LINUX/osi_probe.c
src/cf/linux-test1.m4
src/cf/linux-test4.m4

index 7acbf69..84903b2 100644 (file)
@@ -606,6 +606,10 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*)
                 LINUX_REFRIGERATOR
                 LINUX_LINUX_KEYRING_SUPPORT
                 LINUX_KEY_ALLOC_NEEDS_STRUCT_TASK
+                 LINUX_EXPORTS_SYS_CHDIR
+                 LINUX_EXPORTS_SYS_CLOSE
+                 LINUX_EXPORTS_SYS_OPEN
+                 LINUX_EXPORTS_SYS_WAIT4
                 LINUX_WHICH_MODULES
                  if test "x$ac_cv_linux_config_modversions" = "xno" -o $AFS_SYSKVERS -ge 26; then
                    AC_MSG_WARN([Cannot determine sys_call_table status. assuming it isn't exported])
@@ -619,9 +623,6 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*)
                    LINUX_EXPORTS_KALLSYMS_SYMBOL
                    LINUX_EXPORTS_SYS_CALL_TABLE
                    LINUX_EXPORTS_IA32_SYS_CALL_TABLE
-                   LINUX_EXPORTS_SYS_CHDIR
-                   LINUX_EXPORTS_SYS_CLOSE
-                   LINUX_EXPORTS_SYS_WAIT4
                    if test "x$ac_cv_linux_exports_sys_call_table" = "xno"; then
                          linux_syscall_method=none
                          if test "x$ac_cv_linux_exports_init_mm" = "xyes"; then
@@ -651,6 +652,9 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*)
                 if test "x$ac_cv_linux_exports_sys_chdir" = "xyes" ; then
                  AC_DEFINE(EXPORTED_SYS_CHDIR, 1, [define if your linux kernel exports sys_chdir])
                 fi
+                if test "x$ac_cv_linux_exports_sys_open" = "xyes" ; then
+                 AC_DEFINE(EXPORTED_SYS_OPEN, 1, [define if your linux kernel exports sys_open])
+                fi
                 if test "x$ac_cv_linux_exports_sys_close" = "xyes" ; then
                  AC_DEFINE(EXPORTED_SYS_CLOSE, 1, [define if your linux kernel exports sys_close])
                 fi
index ee10cb6..3b30fdd 100644 (file)
@@ -231,7 +231,9 @@ extern SYSCALLTYPE sys_call_table_emu[] __attribute__((weak));
 
 extern asmlinkage ssize_t sys_read(unsigned int fd, char __user * buf, size_t count) __attribute__((weak));
 extern asmlinkage long sys_close(unsigned int) __attribute__((weak));
+#if defined(EXPORTED_SYS_CHDIR)
 extern asmlinkage long sys_chdir(const char *) __attribute__((weak));
+#endif
 extern asmlinkage ssize_t sys_write(unsigned int, const char *, size_t) __attribute__((weak));
 #ifdef AFS_LINUX26_ENV
 extern asmlinkage long sys_wait4(pid_t, int *, int, struct rusage *) __attribute__((weak));
@@ -239,7 +241,9 @@ extern asmlinkage long sys_wait4(pid_t, int *, int, struct rusage *) __attribute
 extern asmlinkage long sys_wait4(pid_t, unsigned int *, int, struct rusage *) __attribute__((weak));
 #endif
 extern asmlinkage long sys_exit (int) __attribute__((weak));
+#if defined(EXPORTED_SYS_OPEN)
 extern asmlinkage long sys_open (const char *, int, int) __attribute__((weak));
+#endif
 extern asmlinkage long sys_ioctl(unsigned int, unsigned int, unsigned long) __attribute__((weak));
 
 
@@ -300,14 +304,20 @@ typedef struct {
 /* On PPC64 and SPARC64, we need to omit the ones that might match both tables */
 static tryctl main_try[] = {
 #if !defined(AFS_PPC64_LINUX20_ENV) && !defined(AFS_SPARC64_LINUX20_ENV)
+#if defined(EXPORTED_SYS_CHDIR)
     { "scan: close+chdir+write", __NR_close, &sys_close, __NR_chdir, &sys_chdir, __NR_write, &sys_write },
 #endif
+#endif
     { "scan: close+wait4",       __NR_close, &sys_close, __NR_wait4, &sys_wait4, -1,         0          },
 #if !defined(AFS_PPC64_LINUX20_ENV) && !defined(AFS_SPARC64_LINUX20_ENV)
+#if defined(EXPORTED_SYS_CHDIR)
     { "scan: close+chdir",       __NR_close, &sys_close, __NR_chdir, &sys_chdir, -1,         0          },
 #endif
+#endif
     { "scan: close+ioctl",       __NR_close, &sys_close, __NR_ioctl, &sys_ioctl, -1,         0          },
+#if defined(EXPORTED_SYS_OPEN)
     { "scan: exit+open",         __NR_exit,  &sys_exit,  __NR_open,  &sys_open,  -1,         0          },
+#endif
     { 0 }
 };
 
@@ -590,8 +600,10 @@ static probectl main_probe = {
 
 /* syscall pairs/triplets to probe */
 static tryctl ia32_try[] = {
+#if defined(EXPORTED_SYS_CHDIR)
     { "scan: close+chdir+write", __NR_ia32_close, &sys_close, __NR_ia32_chdir, &sys_chdir,        __NR_ia32_write, &sys_write },
     { "scan: close+chdir",       __NR_ia32_close, &sys_close, __NR_ia32_chdir, &sys_chdir,        -1,              0          },
+#endif
     { 0 }
 };
 
index 3934c90..7deea94 100644 (file)
@@ -11,12 +11,15 @@ CFLAGS += $CPPFLAGS
 obj-m += conftest.o
 _ACEOF
     cat >conftest.c <<\_ACEOF
+#include <linux/module.h>
 $1
 
 void conftest(void)
 { 
 $2
 } 
+
+MODULE_LICENSE("http://www.openafs.org/dl/license10.html");
 _ACEOF
     cd ..
   fi
index 92d435a..34dceed 100644 (file)
@@ -107,10 +107,9 @@ AC_DEFUN([LINUX_EXPORTS_SYS_CHDIR], [
   AC_MSG_CHECKING([for exported sys_chdir])
   AC_CACHE_VAL([ac_cv_linux_exports_sys_chdir], [
     AC_TRY_KBUILD(
-[#include <linux/modversions.h>],
-[#ifndef __ver_sys_chdir
-#error sys_chdir not exported
-#endif],
+[extern asmlinkage long sys_chdir(void) __attribute__((weak));],
+[void *address = &sys_chdir;
+printk("%p\n", address);],
       ac_cv_linux_exports_sys_chdir=yes,
       ac_cv_linux_exports_sys_chdir=no)])
   AC_MSG_RESULT($ac_cv_linux_exports_sys_chdir)])
@@ -120,23 +119,33 @@ AC_DEFUN([LINUX_EXPORTS_SYS_CLOSE], [
   AC_MSG_CHECKING([for exported sys_close])
   AC_CACHE_VAL([ac_cv_linux_exports_sys_close], [
     AC_TRY_KBUILD(
-[#include <linux/modversions.h>],
-[#ifndef __ver_sys_close
-#error sys_close not exported
-#endif],
+[extern asmlinkage long sys_close(void) __attribute__((weak));],
+[void *address = &sys_close;
+printk("%p\n", address);],
       ac_cv_linux_exports_sys_close=yes,
       ac_cv_linux_exports_sys_close=no)])
   AC_MSG_RESULT($ac_cv_linux_exports_sys_close)])
 
 
+AC_DEFUN([LINUX_EXPORTS_SYS_OPEN], [
+  AC_MSG_CHECKING([for exported sys_open])
+  AC_CACHE_VAL([ac_cv_linux_exports_sys_open], [
+    AC_TRY_KBUILD(
+[extern asmlinkage long sys_open(void) __attribute__((weak));],
+[void *address = &sys_open;
+printk("%p\n", address);],
+      ac_cv_linux_exports_sys_open=yes,
+      ac_cv_linux_exports_sys_open=no)])
+  AC_MSG_RESULT($ac_cv_linux_exports_sys_open)])
+
+
 AC_DEFUN([LINUX_EXPORTS_SYS_WAIT4], [
   AC_MSG_CHECKING([for exported sys_wait4])
   AC_CACHE_VAL([ac_cv_linux_exports_sys_wait4], [
     AC_TRY_KBUILD(
-[#include <linux/modversions.h>],
-[#ifndef __ver_sys_wait4
-#error sys_wait4 not exported
-#endif],
+[extern asmlinkage long sys_wait4(void) __attribute__((weak));],
+[void *address = &sys_wait4;
+printk("%p\n", address);],
       ac_cv_linux_exports_sys_wait4=yes,
       ac_cv_linux_exports_sys_wait4=no)])
   AC_MSG_RESULT($ac_cv_linux_exports_sys_wait4)])