config.h was removed in 2.6.19

Bug #105552 reported by Paul Weaver
4
Affects Status Importance Assigned to Milestone
drbd8 (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Compiling drbd8 with a custom kernel
Linux version 2.6.20.3-custom-070319 (root@NEWSJTCUBU1) (gcc version 4.1.2 20060928 (prerelease) (Ubuntu 4.1.1-13ubuntu5)) #1 SMP Mon Mar 19 09:23:26 GMT 2007
ii drbd8-module-source 8.0-pre3-1 RAID 1 over tcp/ip for Linux module source

It complains that linux/config.h doesn't exist, I think that was removed in 2.6.19
To get arround it now, on advice of google, I created /usr/src/linux/include/linux/config.h

#ifndef _LINUX_CONFIG_H
#define _LINUX_CONFIG_H
/* This file is no longer in use and kept only for backward compatibility.
 * * autoconf.h is now included via -imacros on the commandline
 * */
#include <linux/autoconf.h>

#endif

Buildlog follows
dpatch deapply-all
rm -rf patch-stamp patch-stampT debian/patched
dh_clean
/usr/bin/make -C drbd clean
make[1]: Entering directory `/usr/src/modules/drbd/drbd'
rm -rf .tmp_versions
rm -f *.[oas] *.ko .*.cmd .*.d .*.tmp *.mod.c .*.flags .depend .kernel*
make[1]: Leaving directory `/usr/src/modules/drbd/drbd'
/usr/bin/make -f debian/rules kdist_clean kdist_config binary-modules
make[1]: Entering directory `/usr/src/modules/drbd'
dpatch deapply-all
rm -rf patch-stamp patch-stampT debian/patched
dh_clean
/usr/bin/make -C drbd clean
make[2]: Entering directory `/usr/src/modules/drbd/drbd'
rm -rf .tmp_versions
rm -f *.[oas] *.ko .*.cmd .*.d .*.tmp *.mod.c .*.flags .depend .kernel*
make[2]: Leaving directory `/usr/src/modules/drbd/drbd'
/usr/bin/gcc-4.1
for templ in /usr/src/modules/drbd/debian/drbd8-module-_KVERS_.postinst /usr/src/modules/drbd/debian/drbd8-module-_KVERS_.postinst.backup /usr/src/modules/dr
bd/debian/drbd8-module-_KVERS_.postinst.modules.in; do \
    cp $templ `echo $templ | sed -e 's/_KVERS_/2.6.20.3-custom-070319/g'` ; \
  done
for templ in `ls debian/*.modules.in` ; do \
    test -e ${templ%.modules.in}.backup || cp ${templ%.modules.in} ${templ%.modules.in}.backup 2>/dev/null || true; \
    sed -e 's/##KVERS##/2.6.20.3-custom-070319/g ;s/#KVERS#/2.6.20.3-custom-070319/g ; s/_KVERS_/2.6.20.3-custom-070319/g ; s/##KDREV##/2.6.20.3-custom-07031
9-10.00.Custom/g ; s/#KDREV#/2.6.20.3-custom-070319-10.00.Custom/g ; s/_KDREV_/2.6.20.3-custom-070319-10.00.Custom/g ' < $templ > ${templ%.modules.in}; \
  done
dh_testdir
dh_testroot
dh_clean -k
/usr/bin/make -C drbd KERNEL_SOURCES=/usr/src/linux-headers-2.6.20.3-custom-070319 MODVERSIONS=detect KERNEL=linux-2.6.20.3-custom-070319 KDIR=/usr/src/linux
-headers-2.6.20.3-custom-070319
make[2]: Entering directory `/usr/src/modules/drbd/drbd'

    Calling toplevel makefile of kernel source tree, which I believe is in
    KDIR=/usr/src/linux-headers-2.6.20.3-custom-070319

/usr/bin/make -C /usr/src/linux-headers-2.6.20.3-custom-070319 SUBDIRS=/usr/src/modules/drbd/drbd modules
make[3]: Entering directory `/usr/src/linux-headers-2.6.20.3-custom-070319'
  CC [M] /usr/src/modules/drbd/drbd/drbd_sizeof_sanity_check.o
  CC [M] /usr/src/modules/drbd/drbd/drbd_buildtag.o
  CC [M] /usr/src/modules/drbd/drbd/drbd_bitmap.o
In file included from /usr/src/modules/drbd/drbd/drbd_bitmap.c:34:
/usr/src/modules/drbd/drbd/drbd_int.h:1064: warning: âkmem_cache_tâ is deprecated
/usr/src/modules/drbd/drbd/drbd_int.h:1065: warning: âkmem_cache_tâ is deprecated
  CC [M] /usr/src/modules/drbd/drbd/drbd_fs.o
/usr/src/modules/drbd/drbd/drbd_fs.c:33:26: error: linux/config.h: No such file or directory
In file included from /usr/src/modules/drbd/drbd/drbd_fs.c:43:
/usr/src/modules/drbd/drbd/drbd_int.h:1064: warning: âkmem_cache_tâ is deprecated
/usr/src/modules/drbd/drbd/drbd_int.h:1065: warning: âkmem_cache_tâ is deprecated
/usr/src/modules/drbd/drbd/drbd_fs.c:396:2: warning: #warning checks below no longer valid
make[4]: *** [/usr/src/modules/drbd/drbd/drbd_fs.o] Error 1
make[3]: *** [_module_/usr/src/modules/drbd/drbd] Error 2
make[3]: Leaving directory `/usr/src/linux-headers-2.6.20.3-custom-070319'
make[2]: *** [kbuild] Error 2
make[2]: Leaving directory `/usr/src/modules/drbd/drbd'
make[1]: *** [binary-modules] Error 2
make[1]: Leaving directory `/usr/src/modules/drbd'
make: *** [kdist_build] Error 2

Revision history for this message
Paul Weaver (iso-isorox) wrote :
Download full text (8.0 KiB)

linux.h appears in
modules/drbd/drbd/drbd_fs.c
modules/drbd/drbd/drbd_main.c
modules/drbd/drbd/drbd_proc.c
modules/drbd/drbd/drbd_receiver.c
modules/drbd/drbd/drbd_req.c
modules/drbd/drbd/drbd_worker.c

However once that hurdle is passed, the next one appears
/usr/src/modules/drbd/drbd/drbd_main.c:52:35: error: linux/devfs_fs_kernel.h: No such file or directory

Which has also been removed (since 2.6.17), it only appears in modules/drbd/drbd/drbd_main.c so I removed the line.

Next issue
if (drbd_ee_cache && kmem_cache_destroy(drbd_ee_cache))
                printk(KERN_ERR DEVICE_NAME
                       ": kmem_cache_destroy(drbd_ee_cache) FAILED\n");
Results in
/usr/src/modules/drbd/drbd/drbd_main.c:2023: error: void value not ignored as it ought to be

Also mentions that kmem_cache_t is deprecated

gcc (GCC) 4.1.2 20060928 (prerelease) (Ubuntu 4.1.1-13ubuntu5)wait...
Copyright (C) 2006 Free Software Foundation, Inc. build KVERS=2.6.20.3-custom-070319 KSRC=/usr/src/linux-headers-2.6.20.3-custom-070319 KDREV=2.6.20.3-customThis is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

GNU Make 3.81
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.

This program built for i486-pc-linux-gnu

dpatch deapply-all
rm -rf patch-stamp patch-stampT debian/patched
dh_clean
/usr/bin/make -C drbd clean
make[1]: Entering directory `/usr/src/modules/drbd/drbd'
rm -rf .tmp_versions
rm -f *.[oas] *.ko .*.cmd .*.d .*.tmp *.mod.c .*.flags .depend .kernel*
make[1]: Leaving directory `/usr/src/modules/drbd/drbd'
/usr/bin/make -f debian/rules kdist_clean kdist_config binary-modules
make[1]: Entering directory `/usr/src/modules/drbd'
dpatch deapply-all
rm -rf patch-stamp patch-stampT debian/patched
dh_clean
/usr/bin/make -C drbd clean
make[2]: Entering directory `/usr/src/modules/drbd/drbd'
rm -rf .tmp_versions
rm -f *.[oas] *.ko .*.cmd .*.d .*.tmp *.mod.c .*.flags .depend .kernel*
make[2]: Leaving directory `/usr/src/modules/drbd/drbd'
/usr/bin/gcc-4.1
for templ in /usr/src/modules/drbd/debian/drbd8-module-_KVERS_.postinst /usr/src/modules/drbd/debian/drbd8-module-_KVERS_.postinst.backup /usr/src/modules/dr
bd/debian/drbd8-module-_KVERS_.postinst.modules.in; do \
    cp $templ `echo $templ | sed -e 's/_KVERS_/2.6.20.3-custom-070319/g'` ; \
  done
for templ in `ls debian/*.modules.in` ; do \
    test -e ${templ%.modules.in}.backup || cp ${templ%.modules.in} ${templ%.modules.in}.backup 2>/dev/null || true; \
    sed -e 's/##KVERS##/2.6.20.3-custom-070319/g ;s/#KVERS#/2.6.20.3-custom-070319/g ; s/_KVERS_/2.6.20.3-custom-070319/g ; s/##KDREV##/2.6.20.3-custom-07031
9-10.00.Custom/g ; s/#KDREV#/2.6.20.3-custom-070319-10.00.Custom/g ; s/_KDREV_/2.6.20.3-custom-070319-10.00.Custom/g ' < $templ > ${templ%.modules.in}; \
  done
dh_testdir
dh_testroot
dh_clean -k
/usr/bin/make -C drbd KERNEL_SOURCES=/usr/src/linux-headers-2.6.20.3-custom-070319 MODVERSIONS=detect KERNEL=linux-2.6.20.3-custom-070319 KDIR=/usr/src/linux
-headers-...

Read more...

Revision history for this message
Tessa (unit3) wrote :

I'm also having this problem with drbd0.7 and the xen 2.6.19 kernel on i386. This is a big problem for those of us upgrading our xen/drbd clusters.

Revision history for this message
Tessa (unit3) wrote :

symlinking autoconf.h to config.h in /usr/src/linux/include/linux/ seems to fix the initial problem for me, but then there are more build errors in 0.7.

Revision history for this message
quendi (quendi) wrote :

i had the same problem (void value not ignored) with feisty and drbd 7.21 and fixed it with the following patch:
http://lists.linbit.com/pipermail/drbd-user/2006-November/005918.html

void drbd_destroy_mempools(void)
{
        if (drbd_request_mempool)
                mempool_destroy(drbd_request_mempool);
        if (drbd_ee_cache)
                kmem_cache_destroy(drbd_ee_cache);
        /* Above code changed from the following function for compatibility
        / with mm3 patches to kernel 2.6.18:
        /
        / if (drbd_ee_cache) && kmem_cache_destroy(drbd_ee_cache))
        / printk(KERN_ERR DEVICE_NAME
        / ": kmem_cache_destroy(drbd_ee_cache) FAILED\n");
        */
        if (drbd_request_cache)
                kmem_cache_destroy(drbd_request_cache);

        /* Above code changed from the following function for compatability
        / with the mm3 patches to kernel 2.6.18:
        /
        / if (drbd_request_cache && kmem_cache_destroy(drbd_request_cache))
        / printk(KERN_ERR DEVICE_NAME
        */

        // FIXME what can we do if we fail to destroy them?

        drbd_request_mempool = NULL;
        drbd_ee_cache = NULL;
        drbd_request_cache = NULL;

        return;
}

Revision history for this message
Chuck Short (zulcss) wrote :

This will be fixed for hardy.

Changed in drbd8:
status: New → In Progress
Chuck Short (zulcss)
Changed in drbd8:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.