Re: Newbie: ENBD on kernel 2.6?
Roland Paterson-Jones <[email protected]>
| Newsgroups | gmane.linux.enbd.general |
|---|---|
| Message-ID | <[email protected]> |
Hi Peter
Here is the error from a clean 2.4.32 build. As I said in my previous
e-mail, it's fairly obvious why this error is occuring at the code level:
----------------------------------------------------------------------------------------------------------------------------
[rolandpj@rolandpj-box0 nbd-2.4.32]$ make config all
export CONFIG_SITE=/usr/local/downloads/nbd-2.4.32/conf/config.Linux; \
cd /tmp; ./configure --srcdir=/usr/local/downloads/nbd-2.4.32/nbd \
--with-kernel-srcdir=/lib/modules/2.6.9-1.667/
build; \
make VPATH=/usr/local/downloads/nbd-2.4.32/nbd \
CFLAGS="-D_LARGEFILE64_SOURCE=1 -D_LARGEFILE_SOURCE=1
-D_GNU_SOU
RCE=1 -D_XOPEN_SOURCE=1 -D_FILE_OFFSET_BITS=64 -Wall -Winline -O2 \
-I/tmp \
-I/usr/local/downloads/nbd-2.4.32/kernel/linux/include \
-DDEBUG=0" \
EXTRA_LIBS=" " \
config
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking whether warnings should be enabled... yes
checking for install... /usr/bin/install
checking whether byte ordering is bigendian... no
checking for inline... inline
checking for an ANSI C-conforming const... yes
checking how to run the C preprocessor... gcc -E
checking for egrep... grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for unsigned char... yes
checking size of unsigned char... 1
checking for unsigned short int... yes
checking size of unsigned short int... 2
checking for unsigned int... yes
checking size of unsigned int... 4
checking for unsigned long int... yes
checking size of unsigned long int... 4
checking for unsigned long long int... yes
checking size of unsigned long long int... 8
checking for char... yes
checking size of char... 1
checking for short int... yes
checking size of short int... 2
checking for int... yes
checking size of int... 4
checking for long int... yes
checking size of long int... 4
checking for long long int... yes
checking size of long long int... 8
checking for llseek... yes
checking for lseek64... yes
checking for if_nameindex... yes
checking for bdflush... yes
checking for mlockall... yes
checking for daemon... yes
checking for strsep... yes
checking for strtok_r... yes
checking for timeradd... no
checking for atomic_t... no
checking for atomic_set... no
checking for atomic_dec_and_test... no
checking for atomic_inc... no
checking for strgsub in -lpub... no
checking for size_t... no
checking for socklen_t... no
checking whether client should be built... yes
checking where your init scripts are kept... /etc/init.d
checking where pidfiles and state files go... below /var
checking where helper scripts go... ${exec_prefix}/sbin
checking where configuration files go... /etc
checking where man pages go... ${prefix}/man
checking where misc documents go... ${prefix}/share/doc
checking where daemons go... ${exec_prefix}/sbin
configure: creating ./config.status
config.status: creating Makefile
config.status: creating config.h
config.status: config.h is unchanged
make[1]: Entering directory `/tmp'
make[1]: Nothing to be done for `config'.
make[1]: Leaving directory `/tmp'
make -C /tmp VPATH=/usr/local/downloads/nbd-2.4.32/nbd \
CFLAGS="-D_LARGEFILE64_SOURCE=1
-D_LARGEFILE_SOURCE=
1 -D_GNU_SOURCE=1 -D_XOPEN_SOURCE=1 -D_FILE_OFFSET_BITS=64 -Wall
-Winline -O2 \
-I/tmp \
-I/usr/local/downloads/nbd-2.4.32/kernel/linux
/include \
-I/lib/modules/2.6.9-1.667/build/include \
\
-DDEBUG=0" \
EXTRA_LIBS=" \
"
make[1]: Entering directory `/tmp'
gcc -D_LARGEFILE64_SOURCE=1 -D_LARGEFILE_SOURCE=1 -D_GNU_SOURCE=1
-D_XOPEN_SOURC
E=1 -D_FILE_OFFSET_BITS=64 -Wall -Winline -O2 -I/tmp
-I/usr/local/downloads/nb
d-2.4.32/kernel/linux/include
-I/lib/modules/2.6.9-1.667/build/include -DDEBU
G=0 -o enbd-server.o -c /usr/local/downloads/nbd-2.4.32/nbd/enbd-server.c
gcc -D_LARGEFILE64_SOURCE=1 -D_LARGEFILE_SOURCE=1 -D_GNU_SOURCE=1
-D_XOPEN_SOURC
E=1 -D_FILE_OFFSET_BITS=64 -Wall -Winline -O2 -I/tmp
-I/usr/local/downloads/nb
d-2.4.32/kernel/linux/include
-I/lib/modules/2.6.9-1.667/build/include -DDEBU
G=0 -o socket.o -c /usr/local/downloads/nbd-2.4.32/nbd/socket.c
gcc -D_LARGEFILE64_SOURCE=1 -D_LARGEFILE_SOURCE=1 -D_GNU_SOURCE=1
-D_XOPEN_SOURC
E=1 -D_FILE_OFFSET_BITS=64 -Wall -Winline -O2 -I/tmp
-I/usr/local/downloads/nb
d-2.4.32/kernel/linux/include
-I/lib/modules/2.6.9-1.667/build/include -DDEBU
G=0 -o logging.o -c /usr/local/downloads/nbd-2.4.32/nbd/logging.c
gcc -D_LARGEFILE64_SOURCE=1 -D_LARGEFILE_SOURCE=1 -D_GNU_SOURCE=1
-D_XOPEN_SOURC
E=1 -D_FILE_OFFSET_BITS=64 -Wall -Winline -O2 -I/tmp
-I/usr/local/downloads/nb
d-2.4.32/kernel/linux/include
-I/lib/modules/2.6.9-1.667/build/include -DDEBU
G=0 -o alarm.o -c /usr/local/downloads/nbd-2.4.32/nbd/alarm.c
gcc -D_LARGEFILE64_SOURCE=1 -D_LARGEFILE_SOURCE=1 -D_GNU_SOURCE=1
-D_XOPEN_SOURC
E=1 -D_FILE_OFFSET_BITS=64 -Wall -Winline -O2 -I/tmp
-I/usr/local/downloads/nb
d-2.4.32/kernel/linux/include
-I/lib/modules/2.6.9-1.667/build/include -DDEBU
G=0 -o file.o -c /usr/local/downloads/nbd-2.4.32/nbd/file.c
gcc -D_LARGEFILE64_SOURCE=1 -D_LARGEFILE_SOURCE=1 -D_GNU_SOURCE=1
-D_XOPEN_SOURC
E=1 -D_FILE_OFFSET_BITS=64 -Wall -Winline -O2 -I/tmp
-I/usr/local/downloads/nb
d-2.4.32/kernel/linux/include
-I/lib/modules/2.6.9-1.667/build/include -DDEBU
G=0 -o select.o -c /usr/local/downloads/nbd-2.4.32/nbd/select.c
gcc -D_LARGEFILE64_SOURCE=1 -D_LARGEFILE_SOURCE=1 -D_GNU_SOURCE=1
-D_XOPEN_SOURC
E=1 -D_FILE_OFFSET_BITS=64 -Wall -Winline -O2 -I/tmp
-I/usr/local/downloads/nb
d-2.4.32/kernel/linux/include
-I/lib/modules/2.6.9-1.667/build/include -DDEBU
G=0 -c -o fileserver.o /usr/local/downloads/nbd-2.4.32/nbd/fileserver.c
gcc -D_LARGEFILE64_SOURCE=1 -D_LARGEFILE_SOURCE=1 -D_GNU_SOURCE=1
-D_XOPEN_SOURC
E=1 -D_FILE_OFFSET_BITS=64 -Wall -Winline -O2 -I/tmp
-I/usr/local/downloads/nb
d-2.4.32/kernel/linux/include
-I/lib/modules/2.6.9-1.667/build/include -DDEBU
G=0 -o db.o -c /usr/local/downloads/nbd-2.4.32/nbd/db.c
gcc -D_LARGEFILE64_SOURCE=1 -D_LARGEFILE_SOURCE=1 -D_GNU_SOURCE=1
-D_XOPEN_SOURC
E=1 -D_FILE_OFFSET_BITS=64 -Wall -Winline -O2 -I/tmp
-I/usr/local/downloads/nb
d-2.4.32/kernel/linux/include
-I/lib/modules/2.6.9-1.667/build/include -DDEBU
G=0 -o stream.o -c /usr/local/downloads/nbd-2.4.32/nbd/stream.c
gcc -D_LARGEFILE64_SOURCE=1 -D_LARGEFILE_SOURCE=1 -D_GNU_SOURCE=1
-D_XOPEN_SOURC
E=1 -D_FILE_OFFSET_BITS=64 -Wall -Winline -O2 -I/tmp
-I/usr/local/downloads/nb
d-2.4.32/kernel/linux/include
-I/lib/modules/2.6.9-1.667/build/include -DDEBU
G=0 -o ioctl.o -c /usr/local/downloads/nbd-2.4.32/nbd/ioctl.c
In file included from
/lib/modules/2.6.9-1.667/build/include/asm/byteorder.h:57,
from
/lib/modules/2.6.9-1.667/build/include/linux/cdrom.h:14,
from /usr/local/downloads/nbd-2.4.32/nbd/ioctl.c:59:
/lib/modules/2.6.9-1.667/build/include/linux/byteorder/little_endian.h:43:
error
: syntax error before "__cpu_to_le64p"
/lib/modules/2.6.9-1.667/build/include/linux/byteorder/little_endian.h:44:
warni
ng: return type defaults to `int'
/lib/modules/2.6.9-1.667/build/include/linux/byteorder/little_endian.h:
In funct
ion `__cpu_to_le64p':
/lib/modules/2.6.9-1.667/build/include/linux/byteorder/little_endian.h:45:
error
: `__le64' undeclared (first use in this function)
/lib/modules/2.6.9-1.667/build/include/linux/byteorder/little_endian.h:45:
error
: (Each undeclared identifier is reported only once
/lib/modules/2.6.9-1.667/build/include/linux/byteorder/little_endian.h:45:
error
: for each function it appears in.)
/lib/modules/2.6.9-1.667/build/include/linux/byteorder/little_endian.h:
At top l
evel:
/lib/modules/2.6.9-1.667/build/include/linux/byteorder/little_endian.h:47:
warni
ng: type defaults to `int' in declaration of `__le64'
/lib/modules/2.6.9-1.667/build/include/linux/byteorder/little_endian.h:47:
error
: syntax error before '*' token
/lib/modules/2.6.9-1.667/build/include/linux/byteorder/little_endian.h:
In funct
ion `__le64_to_cpup':
/lib/modules/2.6.9-1.667/build/include/linux/byteorder/little_endian.h:49:
error
: `p' undeclared (first use in this function)
/lib/modules/2.6.9-1.667/build/include/linux/byteorder/little_endian.h:
At top l
evel:
/lib/modules/2.6.9-1.667/build/include/linux/byteorder/little_endian.h:51:
error
: syntax error before "__cpu_to_le32p"
/lib/modules/2.6.9-1.667/build/include/linux/byteorder/little_endian.h:52:
warni
ng: return type defaults to `int'
/lib/modules/2.6.9-1.667/build/include/linux/byteorder/little_endian.h:
In funct
ion `__cpu_to_le32p':
/lib/modules/2.6.9-1.667/build/include/linux/byteorder/little_endian.h:53:
error
: `__le32' undeclared (first use in this function)
/lib/modules/2.6.9-1.667/build/include/linux/byteorder/little_endian.h:
At top l
evel:
/lib/modules/2.6.9-1.667/build/include/linux/byteorder/little_endian.h:55:
warni
ng: type defaults to `int' in declaration of `__le32'
/lib/modules/2.6.9-1.667/build/include/linux/byteorder/little_endian.h:55:
error
: syntax error before '*' token
/lib/modules/2.6.9-1.667/build/include/linux/byteorder/little_endian.h:
In funct
ion `__le32_to_cpup':
/lib/modules/2.6.9-1.667/build/include/linux/byteorder/little_endian.h:57:
error
: `p' undeclared (first use in this function)
/lib/modules/2.6.9-1.667/build/include/linux/byteorder/little_endian.h:
At top l
evel:
/lib/modules/2.6.9-1.667/build/include/linux/byteorder/little_endian.h:59:
error
: syntax error before "__cpu_to_le16p"
/lib/modules/2.6.9-1.667/build/include/linux/byteorder/little_endian.h:60:
warni
ng: return type defaults to `int'
/lib/modules/2.6.9-1.667/build/include/linux/byteorder/little_endian.h:
In funct
ion `__cpu_to_le16p':
/lib/modules/2.6.9-1.667/build/include/linux/byteorder/little_endian.h:61:
error
: `__le16' undeclared (first use in this function)
/lib/modules/2.6.9-1.667/build/include/linux/byteorder/little_endian.h:
At top l
evel:
/lib/modules/2.6.9-1.667/build/include/linux/byteorder/little_endian.h:63:
warni
ng: type defaults to `int' in declaration of `__le16'
/lib/modules/2.6.9-1.667/build/include/linux/byteorder/little_endian.h:63:
error
: syntax error before '*' token
/lib/modules/2.6.9-1.667/build/include/linux/byteorder/little_endian.h:
In funct
ion `__le16_to_cpup':
/lib/modules/2.6.9-1.667/build/include/linux/byteorder/little_endian.h:65:
error
: `p' undeclared (first use in this function)
/lib/modules/2.6.9-1.667/build/include/linux/byteorder/little_endian.h:
At top l
evel:
/lib/modules/2.6.9-1.667/build/include/linux/byteorder/little_endian.h:67:
error
: syntax error before "__cpu_to_be64p"
/lib/modules/2.6.9-1.667/build/include/linux/byteorder/little_endian.h:68:
warni
ng: return type defaults to `int'
/lib/modules/2.6.9-1.667/build/include/linux/byteorder/little_endian.h:
In funct
ion `__cpu_to_be64p':
/lib/modules/2.6.9-1.667/build/include/linux/byteorder/little_endian.h:69:
error
: `__be64' undeclared (first use in this function)
/lib/modules/2.6.9-1.667/build/include/linux/byteorder/little_endian.h:69:
error
: syntax error before "__swab64p"
/lib/modules/2.6.9-1.667/build/include/linux/byteorder/little_endian.h:
At top l
evel:
/lib/modules/2.6.9-1.667/build/include/linux/byteorder/little_endian.h:71:
warni
ng: type defaults to `int' in declaration of `__be64'
/lib/modules/2.6.9-1.667/build/include/linux/byteorder/little_endian.h:71:
error
: syntax error before '*' token
/lib/modules/2.6.9-1.667/build/include/linux/byteorder/little_endian.h:
In funct
ion `__be64_to_cpup':
/lib/modules/2.6.9-1.667/build/include/linux/byteorder/little_endian.h:73:
error
: `p' undeclared (first use in this function)
/lib/modules/2.6.9-1.667/build/include/linux/byteorder/little_endian.h:
At top l
evel:
/lib/modules/2.6.9-1.667/build/include/linux/byteorder/little_endian.h:75:
error
: syntax error before "__cpu_to_be32p"
/lib/modules/2.6.9-1.667/build/include/linux/byteorder/little_endian.h:76:
warni
ng: return type defaults to `int'
/lib/modules/2.6.9-1.667/build/include/linux/byteorder/little_endian.h:
In funct
ion `__cpu_to_be32p':
/lib/modules/2.6.9-1.667/build/include/linux/byteorder/little_endian.h:77:
error
: `__be32' undeclared (first use in this function)
/lib/modules/2.6.9-1.667/build/include/linux/byteorder/little_endian.h:77:
error
: syntax error before "__swab32p"
/lib/modules/2.6.9-1.667/build/include/linux/byteorder/little_endian.h:
At top l
evel:
/lib/modules/2.6.9-1.667/build/include/linux/byteorder/little_endian.h:79:
warni
ng: type defaults to `int' in declaration of `__be32'
/lib/modules/2.6.9-1.667/build/include/linux/byteorder/little_endian.h:79:
error
: syntax error before '*' token
/lib/modules/2.6.9-1.667/build/include/linux/byteorder/little_endian.h:
In funct
ion `__be32_to_cpup':
/lib/modules/2.6.9-1.667/build/include/linux/byteorder/little_endian.h:81:
error
: `p' undeclared (first use in this function)
/lib/modules/2.6.9-1.667/build/include/linux/byteorder/little_endian.h:
At top l
evel:
/lib/modules/2.6.9-1.667/build/include/linux/byteorder/little_endian.h:83:
error
: syntax error before "__cpu_to_be16p"
/lib/modules/2.6.9-1.667/build/include/linux/byteorder/little_endian.h:84:
warni
ng: return type defaults to `int'
/lib/modules/2.6.9-1.667/build/include/linux/byteorder/little_endian.h:
In funct
ion `__cpu_to_be16p':
/lib/modules/2.6.9-1.667/build/include/linux/byteorder/little_endian.h:85:
error
: `__be16' undeclared (first use in this function)
/lib/modules/2.6.9-1.667/build/include/linux/byteorder/little_endian.h:85:
error
: syntax error before "__swab16p"
/lib/modules/2.6.9-1.667/build/include/linux/byteorder/little_endian.h:
At top l
evel:
/lib/modules/2.6.9-1.667/build/include/linux/byteorder/little_endian.h:87:
warni
ng: type defaults to `int' in declaration of `__be16'
/lib/modules/2.6.9-1.667/build/include/linux/byteorder/little_endian.h:87:
error
: syntax error before '*' token
/lib/modules/2.6.9-1.667/build/include/linux/byteorder/little_endian.h:
In funct
ion `__be16_to_cpup':
/lib/modules/2.6.9-1.667/build/include/linux/byteorder/little_endian.h:89:
error
: `p' undeclared (first use in this function)
make[1]: *** [ioctl.o] Error 1
make[1]: Leaving directory `/tmp'
make: *** [utils] Error 2
[rolandpj@rolandpj-box0 nbd-2.4.32]$
----------------------------------------------------------------------------------------------------------------
Peter T. Breuer wrote:
>"Also sprach Roland Paterson-Jones:"
>
>
>>I was trying to ./configure then 'make'.
>>
>>
>
>That'll do fine for the daemons (provided that your inlcude/linux stuff
>points at 2.4 kernel headers). For the driver yu need t patch the
>kernel in enbd 2.4.31.
>
>
>
>>Looking around in 2.4.32 I found apparent source directory for 2.6 in
>>
>>
>
>Yes, well, no need to look around. Just type "make" in 2.4.32.
>
>
>
>>kernel/linux-2.6.x, and soft link kernel/linux pointing to the
>>linux-2.4.x directory. So, I linked kernel/linux to point to
>>kernel/linux-2.6.x and tried again.
>>
>>
>
>No - please don't. 2.4.32 will work fine on compiling.
>
>
>
>>Then it gets further, but barfs in some header files (from nbd/ioctl.c).
>>This has to do with types not defined with __KERNEL_STRICT_NAMES but
>>used in stuff from linux/cdrom.h (why are you including cdrom headers?).
>>
>>
>
>Because the ioctls are needed, as are ALL ioctl definitions. Enbd does
>remote ioctls.
>
>
>
>>I hacked by defining the types myself, then it built to completion.
>>
>>But now, 'insmod /tmp/enbd.ko' gets past a few messages from enbd_init
>>(which claims it is 2.4._30_ !) then null pointer exception.
>>
>>
>
>You have compiled it wrong ...
>
>
>
>>Now, realise that I don't really have a clue what I'm doing...
>>
>>
>
>Please say what you are doing, exactly, and show what results. Then I
>can say!
>
>You are supposed to set LINUXDIR to the place where your kernel source
>is, and run "make" (maybe preceded by make config). That should
>compile. If it does not compile the userspace daemons, then it may be
>that you need 2.4 kernel headers to compile userspace code with, and
>2.6 kernel headers to compile kernel code with. But I can only say if you
>show me the error you get (the FIRST one).
>
>
>
>>I saw that you have attempted a patch for 2.6.8 by 'dead reckoning'. Has
>>anyone tried this?
>>
>>
>
>Sure. Me at least!
>
>
>
>>Where can I find out how to apply a kernel patch and rebuild the kernel?
>>
>>
>
>You should not need to do anything (indeed, please don't! - type "make").
>
>Peter
>
>
>
>