From: VMware, Inc <> Date: Wed, 20 Jan 2010 21:25:26 +0000 (-0800) Subject: Fix Linux kernel modules build on 2.6.33-rc1 X-Git-Tag: 2010.01.19-226760~38 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3c95acf6ad313cead29bc377d2b11fed1aafd2ac;p=thirdparty%2Fopen-vm-tools.git Fix Linux kernel modules build on 2.6.33-rc1 linux/utsrelease.h & friends moved from linux/ to generated/. Which breaks all our sources, plus all our builders. So there are two changes: (1) make sure our modules include appropriate autoconf.h, and (2) update modconf to know that utsrelease.h may live in different directory. While I was in modconf I could not resist to remove some duplicated code... Signed-off-by: Marcelo Vanzin --- diff --git a/open-vm-tools/modules/linux/shared/autoconf/cachecreate.c b/open-vm-tools/modules/linux/shared/autoconf/cachecreate.c index 88c51c199..1eaaf1e28 100644 --- a/open-vm-tools/modules/linux/shared/autoconf/cachecreate.c +++ b/open-vm-tools/modules/linux/shared/autoconf/cachecreate.c @@ -16,8 +16,8 @@ * *********************************************************/ -#include -#include +#include "compat_version.h" +#include "compat_autoconf.h" /* * All kernels before 2.6.22 take 6 arguments. All kernels since diff --git a/open-vm-tools/modules/linux/shared/autoconf/cachector.c b/open-vm-tools/modules/linux/shared/autoconf/cachector.c index bbc124dea..0f81ed45d 100644 --- a/open-vm-tools/modules/linux/shared/autoconf/cachector.c +++ b/open-vm-tools/modules/linux/shared/autoconf/cachector.c @@ -16,8 +16,8 @@ * *********************************************************/ -#include -#include +#include "compat_version.h" +#include "compat_autoconf.h" /* * Between 2.6.23 and 2.6.24-rc1 ctor prototype was changed from diff --git a/open-vm-tools/modules/linux/shared/autoconf/cachector1.c b/open-vm-tools/modules/linux/shared/autoconf/cachector1.c index 8dc874186..6915e11f7 100644 --- a/open-vm-tools/modules/linux/shared/autoconf/cachector1.c +++ b/open-vm-tools/modules/linux/shared/autoconf/cachector1.c @@ -16,8 +16,8 @@ * *********************************************************/ -#include -#include +#include "compat_version.h" +#include "compat_autoconf.h" /* * Between 2.6.27-rc1 and 2.6.27-rc2 ctor prototype was changed from diff --git a/open-vm-tools/modules/linux/shared/autoconf/epoll.c b/open-vm-tools/modules/linux/shared/autoconf/epoll.c index 44083c6be..2eb67e20c 100644 --- a/open-vm-tools/modules/linux/shared/autoconf/epoll.c +++ b/open-vm-tools/modules/linux/shared/autoconf/epoll.c @@ -22,8 +22,8 @@ * never had it, but some distros backported epoll patch. */ -#include -#include +#include "compat_version.h" +#include "compat_autoconf.h" #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0) #include diff --git a/open-vm-tools/modules/linux/shared/autoconf/filldir1.c b/open-vm-tools/modules/linux/shared/autoconf/filldir1.c index 754da625b..2a2ca7189 100644 --- a/open-vm-tools/modules/linux/shared/autoconf/filldir1.c +++ b/open-vm-tools/modules/linux/shared/autoconf/filldir1.c @@ -16,8 +16,8 @@ * *********************************************************/ -#include -#include +#include "compat_version.h" +#include "compat_autoconf.h" #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 20) #include diff --git a/open-vm-tools/modules/linux/shared/autoconf/geninclude.c b/open-vm-tools/modules/linux/shared/autoconf/geninclude.c index f37a20f10..88d68dc55 100644 --- a/open-vm-tools/modules/linux/shared/autoconf/geninclude.c +++ b/open-vm-tools/modules/linux/shared/autoconf/geninclude.c @@ -16,7 +16,8 @@ * *********************************************************/ -#include +#include "compat_version.h" +#include "compat_autoconf.h" #ifdef CONFIG_X86_VOYAGER APATH/mach-voyager diff --git a/open-vm-tools/modules/linux/shared/autoconf/getsb1.c b/open-vm-tools/modules/linux/shared/autoconf/getsb1.c index 862ae2b32..5965416dc 100644 --- a/open-vm-tools/modules/linux/shared/autoconf/getsb1.c +++ b/open-vm-tools/modules/linux/shared/autoconf/getsb1.c @@ -16,8 +16,8 @@ * *********************************************************/ -#include -#include +#include "compat_version.h" +#include "compat_autoconf.h" #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 19) diff --git a/open-vm-tools/modules/linux/shared/autoconf/inode1.c b/open-vm-tools/modules/linux/shared/autoconf/inode1.c index d010146fc..eeec3c6b1 100644 --- a/open-vm-tools/modules/linux/shared/autoconf/inode1.c +++ b/open-vm-tools/modules/linux/shared/autoconf/inode1.c @@ -16,8 +16,8 @@ * *********************************************************/ -#include -#include +#include "compat_version.h" +#include "compat_autoconf.h" #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 20) #include diff --git a/open-vm-tools/modules/linux/shared/autoconf/netif_num_params.c b/open-vm-tools/modules/linux/shared/autoconf/netif_num_params.c index fa75af40d..a90883b12 100644 --- a/open-vm-tools/modules/linux/shared/autoconf/netif_num_params.c +++ b/open-vm-tools/modules/linux/shared/autoconf/netif_num_params.c @@ -28,8 +28,8 @@ * takes only single napi argument. */ -#include -#include +#include "compat_version.h" +#include "compat_autoconf.h" #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 30) # error This compile test intentionally fails. diff --git a/open-vm-tools/modules/linux/shared/autoconf/setnice.c b/open-vm-tools/modules/linux/shared/autoconf/setnice.c index 8d5ebf21f..31ac8a641 100644 --- a/open-vm-tools/modules/linux/shared/autoconf/setnice.c +++ b/open-vm-tools/modules/linux/shared/autoconf/setnice.c @@ -20,8 +20,8 @@ * set_user_nice appeared in 2.4.21. But some distros * backported it to older kernels. */ -#include -#include +#include "compat_version.h" +#include "compat_autoconf.h" #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 21) #include diff --git a/open-vm-tools/modules/linux/shared/autoconf/sk_filter.c b/open-vm-tools/modules/linux/shared/autoconf/sk_filter.c index 936e4f12c..f8bb288c3 100644 --- a/open-vm-tools/modules/linux/shared/autoconf/sk_filter.c +++ b/open-vm-tools/modules/linux/shared/autoconf/sk_filter.c @@ -23,8 +23,8 @@ * This test will fail to build on kernels with the new interface. */ -#include -#include +#include "compat_version.h" +#include "compat_autoconf.h" /* * We'd restrict this test to 2.4.21 and earlier kernels, but Mandrake's diff --git a/open-vm-tools/modules/linux/shared/autoconf/skblin.c b/open-vm-tools/modules/linux/shared/autoconf/skblin.c index abdcd473b..e3a6ccdcc 100644 --- a/open-vm-tools/modules/linux/shared/autoconf/skblin.c +++ b/open-vm-tools/modules/linux/shared/autoconf/skblin.c @@ -20,8 +20,8 @@ * Detect whether skb_linearize takes one or two arguments. */ -#include -#include +#include "compat_version.h" +#include "compat_autoconf.h" #if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 17) /* diff --git a/open-vm-tools/modules/linux/shared/autoconf/statfs1.c b/open-vm-tools/modules/linux/shared/autoconf/statfs1.c index 8501cab2f..a753917bd 100644 --- a/open-vm-tools/modules/linux/shared/autoconf/statfs1.c +++ b/open-vm-tools/modules/linux/shared/autoconf/statfs1.c @@ -16,8 +16,8 @@ * *********************************************************/ -#include -#include +#include "compat_version.h" +#include "compat_autoconf.h" #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 19) #include diff --git a/open-vm-tools/modules/linux/shared/compat_autoconf.h b/open-vm-tools/modules/linux/shared/compat_autoconf.h new file mode 100644 index 000000000..868b3ad79 --- /dev/null +++ b/open-vm-tools/modules/linux/shared/compat_autoconf.h @@ -0,0 +1,40 @@ +/********************************************************* + * Copyright (C) 2009 VMware, Inc. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation version 2 and no later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + *********************************************************/ + +#ifndef __COMPAT_AUTOCONF_H__ +# define __COMPAT_AUTOCONF_H__ + +#define INCLUDE_ALLOW_VMMON +#define INCLUDE_ALLOW_MODULE +#define INCLUDE_ALLOW_VMCORE +#define INCLUDE_ALLOW_DISTRIBUTE +#include "includeCheck.h" + + +#ifndef LINUX_VERSION_CODE +# error "Include compat_version.h before compat_autoconf.h" +#endif + +/* autoconf.h moved from linux/autoconf.h to generated/autoconf.h in 2.6.33-rc1. */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 33) +# include +#else +# include +#endif + +#endif /* __COMPAT_AUTOCONF_H__ */ diff --git a/open-vm-tools/modules/linux/shared/driver-config.h b/open-vm-tools/modules/linux/shared/driver-config.h index 62e3fd611..927e7802d 100644 --- a/open-vm-tools/modules/linux/shared/driver-config.h +++ b/open-vm-tools/modules/linux/shared/driver-config.h @@ -31,8 +31,8 @@ #define INCLUDE_ALLOW_MODULE #include "includeCheck.h" -#include #include "compat_version.h" +#include "compat_autoconf.h" /* * We rely on Kernel Module support. Check here.