Building arla-0.4 on RedHat Linux 5.0/glibc 2.06

Brad Keryan keryan at andrew.cmu.edu
Mon Mar 30 15:59:39 CEST 1998


On Fri, 27 Mar 1998, A.J.Martin wrote:

> Has anyone managed to build the xfs.o module on 
> a RedHat Linux 5.0/glibc 2.06 system? I get a lot 

Yes.

> of warnings/errors from conflicts between the 
> glibc headers in /usr/include/sys and the 
> linux headers in /usr/include/linux...Is there 
> a simple fix?

GNU libc headers are supposed to insulate userland from kernel changes, so
it won't let you include libc headers in kernel code. The types might be
different (eg. sigset_t is larger in libc than kernel, to allow for
expansion). 

At the very end of this message is a patch that gets the xfs kernel module
to build under RedHat 5.0 (glibc 2.0.6-9, kernel 2.0.33, i586-Linux). It
makes a new file, arla-0.4/xfs/linux/missing_types.h, which defines some
of the types that come from <sys/types.h> in libc5 and on other OSes.

Arlad seems to work correctly in test mode (ie, it uses my krb4 tokens and
can read my AFS files).

xfs is not working, however. There are no inodes under /afs when arla is
mounted (not even . or ..). Using "-r clear" didn't help. Neither did
mounting arla before running arlad--in fact when I did that, /afs became a
file with permissions "?---------", according to ls. 

These are the kernel messages from arla:
Mar 30 08:09:35 fatale kernel: init_module
Mar 30 08:09:35 fatale kernel: offset xfs_cache_init: 0681a934offset
xfs_cache_lookup: 0681a9b4offset xfs_cache_add: 0681aad
coffset xfs_cache_delete: 0681ac14init_xfs_fs
Mar 30 08:09:35 fatale kernel: xfs_fs_type: 0681c640
Mar 30 08:09:35 fatale kernel: init_module exit
Mar 30 08:11:55 fatale kernel: xfs_read_super starting
Mar 30 08:11:55 fatale kernel: xfs_read_super: sb: 001e9684 data: 00000000
silent: 0
Mar 30 08:11:55 fatale kernel: xfs_read_super: 0:3
Mar 30 08:11:55 fatale kernel: xfs_read_super: begin setting variables
Mar 30 08:11:55 fatale kernel: xfs_read_super: returning

Here is the arlad log:
read_conffile: /usr/arla/etc/arla.conf
Arlad booting sequence:
initports
Unable to find service afs3-fileserver/udp, using port 7000
Unable to find service afs3-vlserver/udp, using port 7003
conn_init numconns = 100
initconncache
cellcache
volcache numvols = 100
rx
using rxkad level clear
credcache numcreds = 100
fcache low_vnodes = 3000, high_vnodes = 4000low_bytes = 15000000,
high_bytes = 20000000
cmcb
cm
arla init done.
running cleaner: 0 (3000-4000) files, 0 (15000000-20000000) bytes
cleaner done: 0 (3000-4000) files, 0 (15000000-20000000) bytes
Arla: selecting on fd: 6
running cleaner: 0 (3000-4000) files, 0 (15000000-20000000) bytes
cleaner done: 0 (3000-4000) files, 0 (15000000-20000000) bytes
running cleaner: 0 (3000-4000) files, 0 (15000000-20000000) bytes
cleaner done: 0 (3000-4000) files, 0 (15000000-20000000) bytes
running cleaner: 0 (3000-4000) files, 0 (15000000-20000000) bytes
cleaner done: 0 (3000-4000) files, 0 (15000000-20000000) bytes
running cleaner: 0 (3000-4000) files, 0 (15000000-20000000) bytes
cleaner done: 0 (3000-4000) files, 0 (15000000-20000000) bytes
proc_msg: byte = 20
Rec message: opcode = 2 (getroot), size = 20
Multi-send: opcode = 3 (installroot), size = 120
multi-sending wakeup: seq = 0, error = 0
running cleaner: 1 (3000-4000) files, 0 (15000000-20000000) bytes
cleaner done: 1 (3000-4000) files, 0 (15000000-20000000) bytes

I also tried experimenting with the fs command, but didn't seem to get any
useful output.

The patch follows. I cut out the changes to configure, since that's
autogenerated.

	Brad

diff -urN arla-0.4-clean/configure.in arla-0.4/configure.in
--- arla-0.4-clean/configure.in	Wed Mar 25 23:52:59 1998
+++ arla-0.4/configure.in	Sun Mar 29 23:45:03 1998
@@ -120,6 +120,17 @@
   XFS_SUBDIR=linux
   KERNEL=/dev/null
   AC_MSG_RESULT(Linux)
+
+# test for GNU libc
+  AC_MSG_CHECKING([for glibc])
+  AC_EGREP_CPP(yes,
+[#include <features.h>
+#ifdef __GLIBC__
+yes
+#endif
+], [AC_DEFINE(HAVE_GLIBC)
+	AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no)])
+
   ;;
 osf*)
   KERNEL_INCLUDE=`(cd $srcdir; pwd)`/xfs/unknown
diff -urN arla-0.4-clean/include/config.h.in arla-0.4/include/config.h.in
--- arla-0.4-clean/include/config.h.in	Wed Mar 25 23:55:15 1998
+++ arla-0.4/include/config.h.in	Sun Mar 29 23:26:20 1998
@@ -462,3 +462,6 @@
 
 /* Define if your kernel has a vop_nounlock */
 #undef HAVE_KERNEL_VOP_NOUNLOCK
+
+/* Define if you have GNU libc */
+#undef HAVE_GLIBC
\ No newline at end of file
diff -urN arla-0.4-clean/xfs/include/xfs_message.h arla-0.4/xfs/include/xfs_message.h
--- arla-0.4-clean/xfs/include/xfs_message.h	Wed Mar 25 23:53:33 1998
+++ arla-0.4/xfs/include/xfs_message.h	Mon Mar 30 07:36:52 1998
@@ -41,8 +41,10 @@
 #ifndef _xmsg_h
 #define _xmsg_h
 
+#if !(defined(HAVE_GLIBC) && defined(__KERNEL__))
 #include <sys/types.h>
 #include <sys/param.h>
+#endif
 
 #include <xfs_attr.h>
 
diff -urN arla-0.4-clean/xfs/linux/missing_types.h arla-0.4/xfs/linux/missing_types.h
--- arla-0.4-clean/xfs/linux/missing_types.h	Wed Dec 31 19:00:00 1969
+++ arla-0.4/xfs/linux/missing_types.h	Mon Mar 30 07:46:41 1998
@@ -0,0 +1,22 @@
+/* This file defines some types that are missing from the Linux kernel. With
+   GNU libc, we cannot include <sys/types.h> from kernel code, because some
+   things are defined differently */
+
+
+#ifndef __MISSING_TYPES_H__
+#define __MISSING_TYPES_H__
+
+#include <linux/types.h>
+
+typedef __u32 u_int32_t;
+typedef __u16 u_int16_t;
+typedef __u8 u_int8_t;
+typedef __s32 int32_t;
+typedef __s16 int16_t;
+typedef __s8 int8_t;
+
+/* MAXPATHLEN is also defined in libc */
+#include <linux/limits.h>
+#define MAXPATHLEN PATH_MAX
+
+#endif
diff -urN arla-0.4-clean/xfs/linux/xfs_fs.h arla-0.4/xfs/linux/xfs_fs.h
--- arla-0.4-clean/xfs/linux/xfs_fs.h	Wed Mar 25 23:53:35 1998
+++ arla-0.4/xfs/linux/xfs_fs.h	Mon Mar 30 00:09:13 1998
@@ -4,7 +4,10 @@
 #include <xfs_common.h>
 #include <xfs_node.h>
 #include <namei.h>
+
+#ifndef HAVE_GLIBC
 #include <sys/types.h>
+#endif
 
 /*
  * Filesystem struct.
diff -urN arla-0.4-clean/xfs/linux/xfs_locl.h arla-0.4/xfs/linux/xfs_locl.h
--- arla-0.4-clean/xfs/linux/xfs_locl.h	Wed Mar 25 23:53:36 1998
+++ arla-0.4/xfs/linux/xfs_locl.h	Mon Mar 30 07:42:21 1998
@@ -51,6 +51,11 @@
 #include <linux/string.h>
 #include <linux/locks.h>
 #include <linux/module.h>
+
+#ifdef HAVE_GLIBC
+#include "missing_types.h"
+#endif
+
 #include "xfs_message.h"
 #include "xfs_fs.h"
 #include "xfs_node.h"
diff -urN arla-0.4-clean/xfs/linux/xfs_node.h arla-0.4/xfs/linux/xfs_node.h
--- arla-0.4-clean/xfs/linux/xfs_node.h	Wed Mar 25 23:53:36 1998
+++ arla-0.4/xfs/linux/xfs_node.h	Mon Mar 30 07:41:57 1998
@@ -39,6 +39,10 @@
 #ifndef _xfs_xnode_h
 #define _xfs_xnode_h
 
+#ifdef HAVE_GLIBC
+#include "missing_types.h"
+#endif
+
 #include <linux/types.h>
 #include <linux/time.h>
 #include <xfs_attr.h>






More information about the Arla-drinkers mailing list