Eric Shubert wrote:
> Davide wrote:
>> Hi!
>> I'm trying to install vm-tools in Ipcop 1.4.21 distribution following
>> these instructions:
>> http://www.ipcop.org/index.php?module=pnWikka&tag=HowToCompileAdditionalCode
>> <http://www.ipcop.org/index.php?module=pnWikka&tag=HowToCompileAdditionalCode>
>>
>> I've downloaded the sources package of ipcop and compile it with success.
>> So,
>> I've added the source package of open-vm-tools
>> (http://open-vm-tools.sourceforge.net/) at directory "cache".
>> I've write the script for open-vm-tools in "lsf" directory, like this:
>>
>> $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
>> @$(PREBUILD)
>> @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(DL_FILE)
>> cd $(DIR_APP) && ./configure --without-x --without-procps
>> --without-dnet --without-icu
>> cd $(DIR_APP) && make
>> cd $(DIR_APP) && make install
>> @rm -rf $(DIR_APP)
>> @$(POSTBUILD)
>>
>> But, i have this trouble with the make command:
>>
>> make[3]: Entering directory
>> `/usr/src/vm-tools-2008.09.03-114782/modules/linux/vsock'
>> make[4]: Entering directory
>> `/usr/src/vm-tools-2008.09.03-114782/modules/linux/vsock/driver-2.4.36'
>> Dependencies for .././linux/af_vsock.c
>> Dependencies for .././linux/vsockAddr.c
>> Dependencies for .././linux/util.c
>> Dependencies for .././linux/driverLog.c
>> make[4]: Leaving directory
>> `/usr/src/vm-tools-2008.09.03-114782/modules/linux/vsock/driver-2.4.36'
>> make[4]: Entering directory
>> `/usr/src/vm-tools-2008.09.03-114782/modules/linux/vsock/driver-2.4.36'
>> Compiling .././linux/af_vsock.c
>> ../linux/af_vsock.c: In function `VSockVmciStreamConnect':
>> ../linux/af_vsock.c:3199: warning: implicit declaration of function
>> `DEFINE_WAIT'
>> ../linux/af_vsock.c:3199: error: `wait' undeclared (first use in this
>> function)
>> ../linux/af_vsock.c:3199: error: (Each undeclared identifier is reported
>> only once
>> ../linux/af_vsock.c:3199: error: for each function it appears in.)
>> ../linux/af_vsock.c:3275: warning: implicit declaration of function
>> `prepare_to_wait'
>> ../linux/af_vsock.c:3310: warning: implicit declaration of function
>> `finish_wait'
>> ../linux/af_vsock.c: In function `VSockVmciAccept':
>> ../linux/af_vsock.c:3348: error: `wait' undeclared (first use in this
>> function)
>> ../linux/af_vsock.c: In function `VSockVmciStreamSendmsg':
>> ../linux/af_vsock.c:4079: error: `wait' undeclared (first use in this
>> function)
>> ../linux/af_vsock.c: In function `VSockVmciStreamRecvmsg':
>> ../linux/af_vsock.c:4428: error: `wait' undeclared (first use in this
>> function)
>> make[4]: *** [af_vsock.o] Error 1
>> make[4]: Leaving directory
>> `/usr/src/vm-tools-2008.09.03-114782/modules/linux/vsock/driver-2.4.36'
>> make[3]: *** [driver] Error 2
>> make[3]: Leaving directory
>> `/usr/src/vm-tools-2008.09.03-114782/modules/linux/vsock'
>> make[2]: *** [vsock] Error 2
>> make[2]: Leaving directory `/usr/src/vm-tools-2008.09.03-114782/modules'
>> make[1]: *** [all-recursive] Error 1
>> make[1]: Leaving directory `/usr/src/vm-tools-2008.09.03-114782'
>> make: *** [/usr/src/log/vm-tools-2008.09.03-114782] Error 2
>>
>> Someone have any idea?
>> (I run compile with some parameters that exclude some (optional ?) librarys)
>>
>> Sorry for my english :-\
>>
>> Best regards.
>> Davide
>>
>>
>
> Ok, I've figured this one out. According to some comments in
> compat_wait.h, DEFINE_WAIT() and friends were backported to kernel
> 2.4.28, so they weren't being included. The IPCop kernel 2.4.36 doesn't
> have this backport (why I don't know). I modified compat_wait.h to
> include the DEFINE_WAIT() code with the kernel versions < 2.4.48, and
> now vsock compiles clean.
>
> Now for trying turn on a few more features, then installing and testing
> this thing. Stay tuned.
>
I've been in touch with Dmitry on the open-vm-tools development list,
and he has everything fixed up for the next monthly release. I'm going
to continue working on getting it installed in IPCop and will report back.
In case anyone's interested in trying things out before the next monthly
release of open-vm-tools, the following patch provided by Dmitry will
fix the vsock compile error. It should be applied to all instances of
compat_wait.h in the source tree.
--- compat_wait.h.orig
+++ compat_wait.h
@@ -179,10 +179,16 @@ do { \
/*
* DEFINE_WAIT() and friends were added in 2.5.39 and backported to
2.4.28.
+ *
+ * Unfortunately it is not true. While some distros may have done it the
+ * change has never made it into vanilla 2.4 kernel. Instead of testing
+ * particular kernel versions let's just test for presence of DEFINE_WAIT
+ * when figuring out whether we need to provide replacement implementation
+ * or simply alias existing one.
*/
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 28) || \
- (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 0) && \
- LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 39))
+
+#ifndef DEFINE_WAIT
+
# define COMPAT_DEFINE_WAIT(_wait) \
DECLARE_WAITQUEUE(_wait, current)
# define compat_init_prepare_to_wait(_sleep, _wait, _state) \
@@ -197,7 +203,9 @@ do { \
__set_current_state(_state); \
remove_wait_queue(_sleep, _wait); \
} while (0)
+
#else
+
# define COMPAT_DEFINE_WAIT(_wait) \
DEFINE_WAIT(_wait)
# define compat_init_prepare_to_wait(_sleep, _wait, _state) \
@@ -206,6 +214,7 @@ do { \
prepare_to_wait(_sleep, _wait, _state)
# define compat_finish_wait(_sleep, _wait, _state) \
finish_wait(_sleep, _wait)
-#endif
+
+#endif /* #ifndef DEFINE_WAIT */
#endif /* __COMPAT_WAIT_H__ */
--
-Eric 'shubes'
|