[asterisk-users] Re: compile error on RHEL5 or CENTOS5
Tzafrir Cohen
tzafrir.cohen at xorcom.com
Sat Apr 14 09:28:46 MST 2007
On Sat, Apr 14, 2007 at 01:58:22PM +0200, Axel Thimm wrote:
> On Fri, Apr 13, 2007 at 03:47:15PM -0400, Jerry Geis wrote:
> > I am getting the following compile error on centos 5. Any suggestions?
> > Jerry
>
> I can't tell you waht went wrong in your build, but there are apckages
> of zaptel available at http://atrpms.net/dist/el5/zaptel/
>
> > CC [M] /usr/src/digium/zaptel-1.4.1/xpp/xbus-core.o
> > /usr/src/digium/zaptel-1.4.1/xpp/xbus-core.c: In function
> > ‘debugfs_open’:
> > /usr/src/digium/zaptel-1.4.1/xpp/xbus-core.c:171: error: ‘struct inode’
> > has no member named ‘u’
> > /usr/src/digium/zaptel-1.4.1/xpp/xbus-core.c: In function
> > ‘proc_xbus_command_write’:
> > /usr/src/digium/zaptel-1.4.1/xpp/xbus-core.c:1108: warning: format ‘%d’
> > expects type ‘int’, but argument 6 has type ‘long int’
> > /usr/src/digium/zaptel-1.4.1/xpp/xbus-core.c:1118: warning: format ‘%d’
> > expects type ‘int’, but argument 6 has type ‘long int’
> > make[4]: *** [/usr/src/digium/zaptel-1.4.1/xpp/xbus-core.o] Error 1
> > make[3]: *** [/usr/src/digium/zaptel-1.4.1/xpp] Error 2
> > make[2]: *** [_module_/usr/src/digium/zaptel-1.4.1] Error 2
> > make[2]: Leaving directory `/usr/src/kernels/2.6.18-8.1.1.el5-x86_64'
> > make[1]: *** [modules] Error 2
> > make[1]: Leaving directory `/usr/src/digium/zaptel-1.4.1'
> > make: *** [all] Error 2
> > [root at geishp64 zaptel-1.4.1]#
If you read slightly around line 171 in xbus-core, you'll find:
* As part of the "inode diet" the private data member of struct inode
* has changed in 2.6.19. However, Fedore Core 6 adopted this change
* a bit earlier (2.6.18). If you use such a kernel, Change the
* following test from 2,6,19 to 2,6,18.
*/
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19)
#define I_PRIVATE(inode) ((inode)->u.generic_ip)
#else
#define I_PRIVATE(inode) ((inode)->i_private)
#endif
So how do we know if the kernel has gone through inode diet?
The inode diet patches, as backported into the Centos5 kernel srpm,
contain no extra define to test by.
Looking in the spec file of the source RPM I see that the inode diet
patches were required for the gfs2 backport patches. And the gfs2
patches do seem to add some extra defines. So here is my direction for a
patch:
Index: xpp/xbus-core.c
===================================================================
--- xpp/xbus-core.c (revision 2425)
+++ xpp/xbus-core.c (working copy)
@@ -40,6 +40,7 @@
#include "xbus-core.h"
#ifdef XPP_DEBUGFS
#include "xpp_log.h"
+#include <linux/fs.h> /* To detect RHEL kernel inode diet backport */
#endif
#include "zap_debug.h"
@@ -160,7 +161,8 @@
* a bit earlier (2.6.18). If you use such a kernel, Change the
* following test from 2,6,19 to 2,6,18.
*/
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19) \
+ || ( LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18) && defined(iFS_SYNC_FL) )
#define I_PRIVATE(inode) ((inode)->u.generic_ip)
#else
#define I_PRIVATE(inode) ((inode)->i_private)
Hopefully the syntax is correct and this works as planned, but I don't
have a centos 5 system to test this on right now.
--
Tzafrir Cohen
icq#16849755 jabber:tzafrir at jabber.org
+972-50-7952406 mailto:tzafrir.cohen at xorcom.com
http://www.xorcom.com iax:guest at local.xorcom.com/tzafrir
More information about the asterisk-users
mailing list