[LinuxPPS] offsets

Udo van den Heuvel udovdh at xs4all.nl
Mon Dec 3 08:39:26 CET 2007


Reg Clemens wrote:
>> Now I only need some udev guru with the right tip to have udev run the
>> setserial line for /dev/ttyS0 every time.
>> Anybody?
>>
> When you get that info, please post it.
> I had thought about doing things that way, but gave up for the same reason

I put these lines in /etc/udev/rules.d/10-pps.rules:

KERNEL=="ttyS0", RUN+="/bin/setserial -v %k low_latency hardpps"
KERNEL=="ttyS0",                SYMLINK+="gps0"
KERNEL=="pps0",                 SYMLINK+="gpspps0"

At least they do not give me syntax errors when I do udevtest /dev/ttyS0
or udevtest /dev/pps0. (just that the device could not be opened)

But udevtest /sys/class/pps/pps0 gives me:

# udevtest /sys/class/pps/pps0
This program is for debugging only, it does not run any program,
specified by a RUN key. It may show incorrect results, because
some values may be different, or not available at a simulation run.

parse_file: reading '/etc/udev/rules.d/05-udev-early.rules' as rules file
parse_file: reading '/etc/udev/rules.d/10-pps.rules' as rules file
(....)
parse_file: reading '/etc/udev/rules.d/95-udev-late.rules' as rules file
import_uevent_var: import into environment: 'MAJOR=254'
import_uevent_var: import into environment: 'MINOR=0'
import_uevent_var: import into environment:
'PHYSDEVPATH=/devices/pnp0/00:08'
import_uevent_var: import into environment: 'PHYSDEVBUS=pnp'
import_uevent_var: import into environment: 'PHYSDEVDRIVER=serial'
main: looking at device '/class/pps/pps0' from subsystem 'pps'
udev_rules_get_name: add symlink 'gpspps0'
udev_rules_get_name: no node name set, will use kernel name 'pps0'
udev_db_get_device: found a symlink as db file
udev_device_event: device '/class/pps/pps0' already in database, cleanup
udev_node_add: creating device node '/dev/pps0', major=254, minor=0,
mode=0660, uid=0, gid=0
udev_node_update_symlinks: update symlink 'gpspps0' of '/class/pps/pps0'
udev_db_get_devices_by_name: no index directory
'/dev/.udev/names/gpspps0': No such file or directory
update_link: found -1 devices with name 'gpspps0'
update_link: no reference left, remove 'gpspps0'
main: run: 'socket:/org/freedesktop/hal/udev_event'
main: run: '/sbin/pam_console_apply /dev/pps0 /dev/gpspps0'
main: run: 'socket:/org/kernel/udev/monitor'

Is this OK? (I am not100% sure)

And:

# udevtest /sys/class/tty/ttyS0
This program is for debugging only, it does not run any program,
specified by a RUN key. It may show incorrect results, because
some values may be different, or not available at a simulation run.

parse_file: reading '/etc/udev/rules.d/05-udev-early.rules' as rules file
parse_file: reading '/etc/udev/rules.d/10-pps.rules' as rules file
(....)
parse_file: reading '/etc/udev/rules.d/95-udev-late.rules' as rules file
import_uevent_var: import into environment: 'MAJOR=4'
import_uevent_var: import into environment: 'MINOR=64'
import_uevent_var: import into environment:
'PHYSDEVPATH=/devices/pnp0/00:08'
import_uevent_var: import into environment: 'PHYSDEVBUS=pnp'
import_uevent_var: import into environment: 'PHYSDEVDRIVER=serial'
main: looking at device '/class/tty/ttyS0' from subsystem 'tty'
udev_rules_get_name: add symlink 'gps0'
udev_rules_get_name: no node name set, will use kernel name 'ttyS0'
udev_db_get_device: found a symlink as db file
udev_device_event: device '/class/tty/ttyS0' already in database, cleanup
udev_node_add: creating device node '/dev/ttyS0', major=4, minor=64,
mode=0660, uid=0, gid=14
udev_node_update_symlinks: update symlink 'gps0' of '/class/tty/ttyS0'
udev_db_get_devices_by_name: no index directory '/dev/.udev/names/gps0':
No such file or directory
update_link: found -1 devices with name 'gps0'
update_link: no reference left, remove 'gps0'
main: run: '/bin/setserial -v ttyS0 low_latency hardpps'
main: run: 'socket:/org/freedesktop/hal/udev_event'
main: run: '/sbin/pam_console_apply /dev/ttyS0 /dev/gps0'
main: run: 'socket:/org/kernel/udev/monitor'

Good?

Kind regards,
Udo



More information about the LinuxPPS mailing list