Getgpsdate: Difference between revisions
Jump to navigation
Jump to search
(Uus lehekülg: '=== git repo === git@taru:users/mark/getgpsdate.git === Description === Simple program that gets time straight form a gps device (via a file handler in /dev/) using ...') |
|||
(6 intermediate revisions by the same user not shown) | |||
Line 24: | Line 24: | ||
&& make (or scons equivalent) in gpsd source directory). | && make (or scons equivalent) in gpsd source directory). | ||
In buildroot gpsd is | In buildroot gpsd is automatically selected when choosing getgpsdate. | ||
First the gpsd package is installed to the staging directory, so | |||
getgpsdate could use the lib files and gpsd.h is copied from the | |||
gpsd package direcory to $(STAGING_DIR)/usr/include/ | |||
After that the getgpsdate utility installation is scheduled. | |||
At the end of buildroot build gpsd binary is removed from $(TARGET_DIR)/usr/bin | |||
directory before the new firmware is packaged. | |||
gpsd init script (S50gpsd) is also removed from $(TARGET_DIR)/usr/bin. | |||
The script that removes is gw/buildroot/board/martem/post-build/rm-temp-files.sh | |||
After every firmware update a script S01remove-old-files.sh located in | |||
gw/buildroot/board/martem/telem-common/fs_skeleton/usr/local/bin/post_update/ | |||
runs in the device and removes /usr/bin/gpsd and /etc/init.d/S50gpsd | |||
because we don't need them at the moment. | |||
=== Relevant files in Telem-gw project: === | === Relevant files in Telem-gw project: === | ||
Line 36: | Line 48: | ||
* buildroot/package/getgpsdate/getgpsdate.mk | * buildroot/package/getgpsdate/getgpsdate.mk | ||
[[Kasutaja:MarkTomm|MarkTomm]] 17. veebruar 2015, kell 15:02 (EET) | |||
[[Kasutaja:MarkTomm|MarkTomm]] |
Latest revision as of 13:02, 17 February 2015
git repo
git@taru:users/mark/getgpsdate.git
Description
Simple program that gets time straight form a gps device (via a file handler in /dev/) using the low level gps interface libgpsd to circumvent the need for GPS Daemons (e.g. when using Generic NMEA reference clocks). This program should be run once at system boot, otherwise, with no half-way valid clock, ntpd will receive the time from gps source, but will either refuse to adjust the clock by years of difference or make a sudden change of system time, which may result in system crash.
Building and dependencies
getgpsdate util depends on libgpsd and libgps so files and on some additional headers (gpsd.h and its includes). All this can be obtained from compiled gpsd directory (after running ./configure && make (or scons equivalent) in gpsd source directory).
In buildroot gpsd is automatically selected when choosing getgpsdate. First the gpsd package is installed to the staging directory, so getgpsdate could use the lib files and gpsd.h is copied from the gpsd package direcory to $(STAGING_DIR)/usr/include/ After that the getgpsdate utility installation is scheduled. At the end of buildroot build gpsd binary is removed from $(TARGET_DIR)/usr/bin directory before the new firmware is packaged. gpsd init script (S50gpsd) is also removed from $(TARGET_DIR)/usr/bin. The script that removes is gw/buildroot/board/martem/post-build/rm-temp-files.sh
After every firmware update a script S01remove-old-files.sh located in gw/buildroot/board/martem/telem-common/fs_skeleton/usr/local/bin/post_update/ runs in the device and removes /usr/bin/gpsd and /etc/init.d/S50gpsd because we don't need them at the moment.
Relevant files in Telem-gw project:
- buildroot/board/martem/post-build/rm-temp-files.sh
gpsd binary and S50gpsd init script are removed from system install directory at the end of the build. gpsd is not used in devices, only it's libraries and headers in staging for compiling getgpsdate utility.
- buildroot/package/gpsd/gpsd.mk
cp $(@D)/gpsd.h $(STAGING_DIR)/usr/include line was added to INSTALL_STAGING define, because getgpsdate util includes <gpsd.h>
- buildroot/package/getgpsdate/Config.in
- buildroot/package/getgpsdate/getgpsdate.mk
MarkTomm 17. veebruar 2015, kell 15:02 (EET)