[Home]

Summary:DAHLIN-00234: [patch] Unable to compile dahdi-linux-mod of RHEL 5.6 (and derivates)
Reporter:Nicolas DUPEUX (ndupeux)Labels:
Date Opened:2011-03-18 07:32:21Date Closed:2011-04-13 10:05:02
Priority:MinorRegression?No
Status:Closed/CompleteComponents:dahdi (the module)
Versions:2.4.0 Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) 0001-dahdi-Do-not-define-dev_name-if-already-backported.patch
( 1) dahdi-rhel56.diff
( 2) dev_name_rhel56_backport.diff
Description:When compiling dahdi-linux-kmod under RHEL 5.6, make failed with this message :

 CC [M]  /usr/src/rpm/BUILD/dahdi-linux-kmod-2.4.0/_kmod_build_/drivers/dahdi/xpp/card_bri.o
In file included from /usr/src/rpm/BUILD/dahdi-linux-kmod-2.4.0/_kmod_build_/drivers/dahdi/xpp/xpd.h:31,
                from /usr/src/rpm/BUILD/dahdi-linux-kmod-2.4.0/_kmod_build_/drivers/dahdi/xpp/card_bri.c:29:
include/linux/device.h:407: error: expected identifier or '(' before 'const'
make[3]: *** [/usr/src/rpm/BUILD/dahdi-linux-kmod-2.4.0/_kmod_build_/drivers/dahdi/xpp/card_bri.o] Error 1
make[2]: *** [/usr/src/rpm/BUILD/dahdi-linux-kmod-2.4.0/_kmod_build_/drivers/dahdi/xpp] Error 2
make[1]: *** [_module_/usr/src/rpm/BUILD/dahdi-linux-kmod-2.4.0/_kmod_build_/drivers/dahdi] Error 2
make[1]: Leaving directory `/usr/src/kernels/2.6.18-238.5.1.el5-i686'


****** ADDITIONAL INFORMATION ******

RHEL 5.6 have backported the definition of dev_name from kernel 2.6.26 (as stated in bug DAHLIN-96) in kernel 2.6.18-238

RHEL 5.5 seems to be ok.

This patch solve the problem. I'm applying it in the dahdi-linux-kmod specfile

--- include/dahdi/kernel.h      2010-08-19 20:03:25.000000000 +0200
+++ include/dahdi/kernel.h      2011-03-18 11:32:32.000000000 +0100
@@ -86,7 +86,9 @@
#endif

#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,26)
-#define dev_name(dev)          (dev)->bus_id
+#if RHEL_RELEASE_CODE < RHEL_RELEASE_VERSION(5,6)
+#define dev_name(dev)         (dev)->bus_id
+#endif
#define dev_set_name(dev, format, ...) \
       snprintf((dev)->bus_id, BUS_ID_SIZE, format, ## __VA_ARGS__);
#endif
Comments:By: Shaun Ruffell (sruffell) 2011-04-09 17:09:07

Hmm...instead of looking for RHEL release, I think we will need to look for the back ported definition specifically before this can be merged into trunk (and possibly onto the 2.4 branch).

By: Shaun Ruffell (sruffell) 2011-04-09 18:21:28

I've attached a patch (made with git, so use patch -p1 if you want to apply it with the "wget patch" recipe above) that just looks for an existing definition before defining a new one.  Let me know if this works for you.  This patch should work if other distributions back port the definition as well.

Also, if you would like me to use your real reporter name / email into the commit log, let me know and I'll do so before committing.

By: Günther Nester (ginne) 2011-04-10 02:59:04

Sorry to ask, but how exactly and where is the patch to be applied? Please explain for a newbie. Thank you

By: Shaun Ruffell (sruffell) 2011-04-10 10:58:59

No problem.  The patch is attached to this issue under the "Attached Files" section.  You could apply it onto the last release of DAHDI with the following commands:

]# svn co http://svn.asterisk.org/svn/dahdi/linux/tags/2.4.1.1 dahdi-linux-2.4.1.1
]# cd dahdi-linux-2.4.1.1
]# wget 'https://issues.asterisk.org/file_download.php?file_id=29097&type=bug' -O - | patch -p1

By: Michael L. Young (elguero) 2011-04-11 10:05:05

I can confirm that this patch is working on CentOS 5.6.

Thanks

By: Ralph (quadra) 2011-04-11 11:07:32

Thanks in advance.

But when I use the svn/cd/wget command according sruffell, it ask me always which file I want to patch.

Which file I have to say?
Tkx a lot.


[root@zulu1505 dahdi-linux-2.4.1.1]# wget 'https://issues.asterisk.org/file_download.php?file_id=29097&type=bug' -O - | patch -p0
--2011-04-11 17:07:35--  https://issues.asterisk.org/file_download.php?file_id=29097&type=bug
Resolving issues.asterisk.org... 76.164.171.231, 2001:470:e0d4::e7
Connecting to issues.asterisk.org|76.164.171.231|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1749 (1.7K) [text/plain]
Saving to: `STDOUT'

100%[================================================================================================================>] 1,749       --.-K/s   in 0s

2011-04-11 17:07:36 (7.79 MB/s) - `-' saved [1749/1749]

can't find file to patch at input line 23
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|From f86080371ffff20f44adf21d1df24d3e00918c44 Mon Sep 17 00:00:00 2001
|From: Shaun Ruffell <sruffell@digium.com>
|Date: Sat, 9 Apr 2011 18:10:51 -0500
|Subject: [PATCH] dahdi: Do not define dev_name if already backported.
|
|RHEL 5.6 has backported dev_name in include/dahdi/devices.h.  We now need to
|check for a back ported definition before defining our own version on pre
|2.6.26 kernels.
|
|(closes issue DAHLIN-234)
|Reported by: ndupeux, AlexCeli
|
|Signed-off-by: Shaun Ruffell <sruffell@digium.com>
|---
| drivers/dahdi/Kbuild   |    5 +++++
| include/dahdi/kernel.h |    2 ++
| 2 files changed, 7 insertions(+), 0 deletions(-)
|
|diff --git a/drivers/dahdi/Kbuild b/drivers/dahdi/Kbuild
|index ec881dc..ec029a6 100644
|--- a/drivers/dahdi/Kbuild
|+++ b/drivers/dahdi/Kbuild
--------------------------
File to patch:

By: Ralph (quadra) 2011-04-11 11:14:58

Ok, the patch run. It was a problem here. Will try to compile now.

By: Digium Subversion (svnbot) 2011-04-11 13:41:49

Repository: dahdi
Revision: 9894

U   linux/trunk/include/dahdi/kernel.h

------------------------------------------------------------------------
r9894 | sruffell | 2011-04-11 13:41:48 -0500 (Mon, 11 Apr 2011) | 12 lines

dahdi: Do not define dev_name if already backported.

RHEL 5.6 has backported dev_name in include/dahdi/devices.h.  We now need to
check for a back ported definition before defining our own version on pre
2.6.26 kernels.

(closes issue DAHLIN-234)
Reported by: ndupeux, AlexCeli
Tested by: elguero

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
Acked-by: Shaun Ruffell <sruffell@digium.com>
------------------------------------------------------------------------

http://svn.digium.com/view/dahdi?view=rev&revision=9894

By: Digium Subversion (svnbot) 2011-04-11 13:45:06

Repository: dahdi
Revision: 9895

U   linux/branches/2.4/include/dahdi/kernel.h

------------------------------------------------------------------------
r9895 | sruffell | 2011-04-11 13:45:06 -0500 (Mon, 11 Apr 2011) | 14 lines

dahdi: Do not define dev_name if already backported.

RHEL 5.6 has backported dev_name in include/dahdi/devices.h.  We now need to
check for a back ported definition before defining our own version on pre
2.6.26 kernels.

(closes issue DAHLIN-234)
Reported by: ndupeux, AlexCeli
Tested by: elguero

Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
Acked-by: Shaun Ruffell <sruffell@digium.com>

Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=9894
------------------------------------------------------------------------

http://svn.digium.com/view/dahdi?view=rev&revision=9895