zfs-linux / zfs

Native ZFS for Linux
http://wiki.github.com/behlendorf/zfs/
Other
56 stars 2 forks source link

SPL check.sh: insmod: error inserting '../module/spl/spl.ko': -1 Invalid module format #111

Open ptecza opened 13 years ago

ptecza commented 13 years ago

Hello,

It's me again :)

It seems that finally I can build your SPL on my Debian squeeze 64-bit chroot with Linux kernel 2.6.32-5-amd64, but there is an issue with checking the kernel module:

(squeeze-amd64)ptecza@kopa:~/git/linux-zfs/spl$ sudo dpkg-buildpackage -b -uc -us
dpkg-buildpackage: export CFLAGS from dpkg-buildflags (origin: vendor): -g -O2
dpkg-buildpackage: export CPPFLAGS from dpkg-buildflags (origin: vendor): 
dpkg-buildpackage: export CXXFLAGS from dpkg-buildflags (origin: vendor): -g -O2
dpkg-buildpackage: export FFLAGS from dpkg-buildflags (origin: vendor): -g -O2
dpkg-buildpackage: export LDFLAGS from dpkg-buildflags (origin: vendor): 
dpkg-buildpackage: source package spl
dpkg-buildpackage: source version 0.5-2
dpkg-buildpackage: source changed by kqinfo <zfs@kqinfotech.com>
 dpkg-source --before-build spl
dpkg-buildpackage: host architecture amd64
 debian/rules clean
dh  clean
   dh_testdir
   dh_auto_clean
    make -j1 distclean
make[1]: Entering directory `/home/ptecza/git/linux-zfs/spl'
Making distclean in include
make[2]: Entering directory `/home/ptecza/git/linux-zfs/spl/include'
rm -rf .libs _libs
rm -f *.lo
test -z "" || rm -f 
test . = "." || test -z "" || rm -f 
rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
rm -f Makefile
make[2]: Leaving directory `/home/ptecza/git/linux-zfs/spl/include'
Making distclean in module
make[2]: Entering directory `/home/ptecza/git/linux-zfs/spl/module'
make -C /usr/src/linux-headers-2.6.32-5-amd64/ SUBDIRS=`pwd`  clean
make[3]: Entering directory `/usr/src/linux-headers-2.6.32-5-amd64'
  CLEAN   /home/ptecza/git/linux-zfs/spl/module/.tmp_versions
  CLEAN   /home/ptecza/git/linux-zfs/spl/module/Module.symvers /home/ptecza/git/linux-zfs/spl/module/modules.order
make[3]: Leaving directory `/usr/src/linux-headers-2.6.32-5-amd64'
if [ -f Module.symvers ]; then rm -f Module.symvers; fi
if [ -f Module.markers ]; then rm -f Module.markers; fi
make[2]: Leaving directory `/home/ptecza/git/linux-zfs/spl/module'
Making distclean in scripts
make[2]: Entering directory `/home/ptecza/git/linux-zfs/spl/scripts'
rm -rf .libs _libs
rm -f *.lo
test -z "" || rm -f 
test . = "." || test -z "" || rm -f 
rm -f Makefile
make[2]: Leaving directory `/home/ptecza/git/linux-zfs/spl/scripts'
Making distclean in cmd
make[2]: Entering directory `/home/ptecza/git/linux-zfs/spl/cmd'
rm -rf .libs _libs
 rm -f spl splat
rm -f *.o
rm -f *.lo
rm -f *.tab.c
test -z "" || rm -f 
test . = "." || test -z "" || rm -f 
rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
rm -rf ./.deps
rm -f Makefile
make[2]: Leaving directory `/home/ptecza/git/linux-zfs/spl/cmd'
Making distclean in lib
make[2]: Entering directory `/home/ptecza/git/linux-zfs/spl/lib'
rm -rf .libs _libs
test -z "libcommon.la" || rm -f libcommon.la
rm -f "./so_locations"
rm -f *.o
rm -f *.lo
rm -f *.tab.c
test -z "" || rm -f 
test . = "." || test -z "" || rm -f 
rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
rm -rf ./.deps
rm -f Makefile
make[2]: Leaving directory `/home/ptecza/git/linux-zfs/spl/lib'
Making distclean in .
make[2]: Entering directory `/home/ptecza/git/linux-zfs/spl'
rm -rf .libs _libs
rm -f *.lo
test -z "module/Makefile module/spl/Makefile module/splat/Makefile spl.spec spl-modules.spec" || rm -f module/Makefile module/spl/Makefile module/splat/Makefile spl.spec spl-modules.spec
test . = "." || test -z "" || rm -f 
rm -f spl_config.h stamp-h1
rm -f libtool config.lt
rm -f -R autom4te*.cache
find . \( -name SCCS -o -name BitKeeper -o -name .svn -o -name CVS \
        -o -name .pc -o -name .hg -o -name .git \) -prune -o \
        \( -name '*.orig' -o -name '*.rej' -o -name '*~' \
        -o -name '*.bak' -o -name '#*#' -o -name '.*.orig' \
        -o -name '.*.rej' -o -name 'aclocal.m4' -o -size 0 \
        -o -name '*%' -o -name '.*.cmd' -o -name 'core' \
        -o -name 'Makefile' -o -name 'Module.symvers' \
        -o -name '*.order' -o -name '*.markers' \) \
        -type f -print | xargs rm -f
rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
make[2]: Leaving directory `/home/ptecza/git/linux-zfs/spl'
rm -f config.status config.cache config.log configure.lineno config.status.lineno
rm -f Makefile
make[1]: Leaving directory `/home/ptecza/git/linux-zfs/spl'
   dh_clean
    rm -f debian/spl.substvars
    rm -f debian/spl.*.debhelper
    rm -f debian/spl.debhelper.log
    rm -rf debian/spl/
    rm -f debian/files
    find .  \( \( -type f -a \
            \( -name '#*#' -o -name '.*~' -o -name '*~' -o -name DEADJOE \
         -o -name '*.orig' -o -name '*.rej' -o -name '*.bak' \
         -o -name '.*.orig' -o -name .*.rej -o -name '.SUMS' \
         -o -name TAGS -o \( -path '*/.deps/*' -a -name '*.P' \) \
        \) -exec rm -f {} \; \) -o \
        \( -type d -a -name autom4te.cache -prune -exec rm -rf {} \; \) \)
    rm -f *-stamp
 debian/rules build
dh  build
   dh_testdir
   debian/rules override_dh_auto_configure
make[1]: Entering directory `/home/ptecza/git/linux-zfs/spl'
dh_auto_configure -- --with-linux=/usr/src/linux-headers-2.6.32-5-amd64/
    ./configure --build=x86_64-linux-gnu --prefix=/usr --includedir=\${prefix}/include --mandir=\${prefix}/share/man --infodir=\${prefix}/share/info --sysconfdir=/etc --localstatedir=/var --libexecdir=\${prefix}/lib/spl --disable-maintainer-mode --disable-dependency-tracking --with-linux=/usr/src/linux-headers-2.6.32-5-amd64/
checking metadata... yes
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... x86_64-pc-linux-gnu
checking whether to enable maintainer-specific portions of Makefiles... no
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
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 ISO C89... none needed
checking for style of include used by make... GNU
checking dependency style of gcc... none
checking how to print strings... printf
checking for a sed that does not truncate output... /bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for fgrep... /bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 3458764513820540925
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for ar... ar
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking how to run the C preprocessor... gcc -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 dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking spl license... GPL
checking whether rpm is available... no
checking whether rpmbuild is available... no
checking whether dpkg is available... yes (1.15.8.8)
checking whether dpkg-buildpackage is available... yes (1.15.8.8)
checking whether alien is available... no
checking linux distribution... debian
checking default package type... deb
checking spl config... all
checking kernel source directory... /usr/src/linux-headers-2.6.32-5-amd64/
checking kernel build directory... /usr/src/linux-headers-2.6.32-5-amd64/
checking kernel source version... 2.6.32-5-amd64
checking kernel file name for module symbols... Module.symvers
checking whether debugging is enabled... no
checking whether basic kmem accounting is enabled... yes
checking whether detailed kmem tracking is enabled... no
checking whether atomic types use spinlocks... no
checking whether kernel defines atomic64_t... yes
checking whether kernel defines atomic64_cmpxchg... yes
checking whether kernel defines atomic64_xchg... yes
checking whether kernel defines uintptr_t... yes
checking whether INIT_WORK wants 3 args... no
checking whether register_sysctl_table() wants 2 args... no
checking whether set_shrinker() available... no
checking whether shrinker callback wants 3 args... no
checking whether struct path used in struct nameidata... yes
checking whether symbol task_curr is exported... no
checking whether unnumbered sysctl support exists... yes
checking whether struct ctl_table has ctl_name... yes
checking whether fls64() is available... yes
checking whether symbol device_create is exported... yes
checking whether device_create() wants 5 args... yes
checking whether symbol class_device_create is exported... no
checking whether symbol set_normalized_timespec is exported... yes
checking whether set_normalized_timespec() is an inline... yes
checking whether timespec_sub() is available... yes
checking whether init_utsname() is available... yes
checking whether header linux/fdtable.h exists... yes
checking whether files_fdtable() is available... yes
checking whether header linux/uaccess.h exists... yes
checking whether kmalloc_node() is available... yes
checking whether symbol monotonic_clock is exported... no
checking whether struct inode has i_mutex... yes
checking whether struct mutex has owner... yes
checking whether mutex_lock_nested() is available... yes
checking whether on_each_cpu() wants 3 args... yes
checking whether symbol kallsyms_lookup_name is exported... no
checking whether symbol get_vmalloc_info is exported... no
checking whether symbol *_pgdat exist... no
checking whether symbol first_online_pgdat is exported... no
checking whether symbol next_online_pgdat is exported... no
checking whether symbol next_zone is exported... no
checking whether symbol pgdat_list is exported... no
checking whether global_page_state() is available... yes
checking whether page state NR_FREE_PAGES is available... yes
checking whether page state NR_INACTIVE is available... no
checking whether page state NR_INACTIVE_ANON is available... yes
checking whether page state NR_INACTIVE_FILE is available... yes
checking whether page state NR_ACTIVE is available... no
checking whether page state NR_ACTIVE_ANON is available... yes
checking whether page state NR_ACTIVE_FILE is available... yes
checking whether symbol get_zone_counts is needed... no
checking whether symbol user_path_at is exported... yes
checking whether symbol set_fs_pwd is exported... no
checking whether set_fs_pwd() wants 2 args... yes
checking whether vfs_unlink() wants 2 args... yes
checking whether vfs_rename() wants 4 args... yes
checking whether struct fs_struct uses spinlock_t... no
checking whether struct cred exists... yes
checking whether symbol groups_search is exported... no
checking whether symbol __put_task_struct is exported... no
checking whether proc_handler() wants 5 args... yes
checking whether symbol kvasprintf is exported... yes
checking whether file_fsync() wants 3 args... yes
checking whether symbol rwsem_is_locked is exported... no
configure: creating ./config.status
config.status: creating Makefile
config.status: creating lib/Makefile
config.status: creating cmd/Makefile
config.status: creating module/Makefile
config.status: creating module/spl/Makefile
config.status: creating module/splat/Makefile
config.status: creating include/Makefile
config.status: creating scripts/Makefile
config.status: creating spl.spec
config.status: creating spl-modules.spec
config.status: creating spl_config.h
config.status: executing depfiles commands
config.status: executing libtool commands
make[1]: Leaving directory `/home/ptecza/git/linux-zfs/spl'
   dh_auto_build
    make -j1
make[1]: Entering directory `/home/ptecza/git/linux-zfs/spl'
make  all-recursive
make[2]: Entering directory `/home/ptecza/git/linux-zfs/spl'
Making all in lib
make[3]: Entering directory `/home/ptecza/git/linux-zfs/spl/lib'
\
#   source='list.c' object='list.lo' libtool=yes 
/bin/bash ../libtool  --tag=CC --silent  --mode=compile gcc -DHAVE_CONFIG_H -include ../spl_config.h    -Wall -Wshadow -Wstrict-prototypes -fno-strict-aliasing -D__USE_LARGEFILE64 -DNDEBUG -g -O2 -c -o list.lo list.c
/bin/bash ../libtool  --tag=CC --silent  --mode=link gcc -Wall -Wshadow -Wstrict-prototypes -fno-strict-aliasing -D__USE_LARGEFILE64 -DNDEBUG -g -O2   -o libcommon.la  list.lo  
make[3]: Leaving directory `/home/ptecza/git/linux-zfs/spl/lib'
Making all in cmd
make[3]: Entering directory `/home/ptecza/git/linux-zfs/spl/cmd'
\
#   source='spl.c' object='spl.o' libtool=no 
gcc -DHAVE_CONFIG_H -include ../spl_config.h -I../lib    -Wall -Wshadow -Wstrict-prototypes -fno-strict-aliasing -D__USE_LARGEFILE64 -DNDEBUG -g -O2 -c spl.c
/bin/bash ../libtool  --tag=CC --silent  --mode=link gcc -Wall -Wshadow -Wstrict-prototypes -fno-strict-aliasing -D__USE_LARGEFILE64 -DNDEBUG -g -O2   -o spl spl.o  
\
#   source='splat.c' object='splat.o' libtool=no 
gcc -DHAVE_CONFIG_H -include ../spl_config.h -I../lib    -Wall -Wshadow -Wstrict-prototypes -fno-strict-aliasing -D__USE_LARGEFILE64 -DNDEBUG -g -O2 -c splat.c
/bin/bash ../libtool  --tag=CC --silent  --mode=link gcc -Wall -Wshadow -Wstrict-prototypes -fno-strict-aliasing -D__USE_LARGEFILE64 -DNDEBUG -g -O2 ../lib/libcommon.la  -o splat splat.o  
make[3]: Leaving directory `/home/ptecza/git/linux-zfs/spl/cmd'
Making all in scripts
make[3]: Entering directory `/home/ptecza/git/linux-zfs/spl/scripts'
make[3]: Nothing to be done for `all'.
make[3]: Leaving directory `/home/ptecza/git/linux-zfs/spl/scripts'
Making all in module
make[3]: Entering directory `/home/ptecza/git/linux-zfs/spl/module'
make -C /usr/src/linux-headers-2.6.32-5-amd64/ SUBDIRS=`pwd`  modules
make[4]: Entering directory `/usr/src/linux-headers-2.6.32-5-amd64'
  CC [M]  /home/ptecza/git/linux-zfs/spl/module/spl/../../module/spl/spl-debug.o
  CC [M]  /home/ptecza/git/linux-zfs/spl/module/spl/../../module/spl/spl-proc.o
  CC [M]  /home/ptecza/git/linux-zfs/spl/module/spl/../../module/spl/spl-kmem.o
  CC [M]  /home/ptecza/git/linux-zfs/spl/module/spl/../../module/spl/spl-thread.o
  CC [M]  /home/ptecza/git/linux-zfs/spl/module/spl/../../module/spl/spl-taskq.o
  CC [M]  /home/ptecza/git/linux-zfs/spl/module/spl/../../module/spl/spl-rwlock.o
  CC [M]  /home/ptecza/git/linux-zfs/spl/module/spl/../../module/spl/spl-vnode.o
  CC [M]  /home/ptecza/git/linux-zfs/spl/module/spl/../../module/spl/spl-err.o
  CC [M]  /home/ptecza/git/linux-zfs/spl/module/spl/../../module/spl/spl-time.o
  CC [M]  /home/ptecza/git/linux-zfs/spl/module/spl/../../module/spl/spl-kobj.o
  CC [M]  /home/ptecza/git/linux-zfs/spl/module/spl/../../module/spl/spl-module.o
  CC [M]  /home/ptecza/git/linux-zfs/spl/module/spl/../../module/spl/spl-generic.o
  CC [M]  /home/ptecza/git/linux-zfs/spl/module/spl/../../module/spl/spl-atomic.o
  CC [M]  /home/ptecza/git/linux-zfs/spl/module/spl/../../module/spl/spl-mutex.o
  CC [M]  /home/ptecza/git/linux-zfs/spl/module/spl/../../module/spl/spl-kstat.o
  CC [M]  /home/ptecza/git/linux-zfs/spl/module/spl/../../module/spl/spl-condvar.o
  CC [M]  /home/ptecza/git/linux-zfs/spl/module/spl/../../module/spl/spl-xdr.o
  CC [M]  /home/ptecza/git/linux-zfs/spl/module/spl/../../module/spl/spl-cred.o
  CC [M]  /home/ptecza/git/linux-zfs/spl/module/spl/../../module/spl/spl-tsd.o
  CC [M]  /home/ptecza/git/linux-zfs/spl/module/spl/../../module/spl/spl-flock.o
  CC [M]  /home/ptecza/git/linux-zfs/spl/module/spl/../../module/spl/spl-dnlc.o
  LD [M]  /home/ptecza/git/linux-zfs/spl/module/spl/spl.o
  CC [M]  /home/ptecza/git/linux-zfs/spl/module/splat/../../module/splat/splat-ctl.o
  CC [M]  /home/ptecza/git/linux-zfs/spl/module/splat/../../module/splat/splat-kmem.o
  CC [M]  /home/ptecza/git/linux-zfs/spl/module/splat/../../module/splat/splat-taskq.o
  CC [M]  /home/ptecza/git/linux-zfs/spl/module/splat/../../module/splat/splat-random.o
  CC [M]  /home/ptecza/git/linux-zfs/spl/module/splat/../../module/splat/splat-mutex.o
  CC [M]  /home/ptecza/git/linux-zfs/spl/module/splat/../../module/splat/splat-condvar.o
  CC [M]  /home/ptecza/git/linux-zfs/spl/module/splat/../../module/splat/splat-thread.o
  CC [M]  /home/ptecza/git/linux-zfs/spl/module/splat/../../module/splat/splat-rwlock.o
  CC [M]  /home/ptecza/git/linux-zfs/spl/module/splat/../../module/splat/splat-time.o
  CC [M]  /home/ptecza/git/linux-zfs/spl/module/splat/../../module/splat/splat-vnode.o
  CC [M]  /home/ptecza/git/linux-zfs/spl/module/splat/../../module/splat/splat-kobj.o
  CC [M]  /home/ptecza/git/linux-zfs/spl/module/splat/../../module/splat/splat-atomic.o
  CC [M]  /home/ptecza/git/linux-zfs/spl/module/splat/../../module/splat/splat-list.o
  CC [M]  /home/ptecza/git/linux-zfs/spl/module/splat/../../module/splat/splat-generic.o
  CC [M]  /home/ptecza/git/linux-zfs/spl/module/splat/../../module/splat/splat-cred.o
  LD [M]  /home/ptecza/git/linux-zfs/spl/module/splat/splat.o
  Building modules, stage 2.
  MODPOST 2 modules
WARNING: "next_zone" [/home/ptecza/git/linux-zfs/spl/module/spl/spl.ko] undefined!
WARNING: "first_online_pgdat" [/home/ptecza/git/linux-zfs/spl/module/spl/spl.ko] undefined!
  CC      /home/ptecza/git/linux-zfs/spl/module/spl/spl.mod.o
  LD [M]  /home/ptecza/git/linux-zfs/spl/module/spl/spl.ko
  CC      /home/ptecza/git/linux-zfs/spl/module/splat/splat.mod.o
  LD [M]  /home/ptecza/git/linux-zfs/spl/module/splat/splat.ko
make[4]: Leaving directory `/usr/src/linux-headers-2.6.32-5-amd64'
make[3]: Leaving directory `/home/ptecza/git/linux-zfs/spl/module'
Making all in include
make[3]: Entering directory `/home/ptecza/git/linux-zfs/spl/include'
make[3]: Nothing to be done for `all'.
make[3]: Leaving directory `/home/ptecza/git/linux-zfs/spl/include'
make[3]: Entering directory `/home/ptecza/git/linux-zfs/spl'
make[3]: Nothing to be done for `all-am'.
make[3]: Leaving directory `/home/ptecza/git/linux-zfs/spl'
make[2]: Leaving directory `/home/ptecza/git/linux-zfs/spl'
make[1]: Leaving directory `/home/ptecza/git/linux-zfs/spl'
   dh_auto_test
    make -j1 check
make[1]: Entering directory `/home/ptecza/git/linux-zfs/spl'
Making check in lib
make[2]: Entering directory `/home/ptecza/git/linux-zfs/spl/lib'
make[2]: Nothing to be done for `check'.
make[2]: Leaving directory `/home/ptecza/git/linux-zfs/spl/lib'
Making check in cmd
make[2]: Entering directory `/home/ptecza/git/linux-zfs/spl/cmd'
make[2]: Nothing to be done for `check'.
make[2]: Leaving directory `/home/ptecza/git/linux-zfs/spl/cmd'
Making check in scripts
make[2]: Entering directory `/home/ptecza/git/linux-zfs/spl/scripts'
../scripts/check.sh
Loading ../module/spl/spl.ko
insmod: error inserting '../module/spl/spl.ko': -1 Invalid module format
check.sh: Failed to load ../module/spl/spl.ko
make[2]: *** [check] Error 1
make[2]: Leaving directory `/home/ptecza/git/linux-zfs/spl/scripts'
make[1]: *** [check-recursive] Error 1
make[1]: Leaving directory `/home/ptecza/git/linux-zfs/spl'
dh_auto_test: make -j1 check returned exit code 2
make: *** [build] Error 25
dpkg-buildpackage: error: debian/rules build gave error exit status 2

How can I fix it?

My best regards, Pawel

nkhare commented 13 years ago

From the logs I see :- WARNING: "next_zone" [/home/ptecza/git/linux-zfs/spl/module/spl/spl.ko] undefined! WARNING: "first_online_pgdat" [/home/ptecza/git/linux-zfs/spl/module/spl/spl.ko] undefined!

It looks these symbols are not exported. In the SPL source code, there is a folder called "patches". Can you apply "fc11-spl-export-symbols.patch" patch and try it again.

ptecza commented 13 years ago

Hi Neependra,

Thanks a lot for your reply! I guess I need to apply that patch against the sources of Linux kernel 2.6.32? Now I have only installed Debian package with the kernel headers.

My best regards, Pawel

jonathan-molyneux commented 13 years ago

Give this a go:

./configure --with-linux=/usr/src/linux-headers-2.6.32-5-common/ --with-linux-obj=/usr/src/linux-headers-2.6.32-5-686/

ptecza commented 13 years ago

Hello,

Thanks a lot for the hint! But unfortunately it's not so easy...

(squeeze-amd64)ptecza@kopa:~/git/linux-zfs/spl$ LANG=C dpkg-buildpackage -b -uc -us -rfakeroot
[...]
configure: exit 1
dh_auto_configure: ./configure --build=x86_64-linux-gnu --prefix=/usr --includedir=${prefix}/include --mandir=${prefix}/share/man --infodir=${prefix}/share/info --sysconfdir=/etc --localstatedir=/var --libexecdir=${prefix}/lib/spl --disable-maintainer-mode --disable-dependency-tracking --with-linux=/usr/src/linux-headers-2.6.32-5-common/ --with-linux-obj=/usr/src/linux-headers-2.6.32-5-686/ returned exit code 1
make[1]: *** [override_dh_auto_configure] Error 9
make[1]: Leaving directory `/home/ptecza/git/linux-zfs/spl'
make: *** [build] Error 2
dpkg-buildpackage: error: debian/rules build gave error exit status 2

In config.log file I can see the following messages:

configure:14234: checking kernel source directory
configure:14262: result: /usr/src/linux-headers-2.6.32-5-common/
configure:14264: checking kernel build directory
configure:14277: result: /usr/src/linux-headers-2.6.32-5-686/
configure:14280: checking kernel source version
configure:14305: result: Not found
configure:14307: error: *** Cannot find UTS_RELEASE definition.

I believe that I still need to have Linux kernel sources, because I have to patch them against missing SPL export symbols. Debian linux-headers-2.6.32* packages don't contain these files:

(squeeze-amd64)ptecza@kopa:~/git/linux-zfs/spl$ grep '^+++' patches/fc11-spl-export-symbols.patch
+++ b/fs/proc/mmu.c
+++ b/kernel/groups.c
+++ b/kernel/sched.c
+++ b/mm/mmzone.c
+++ b/kernel/fork.c
(squeeze-amd64)ptecza@kopa:~/git/linux-zfs/spl$
(squeeze-amd64)ptecza@kopa:~/git/linux-zfs/spl$ find /usr/src/linux-headers-2.6.32-5-* -type f -name mmu.c
(squeeze-amd64)ptecza@kopa:~/git/linux-zfs/spl$

Best regards, Pawel

ptecza commented 13 years ago

I've just installed Debian source package linux-image-2.6.32-5-686 and patched it using fc11-spl-export-symbols.patch file.

(squeeze-amd64)ptecza@kopa:~/debian$ sudo apt-get source linux-image-2.6.32-5-686
(squeeze-amd64)ptecza@kopa:~/debian$ sudo apt-get build-dep linux-image-2.6.32-5-686
(squeeze-amd64)ptecza@kopa:~/debian$ sudo chown -R ptecza.staff linux-2.6-2.6.32/
(squeeze-amd64)ptecza@kopa:~/debian$ cd linux-2.6-2.6.32/

(squeeze-amd64)ptecza@kopa:~/debian/linux-2.6-2.6.32$ LANG=C make -f debian/rules.gen source_amd64_none
[...]
rm -rf 'debian/build/source_amd64_none'
cp -al 'debian/build/source' 'debian/build/source_amd64_none'
cd 'debian/build/source_amd64_none'; python '/home/ptecza/debian/linux-2.6-2.6.32/debian/bin/patch.apply' --overwrite-home='/home/ptecza/debian/linux-2.6-2.6.32/debian/patches' -a amd64 -f none
--> Try to apply 30-extra.
--> 30-extra fully applied.
make[1]: Leaving directory `/home/ptecza/debian/linux-2.6-2.6.32'

(squeeze-amd64)ptecza@kopa:~/debian/linux-2.6-2.6.32$ LANG=C patch -d debian/build/source/ -p1 < ~/git/linux-zfs/spl/patches/fc11-spl-export-symbols.patch
patching file fs/proc/mmu.c
patching file kernel/groups.c
Hunk \#1 succeeded at 152 (offset -1 lines).
patching file kernel/sched.c
Hunk \#1 succeeded at 2000 with fuzz 2 (offset 117 lines).
patching file mm/mmzone.c
patching file kernel/fork.c
Hunk \#1 succeeded at 168 (offset 9 lines).

(squeeze-amd64)ptecza@kopa:~/debian/linux-2.6-2.6.32$ LANG=C patch -d debian/build/source_amd64_none/ -p1 < ~/git/linux-zfs/spl/patches/fc11-spl-export-symbols.patch
patching file fs/proc/mmu.c
patching file kernel/groups.c
Hunk \#1 succeeded at 152 (offset -1 lines).
patching file kernel/sched.c
Hunk \#1 succeeded at 2000 with fuzz 2 (offset 117 lines).
patching file mm/mmzone.c
patching file kernel/fork.c
Hunk \#1 succeeded at 168 (offset 9 lines).

Next I built only generic amd64 kernel, it means without kernels which support OpenVZ, VServer, etc.

(squeeze-amd64)ptecza@kopa:~/debian/linux-2.6-2.6.32$ LANG=C sudo make -f debian/rules.gen build_amd64_none
[...]
make[2]: Leaving directory `/home/ptecza/debian/linux-2.6-2.6.32/debian/build/build_amd64_none_amd64'
python debian/bin/buildcheck.py debian/build/build_amd64_none_amd64 amd64 none amd64
ABI has changed but all changes have been ignored.  Continuing.

Added symbols:
__put_task_struct                                module: vmlinux, version: 0x7ac5499b, export: EXPORT_SYMBOL
blk_queue_physical_block_size_fixed              module: vmlinux, version: 0xdaeb992c, export: EXPORT_SYMBOL
first_online_pgdat                               module: vmlinux, version: 0xccbf56eb, export: EXPORT_SYMBOL
groups_search                                    module: vmlinux, version: 0x3f3c577e, export: EXPORT_SYMBOL
next_online_pgdat                                module: vmlinux, version: 0xc47c6dd5, export: EXPORT_SYMBOL
next_zone                                        module: vmlinux, version: 0x6638c6e7, export: EXPORT_SYMBOL
task_curr                                        module: vmlinux, version: 0x251106e7, export: EXPORT_SYMBOL
[...]

Unfortunately I still can't build SPL:

(squeeze-amd64)ptecza@kopa:~/git/linux-zfs/spl$ LANG=C sudo dpkg-buildpackage -b -uc -us
dpkg-buildpackage: export CFLAGS from dpkg-buildflags (origin: vendor): -g -O2
dpkg-buildpackage: export CPPFLAGS from dpkg-buildflags (origin: vendor): 
dpkg-buildpackage: export CXXFLAGS from dpkg-buildflags (origin: vendor): -g -O2
dpkg-buildpackage: export FFLAGS from dpkg-buildflags (origin: vendor): -g -O2
dpkg-buildpackage: export LDFLAGS from dpkg-buildflags (origin: vendor): 
dpkg-buildpackage: source package spl
dpkg-buildpackage: source version 0.5-2
dpkg-buildpackage: source changed by kqinfo <zfs@kqinfotech.com>
 dpkg-source --before-build spl
dpkg-buildpackage: host architecture amd64
 debian/rules clean
dh  clean
   dh_testdir
   dh_auto_clean
   dh_clean
 debian/rules build
dh  build
   dh_testdir
   debian/rules override_dh_auto_configure
make[1]: Entering directory `/home/ptecza/git/linux-zfs/spl'
dh_auto_configure -- --with-linux=/home/ptecza/debian/linux-2.6-2.6.32/debian/build/build_amd64_none_amd64/
checking metadata... yes
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... x86_64-pc-linux-gnu
checking whether to enable maintainer-specific portions of Makefiles... no
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
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 ISO C89... none needed
checking for style of include used by make... GNU
checking dependency style of gcc... none
checking how to print strings... printf
checking for a sed that does not truncate output... /bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for fgrep... /bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 3458764513820540925
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for ar... ar
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking how to run the C preprocessor... gcc -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 dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking spl license... GPL
checking whether rpm is available... no
checking whether rpmbuild is available... no
checking whether dpkg is available... yes (1.15.8.9)
checking whether dpkg-buildpackage is available... yes (1.15.8.9)
checking whether alien is available... no
checking linux distribution... debian
checking default package type... deb
checking spl config... all
checking kernel source directory... /home/ptecza/debian/linux-2.6-2.6.32/debian/build/build_amd64_none_amd64/
checking kernel build directory... /home/ptecza/debian/linux-2.6-2.6.32/debian/build/build_amd64_none_amd64/
checking kernel source version... 2.6.32-5-amd64
checking kernel file name for module symbols... NONE
checking whether debugging is enabled... no
checking whether basic kmem accounting is enabled... yes
checking whether detailed kmem tracking is enabled... no
checking whether atomic types use spinlocks... no
checking whether kernel defines atomic64_t... yes
checking whether kernel defines atomic64_cmpxchg... yes
checking whether kernel defines atomic64_xchg... yes
checking whether kernel defines uintptr_t... yes
checking whether INIT_WORK wants 3 args... no
checking whether register_sysctl_table() wants 2 args... no
checking whether set_shrinker() available... no
checking whether shrinker callback wants 3 args... no
checking whether struct path used in struct nameidata... yes
checking whether symbol task_curr is exported... yes
checking whether unnumbered sysctl support exists... yes
checking whether struct ctl_table has ctl_name... yes
checking whether fls64() is available... yes
checking whether symbol device_create is exported... yes
checking whether device_create() wants 5 args... yes
checking whether symbol class_device_create is exported... no
checking whether symbol set_normalized_timespec is exported... yes
checking whether set_normalized_timespec() is an inline... yes
checking whether timespec_sub() is available... yes
checking whether init_utsname() is available... yes
checking whether header linux/fdtable.h exists... yes
checking whether files_fdtable() is available... yes
checking whether header linux/uaccess.h exists... yes
checking whether kmalloc_node() is available... yes
checking whether symbol monotonic_clock is exported... no
checking whether struct inode has i_mutex... yes
checking whether struct mutex has owner... yes
checking whether mutex_lock_nested() is available... yes
checking whether on_each_cpu() wants 3 args... yes
checking whether symbol kallsyms_lookup_name is exported... no
checking whether symbol get_vmalloc_info is exported... no
checking whether symbol *_pgdat exist... no
checking whether symbol first_online_pgdat is exported... yes
checking whether symbol next_online_pgdat is exported... yes
checking whether symbol next_zone is exported... yes
checking whether symbol pgdat_list is exported... no
checking whether global_page_state() is available... yes
checking whether page state NR_FREE_PAGES is available... yes
checking whether page state NR_INACTIVE is available... no
checking whether page state NR_INACTIVE_ANON is available... yes
checking whether page state NR_INACTIVE_FILE is available... yes
checking whether page state NR_ACTIVE is available... no
checking whether page state NR_ACTIVE_ANON is available... yes
checking whether page state NR_ACTIVE_FILE is available... yes
checking whether symbol get_zone_counts is needed... no
checking whether symbol user_path_at is exported... yes
checking whether symbol set_fs_pwd is exported... no
checking whether set_fs_pwd() wants 2 args... yes
checking whether vfs_unlink() wants 2 args... yes
checking whether vfs_rename() wants 4 args... yes
checking whether struct fs_struct uses spinlock_t... no
checking whether struct cred exists... yes
checking whether symbol groups_search is exported... yes
checking whether symbol __put_task_struct is exported... yes
checking whether proc_handler() wants 5 args... yes
checking whether symbol kvasprintf is exported... yes
checking whether file_fsync() wants 3 args... yes
checking whether symbol rwsem_is_locked is exported... no
configure: creating ./config.status
config.status: creating Makefile
config.status: creating lib/Makefile
config.status: creating cmd/Makefile
config.status: creating module/Makefile
config.status: creating module/spl/Makefile
config.status: creating module/splat/Makefile
config.status: creating include/Makefile
config.status: creating scripts/Makefile
config.status: creating spl.spec
config.status: creating spl-modules.spec
config.status: creating spl_config.h
config.status: executing depfiles commands
config.status: executing libtool commands
make[1]: Leaving directory `/home/ptecza/git/linux-zfs/spl'
   dh_auto_build
make[1]: Entering directory `/home/ptecza/git/linux-zfs/spl'
make  all-recursive
make[2]: Entering directory `/home/ptecza/git/linux-zfs/spl'
Making all in lib
make[3]: Entering directory `/home/ptecza/git/linux-zfs/spl/lib'
\
#   source='list.c' object='list.lo' libtool=yes 
/bin/bash ../libtool  --tag=CC --silent  --mode=compile gcc -DHAVE_CONFIG_H -include ../spl_config.h    -Wall -Wshadow -Wstrict-prototypes -fno-strict-aliasing -D__USE_LARGEFILE64 -DNDEBUG -g -O2 -c -o list.lo list.c
/bin/bash ../libtool  --tag=CC --silent  --mode=link gcc -Wall -Wshadow -Wstrict-prototypes -fno-strict-aliasing -D__USE_LARGEFILE64 -DNDEBUG -g -O2   -o libcommon.la  list.lo  
make[3]: Leaving directory `/home/ptecza/git/linux-zfs/spl/lib'
Making all in cmd
make[3]: Entering directory `/home/ptecza/git/linux-zfs/spl/cmd'
\
#   source='spl.c' object='spl.o' libtool=no 
gcc -DHAVE_CONFIG_H -include ../spl_config.h -I../lib    -Wall -Wshadow -Wstrict-prototypes -fno-strict-aliasing -D__USE_LARGEFILE64 -DNDEBUG -g -O2 -c spl.c
/bin/bash ../libtool  --tag=CC --silent  --mode=link gcc -Wall -Wshadow -Wstrict-prototypes -fno-strict-aliasing -D__USE_LARGEFILE64 -DNDEBUG -g -O2   -o spl spl.o  
\
#   source='splat.c' object='splat.o' libtool=no 
gcc -DHAVE_CONFIG_H -include ../spl_config.h -I../lib    -Wall -Wshadow -Wstrict-prototypes -fno-strict-aliasing -D__USE_LARGEFILE64 -DNDEBUG -g -O2 -c splat.c
/bin/bash ../libtool  --tag=CC --silent  --mode=link gcc -Wall -Wshadow -Wstrict-prototypes -fno-strict-aliasing -D__USE_LARGEFILE64 -DNDEBUG -g -O2 ../lib/libcommon.la  -o splat splat.o  
make[3]: Leaving directory `/home/ptecza/git/linux-zfs/spl/cmd'
Making all in scripts
make[3]: Entering directory `/home/ptecza/git/linux-zfs/spl/scripts'
make[3]: Nothing to be done for `all'.
make[3]: Leaving directory `/home/ptecza/git/linux-zfs/spl/scripts'
Making all in module
make[3]: Entering directory `/home/ptecza/git/linux-zfs/spl/module'
make -C /home/ptecza/debian/linux-2.6-2.6.32/debian/build/build_amd64_none_amd64/ SUBDIRS=`pwd`  modules
make[4]: Entering directory `/home/ptecza/debian/linux-2.6-2.6.32/debian/build/build_amd64_none_amd64'
make -C /home/ptecza/debian/linux-2.6-2.6.32/debian/build/source_amd64_none O=/home/ptecza/debian/linux-2.6-2.6.32/debian/build/build_amd64_none_amd64/. modules
  CC [M]  /home/ptecza/git/linux-zfs/spl/module/spl/../../module/spl/spl-debug.o
  CC [M]  /home/ptecza/git/linux-zfs/spl/module/spl/../../module/spl/spl-proc.o
  CC [M]  /home/ptecza/git/linux-zfs/spl/module/spl/../../module/spl/spl-kmem.o
  CC [M]  /home/ptecza/git/linux-zfs/spl/module/spl/../../module/spl/spl-thread.o
  CC [M]  /home/ptecza/git/linux-zfs/spl/module/spl/../../module/spl/spl-taskq.o
  CC [M]  /home/ptecza/git/linux-zfs/spl/module/spl/../../module/spl/spl-rwlock.o
  CC [M]  /home/ptecza/git/linux-zfs/spl/module/spl/../../module/spl/spl-vnode.o
  CC [M]  /home/ptecza/git/linux-zfs/spl/module/spl/../../module/spl/spl-err.o
  CC [M]  /home/ptecza/git/linux-zfs/spl/module/spl/../../module/spl/spl-time.o
  CC [M]  /home/ptecza/git/linux-zfs/spl/module/spl/../../module/spl/spl-kobj.o
  CC [M]  /home/ptecza/git/linux-zfs/spl/module/spl/../../module/spl/spl-module.o
  CC [M]  /home/ptecza/git/linux-zfs/spl/module/spl/../../module/spl/spl-generic.o
  CC [M]  /home/ptecza/git/linux-zfs/spl/module/spl/../../module/spl/spl-atomic.o
  CC [M]  /home/ptecza/git/linux-zfs/spl/module/spl/../../module/spl/spl-mutex.o
  CC [M]  /home/ptecza/git/linux-zfs/spl/module/spl/../../module/spl/spl-kstat.o
  CC [M]  /home/ptecza/git/linux-zfs/spl/module/spl/../../module/spl/spl-condvar.o
  CC [M]  /home/ptecza/git/linux-zfs/spl/module/spl/../../module/spl/spl-xdr.o
  CC [M]  /home/ptecza/git/linux-zfs/spl/module/spl/../../module/spl/spl-cred.o
  CC [M]  /home/ptecza/git/linux-zfs/spl/module/spl/../../module/spl/spl-tsd.o
  CC [M]  /home/ptecza/git/linux-zfs/spl/module/spl/../../module/spl/spl-flock.o
  CC [M]  /home/ptecza/git/linux-zfs/spl/module/spl/../../module/spl/spl-dnlc.o
  LD [M]  /home/ptecza/git/linux-zfs/spl/module/spl/spl.o
  CC [M]  /home/ptecza/git/linux-zfs/spl/module/splat/../../module/splat/splat-ctl.o
  CC [M]  /home/ptecza/git/linux-zfs/spl/module/splat/../../module/splat/splat-kmem.o
  CC [M]  /home/ptecza/git/linux-zfs/spl/module/splat/../../module/splat/splat-taskq.o
  CC [M]  /home/ptecza/git/linux-zfs/spl/module/splat/../../module/splat/splat-random.o
  CC [M]  /home/ptecza/git/linux-zfs/spl/module/splat/../../module/splat/splat-mutex.o
  CC [M]  /home/ptecza/git/linux-zfs/spl/module/splat/../../module/splat/splat-condvar.o
  CC [M]  /home/ptecza/git/linux-zfs/spl/module/splat/../../module/splat/splat-thread.o
  CC [M]  /home/ptecza/git/linux-zfs/spl/module/splat/../../module/splat/splat-rwlock.o
  CC [M]  /home/ptecza/git/linux-zfs/spl/module/splat/../../module/splat/splat-time.o
  CC [M]  /home/ptecza/git/linux-zfs/spl/module/splat/../../module/splat/splat-vnode.o
  CC [M]  /home/ptecza/git/linux-zfs/spl/module/splat/../../module/splat/splat-kobj.o
  CC [M]  /home/ptecza/git/linux-zfs/spl/module/splat/../../module/splat/splat-atomic.o
  CC [M]  /home/ptecza/git/linux-zfs/spl/module/splat/../../module/splat/splat-list.o
  CC [M]  /home/ptecza/git/linux-zfs/spl/module/splat/../../module/splat/splat-generic.o
  CC [M]  /home/ptecza/git/linux-zfs/spl/module/splat/../../module/splat/splat-cred.o
  LD [M]  /home/ptecza/git/linux-zfs/spl/module/splat/splat.o
  Building modules, stage 2.
  MODPOST 2 modules
  CC      /home/ptecza/git/linux-zfs/spl/module/spl/spl.mod.o
  LD [M]  /home/ptecza/git/linux-zfs/spl/module/spl/spl.ko
  CC      /home/ptecza/git/linux-zfs/spl/module/splat/splat.mod.o
  LD [M]  /home/ptecza/git/linux-zfs/spl/module/splat/splat.ko
make[4]: Leaving directory `/home/ptecza/debian/linux-2.6-2.6.32/debian/build/build_amd64_none_amd64'
make[3]: Leaving directory `/home/ptecza/git/linux-zfs/spl/module'
Making all in include
make[3]: Entering directory `/home/ptecza/git/linux-zfs/spl/include'
make[3]: Nothing to be done for `all'.
make[3]: Leaving directory `/home/ptecza/git/linux-zfs/spl/include'
make[3]: Entering directory `/home/ptecza/git/linux-zfs/spl'
make[3]: Nothing to be done for `all-am'.
make[3]: Leaving directory `/home/ptecza/git/linux-zfs/spl'
make[2]: Leaving directory `/home/ptecza/git/linux-zfs/spl'
make[1]: Leaving directory `/home/ptecza/git/linux-zfs/spl'
   dh_auto_test
make[1]: Entering directory `/home/ptecza/git/linux-zfs/spl'
Making check in lib
make[2]: Entering directory `/home/ptecza/git/linux-zfs/spl/lib'
make[2]: Nothing to be done for `check'.
make[2]: Leaving directory `/home/ptecza/git/linux-zfs/spl/lib'
Making check in cmd
make[2]: Entering directory `/home/ptecza/git/linux-zfs/spl/cmd'
make[2]: Nothing to be done for `check'.
make[2]: Leaving directory `/home/ptecza/git/linux-zfs/spl/cmd'
Making check in scripts
make[2]: Entering directory `/home/ptecza/git/linux-zfs/spl/scripts'
../scripts/check.sh
Opening /proc/modules: No such file or directory
Loading ../module/spl/spl.ko
insmod: error inserting '../module/spl/spl.ko': -1 Invalid module format
check.sh: Failed to load ../module/spl/spl.ko
make[2]: *** [check] Error 1
make[2]: Leaving directory `/home/ptecza/git/linux-zfs/spl/scripts'
make[1]: *** [check-recursive] Error 1
make[1]: Leaving directory `/home/ptecza/git/linux-zfs/spl'
dh_auto_test: make -j1 check returned exit code 2
make: *** [build] Error 29
dpkg-buildpackage: error: debian/rules build gave error exit status 2

What's wrong this time? Are there still any missing exported kernel symbols?

ptecza commented 13 years ago

Probably I've found the reason of my problem. I'm trying to load the module of Linux kernel 2.6.32 in the schroot, but my server runs under control of Linux kernel 2.6.26...

(squeeze-amd64)root@kopa:/home/ptecza/git/linux-zfs/spl# insmod module/spl/spl.ko spl_debug_mask=0xffffffff spl_debug_subsys=0xffffffff
insmod: error inserting 'module/spl/spl.ko': -1 Invalid module format
(squeeze-amd64)root@kopa:/home/ptecza/git/linux-zfs/spl#
(squeeze-amd64)root@kopa:/home/ptecza/git/linux-zfs/spl# modprobe -v module/spl/spl.ko spl_debug_mask=0xffffffff spl_debug_subsys=0xffffffff
FATAL: Could not load /lib/modules/2.6.26-2-amd64/modules.dep: No such file or directory
(squeeze-amd64)root@kopa:/home/ptecza/git/linux-zfs/spl#
(squeeze-amd64)root@kopa:/home/ptecza/git/linux-zfs/spl# uname -a
Linux kopa 2.6.26-2-amd64 #1 SMP Tue Jan 12 22:12:20 UTC 2010 x86_64 GNU/Linux
ptecza commented 13 years ago

I've upgraded my build machine to Debian Squeeze, but it didn't resolved all the problems with building SPL:

(squeeze-amd64)ptecza@kopa:~/git/linux-zfs/spl$ LANG=C sudo dpkg-buildpackage -b -uc -us |tee my.log[sudo] password for ptecza: 
dpkg-buildpackage: export CFLAGS from dpkg-buildflags (origin: vendor): -g -O2
dpkg-buildpackage: export CPPFLAGS from dpkg-buildflags (origin: vendor): 
dpkg-buildpackage: export CXXFLAGS from dpkg-buildflags (origin: vendor): -g -O2
dpkg-buildpackage: export FFLAGS from dpkg-buildflags (origin: vendor): -g -O2
dpkg-buildpackage: export LDFLAGS from dpkg-buildflags (origin: vendor): 
dpkg-buildpackage: source package spl
dpkg-buildpackage: source version 0.5-2
dpkg-buildpackage: source changed by kqinfo <zfs@kqinfotech.com>
 dpkg-source --before-build spl
dpkg-buildpackage: host architecture amd64
 debian/rules clean
dh  clean
   dh_testdir
   dh_auto_clean
make[1]: Entering directory `/home/ptecza/git/linux-zfs/spl'
Making distclean in include
make[2]: Entering directory `/home/ptecza/git/linux-zfs/spl/include'
rm -rf .libs _libs
rm -f *.lo
test -z "" || rm -f 
test . = "." || test -z "" || rm -f 
rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
rm -f Makefile
make[2]: Leaving directory `/home/ptecza/git/linux-zfs/spl/include'
Making distclean in module
make[2]: Entering directory `/home/ptecza/git/linux-zfs/spl/module'
make -C /home/ptecza/debian/linux-2.6-2.6.32/debian/build/build_amd64_none_amd64/ SUBDIRS=`pwd`  clean
make[3]: Entering directory `/home/ptecza/debian/linux-2.6-2.6.32/debian/build/build_amd64_none_amd64'
make -C /home/ptecza/debian/linux-2.6-2.6.32/debian/build/source_amd64_none O=/home/ptecza/debian/linux-2.6-2.6.32/debian/build/build_amd64_none_amd64/. clean
  CLEAN   /home/ptecza/git/linux-zfs/spl/module/.tmp_versions
  CLEAN   /home/ptecza/git/linux-zfs/spl/module/Module.symvers /home/ptecza/git/linux-zfs/spl/module/modules.order
make[3]: Leaving directory `/home/ptecza/debian/linux-2.6-2.6.32/debian/build/build_amd64_none_amd64'
if [ -f NONE ]; then rm -f NONE; fi
if [ -f Module.markers ]; then rm -f Module.markers; fi
make[2]: Leaving directory `/home/ptecza/git/linux-zfs/spl/module'
Making distclean in scripts
make[2]: Entering directory `/home/ptecza/git/linux-zfs/spl/scripts'
rm -rf .libs _libs
rm -f *.lo
test -z "" || rm -f 
test . = "." || test -z "" || rm -f 
rm -f Makefile
make[2]: Leaving directory `/home/ptecza/git/linux-zfs/spl/scripts'
Making distclean in cmd
make[2]: Entering directory `/home/ptecza/git/linux-zfs/spl/cmd'
rm -rf .libs _libs
 rm -f spl splat
rm -f *.o
rm -f *.lo
rm -f *.tab.c
test -z "" || rm -f 
test . = "." || test -z "" || rm -f 
rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
rm -rf ./.deps
rm -f Makefile
make[2]: Leaving directory `/home/ptecza/git/linux-zfs/spl/cmd'
Making distclean in lib
make[2]: Entering directory `/home/ptecza/git/linux-zfs/spl/lib'
rm -rf .libs _libs
test -z "libcommon.la" || rm -f libcommon.la
rm -f "./so_locations"
rm -f *.o
rm -f *.lo
rm -f *.tab.c
test -z "" || rm -f 
test . = "." || test -z "" || rm -f 
rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
rm -rf ./.deps
rm -f Makefile
make[2]: Leaving directory `/home/ptecza/git/linux-zfs/spl/lib'
Making distclean in .
make[2]: Entering directory `/home/ptecza/git/linux-zfs/spl'
rm -rf .libs _libs
rm -f *.lo
test -z "module/Makefile module/spl/Makefile module/splat/Makefile spl.spec spl-modules.spec" || rm -f module/Makefile module/spl/Makefile module/splat/Makefile spl.spec spl-modules.spec
test . = "." || test -z "" || rm -f 
rm -f spl_config.h stamp-h1
rm -f libtool config.lt
rm -f -R autom4te*.cache
find . \( -name SCCS -o -name BitKeeper -o -name .svn -o -name CVS \
        -o -name .pc -o -name .hg -o -name .git \) -prune -o \
        \( -name '*.orig' -o -name '*.rej' -o -name '*~' \
        -o -name '*.bak' -o -name '#*#' -o -name '.*.orig' \
        -o -name '.*.rej' -o -name 'aclocal.m4' -o -size 0 \
        -o -name '*%' -o -name '.*.cmd' -o -name 'core' \
        -o -name 'Makefile' -o -name 'NONE' \
        -o -name '*.order' -o -name '*.markers' \) \
        -type f -print | xargs rm -f
rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
make[2]: Leaving directory `/home/ptecza/git/linux-zfs/spl'
rm -f config.status config.cache config.log configure.lineno config.status.lineno
rm -f Makefile
make[1]: Leaving directory `/home/ptecza/git/linux-zfs/spl'
   dh_clean
dh_auto_configure -- --disable-debug-kmem --with-linux=/home/ptecza/debian/linux-2.6-2.6.32/debian/build/build_amd64_none_amd64/
checking metadata... yes
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... x86_64-pc-linux-gnu
checking whether to enable maintainer-specific portions of Makefiles... no
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
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 ISO C89... none needed
checking for style of include used by make... GNU
checking dependency style of gcc... none
checking how to print strings... printf
checking for a sed that does not truncate output... /bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for fgrep... /bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 3458764513820540925
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for ar... ar
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking how to run the C preprocessor... gcc -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 dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking spl license... GPL
checking whether rpm is available... no
checking whether rpmbuild is available... no
checking whether dpkg is available... yes (1.15.8.10)
checking whether dpkg-buildpackage is available... yes (1.15.8.10)
checking whether alien is available... no
checking linux distribution... debian
checking default package type... deb
checking spl config... all
checking kernel source directory... /home/ptecza/debian/linux-2.6-2.6.32/debian/build/build_amd64_none_amd64/
checking kernel build directory... /home/ptecza/debian/linux-2.6-2.6.32/debian/build/build_amd64_none_amd64/
checking kernel source version... 2.6.32-5-amd64
checking kernel file name for module symbols... NONE
checking whether debugging is enabled... no
checking whether basic kmem accounting is enabled... no
checking whether detailed kmem tracking is enabled... no
checking whether atomic types use spinlocks... no
checking whether kernel defines atomic64_t... yes
checking whether kernel defines atomic64_cmpxchg... yes
checking whether kernel defines atomic64_xchg... yes
checking whether kernel defines uintptr_t... yes
checking whether INIT_WORK wants 3 args... no
checking whether register_sysctl_table() wants 2 args... no
checking whether set_shrinker() available... no
checking whether shrinker callback wants 3 args... no
checking whether struct path used in struct nameidata... yes
checking whether symbol task_curr is exported... yes
checking whether unnumbered sysctl support exists... yes
checking whether struct ctl_table has ctl_name... yes
checking whether fls64() is available... yes
checking whether symbol device_create is exported... yes
checking whether device_create() wants 5 args... yes
checking whether symbol class_device_create is exported... no
checking whether symbol set_normalized_timespec is exported... yes
checking whether set_normalized_timespec() is an inline... yes
checking whether timespec_sub() is available... yes
checking whether init_utsname() is available... yes
checking whether header linux/fdtable.h exists... yes
checking whether files_fdtable() is available... yes
checking whether header linux/uaccess.h exists... yes
checking whether kmalloc_node() is available... yes
checking whether symbol monotonic_clock is exported... no
checking whether struct inode has i_mutex... yes
checking whether struct mutex has owner... yes
checking whether mutex_lock_nested() is available... yes
checking whether on_each_cpu() wants 3 args... yes
checking whether symbol kallsyms_lookup_name is exported... no
checking whether symbol get_vmalloc_info is exported... no
checking whether symbol *_pgdat exist... no
checking whether symbol first_online_pgdat is exported... yes
checking whether symbol next_online_pgdat is exported... yes
checking whether symbol next_zone is exported... yes
checking whether symbol pgdat_list is exported... no
checking whether global_page_state() is available... yes
checking whether page state NR_FREE_PAGES is available... yes
checking whether page state NR_INACTIVE is available... no
checking whether page state NR_INACTIVE_ANON is available... yes
checking whether page state NR_INACTIVE_FILE is available... yes
checking whether page state NR_ACTIVE is available... no
checking whether page state NR_ACTIVE_ANON is available... yes
checking whether page state NR_ACTIVE_FILE is available... yes
checking whether symbol get_zone_counts is needed... no
checking whether symbol user_path_at is exported... yes
checking whether symbol set_fs_pwd is exported... no
checking whether set_fs_pwd() wants 2 args... yes
checking whether vfs_unlink() wants 2 args... yes
checking whether vfs_rename() wants 4 args... yes
checking whether struct fs_struct uses spinlock_t... no
checking whether struct cred exists... yes
checking whether symbol groups_search is exported... yes
checking whether symbol __put_task_struct is exported... yes
checking whether proc_handler() wants 5 args... yes
checking whether symbol kvasprintf is exported... yes
checking whether file_fsync() wants 3 args... yes
checking whether symbol rwsem_is_locked is exported... no
configure: creating ./config.status
config.status: creating Makefile
config.status: creating lib/Makefile
config.status: creating cmd/Makefile
config.status: creating module/Makefile
config.status: creating module/spl/Makefile
config.status: creating module/splat/Makefile
config.status: creating include/Makefile
config.status: creating scripts/Makefile
config.status: creating spl.spec
config.status: creating spl-modules.spec
config.status: creating spl_config.h
config.status: executing depfiles commands
config.status: executing libtool commands
 debian/rules build
dh  build
   dh_auto_build
make[1]: Entering directory `/home/ptecza/git/linux-zfs/spl'
make  all-recursive
make[2]: Entering directory `/home/ptecza/git/linux-zfs/spl'
Making all in lib
make[3]: Entering directory `/home/ptecza/git/linux-zfs/spl/lib'
\
#   source='list.c' object='list.lo' libtool=yes 
/bin/bash ../libtool  --tag=CC --silent  --mode=compile gcc -DHAVE_CONFIG_H -include ../spl_config.h    -Wall -Wshadow -Wstrict-prototypes -fno-strict-aliasing -D__USE_LARGEFILE64 -DNDEBUG -g -O2 -c -o list.lo list.c
/bin/bash ../libtool  --tag=CC --silent  --mode=link gcc -Wall -Wshadow -Wstrict-prototypes -fno-strict-aliasing -D__USE_LARGEFILE64 -DNDEBUG -g -O2   -o libcommon.la  list.lo  
make[3]: Leaving directory `/home/ptecza/git/linux-zfs/spl/lib'
Making all in cmd
make[3]: Entering directory `/home/ptecza/git/linux-zfs/spl/cmd'
\
#   source='spl.c' object='spl.o' libtool=no 
gcc -DHAVE_CONFIG_H -include ../spl_config.h -I../lib    -Wall -Wshadow -Wstrict-prototypes -fno-strict-aliasing -D__USE_LARGEFILE64 -DNDEBUG -g -O2 -c spl.c
/bin/bash ../libtool  --tag=CC --silent  --mode=link gcc -Wall -Wshadow -Wstrict-prototypes -fno-strict-aliasing -D__USE_LARGEFILE64 -DNDEBUG -g -O2   -o spl spl.o  
\
#   source='splat.c' object='splat.o' libtool=no 
gcc -DHAVE_CONFIG_H -include ../spl_config.h -I../lib    -Wall -Wshadow -Wstrict-prototypes -fno-strict-aliasing -D__USE_LARGEFILE64 -DNDEBUG -g -O2 -c splat.c
/bin/bash ../libtool  --tag=CC --silent  --mode=link gcc -Wall -Wshadow -Wstrict-prototypes -fno-strict-aliasing -D__USE_LARGEFILE64 -DNDEBUG -g -O2 ../lib/libcommon.la  -o splat splat.o  
make[3]: Leaving directory `/home/ptecza/git/linux-zfs/spl/cmd'
Making all in scripts
make[3]: Entering directory `/home/ptecza/git/linux-zfs/spl/scripts'
make[3]: Nothing to be done for `all'.
make[3]: Leaving directory `/home/ptecza/git/linux-zfs/spl/scripts'
Making all in module
make[3]: Entering directory `/home/ptecza/git/linux-zfs/spl/module'
make -C /home/ptecza/debian/linux-2.6-2.6.32/debian/build/build_amd64_none_amd64/ SUBDIRS=`pwd`  modules
make[4]: Entering directory `/home/ptecza/debian/linux-2.6-2.6.32/debian/build/build_amd64_none_amd64'
make -C /home/ptecza/debian/linux-2.6-2.6.32/debian/build/source_amd64_none O=/home/ptecza/debian/linux-2.6-2.6.32/debian/build/build_amd64_none_amd64/. modules
  CC [M]  /home/ptecza/git/linux-zfs/spl/module/spl/../../module/spl/spl-debug.o
  CC [M]  /home/ptecza/git/linux-zfs/spl/module/spl/../../module/spl/spl-proc.o
  CC [M]  /home/ptecza/git/linux-zfs/spl/module/spl/../../module/spl/spl-kmem.o
  CC [M]  /home/ptecza/git/linux-zfs/spl/module/spl/../../module/spl/spl-thread.o
  CC [M]  /home/ptecza/git/linux-zfs/spl/module/spl/../../module/spl/spl-taskq.o
  CC [M]  /home/ptecza/git/linux-zfs/spl/module/spl/../../module/spl/spl-rwlock.o
  CC [M]  /home/ptecza/git/linux-zfs/spl/module/spl/../../module/spl/spl-vnode.o
  CC [M]  /home/ptecza/git/linux-zfs/spl/module/spl/../../module/spl/spl-err.o
  CC [M]  /home/ptecza/git/linux-zfs/spl/module/spl/../../module/spl/spl-time.o
  CC [M]  /home/ptecza/git/linux-zfs/spl/module/spl/../../module/spl/spl-kobj.o
  CC [M]  /home/ptecza/git/linux-zfs/spl/module/spl/../../module/spl/spl-module.o
  CC [M]  /home/ptecza/git/linux-zfs/spl/module/spl/../../module/spl/spl-generic.o
  CC [M]  /home/ptecza/git/linux-zfs/spl/module/spl/../../module/spl/spl-atomic.o
  CC [M]  /home/ptecza/git/linux-zfs/spl/module/spl/../../module/spl/spl-mutex.o
  CC [M]  /home/ptecza/git/linux-zfs/spl/module/spl/../../module/spl/spl-kstat.o
  CC [M]  /home/ptecza/git/linux-zfs/spl/module/spl/../../module/spl/spl-condvar.o
  CC [M]  /home/ptecza/git/linux-zfs/spl/module/spl/../../module/spl/spl-xdr.o
  CC [M]  /home/ptecza/git/linux-zfs/spl/module/spl/../../module/spl/spl-cred.o
  CC [M]  /home/ptecza/git/linux-zfs/spl/module/spl/../../module/spl/spl-tsd.o
  CC [M]  /home/ptecza/git/linux-zfs/spl/module/spl/../../module/spl/spl-flock.o
  CC [M]  /home/ptecza/git/linux-zfs/spl/module/spl/../../module/spl/spl-dnlc.o
  LD [M]  /home/ptecza/git/linux-zfs/spl/module/spl/spl.o
  CC [M]  /home/ptecza/git/linux-zfs/spl/module/splat/../../module/splat/splat-ctl.o
  CC [M]  /home/ptecza/git/linux-zfs/spl/module/splat/../../module/splat/splat-kmem.o
  CC [M]  /home/ptecza/git/linux-zfs/spl/module/splat/../../module/splat/splat-taskq.o
  CC [M]  /home/ptecza/git/linux-zfs/spl/module/splat/../../module/splat/splat-random.o
  CC [M]  /home/ptecza/git/linux-zfs/spl/module/splat/../../module/splat/splat-mutex.o
  CC [M]  /home/ptecza/git/linux-zfs/spl/module/splat/../../module/splat/splat-condvar.o
  CC [M]  /home/ptecza/git/linux-zfs/spl/module/splat/../../module/splat/splat-thread.o
  CC [M]  /home/ptecza/git/linux-zfs/spl/module/splat/../../module/splat/splat-rwlock.o
  CC [M]  /home/ptecza/git/linux-zfs/spl/module/splat/../../module/splat/splat-time.o
  CC [M]  /home/ptecza/git/linux-zfs/spl/module/splat/../../module/splat/splat-vnode.o
  CC [M]  /home/ptecza/git/linux-zfs/spl/module/splat/../../module/splat/splat-kobj.o
  CC [M]  /home/ptecza/git/linux-zfs/spl/module/splat/../../module/splat/splat-atomic.o
  CC [M]  /home/ptecza/git/linux-zfs/spl/module/splat/../../module/splat/splat-list.o
  CC [M]  /home/ptecza/git/linux-zfs/spl/module/splat/../../module/splat/splat-generic.o
  CC [M]  /home/ptecza/git/linux-zfs/spl/module/splat/../../module/splat/splat-cred.o
  LD [M]  /home/ptecza/git/linux-zfs/spl/module/splat/splat.o
  Building modules, stage 2.
  MODPOST 2 modules
  CC      /home/ptecza/git/linux-zfs/spl/module/spl/spl.mod.o
  LD [M]  /home/ptecza/git/linux-zfs/spl/module/spl/spl.ko
  CC      /home/ptecza/git/linux-zfs/spl/module/splat/splat.mod.o
  LD [M]  /home/ptecza/git/linux-zfs/spl/module/splat/splat.ko
make[4]: Leaving directory `/home/ptecza/debian/linux-2.6-2.6.32/debian/build/build_amd64_none_amd64'
make[3]: Leaving directory `/home/ptecza/git/linux-zfs/spl/module'
Making all in include
make[3]: Entering directory `/home/ptecza/git/linux-zfs/spl/include'
make[3]: Nothing to be done for `all'.
make[3]: Leaving directory `/home/ptecza/git/linux-zfs/spl/include'
make[3]: Entering directory `/home/ptecza/git/linux-zfs/spl'
make[3]: Nothing to be done for `all-am'.
make[3]: Leaving directory `/home/ptecza/git/linux-zfs/spl'
make[2]: Leaving directory `/home/ptecza/git/linux-zfs/spl'
make[1]: Leaving directory `/home/ptecza/git/linux-zfs/spl'
   dh_auto_test
make[1]: Entering directory `/home/ptecza/git/linux-zfs/spl'
Making check in lib
make[2]: Entering directory `/home/ptecza/git/linux-zfs/spl/lib'
make[2]: Nothing to be done for `check'.
make[2]: Leaving directory `/home/ptecza/git/linux-zfs/spl/lib'
Making check in cmd
make[2]: Entering directory `/home/ptecza/git/linux-zfs/spl/cmd'
make[2]: Nothing to be done for `check'.
make[2]: Leaving directory `/home/ptecza/git/linux-zfs/spl/cmd'
Making check in scripts
make[2]: Entering directory `/home/ptecza/git/linux-zfs/spl/scripts'
../scripts/check.sh
Loading ../module/spl/spl.ko
insmod: error inserting '../module/spl/spl.ko': -1 Unknown symbol in module
check.sh: Failed to load ../module/spl/spl.ko
make[2]: *** [check] Error 1
make[2]: Leaving directory `/home/ptecza/git/linux-zfs/spl/scripts'
make[1]: *** [check-recursive] Error 1
make[1]: Leaving directory `/home/ptecza/git/linux-zfs/spl'
dh_auto_test: make -j1 check returned exit code 2
make: *** [build] Error 29
dpkg-buildpackage: error: debian/rules build gave error exit status 2

I'm not a kernel expert, but I guess that I need to run patched Linux kernel with the exported symbols to load SPL module, right? Now my server runs under a standard distro kernel.

dapperfu commented 13 years ago

I was getting this same bug and to keep using the create_debian.sh script I added ' --with-linux=/usr/src/linux-headers-2.6.32-5-common --with-linux-obj=/usr/src/linux-headers-2.6.32-5-amd64'

to spl/debian/rules