Summary:ASTERISK-04848: [request] building Zaptel requires full kernel source install & make
Reporter:Steve Murphy (murf)Labels:
Date Opened:2005-08-16 19:05:03Date Closed:2011-06-07 14:03:13
Versions:Frequency of

A few weeks back, I ran the FC3 up2date, and it updated my kernel.
But to my dismay, zaptel would no longer build.

I had to download the kernel-src package, and follow (with painstaking
care) the kernel source explosion instructions in the FC3 release notes.

I also, on top of that, had to do some improvisation, as the kernel
sources did not put the source where the updated package was expecting
it be, so I created the hierarchy so the kernel BUILD stuff was where
the links point to.

So, what happened? has Fedora just changed something, or is Asterisk
doing something different? Or is this an FC3 bug?

The FC3 (and FC4) release notes say this:

> Building Only Kernel Modules
> An exploded source tree is not required to build a kernel module, such
> as your own device driver, against the currently in-use kernel.
> For example, to build the foo.ko module, create the following Makefile
> in the directory containing the foo.c file:
> obj-m := foo.o
> KDIR  := /lib/modules/$(shell uname -r)/build
> PWD   := $(shell pwd)
> default:
>     $(MAKE) -C $(KDIR) M=$(PWD) modules
> Issue the make command to build the foo.ko module.

So, is there any plan to arrange the zaptel build process to run in such
a way as to avoid the necessity of a kernel-src build?

****** STEPS TO REPRODUCE ******

On FC3, do up2date to latest kernel update.
Then, try and rebuild Zaptel.
Comments:By: Michael Jerris (mikej) 2005-08-17 08:28:38

Please supply actual date of the cvs version you are using.

By: Steve Murphy (murf) 2005-08-17 10:16:18

According to my records, I built the kernel source from the rpm on 21 or 22 July 2005. The cvs update would have been done on one of those two days, most likely 21 July 2005, as I spent a full day getting the drivers to compile.

By: Kevin P. Fleming (kpfleming) 2005-08-22 22:02:46

It already works the way you describe, if the 'build' directory is populated properly. I have built Zaptel on other distros without having to install, configure and build the full kernel sources.

Can you get your system back to 'normal' and post the errors that you receive when trying to build Zaptel?

By: Michael Jerris (mikej) 2005-08-28 00:02:27

bug suspended pending requesteed information.  Please re-open when you have the requested information ready to upload.

By: Steve Murphy (murf) 2005-09-01 00:12:48

OK, I'm reopening this issue. I just found another kernel update via the
fedora core 3 up2date process.

I had the kernel-2.6.12-1.1372_FC3; the up2date will update me to

After installation of kernel update, I cd to my zaptel cvs dir, and
run a "cvs update -d" and then do a "make". This was done today, so this sets the date of the CVS version.

I get the message:

You do not appear to have the sources for the $(KVERS) kernel installed.

(sorry, the message scrolled off the screen, I fetched the above from
the makefile).

I tried updating the kernel-devel package... no affect.

I tried the kernel-doc... no such thing.

So, I pulled out the FC4 release notes (which has the same kernel source building instructions as FC3, but more detailed and "better" than FC3.)
and ran down the list for getting and installing the kernel-source package.

First of all, getting the kernel source pkg...
I gave up on using the up2date --get-source kernel command, all I got was 404 results... seems very few of the mirrors stock the source pkg, or they don't put it where the up2date expects it to be, or something, so I go to redhat and hit the downloads, and search until I find the package, and I download by hand.

Then I follow instructions:

rpm -Uvh kernel-2.6.12-1.1376_FC3.src.rpm
cd /usr/src/redhat/SPECS/
echo $(arch)
rpmbuild -bp --target $(arch) kernel-2.6.spec
rm -rf /usr/src/kernels/linux-2.6.12/
cd /usr/src/redhat/BUILD/kernel-2.6.12
mv linux-2.6.12/ /usr/src/kernels
cd /usr/src/kernels/
ln -s linux-2.6.12/ 2.6.12-1.1376_FC3-i686
cd /usr/src/linux/  (a link I made last time to the linux-2.6.12 dir in kernels)
ls configs
cp configs/kernel-2.6.12-i686.config .config
make oldconfig

and now I could recompile zaptel.
After some heartache caused by forgetting to do a "make clean" before I recompiled zaptel, I finally woke up and did the make clean; make; make install, and then things worked fine.

Now, since no-one else seems to suffer from this problem, I suppose I'm the only guy on the face of the whole earth to have this problem. But I swear, I have no idea of what I might have done to cause this. I never play with the kernel.All I do is the *^(*^&%$&%!!!  up2dates. And the 1372 version had this prob, and now the 1376 version of the 2.6.12 kernel has it, too. If everybody else on FC3 is running up2date, and have no probs, then close this bug, and ignore me. I'll keep downloading the #^%#$^%$#!$#@@^%$#@!! source packages until upgrade to FC4.
Maybe RH is just getting sloppy about kernel updates. Or maybe I did something weird that throws it off.


By: Brian West (bkw918) 2005-09-01 01:10:49

This is not a zaptel problem nor is it an asterisk issue.  Its a problem with your distro.  


By: Michael Jerris (mikej) 2005-09-01 06:41:11

murf, for what it's worth, fedora core 2 required you to do yum install kernel-sources as welll so this may just be that fedora does not put the headers in with the kernel package, or that they are in a weird place.  Can you verify if it is installing any of the kernel headers with the kernel, and if so, where?

By: Steve Murphy (murf) 2005-09-01 09:16:23


OK, I THINK I understand what happened, sort of... alas, a tail of treachery, stupidity, and more stupidity.

I wouldn't be surprised if 1376 was released to fix the insanity of 1372. They don't show the reasoning when you do the up2date updates--- I guess the same happens with windows update-- except there they do give a fuzzy few words about the reasons for the update, that don't really mean much anyway...

Anyway, I digress. The treachery was thus: in the 2.6.12 1372 release, the /lib/modules dir was so arranged:

[467]/lib/modules/2.6.12-1.1372_FC3 Yes, Master? ls -l
total 1044
lrwxrwxrwx  1 root root     47 Nya 22 20:13 build -> ../../../usr/src/kernels/2.6.12-1.1372_FC3-i686
drwxr-xr-x  9 root root   4096 Nya 22 20:14 kernel/
-rw-rw-r--  1 root root 194916 Nya 22 20:14 modules.alias
-rw-rw-r--  1 root root     69 Nya 22 20:14 modules.ccwmap
-rw-rw-r--  1 root root 234004 Nya 22 20:14 modules.dep
-rw-rw-r--  1 root root    813 Nya 22 20:14 modules.ieee1394map
-rw-rw-r--  1 root root    357 Nya 22 20:14 modules.inputmap
-rw-rw-r--  1 root root  16284 Nya 22 20:14 modules.isapnpmap
-rw-rw-r--  1 root root 169632 Nya 22 20:14 modules.pcimap
-rw-rw-r--  1 root root  89255 Nya 22 20:14 modules.symbols
-rw-rw-r--  1 root root 268793 Nya 22 20:14 modules.usbmap
lrwxrwxrwx  1 root root      5 Nya 22 20:14 source -> build

I double checked, actually triple checked. I have 3 machines running FC3, all three were updated to 1372. Two of the 3 are updated to 1376 now. As you can see, the build dir is just a pointer. I had to install the source in the pointed to location (/usr/src/kernels/2.6.12-1.1372_FC3-i686) to build zaptel.

So much for the treachery. Now the stupidity. When I installed 1376 via the up2date procedure, the /lib/modules dir was set up thus:

[469]/lib/modules/2.6.12-1.1376_FC3 Yes, Master? ls -l
total 1044
drwxr-xr-x  17 root root   4096 Kan 31 18:03 build/
drwxr-xr-x   9 root root   4096 Kan 31 18:04 kernel/
-rw-rw-r--   1 root root 195024 Kan 31 18:05 modules.alias
-rw-rw-r--   1 root root     69 Kan 31 18:05 modules.ccwmap
-rw-rw-r--   1 root root 234191 Kan 31 18:05 modules.dep
-rw-rw-r--   1 root root    813 Kan 31 18:05 modules.ieee1394map
-rw-rw-r--   1 root root    357 Kan 31 18:05 modules.inputmap
-rw-rw-r--   1 root root  16284 Kan 31 18:05 modules.isapnpmap
-rw-rw-r--   1 root root 169723 Kan 31 18:05 modules.pcimap
-rw-rw-r--   1 root root  89255 Kan 31 18:05 modules.symbols
-rw-rw-r--   1 root root 268974 Kan 31 18:05 modules.usbmap

which seems to have a nice, full setup of build:

[root@phone 2.6.12-1.1376_FC3]# ls build
arch  crypto  drivers  fs  include  init  ipc  kernel  lib  Makefile  mm  Module.symvers  net  scripts  security  sound  usr

So, why did I have probs? Simple. I compiled the darn stuff before the reboot to the new kernel! So, apparently some of the links don't change till you boot. So, I continued to use the old (mixed with the new) in strange ways. And had trouble...
After the boot, I recompiled zaptel from scratch again, and had no probs, even with two copies of the #!$!^%#! kernel include files.

My conclusion is this: If some other poor sot happens to do up2date to 1372, and has problems compiling zaptel, then tell him this: immediately do another up2date, and get 1376 of the kernel installed. Reboot. In zaptel, do a make clean, make, make install. Then, Live Life to its Fullest. Breathe the Fresh Air. Don't Worry--- Be Happy!!

Sorry for filing bugs only I seem to hit, then solve myself (with some nudging from you folks).