[LinuxPPS] HOWTO (was - Kernel Include files needed in Userland.)

Hal V. Engel hvengel at astound.net
Wed Aug 27 01:47:20 CEST 2008


On Tuesday 26 August 2008 01:54:41 am Rodolfo Giometti wrote:
> On Tue, Aug 26, 2008 at 06:42:15PM +1000, Cirilo Bernardo wrote:
> > Ah, I forgot about that timepps.h file.   This is a tricky situation
> > since the file cannot be added to the NTP source either.  I guess it
> > will have to remain an item linked to in the LinuxPPS wiki.  The
> > distro maintainers will have to add it to their packaged NTP sources
> > and also patch and build NTP to use linuxpps.   This will have
> > absolutely no effect on people who use NTP without pps, but users may
> > have to inform the appropriate maintainer for their distro so that the
> > support can all be pre-built and end users don't have to run off and
> > recompile NTP.
>
> That's why an HOWTO will be useful... ;)
>
> Ciao,
>
> Rodolfo

Remco has a cookbook recipe here

http://rembl.org/index.php/2008/04/19/motorola-oncore-ut-and-linuxpps/

that covers some of this stuff as it relates to getting NTP working with an 
OnCore.  The recipe is also not generalized in that it is distro specific (I 
had to change some things to get this to work with my distro) and it only 
covers one refclock type.  There are other sources of information available 
such as items on this list that can be used to generalize this.  

Reg suggested that there might be a small list of header files that need to be 
copied to /usr/include/linux.  Rodolfo replied "This info is temporary ... 
Also this info is reported into the wiki."    I agree that hand copying or 
creating links is a temporary situation but the wiki uses brute force to deal 
with this:

/usr/include# ln -s /lib/modules/$(uname -r)/build/include/linux
/usr/include# ln -s /lib/modules/$(uname -r)/build/include/asm
/usr/include# ln -s /lib/modules/$(uname -r)/build/include/asm-generic

I think that what Reg was trying to get at is that the specific list of 
LinuxPPS header files that need to be made available for user land tool builds 
is a small list and that perhaps there is a better way to handle this than to 
use brute force like is currently used in the wiki.  If in fact there are only 
2 or 3 files that need to be copied from the kernel tree to /usr/include... 
then perhaps it would be better to change from using brute force links to just 
copying those missing files to were they are needed or by using links only to 
those files like the Wiki does for timepps.h.  Initially this would be done by 
hand but when LinuxPPS becomes part of the kernel then the normal kernel 
installation will make the problem go away for the /usr/include/linux/* files.  
On my system it appears that the only kernel header file that would be needed 
is pps.h.

I just did a test and to get NTP and the linuxpps user land tools to build all 
I needed was:

/usr/include/linux # ln -s /lib/modules/$(uname -r)/build/include/linux/pps.h
/usr/include # ln -s /lib/modules/$(uname -
r)/build/Documentation/pps/timepps.h

Which makes things much simpler (and less dangerous) since it is very specific 
and only involves two files.

In addition to the two sym links I also needed to patch 
/usr/include/sys/timex.h to get NTP to build with nano support.  So this is 
not handled correctly yet by my distro even though I have the distro package 
for the 2.6.26 linux headers installed.  In fact this package over wrote the 
changes I had made to /usr/include/sys/timex.h to get nano working when I 
installed the 2.6.26 linux headers.  I suspect that most distros will have 
similar issues with these newer kernels.

With regard to timepps.h, longer term there needs to be a simple way to 
install this header file otherwise it will be an ongoing issue.  It clearly is 
not correct to include it in the NTP tree since it is OS specific.   In 
addition,  it is needed by ppstest.c.  The root issue here is that the user 
land tools are sitting in a directory in the kernel tree (which is where this 
header is also located) but this code is not really a part of the kernel.  
These should be pulled out into a seperate package - prehaps called ppstools 
or ppsusertools - and this package should include timepps.h and handle 
installing the header file along with ppsldisc and ppstest.  This would make 
ntp dependant on this new package if the user wanted to build it with PPS 
refclock support since it needs both the header file to build and the user 
land tools to function.  It would also make the process of installing userland 
tools much simpler and cleaner.  This will have to happen at some point so why 
not now?  The biggest issue is that the build needs to be generalized and also 
needs an install target.   Moving this into it's own package would also 
simplify maintaince since it would no longer be tightly coupled to the kernel 
code.

Getting back to a HOWTO for LinuxPPS.  I would be willing to help and in fact 
I would be willing to write a draft version which would consist mostly of 
reorganized materials pulled together from existing sources.  But I suspect I 
will also need a lot of feed back from others here on the list.  Give me a few 
days to see what I can pull together.  Perhaps someone else can pull the 
LinuxPPS user land tools into a seperate package and generalize it's build?

Hal
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://ml.enneenne.com/pipermail/linuxpps/attachments/20080826/bd5cc863/attachment-0001.html 


More information about the LinuxPPS mailing list