[OpenAFS] Linux 2.6 support

Miroslav Ruda ruda@ics.muni.cz
Tue, 08 Jun 2004 13:59:59 +0200


This is a multi-part message in MIME format.
--------------030101060602050207080507
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

chas williams (contractor) wrote:
> the cvs head of the 1.3 should build a working kernel on a stock
> 2.6 kernel distribution (it wont have pag support unless you patch
> the 2.6 kernel to export the sys call table though and on some of
> the non-i386 arches its also marked readonly which would also need
> to be changed).

Great, I was able to compile (but not use, see below) today's CVS 
head on Suse 9.1 64bit on Opteron. See attached patch and paramfile 
for amd64_linux26. I was not able to compile libafs with Suse kernel 
2.6.4-54.5-x86_64-default (kbuild for libafs.ko failed), but 
complete compilation succeeded with vanila 2.6.6.

Patch should be applicable for others in most cases, the only 
problem I see is in acinclude.m4 - Suse kernel has version.h in in form
#include "some suse config file"
#ifdef default
UTS_RELEASE=..
#else
UTS_RELEASE=..
#fi

The best way would be to compile some program with this header file 
and print  UTS_RELEASE.

I'm able to insert module to kernel, but I'm not able to start afsd 
- it' frozen and no cachefile was created.

sh -x /usr/vice/etc/go
+ /sbin/insmod /usr/vice/etc/libafs-2.6.6.ko
+ /usr/vice/etc/afsd -stat 2800 -dcache 2400 -daemons 5 -volumes 128
... and afsd is frozen forever ...


dmeg |tail -2
libafs: module license 'unspecified' taints kernel.
Failed to find address of sys_call_table
/usr/afsws/bin/klog ruda
Password:
  /usr/afsws/bin/tokens
dmesg
Unable to authenticate to AFS because Cache Manager is not 
initialized / afsd is not running.


 > ps -ef |grep afs
root     12802 12800  0 13:22 pts/34   00:00:00 /usr/vice/etc/afsd 
-stat 2800 -dcache 2400 -daemons 5 -volumes 128
root     12803 12802  0 13:22 pts/34   00:00:00 /usr/vice/etc/afsd 
-stat 2800 -dcache 2400 -daemons 5 -volumes 128
root     12804 12802  0 13:22 pts/34   00:00:00 [afsd] <defunct>
root     12805     1  0 13:22 ?        00:00:00 [afs_cbstart]
root     12806 12802  0 13:22 pts/34   00:00:00 [afsd] <defunct>
root     12807     1  0 13:22 ?        00:00:00 [afs_evtstart]
ruda     12888 12812  0 13:48 pts/35   00:00:00 grep afs



Any idea what's wrong?

BTW: "export the sys call table " - is EXPORT(sys_call_table) 
somewhere in ksyms.c enough?

-- 

              Mirek Ruda

--------------030101060602050207080507
Content-Type: text/plain;
 name="amd64_linux26.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="amd64_linux26.patch"

? src/config/param.amd64_linux26.h
? src/sys/afs.exp
? src/sys/afsl.exp
? src/tvolser/Makefile
? src/volser/voldump
Index: Makefile.in
===================================================================
RCS file: /cvs/openafs/Makefile.in,v
retrieving revision 1.66
diff -b -B -r1.66 Makefile.in
494,495c494,495
< 	amd64_linux24) \
< 		echo Skipping shlibafsrpc for amd64_linux24 ;; \
---
> 	amd64_linux2*) \
> 		echo Skipping shlibafsrpc for amd64 ;; \
504,505c504,505
< 	amd64_linux24) \
< 		echo Skipping shlibafsauthent for amd64_linux24 ;; \
---
> 	amd64_linux2*) \
> 		echo Skipping shlibafsauthent for amd64 ;; \
Index: acinclude.m4
===================================================================
RCS file: /cvs/openafs/acinclude.m4,v
retrieving revision 1.110
diff -b -B -r1.110 acinclude.m4
121a122
>                  set -x
123c124
< 		  linux_kvers=`fgrep UTS_RELEASE $LINUX_KERNEL_PATH/include/linux/version.h |awk 'BEGIN { FS="\"" } { print $[]2 }'|tail -n 1`
---
> 		  linux_kvers=`fgrep UTS_RELEASE $LINUX_KERNEL_PATH/include/linux/version.h |awk 'BEGIN { FS="\"" } { print $[]2 }'|head -1`
157a159
>                 set +x
Index: src/afs/afs.h
===================================================================
RCS file: /cvs/openafs/src/afs/afs.h,v
retrieving revision 1.48
diff -b -B -r1.48 afs.h
46c46
< #if     defined(AFS_SUN56_ENV) || defined(AFS_LINUX24_ENV)
---
> #if     defined(AFS_SUN56_ENV) || defined(AFS_LINUX24_ENV) && !defined(AFS_AMD64_LINUX26_ENV)
Index: src/afs/sysincludes.h
===================================================================
RCS file: /cvs/openafs/src/afs/sysincludes.h,v
retrieving revision 1.25
diff -b -B -r1.25 sysincludes.h
Index: src/afs/LINUX/osi_module.c
===================================================================
RCS file: /cvs/openafs/src/afs/LINUX/osi_module.c,v
retrieving revision 1.50
diff -b -B -r1.50 osi_module.c
25,26c25,26
< #ifdef AFS_AMD64_LINUX20_ENV
< #include "../asm/ia32_unistd.h"
---
> #if defined(AFS_AMD64_LINUX20_ENV) 
> #include "asm/ia32_unistd.h"
Index: src/afs/LINUX/osi_vnodeops.c
===================================================================
RCS file: /cvs/openafs/src/afs/LINUX/osi_vnodeops.c,v
retrieving revision 1.77
diff -b -B -r1.77 osi_vnodeops.c
649c649
< #ifdef AFS_LINUX24_ENV
---
> #if defined(AFS_LINUX24_ENV) && !defined(AFS_AMD64_LINUX26_ENV)
Index: src/cf/osconf.m4
===================================================================
RCS file: /cvs/openafs/src/cf/osconf.m4,v
retrieving revision 1.50
diff -b -B -r1.50 osconf.m4
243a244,256
> 	amd64_linux26)
> 		KERN_OPTMZ=-O2
> 		LEX="flex -l"
> 		MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}'
> 		MT_LIBS="-lpthread"
> 		PAM_CFLAGS="-g -O2 -Dlinux -DLINUX_PAM -fPIC"
> 		SHLIB_LDFLAGS="-shared -Xlinker -x"
> 		TXLIBS="-lncurses"
> 		XCFLAGS="-g -O2 -D_LARGEFILE64_SOURCE"
> 		SHLIB_LINKER="${MT_CC} -shared"
> 		;;
> 
> 
Index: src/config/afs_sysnames.h
===================================================================
RCS file: /cvs/openafs/src/config/afs_sysnames.h,v
retrieving revision 1.48
diff -b -B -r1.48 afs_sysnames.h
201a202
> #define SYS_NAME_ID_amd64_linux26       2703
Index: src/libafs/MakefileProto.LINUX.in
===================================================================
RCS file: /cvs/openafs/src/libafs/MakefileProto.LINUX.in,v
retrieving revision 1.39
diff -b -B -r1.39 MakefileProto.LINUX.in
48c48
< <amd64_linux24>
---
> <amd64_linux24 amd64_linux26>
107c107
< <i386_linux26>
---
> <i386_linux26 amd64_linux26>
109c109
< <all -i386_linux26>
---
> <all -i386_linux26 -amd64_linux26>
232c232
< <i386_linux26>
---
> <i386_linux26 amd64_linux26>
242c242
< <all -i386_linux26>
---
> <all -i386_linux26 -amd64_linux26>

--------------030101060602050207080507
Content-Type: text/x-chdr;
 name="param.amd64_linux26.h"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="param.amd64_linux26.h"

#ifndef UKERNEL
/* This section for kernel libafs compiles only */

/* 
 * Copyright 2000, International Business Machines Corporation and others.
 * All Rights Reserved.
 * 
 * This software has been released under the terms of the IBM Public
 * License.  For details, see the LICENSE file in the top-level source
 * directory or online at http://www.openafs.org/dl/license10.html
 */


#ifndef AFS_PARAM_H
#define AFS_PARAM_H

/* In user space the AFS_LINUX20_ENV should be sufficient. In the kernel,
 * it's a judgment call. If something is obviously amd64 specific, use that
 * #define instead. Note that "20" refers to the linux 2.0 kernel. The "2"
 * in the sysname is the current version of the client. This takes into
 * account the perferred OS user space configuration as well as the kernel.
 */

#define AFS_LINUX20_ENV	1
#define AFS_LINUX22_ENV	1
#define AFS_LINUX24_ENV	1
#define AFS_LINUX26_ENV	1
#define AFS_AMD64_LINUX20_ENV	1
#define AFS_AMD64_LINUX22_ENV	1
#define AFS_AMD64_LINUX24_ENV	1
#define AFS_AMD64_LINUX26_ENV	1
#define AFS_USR_AMD64_LINUX26_ENV 1
#define AFS_LINUX_64BIT_KERNEL 1
#define AFS_NONFSTRANS 1

#define AFS_MOUNT_AFS "afs"	/* The name of the filesystem type. */
#define AFS_SYSCALL 183
#define AFS_64BIT_IOPS_ENV  1
#define AFS_NAMEI_ENV     1	/* User space interface to file system */

#define AFS_64BIT_ENV		1	/* Defines afs_int32 as int, not long. */

#define AFS_64BITPOINTER_ENV	1	/* pointers are 64 bits. */

#if defined(__KERNEL__) && !defined(KDUMP_KERNEL)
#include <linux/threads.h>

#include <linux/config.h>
#ifdef CONFIG_SMP
#undef CONFIG_SMP
#endif
/* Using "AFS_SMP" to map to however many #define's are required to get
 * MP to compile for Linux
 */
#ifdef AFS_SMP
#define CONFIG_SMP 1
#ifndef __SMP__
#define __SMP__
#endif
#define AFS_GLOBAL_SUNLOCK
#endif

/*
#if defined(MODULE) && defined(CONFIG_MODVERSIONS)
#define MODVERSIONS
#include <linux/modversions.h>
#endif
*/

#endif /* __KERNEL__  && !DUMP_KERNEL */

#include <afs/afs_sysnames.h>

#define AFS_USERSPACE_IP_ADDR 1
#define RXK_LISTENER_ENV 1
#define AFS_GCPAGS       2	/* Set to Userdisabled, allow sysctl to override */

/* Machine / Operating system information */
#define SYS_NAME	"amd64_linux26"
#define SYS_NAME_ID	SYS_NAME_ID_amd64_linux26
#define AFSLITTLE_ENDIAN    1
#define AFS_HAVE_FFS        1	/* Use system's ffs. */
#define AFS_HAVE_STATVFS    0	/* System doesn't support statvfs */
#define AFS_VM_RDWR_ENV	    1	/* read/write implemented via VM */

#ifdef KERNEL
#ifndef MIN
#define MIN(A,B) ((A) < (B) ? (A) : (B))
#endif
#ifndef MAX
#define MAX(A,B) ((A) > (B) ? (A) : (B))
#endif
#endif /* KERNEL */

#define USE_UCONTEXT		/* should be in afsconfig.h */

#endif /* _PARAM_AMD64_LINUX20_H_ */

#else /* !defined(UKERNEL) */

/* This section for user space compiles only */

/* 
 * Copyright 2000, International Business Machines Corporation and others.
 * All Rights Reserved.
 * 
 * This software has been released under the terms of the IBM Public
 * License.  For details, see the LICENSE file in the top-level source
 * directory or online at http://www.openafs.org/dl/license10.html
 */


#ifndef AFS_PARAM_H
#define AFS_PARAM_H

/* In user space the AFS_LINUX20_ENV should be sufficient. In the kernel,
 * it's a judgment call. If something is obviously amd64 specific, use that
 * #define instead. Note that "20" refers to the linux 2.0 kernel. The "2"
 * in the sysname is the current version of the client. This takes into
 * account the perferred OS user space configuration as well as the kernel.
 */

#define UKERNEL			1	/* user space kernel */
#define AFS_ENV			1
#define AFS_USR_LINUX20_ENV	1
#define AFS_USR_LINUX22_ENV	1
#define AFS_USR_LINUX24_ENV	1
#define AFS_USR_LINUX26_ENV	1
#define AFS_USR_AMD64_LINUX26_ENV 1
#define AFS_NONFSTRANS 1

#define AFS_MOUNT_AFS "afs"	/* The name of the filesystem type. */
#define AFS_SYSCALL 183
#define AFS_64BIT_IOPS_ENV  1
#define AFS_NAMEI_ENV     1	/* User space interface to file system */
#include <afs/afs_sysnames.h>

#define AFS_USERSPACE_IP_ADDR 1
#define RXK_LISTENER_ENV 1
#define AFS_GCPAGS		0	/* if nonzero, garbage collect PAGs */


/* Machine / Operating system information */
#define SYS_NAME	"amd64_linux26"
#define SYS_NAME_ID	SYS_NAME_ID_amd64_linux26
#define AFSLITTLE_ENDIAN    1
#define AFS_HAVE_FFS        1	/* Use system's ffs. */
#define AFS_HAVE_STATVFS    0	/* System doesn't support statvfs */
#define AFS_VM_RDWR_ENV	    1	/* read/write implemented via VM */

#define	afsio_iov	uio_iov
#define	afsio_iovcnt	uio_iovcnt
#define	afsio_offset	uio_offset
#define	afsio_seg	uio_segflg
#define	afsio_fmode	uio_fmode
#define	afsio_resid	uio_resid
#define	AFS_UIOSYS	1
#define	AFS_UIOUSER	UIO_USERSPACE
#define	AFS_CLBYTES	MCLBYTES
#define	AFS_MINCHANGE	2
#define	VATTR_NULL	usr_vattr_null

#define AFS_DIRENT
#ifndef CMSERVERPREF
#define CMSERVERPREF
#endif

#define USE_UCONTEXT		/* should be in afsconfig.h */

#endif /* AFS_PARAM_H */

#endif /* !defined(UKERNEL) */

--------------030101060602050207080507--