[LinuxPPS] LinuxPPS new functionalities

Hal V. Engel hvengel at astound.net
Mon Feb 22 20:56:58 CET 2010


On Monday 22 February 2010 11:06:04 am clemens at dwf.com wrote:
> > On 2010-02-21 20:40, clemens at dwf.com wrote:
> > >> Do we know *WHY* this patch works?
> > >> I got this question from the person that I sent the previous ldattach
> > >> patches to. The answer might help add the needed functionality.
> > >
> > > I dont know anything about the patch.
> > > I am using the ldattach as distributed in Fedora12, and am having no
> > > problems with it at all,- so  it would seem that in at least my case
> > > that the patch is not necessary.
> >
> > Hmm, OK.
> > What exactly is the hardware that you are using?
> > And/or how do you start ntpd et all? (this might help explaining)

Like Reg I am using an unmodified ldattach with my setup and it has been 
working since I started using the 2.6.32 patches.  But my ldattach is a CVS 
version from around the time that the linuxpps 2.6.32 patches were released.  
I don't do anything special with the possible exception of using UDEV to setup 
the sym links for the PPS and the serial port for the driver.  All I did was 
create a ntp-pps startup script that calls ldattach and then runs the stock 
ntp startup script after waiting a few seconds.  This script and ldattach have 
been 100% reliable.

I am running an AMD64 Gentoo system.

The custom startup script looks like this:

#!/sbin/runscript
depend() {
        need net
        use dns logger
        after  ntp-client
}

start() {

        ebegin "Starting custom ntpd"

        ldattach PPS /dev/ttyS1

        sleep 2 # give ldattach and udev time to get settled

        /etc/init.d/ntpd start
}

stop() {
        ebegin "Stopping custom ntpd"
        /etc/init.d/ntpd stop
}


> 
> Well, I think the most important thing is that this is ldattach from
>  Fedora12, It is part of the glibc yum package, which shows a version of
>     glibc-2.10.1-2
> for x86_64 and i586 and i686.  Previous versions (Fedora11) complain that
> PPS is not defined.

Are you sure it is part of the glibc package?  On my system this is in the 
sys-apps/util-linux package and I have versions 2.16.1, 2.16.2, 2.17, 2.17-r1 
and 9999 (CVS) available.  Current stable version is 2.16.2.  I tried to get 
2.16* and 2.17* to work and they didn't.  But CVS did work very nicely.  In 
any case those who are trying this with 2.16 or 2.17 and having issues should 
try running CVS before reporting issues up stream since things may be fixed in 
CVS.

> 
> It is also possible (as you surmise) that its the way I use it.
> My startup code does the following
>        ldattach PPS /dev/ttyS0
>         loop, up to 10 times with 5 sec pause, looking for the /dev/pps<x>
>             that belongs to the device on the ldattach line.
>         set up the symbolic link from /dev/oncore.pps.0 to that device
>         daemon ntpd
> 
> The only really interesting thing here is the wait for /dev/pps<x> to
> appear.  This was important with a previous version of the ldisc code, and
> the search for the correct /dev/pps<x> is important on my machine
> since I keep changing things around and /dev/pps0 is not guaranteed.
> 
> As for hardware, this is working on everything from a Pentium II, thru
> a  couple of Pentium4's, and a Core 2 duo.
> 
> If anyone is interested, I can provide my startup script (from
> /etc/rc.d/init.d)
> and/or the little job that searches for the right /dev/pps<x> .
> 



More information about the LinuxPPS mailing list