Home/Support/Support Forum/error: cannot create %sourcedir /usr/src/redhat/SOURCES
Welcome to Digi Forum, where you can ask questions and receive answers from other members of the community.

error: cannot create %sourcedir /usr/src/redhat/SOURCES

0 votes
I am trying to install the driver software on CentOS 4.4 for a digi portserver but I am having problems.

Files:
http://ftp1.digi.com/support/driver/40002086_M.src.rpm
http://ftp1.digi.com/support/driver/40002086_M.tgz
http://ftp1.digi.com/support/driver/93000359_M.txt

[root@localhost ~]# rpm -ivv 40002086_M.src.rpm
D: ============== 40002086_M.src.rpm
D: Expected size: 3077003 = lead(96)+sigs(180)+pad(4)+data(3076723)
D: Actual size: 3077003
D: 40002086_M.src.rpm: MD5 digest: OK (6f4539a9c499f3b87d87fe1ab8509d20)
D: added source package [0]
D: found 1 source and 0 binary packages
D: Expected size: 3077003 = lead(96)+sigs(180)+pad(4)+data(3076723)
D: Actual size: 3077003
error: cannot create %sourcedir /usr/src/redhat/SOURCES

That didn't work so I do:
tar -zxvf 40002086_M.tgz && cd dgrp-1.9 && ./configure

[root@localhost dgrp-1.9]# ./configure
checking for awk... /bin/awk
checking for arch... /bin/arch
checking for cat... /bin/cat
checking for cd... /bin/cd
checking for chkconfig... /sbin/chkconfig
checking for chmod... /bin/chmod
checking for chown... /bin/chown
checking for cp... /bin/cp
checking for depmod... /sbin/depmod
checking for echo... /bin/echo
checking for fuser... /sbin/fuser
checking for grep... /bin/grep
checking for init... /sbin/init
checking for insmod... /sbin/insmod
checking for kill... /bin/kill
checking for ln... /bin/ln
checking for ls... /bin/ls
checking for lsmod... /sbin/lsmod
checking for make... /usr/bin/make
checking for mkdir... /bin/mkdir
checking for mknod... /bin/mknod
checking for more... /bin/more
checking for mv... /bin/mv
checking for ps... /bin/ps
checking for rm... /bin/rm
checking for rmdir... /bin/rmdir
checking for rmmod... /usr/local/bin/rmmod
checking for sed... /bin/sed
checking for sleep... /bin/sleep
checking for stty... /bin/stty
checking for tar... /bin/tar
checking for tr... /usr/bin/tr
checking for touch... /bin/touch
checking for true... /bin/true
checking for uname... /bin/uname
checking for platform type... i386
checking for gcc... gcc
checking for gcc version... >= 3.2 (3.4.6)
checking for gcc... gcc
checking for C compiler default output... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking for current kernel version... 2.6.9-42.ELsmp -> 2.6.9-42. -> 2.6.9
checking for kernel headers... "Not found."



****************************************************************************
* Unable to locate matching kernel source for the
* linux 2.6.9-42.ELsmp kernel that is currently running!
*
* The Digi RealPort driver requires this linux kernel source to be
* installed as /usr/src/linux-2.6.9-42.ELsmp before being able to correctly
* build the driver.
*
* Please install the kernel sources which must match the running
* linux 2.6.9-42.ELsmp kernel, and then try installing again.
****************************************************************************

configure: error: Unable to find kernel headers. Failing configure script.

Anyone got any fantastic ideas of how to install this on CentOS?
asked Jan 2, 2007 in Realport by hm2k New to the Community (8 points)

Please log in or register to answer this question.

12 Answers

0 votes
The issue is that an end user is building as root, and the permissions of the build system are not able to make a directory it wants on centos which uses a different hierarchy of directorys for builds

The topic is covered as to setting up a build environment for an end user at:

http://www.oldrpm.org/hintskinks/buildtree/

and a longer tutorial on rpm building is at:

http://www.gurulabs.com/goodies/guru+guides.php

Following that under centos-4, I get:

[herrold@centos-4 build]$ mkdir build
[herrold@centos-4 build]$ cd build
[herrold@centos-4 build]$ wget http://ftp1.digi.com/support/driver/40002086_M.src.rpm

... snip

10:32:03 (301.39 KB/s) - `40002086_M.src.rpm' saved [3077003/3077003]

[herrold@centos-4 build]$ rpmbuild --rebuild 40002086_M.src.rpm
Installing 40002086_M.src.rpm
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.37748
+ umask 022

... snip

Requires(rpmlib): rpmlib(CompressedFileNames) <= 3.0.4-1 rpmlib(PayloadFilesHavePrefix) <= 4.0-1
Checking for unpackaged file(s): /usr/lib/rpm/check-files /var/tmp/dgrp-buildroot
Wrote: /home/herrold/rpmbuild/RPMS/i386/dgrp-1.9-6.i386.rpm
Wrote: /home/herrold/rpmbuild/RPMS/i386/dgrp-debuginfo-1.9-6.i386.rpm
Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.62800
+ umask 022

... snip

+ exit 0
[herrold@centos-4 build]$
answered Jan 2, 2007 by herrold New to the Community (1 point)
0 votes
checking for current kernel version... 2.6.9-42.ELsmp -> 2.6.9-42. -> 2.6.9
checking for kernel headers... "Not found."



****************************************************************************
* Unable to locate matching kernel source for the
* linux 2.6.9-42.ELsmp kernel that is currently running!
*
* The Digi RealPort driver requires this linux kernel source to be
* installed as /usr/src/linux-2.6.9-42.ELsmp before being able to correctly
* build the driver.
*
* Please install the kernel sources which must match the running
* linux 2.6.9-42.ELsmp kernel, and then try installing again.
****************************************************************************

configure: error: Unable to find kernel headers. Failing configure script.




The above errors indicate that the kernel sources/headers are not found for your 2.6.9-42-ELsmp kernel. Have you installed the kernel-smp-devel package to match your kernel?
answered Jan 2, 2007 by userid0 Veteran of the Digi Community (2,158 points)
0 votes
This is the problem i'm faced with now.

"configure: error: Unable to find kernel headers. Failing configure script."

On CentOS it appears that "/usr/src/linux-2.6.9-42.ELsmp" would not exist, however "/usr/src/kernels/2.6.9-42.0.3.EL-smp-i686" does.

Now I have installed kernel-smp-devel (I had only installed kernel-devel previously).

I'm assuming I need to do:
ln -s /usr/src/kernels/2.6.9-42.0.3.EL-smp-i686 /usr/src/linux-2.6.9-42.ELsmp

And that should work.

Next issue is as follows...

checking OpenSSL header version... "Not found."


******************************************************************************
* Unable to locate the OpenSSL headers!
*
* The Digi RealPort driver requires the OpenSSL layer.
*
* This driver will use the shipped version of the OpenSSL package that comes
* with this driver package.
*
* There will be a considerable amount of extra time spent
* compiling this driver package (anywhere from 5 - 60 minutes),
* because the OpenSSL library will also be compiled.
******************************************************************************

So I did yum install openssl-devel, i'm guessing this will work...


Message was edited by: hm2k
answered Jan 2, 2007 by hm2k New to the Community (8 points)
0 votes
The SSL files will be installed automatically with the Digi driver. It will just take a little extra time to compile, so there is no need to worry about that message.
answered Jan 2, 2007 by userid0 Veteran of the Digi Community (2,158 points)
0 votes
./configure worked...

Now time for make all...

[root@localhost dgrp-1.9]# make all
(cd driver; make all)
make[1]: Entering directory `/root/dgrp-1.9/driver'
make -C /usr/src/linux-2.6.9-42.ELsmp SUBDIRS=$PWD modules MYPWD=/root/dgrp-1.9/driver MYMANDIR=/usr/share/man
make[2]: Entering directory `/usr/src/kernels/2.6.9-42.0.3.EL-smp-i686'
Building modules, stage 2.
MODPOST
make[2]: Leaving directory `/usr/src/kernels/2.6.9-42.0.3.EL-smp-i686'
make[1]: Leaving directory `/root/dgrp-1.9/driver'
(cd ditty; make all)
make[1]: Entering directory `/root/dgrp-1.9/ditty'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/root/dgrp-1.9/ditty'
(cd daemon; make all)
make[1]: Entering directory `/root/dgrp-1.9/daemon'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/root/dgrp-1.9/daemon'
(cd config; make all)
make[1]: Entering directory `/root/dgrp-1.9/config'
echo "#!/bin/sh" > dgrp_gui
echo "# Run wish from the user's PATH \\" >> dgrp_gui
echo "exec wish -f \"\$0\" \${1+\"\$@\"}" >> dgrp_gui
cat dgrp_msgs.tcl dgrp_misc.tcl dgrp_nodes.tcl dgrp_ttys.tcl dgrp_scriptlog.tcl dgrp_main.tcl >> dgrp_gui
chmod +x dgrp_gui
make[1]: Leaving directory `/root/dgrp-1.9/config'
(cd dgipserv; make -f Makefile.linux all)
make[1]: Entering directory `/root/dgrp-1.9/dgipserv'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/root/dgrp-1.9/dgipserv'
(cd dgelreset; make -f Makefile.linux all)
make[1]: Entering directory `/root/dgrp-1.9/dgelreset'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/root/dgrp-1.9/dgelreset'
(cd dinc; make LINUX)
make[1]: Entering directory `/root/dgrp-1.9/dinc'
make[2]: Entering directory `/root/dgrp-1.9/dinc'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/root/dgrp-1.9/dinc'
make[1]: Leaving directory `/root/dgrp-1.9/dinc'
(cd dparp; make linux)
make[1]: Entering directory `/root/dgrp-1.9/dparp'
make -f os/Makefile.Linux all
make[2]: Entering directory `/root/dgrp-1.9/dparp'
make -f os/Makefile.Linux all
make[2]: Entering directory `/root/dgrp-1.9/dparp'
gcc -O2 -g -W -Wall -DLINUX -I./inc -c -o main.o main.c
main.c:24:21: curses.h: No such file or directory
main.c:29:20: panel.h: No such file or directory
In file included from main.c:44:
./inc/dpa_rp.h:119: error: syntax error before '*' token
./inc/dpa_rp.h:119: warning: type defaults to `int' in declaration of `dfp'
./inc/dpa_rp.h:119: warning: data definition has no type or storage class
In file included from main.c:47:
./inc/curses_helpers.h:49: error: syntax error before "WINDOW"
./inc/curses_helpers.h:49: warning: no semicolon at end of struct or union
./inc/curses_helpers.h:50: warning: type defaults to `int' in declaration of `pan'
./inc/curses_helpers.h:50: warning: data definition has no type or storage class
./inc/curses_helpers.h:56: error: syntax error before '}' token
./inc/curses_helpers.h:56: warning: type defaults to `int' in declaration of `DigiWin'
./inc/curses_helpers.h:56: warning: data definition has no type or storage class
./inc/curses_helpers.h:71: error: syntax error before '*' token
./inc/curses_helpers.h:71: warning: type defaults to `int' in declaration of `new_digi_win'
./inc/curses_helpers.h:71: warning: data definition has no type or storage class
./inc/curses_helpers.h:72: error: syntax error before '*' token
./inc/curses_helpers.h:73: error: syntax error before '*' token
./inc/curses_helpers.h:77: error: syntax error before '*' token
./inc/curses_helpers.h:78: error: syntax error before '*' token
./inc/curses_helpers.h:80: error: syntax error before '*' token
./inc/curses_helpers.h:81: error: syntax error before '*' token
In file included from main.c:48:
./inc/general_panels.h:26: error: syntax error before '*' token
./inc/general_panels.h:26: warning: type defaults to `int' in declaration of `MainWin'
./inc/general_panels.h:26: warning: data definition has no type or storage class
./inc/general_panels.h:27: error: syntax error before '*' token
./inc/general_panels.h:27: warning: type defaults to `int' in declaration of `CRWin'
./inc/general_panels.h:27: warning: data definition has no type or storage class
./inc/general_panels.h:28: error: syntax error before '*' token
./inc/general_panels.h:28: warning: type defaults to `int' in declaration of `HeadWin'
./inc/general_panels.h:28: warning: data definition has no type or storage class
./inc/general_panels.h:29: error: syntax error before '*' token
./inc/general_panels.h:29: warning: type defaults to `int' in declaration of `IdentWin'
./inc/general_panels.h:29: warning: data definition has no type or storage class
./inc/general_panels.h:30: error: syntax error before '*' token
./inc/general_panels.h:30: warning: type defaults to `int' in declaration of `ChanWin'
./inc/general_panels.h:30: warning: data definition has no type or storage class
./inc/general_panels.h:31: error: syntax error before '*' token
./inc/general_panels.h:31: warning: type defaults to `int' in declaration of `LBWin'
./inc/general_panels.h:31: warning: data definition has no type or storage class
./inc/general_panels.h:32: error: syntax error before '*' token
./inc/general_panels.h:32: warning: type defaults to `int' in declaration of `ScopeWin'
./inc/general_panels.h:32: warning: data definition has no type or storage class
./inc/general_panels.h:33: error: syntax error before '*' token
./inc/general_panels.h:33: warning: type defaults to `int' in declaration of `ExamWin'
./inc/general_panels.h:33: warning: data definition has no type or storage class
./inc/general_panels.h:34: error: syntax error before '*' token
./inc/general_panels.h:34: warning: type defaults to `int' in declaration of `NodeWin'
./inc/general_panels.h:34: warning: data definition has no type or storage class
./inc/general_panels.h:61: error: syntax error before '*' token
main.c:56: error: syntax error before '*' token
main.c:56: warning: type defaults to `int' in declaration of `dfp'
main.c:56: warning: data definition has no type or storage class
main.c: In function `usage':
main.c:77: warning: implicit declaration of function `printf'
main.c:79: warning: implicit declaration of function `fprintf'
main.c: In function `main':
main.c:98: error: `TRUE' undeclared (first use in this function)
main.c:98: error: (Each undeclared identifier is reported only once
main.c:98: error: for each function it appears in.)
main.c:106: error: `stderr' undeclared (first use in this function)
main.c:123: error: `FALSE' undeclared (first use in this function)
main.c:126: warning: implicit declaration of function `fopen'
main.c:126: warning: assignment makes pointer from integer without a cast
make[2]: *** [main.o] Error 1
make[2]: Leaving directory `/root/dgrp-1.9/dparp'
make[1]: *** [linux] Error 2
make[1]: Leaving directory `/root/dgrp-1.9/dparp'
make: *** [build] Error 2
[root@localhost dgrp-1.9]#

It failed... why? any ideas?
answered Jan 2, 2007 by hm2k New to the Community (8 points)
0 votes
Looks like there is a mis-match with the kernel sources. You will want to confirm the running kernel matches the new installed sources exactly:

# uname -a
# rpm -qa | grep kernel
answered Jan 2, 2007 by userid0 Veteran of the Digi Community (2,158 points)
0 votes
[root@localhost dgrp-1.9]# uname -a
Linux localhost.localdomain 2.6.9-42.ELsmp #1 SMP Sat Aug 12 09:39:11 CDT 2006 i686 i686 i386 GNU/Linux
[root@localhost dgrp-1.9]# rpm -qa | grep kernel
kernel-utils-2.4-13.1.83
kernel-devel-2.6.9-42.0.3.EL
kernel-smp-2.6.9-42.EL
kernel-smp-2.6.9-42.0.3.EL
kernel-2.6.9-42.EL
kernel-2.6.9-42.0.3.EL
kernel-smp-devel-2.6.9-42.0.3.EL


Also worth noting...

[root@localhost dgrp-1.9]# ls /usr/src/kernels
2.6.9-42.0.3.EL-i686 2.6.9-42.0.3.EL-smp-i686

Also remember I created a symlink, as follows:
ln -s /usr/src/kernels/2.6.9-42.0.3.EL-smp-i686 /usr/src/linux-2.6.9-42.ELsmp

Thanks.
answered Jan 2, 2007 by hm2k New to the Community (8 points)
0 votes
Your running kernel is 2.6.9-42.ELsmp, while your kernel source is version 2.6.9-42.0.3.ELsmp.

I recommend booting into kernel version 2.6.9-42.0.3.ELsmp (which appears to be installed) and re-try the driver build or install the kernel-smp-devel-2.6.9-42 kernel source package (without the .0.3) to match your running kernel.
answered Jan 2, 2007 by userid0 Veteran of the Digi Community (2,158 points)
0 votes
I recently upgraded the kernel via yum update, I have not rebooted since the upgrade was done.

I'm assuming if I reboot it will automatically launch the new kernel, and it should compile without any issues?
answered Jan 2, 2007 by hm2k New to the Community (8 points)
0 votes
Once booted into the new kernel, the driver package should install fine.

If not, I recommend contacting Digi Technical Support to pursue this matter further.
answered Jan 2, 2007 by userid0 Veteran of the Digi Community (2,158 points)
Contact a Digi expert and get started today! Contact Us
...