[asterisk-users] Invalid use of undefined type when make dahdi

CB kjcsb at xnet.co.nz
Wed May 4 12:44:39 CDT 2011


> 
> On Wed, May 04, 2011 at 09:56:40PM +1200, CB wrote:
> > I am attempting to install Dahdi on a virtual machine running Centos
> 5.5 and
> > having various problems.
> >
> > yum install kernel-devel gcc make gcc-c++ libxml2-devel
> > Loaded plugins: fastestmirror
> > Loading mirror speeds from cached hostfile
> > * base: mirror.optus.net
> > * extras: mirror.optus.net
> > * rpmforge: fr2.rpmfind.net
> > * updates: mirror.optus.net
> > Setting up Install Process
> > Package kernel-devel-2.6.18-238.9.1.el5.x86_64 already installed and
> > latest version
> > Package gcc-4.1.2-50.el5.x86_64 already installed and latest version
> > Package 1:make-3.81-3.el5.x86_64 already installed and latest version
> > Package gcc-c++-4.1.2-50.el5.x86_64 already installed and latest
> version
> > Package libxml2-devel-2.6.26-2.1.2.8.el5_5.1.x86_64 already installed
> > and latest version
> > Package libxml2-devel-2.6.26-2.1.2.8.el5_5.1.i386 already installed
> and
> > latest version
> > Nothing to do
> >
> > [root at atlantis dahdi-linux-2.4.1.2]# make
> > make -C drivers/dahdi/firmware firmware-loaders
> > make[1]: Entering directory
> > `/usr/src/dahdi-linux-2.4.1.2/drivers/dahdi/firmware'
> > make[1]: Leaving directory
> > `/usr/src/dahdi-linux-2.4.1.2/drivers/dahdi/firmware'
> > You do not appear to have the sources for the 2.6.18-238.el5 kernel
> > installed.
> >
> > So we're running a different kernel...
> >
> > uname -r
> > 2.6.18-238.el5
> >
> > Downloaded kernel sources for 2.6.18-238.el5
> >
> > [user at atlantis ~]$ mkdir -p
> ~/rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
> > [user at atlantis ~]$ echo '%_topdir %(echo $HOME)/rpmbuild' >
> > ~/.rpmmacros
> > [user at atlantis ~]$cd ~/rpmbuild/SPECS
> > [user at atlantis ~]$rpmbuild -bp --target=`uname -m` kernel-2.6.spec
> > 2> prep-err.log | tee prep-out.log
> >
> > [root at atlantis kernel-2.6.18]# cp
> > /home/user/rpmbuild/BUILD/kernel-2.6.18/linux-2.6.18.x86_64
> > /usr/src/kernels/2.6.18-238.el5-x86_64 -R
> >
> > [root at atlantis dahdi-linux-complete-2.4.1.2+2.4.1]# make all
> >
> > /usr/src/dahdi-linux-complete-
> 2.4.1.2+2.4.1/linux/drivers/dahdi/dahdi-base.c:8652:
> > error: invalid use of undefined type ‘struct module’
> > /usr/src/dahdi-linux-complete-
> 2.4.1.2+2.4.1/linux/drivers/dahdi/dahdi-base.c:8652:
> > error: ‘struct dahdi_chan’ has no member named ‘pulsecount’
> > etc etc
> >
> > This article (http://asteriskfaqs.org/2011/01/30/asterisk-
> users/invalid-use-of-undefined-type-struct-module.html) indicates that
> those errors are the result of not having CONFIG_MODULES set in the
> kernel config.
> >
> > cd /home/user/rpmbuild/BUILD/kernel-2.6.18/linux-2.6.18.x86_64
> > make menuconfig
> > [*] Enable loadable module support
> >
> > Legend: [*] built-in
> >
> > Any advice appreciated.
> 
> It still looks like the kernel that is running doesn't match the kernel
> that
> you prepped.
> 
> Can you "yum install kernel-devel-`uname -r`" after cleaning up the
> /usr/src/kernels/2.6.18-238.el5-x86_64 directory and then build?
> 
mv 2.6.18-238.el5-x86_64 /tmp
yum install kernel-devel-`uname -r`
make clean
make all
make install
service dahdi start
Loading DAHDI hardware modules:

No hardware timing source found in /proc/dahdi, loading dahdi_dummy
Running dahdi_cfg:                                         [  OK  ]

Nice!

Thanks very much.




More information about the asterisk-users mailing list