summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore2
-rw-r--r--configure.ac3
-rw-r--r--services/Makemodule.am3
-rw-r--r--services/swclock.in6
-rw-r--r--services/swclocksave.in7
5 files changed, 20 insertions, 1 deletions
diff --git a/.gitignore b/.gitignore
index f1b0640..e28328d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -33,6 +33,8 @@ services/ifcfg
services/ifdown
services/modules
services/hostapd
+services/swclock
+services/swclocksave
scripts/devfs.sh
scripts/ifrename.sh
diff --git a/configure.ac b/configure.ac
index f6fd637..564689a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -56,6 +56,7 @@ AC_DEFINE_DIR(SOCKDIR, localstatedir/run, [Directory for initd socket])
AC_DEFINE_DIR(BINPATH, bindir, [Fully evaluated bin directory])
AC_DEFINE_DIR(SBINPATH, sbindir, [Fully evaluated sbin directory])
AC_DEFINE_DIR(ETCPATH, sysconfdir, [Fulle evaluated etc directory])
+AC_DEFINE_DIR(STATEFILESPATH, prefix/var/lib, [Path for persistent state files])
AC_CONFIG_FILES([services/sigkill])
AC_CONFIG_FILES([services/sigterm])
@@ -67,6 +68,8 @@ AC_CONFIG_FILES([services/ifcfg])
AC_CONFIG_FILES([services/ifdown])
AC_CONFIG_FILES([services/modules])
AC_CONFIG_FILES([services/hostapd])
+AC_CONFIG_FILES([services/swclock])
+AC_CONFIG_FILES([services/swclocksave])
AC_CONFIG_FILES([scripts/devfs.sh])
AC_CONFIG_FILES([scripts/ifrename.sh])
AC_CONFIG_FILES([scripts/ifcfg.sh])
diff --git a/services/Makemodule.am b/services/Makemodule.am
index 8f22675..3625715 100644
--- a/services/Makemodule.am
+++ b/services/Makemodule.am
@@ -7,7 +7,8 @@ init_DATA += services/sysfs services/procfs services/tmpfs
init_DATA += services/vfs services/ifrename services/ifcfg
init_DATA += services/dhcpcd services/dhcpcdmaster services/unbound
init_DATA += services/dnsmasq services/ifdown services/modules
-init_DATA += services/network services/hostapd
+init_DATA += services/network services/hostapd services/swclock
+init_DATA += services/swclocksave
if USYSLOGD
init_DATA += services/usyslogd
diff --git a/services/swclock.in b/services/swclock.in
new file mode 100644
index 0000000..02c4c27
--- /dev/null
+++ b/services/swclock.in
@@ -0,0 +1,6 @@
+description restore saved time from last shutdown
+type wait
+target boot
+before sysinit
+after vfs modules
+exec xargs -a @STATEFILESPATH@/swclock date --utc
diff --git a/services/swclocksave.in b/services/swclocksave.in
new file mode 100644
index 0000000..683ded7
--- /dev/null
+++ b/services/swclocksave.in
@@ -0,0 +1,7 @@
+description write current time to backup file
+type wait
+target %0
+after sigkill
+before sync
+tty truncate @STATEFILESPATH@/swclock
+exec date --utc +%%m%%d%%H%%M%%Y.%%S