[LinuxPPS] HOWTO (was - Kernel Include files needed in Userland.)
Rodolfo Giometti
giometti at enneenne.com
Wed Aug 27 15:02:49 CEST 2008
On Tue, Aug 26, 2008 at 04:47:20PM -0700, Hal V. Engel wrote:
> 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
I saw it and I already asked to turn it into a more general HOWTO.
> 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
This is true __iif__ your distro has the same linux version of the one
you compiled LinuxPPS to. Otherwise you __must__ do the above links!
> 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.
Maybe less for userland but not for kernel land.
> 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.
In this situation the-right-think(TM) is to do the links and __then__
patch the timex.h file.
> 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.
After kernel inclusion files pps.h and timex.h should be installed by
the kernel package; regarding timepps.h distro's maintainers should
provide a specific package (libpps, pps-dev, etc.) to install into the
system the header timepps.g and other pps related programs/docs.
> 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?
Great! :)
Ciao,
Rodolfo
--
GNU/Linux Solutions e-mail: giometti at enneenne.com
Linux Device Driver giometti at linux.it
Embedded Systems phone: +39 349 2432127
UNIX programming skype: rodolfo.giometti
More information about the LinuxPPS
mailing list