Re: Newbie: ENBD on kernel 2.6?
Roland Paterson-Jones <[email protected]>
| Newsgroups | gmane.linux.enbd.general |
|---|---|
| Message-ID | <[email protected]> |
Here is how I got past this first error:
---------------------------------------------------------------------------------------------------
[rolandpj@rolandpj-box0 nbd-2.4.32]$ diff nbd/ioctl.c.orig nbd/ioctl.c
57a58,75
> // RPJ
> #ifdef __KERNEL_STRICT_NAMES
>
> #ifdef __CHECKER__
> #define __bitwise __attribute__((bitwise))
> #else
> #define __bitwise
> #endif
>
> typedef __u16 __bitwise __le16;
> typedef __u16 __bitwise __be16;
> typedef __u32 __bitwise __le32;
> typedef __u32 __bitwise __be32;
> typedef __u64 __bitwise __le64;
> typedef __u64 __bitwise __be64;
>
> #endif //__KERNEL_STRICT_NAMES
> // end RPJ
------------------------------------------------------------------------------------------------------
And now it builds further...
--------------------------------------------------------------------------------------------------------
[rolandpj@rolandpj-box0 nbd-2.4.32]$ make
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 ioctl.o -c /usr/local/downloads/nbd-2.4.32/nbd/ioctl.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 ipaddrfile.o -c /usr/local/downloads/nbd-2.4.32/nbd/ipaddrfile.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 pidfile.o -c /usr/local/downloads/nbd-2.4.32/nbd/pidfile.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 interface.o -c /usr/local/downloads/nbd-2.4.32/nbd/interface.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 lockfile.o -c /usr/local/downloads/nbd-2.4.32/nbd/lockfile.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 md5.o -c /usr/local/downloads/nbd-2.4.32/nbd/md5.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 lock.o -c /usr/local/downloads/nbd-2.4.32/nbd/lock.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 shmem.o -c /usr/local/downloads/nbd-2.4.32/nbd/shmem.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 hash.o -c /usr/local/downloads/nbd-2.4.32/nbd/hash.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 time.o -c /usr/local/downloads/nbd-2.4.32/nbd/time.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 sem.o -c /usr/local/downloads/nbd-2.4.32/nbd/sem.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 gm.o -c /usr/local/downloads/nbd-2.4.32/nbd/gm.c
gcc -o enbd-server enbd-server.o socket.o logging.o alarm.o file.o
select.o fil
eserver.o db.o stream.o ioctl.o ipaddrfile.o pidfile.o interface.o
lockfile.o md
5.o lock.o shmem.o hash.o time.o sem.o gm.o
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-sstatd.o -c /usr/local/downloads/nbd-2.4.32/nbd/enbd-sstatd.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 config.o -c /usr/local/downloads/nbd-2.4.32/nbd/config.c
gcc -o enbd-sstatd enbd-sstatd.o config.o ipaddrfile.o lockfile.o select.o
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-client.o -c /usr/local/downloads/nbd-2.4.32/nbd/enbd-client.c
/usr/local/downloads/nbd-2.4.32/nbd/enbd-client.c: In function
`introduction':
/usr/local/downloads/nbd-2.4.32/nbd/enbd-client.c:2869: warning:
dereferencing t
ype-punned pointer will break strict-aliasing rules
/usr/local/downloads/nbd-2.4.32/nbd/enbd-client.c:2874: warning:
dereferencing t
ype-punned pointer will break strict-aliasing rules
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 netserver.o -c /usr/local/downloads/nbd-2.4.32/nbd/netserver.c
gcc -o enbd-client enbd-client.o socket.o logging.o alarm.o stream.o
select.o i
octl.o netserver.o pidfile.o md5.o file.o fileserver.o time.o lock.o
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-cstatd.o -c /usr/local/downloads/nbd-2.4.32/nbd/enbd-cstatd.c
gcc -o enbd-cstatd enbd-cstatd.o config.o interface.o pidfile.o select.o
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-test.o -c /usr/local/downloads/nbd-2.4.32/nbd/enbd-test.c
gcc -o enbd-test enbd-test.o
enbd-test.o(.text+0x23b8): In function `main':
: warning: the use of `tempnam' is dangerous, better use `mkstemp'
make[1]: Leaving directory `/tmp'
test "2.6" = "2.6" && { \
VPATH="/usr/local/downloads/nbd-2.4.32/kernel/linux-2.6.x"; \
cp -a "$VPATH" "/tmp/linux-2.6.x" && \
cd "/tmp/linux-2.6.x/drivers/block"; \
make -C "/lib/modules/2.6.9-1.667/build" \
-f "$VPATH/Makefile" \
SUBDIRS="/tmp/linux-2.6.x/drivers/block/enbd" \
KBUILD_VERBOSE=1 \
CONFIG_BLK_DEV_ENBD=m \
CONFIG_BLK_DEV_ENBD_IOCTL=m \
CFLAGS_MODULE="-DMODULE -I\"$VPATH/include\"" \
MODVERDIR="/tmp/linux-2.6.x/.tmp_versions" \
VERSION="2" \
PATCHLEVEL="6" \
SUBLEVEL="9" \
EXTRAVERSION="-1.667" \
\
modules && \
for file in enbd.ko enbd_ioctl.ko; do \
if ! test -s
"/tmp/linux-2.6.x/drivers/block/enbd/$file"; t
hen \
ld -r -o
"/tmp/linux-2.6.x/drivers/block/enbd/$file" "
/tmp/linux-2.6.x/drivers/block/enbd/${file%.ko}.o"
"/tmp/linux-2.6.x/drivers/blo
ck/enbd/${file%.ko}.mod.o"; \
fi; \
cp "/tmp/linux-2.6.x/drivers/block/enbd/$file"
"/tmp/"; \
done || \
{ echo "*************************************"; \
echo "* please apply kernel patch instead *"; \
echo "*************************************"; \
} ; exit 0; \
}; \
for file in enbd.ko enbd_ioctl.ko; do \
make -C /tmp \
-f
/usr/local/downloads/nbd-2.4.32/kernel/linux/drivers/block/Ma
kefile \
VPATH=/usr/local/downloads/nbd-2.4.32/kernel/linux/drivers/bl
ock \
CONFIG_BLK_DEV_NBD=m \
CC="gcc" \
EXTRA_CFLAGS=" \
-D__KERNEL__ \
-DMODULE \
-DDEBUG=0 \
-DCONFIG_ENBD=m \
-DENBD_VERSION='\"2.4.32 Date: Mon May 16
11:37:1
7 SAST 2005\"' \
-I/usr/local/downloads/nbd-2.4.32/kernel/linux/in
clude \
-I/lib/modules/2.6.9-1.667/build/include \
" \
TOPDIR=/lib/modules/2.6.9-1.667/build \
VERSION="2" \
PATCHLEVEL="6" \
SUBLEVEL="9" \
EXTRAVERSION="-1.667" \
\
$file ; \
done
/bin/sh: line 0: [: -ge: unary operator expected
make[1]: Entering directory `/lib/modules/2.6.9-1.667/build'
*** Warning: Overriding SUBDIRS on the command line can cause
*** inconsistencies
mkdir -p /tmp/linux-2.6.x/.tmp_versions
CHK include/asm-i386/asm_offsets.h
/bin/sh: include/asm-i386/asm_offsets.h.tmp: No such file or directory
UPD include/asm-i386/asm_offsets.h
mv: cannot stat `include/asm-i386/asm_offsets.h.tmp': No such file or
directory
make[1]: *** [include/asm-i386/asm_offsets.h] Error 1
make[1]: Leaving directory `/lib/modules/2.6.9-1.667/build'
*************************************
* please apply kernel patch instead *
*************************************
[rolandpj@rolandpj-box0 nbd-2.4.32]$
---------------------------------------------------------------------------------------------------------------------
I think this is where it gets interesting!
Regards
Roland
Roland Paterson-Jones wrote:
> 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
>>
>>
>>
>>
>