# HG changeset patch # User Stanislas Leduc # Date 1705430903 -3600 # Node ID 11d3cfab0628751f5472c7cdce9131d709b65432 # Parent 6a171134e9776023a461d46fd5308316732bb05b Add fake-hwclock, manage time on system without RTC diff -r 6a171134e977 -r 11d3cfab0628 fake-hwclock/receipt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/fake-hwclock/receipt Tue Jan 16 19:48:23 2024 +0100 @@ -0,0 +1,31 @@ +# SliTaz package receipt. + +PACKAGE="fake-hwclock" +VERSION="0.13" +CATEGORY="network" +TAGS="clock" +SHORT_DESC="Save/restore system clock on machines without working RTC hardware." +MAINTAINER="maintainer@slitaz.org" +LICENSE="GPL" +WEB_SITE="https://git.einval.com/cgi-bin/gitweb.cgi?p=fake-hwclock.git" + +TARBALL="$PACKAGE-$VERSION.tar.bz2" +WGET_URL="git|https://git.einval.com/git/fake-hwclock.git" +BRANCH="75363d85aac2423fbd15c61f3729e63fea4019df" + +BUILD_DEPENDS="git" + +# Rules to gen a SliTaz package suitable for Tazpkg. +genpkg_rules() +{ + mkdir -p $fs/usr/sbin $fs/etc/init.d + cp $src/fake-hwclock $fs/usr/sbin + cp $stuff/fake-hwclock $fs/etc/init.d + cp $stuff/fake-hwclock.data $fs/etc +} + +post_install() +{ + # Ensure we have start point + echo $(date '+%Y-%m-%d %H:%M:%S') > /etc/fake-hwclock.data +} diff -r 6a171134e977 -r 11d3cfab0628 fake-hwclock/stuff/fake-hwclock --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/fake-hwclock/stuff/fake-hwclock Tue Jan 16 19:48:23 2024 +0100 @@ -0,0 +1,30 @@ +#!/bin/sh +# /etc/init.d/fake-hwclock: Manage time on system without RTC on SliTaz, +# at boot time or with the command line. Daemons options are configured +# with /etc/daemons.conf +# +. /etc/init.d/rc.functions +. /etc/daemons.conf + +NAME=fake-hwclock +DAEMON=/usr/sbin/fake-hwclock + +case "$1" in + start) + action 'Restore time from file: %s...' $NAME + $DAEMON load + status + ;; + stop) + action 'Save time in file for next boot: %s...' $NAME + $DAEMON save + status + ;; + *) + emsg "$(_ 'Usage:') $0 [start|stop]" + newline + exit 1 + ;; +esac + +exit 0 diff -r 6a171134e977 -r 11d3cfab0628 fake-hwclock/stuff/fake-hwclock.data --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/fake-hwclock/stuff/fake-hwclock.data Tue Jan 16 19:48:23 2024 +0100 @@ -0,0 +1,1 @@ +2024-01-15 00:00:00