Add dhcpcd hook for swclock

Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
This commit is contained in:
David Oberhollenzer 2018-11-23 22:15:08 +01:00
parent 6ed7e164c8
commit f86d76513a
4 changed files with 18 additions and 0 deletions

1
.gitignore vendored
View File

@ -30,4 +30,5 @@ services/sysfs
services/mountusr services/mountusr
services/tmpfsvar services/tmpfsvar
crontab/swclock crontab/swclock
etc/40-ntpsetdate
.#* .#*

View File

@ -8,6 +8,14 @@ helperdir = @SCRIPTDIR@
helper_PROGRAMS = helper_PROGRAMS =
helper_SCRIPTS = helper_SCRIPTS =
dhcpcddir = @DHCPCDHOOKDIR@
if SWCLOCK
if DHCPCLIENT
dhcpcd_DATA = etc/40-ntpsetdate
endif
endif
include scripts/Makemodule.am include scripts/Makemodule.am
include services/Makemodule.am include services/Makemodule.am
include crontab/Makemodule.am include crontab/Makemodule.am

View File

@ -12,6 +12,7 @@ AC_DEFINE_DIR(SVCDIR, sysconfdir/init.d, [Startup service directory])
AC_DEFINE_DIR(GCRONDIR, sysconfdir/crontab.d, [Cron service directory]) AC_DEFINE_DIR(GCRONDIR, sysconfdir/crontab.d, [Cron service directory])
AC_DEFINE_DIR(TEMPLATEDIR, datadir/init, [Service template directory]) AC_DEFINE_DIR(TEMPLATEDIR, datadir/init, [Service template directory])
AC_DEFINE_DIR(SCRIPTDIR, libexecdir/init, [Helper script directory]) AC_DEFINE_DIR(SCRIPTDIR, libexecdir/init, [Helper script directory])
AC_DEFINE_DIR(DHCPCDHOOKDIR, libexecdir/dhcpcd-hooks, [DHCPCD hook directory])
AC_DEFINE_DIR(SBINPATH, sbindir, [Fully evaluated sbin directory]) AC_DEFINE_DIR(SBINPATH, sbindir, [Fully evaluated sbin directory])
AC_DEFINE_DIR(ETCPATH, sysconfdir, [Fulle evaluated etc directory]) AC_DEFINE_DIR(ETCPATH, sysconfdir, [Fulle evaluated etc directory])
@ -40,6 +41,7 @@ AC_CONFIG_FILES([scripts/ifcfg.sh])
AC_CONFIG_FILES([scripts/modules_load.sh]) AC_CONFIG_FILES([scripts/modules_load.sh])
AC_CONFIG_FILES([crontab/swclock]) AC_CONFIG_FILES([crontab/swclock])
AC_CONFIG_FILES([etc/40-ntpsetdate])
AC_ARG_ENABLE([swclock], AC_ARG_ENABLE([swclock],
[AS_HELP_STRING([--enable-swclock], [Enable software pseudo RTC])], [AS_HELP_STRING([--enable-swclock], [Enable software pseudo RTC])],

7
etc/40-ntpsetdate.in Normal file
View File

@ -0,0 +1,7 @@
case "$reason" in
BOUND*)
@SCRIPTDIR@/setntpdate.sh
;;
*)
;;
esac