wok rev 25644
Add fake-hwclock, manage time on system without RTC
author | Stanislas Leduc <shann@slitaz.org> |
---|---|
date | Tue Jan 16 19:48:23 2024 +0100 (13 months ago) |
parents | 6a171134e977 |
children | ab858238497c |
files | fake-hwclock/receipt fake-hwclock/stuff/fake-hwclock fake-hwclock/stuff/fake-hwclock.data |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/fake-hwclock/receipt Tue Jan 16 19:48:23 2024 +0100 1.3 @@ -0,0 +1,31 @@ 1.4 +# SliTaz package receipt. 1.5 + 1.6 +PACKAGE="fake-hwclock" 1.7 +VERSION="0.13" 1.8 +CATEGORY="network" 1.9 +TAGS="clock" 1.10 +SHORT_DESC="Save/restore system clock on machines without working RTC hardware." 1.11 +MAINTAINER="maintainer@slitaz.org" 1.12 +LICENSE="GPL" 1.13 +WEB_SITE="https://git.einval.com/cgi-bin/gitweb.cgi?p=fake-hwclock.git" 1.14 + 1.15 +TARBALL="$PACKAGE-$VERSION.tar.bz2" 1.16 +WGET_URL="git|https://git.einval.com/git/fake-hwclock.git" 1.17 +BRANCH="75363d85aac2423fbd15c61f3729e63fea4019df" 1.18 + 1.19 +BUILD_DEPENDS="git" 1.20 + 1.21 +# Rules to gen a SliTaz package suitable for Tazpkg. 1.22 +genpkg_rules() 1.23 +{ 1.24 + mkdir -p $fs/usr/sbin $fs/etc/init.d 1.25 + cp $src/fake-hwclock $fs/usr/sbin 1.26 + cp $stuff/fake-hwclock $fs/etc/init.d 1.27 + cp $stuff/fake-hwclock.data $fs/etc 1.28 +} 1.29 + 1.30 +post_install() 1.31 +{ 1.32 + # Ensure we have start point 1.33 + echo $(date '+%Y-%m-%d %H:%M:%S') > /etc/fake-hwclock.data 1.34 +}
2.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 2.2 +++ b/fake-hwclock/stuff/fake-hwclock Tue Jan 16 19:48:23 2024 +0100 2.3 @@ -0,0 +1,30 @@ 2.4 +#!/bin/sh 2.5 +# /etc/init.d/fake-hwclock: Manage time on system without RTC on SliTaz, 2.6 +# at boot time or with the command line. Daemons options are configured 2.7 +# with /etc/daemons.conf 2.8 +# 2.9 +. /etc/init.d/rc.functions 2.10 +. /etc/daemons.conf 2.11 + 2.12 +NAME=fake-hwclock 2.13 +DAEMON=/usr/sbin/fake-hwclock 2.14 + 2.15 +case "$1" in 2.16 + start) 2.17 + action 'Restore time from file: %s...' $NAME 2.18 + $DAEMON load 2.19 + status 2.20 + ;; 2.21 + stop) 2.22 + action 'Save time in file for next boot: %s...' $NAME 2.23 + $DAEMON save 2.24 + status 2.25 + ;; 2.26 + *) 2.27 + emsg "<n><b>$(_ 'Usage:')</b> $0 [start|stop]" 2.28 + newline 2.29 + exit 1 2.30 + ;; 2.31 +esac 2.32 + 2.33 +exit 0