Skip to content

Commit 1e7802f

Browse files
authored
Add service to persist /etc/fake-hwclock.data past /etc-overlay unmount (#542)
* Add service to persist `/etc/fake-hwclock.data` past etc overlay unmount * Update `CHANGELOG.md` * Properly enable the new systemd service * Try to fix incorrect implementation of the systemd service * Try to adjust the system service's dependencies
1 parent 42c26ba commit 1e7802f

File tree

4 files changed

+21
-1
lines changed

4 files changed

+21
-1
lines changed

software/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ All dates in this file are given in the [UTC time zone](https://en.wikipedia.org
3737
- (System: networking) `planktoscope.local` and `pkscope.local` should now work on local area networks (i.e. when the PlanktoScope is connected to a router) and not just on direct connections.
3838
- (Application: GUI) The Node-RED dashboard's sample page's "Dilution Factor" input field has been renamed to "Concentration Factor", which is a less misleading name for what that input field actually represents.
3939
- (Application) The `/home/pi/data` and `/home/pi/device-backend-logs` are now created with non-`root` user ownership, so that their contents can be managed via an SFTP/SCP connection as the `pi` user. This fixes a regression introduced with v2023.9.0-beta.0.
40+
- (System) The system time is now correctly persisted on the filesystem (in `/etc/fake-hwclock.data`) in a way that the system time should no longer reset back to a previous time in the past between reboots.
4041
- (System) Machine name generation now falls back to the `en_US.UTF-8`-based naming scheme when the OS is set to a non-default locale (i.e. anything other than `en_US.UTF-8`), instead of failing and falling back to `unknown`.
4142

4243
## v2024.0.0 - 2024-12-25

software/distro/setup/base-os/forklift/install.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,4 +101,5 @@ sudo systemctl preset \
101101
bindro-run-forklift-stages-current.service \
102102
overlay-usr.service \
103103
overlay-etc.service \
104-
start-overlaid-units.service
104+
start-overlaid-units.service \
105+
fake-hwclock-overlay-support.service

software/distro/setup/base-os/forklift/usr/lib/systemd/system-preset/20-forklift.preset

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ enable overlay-sysroot.service
44
enable bindro-run-forklift-stages-current.service
55
enable overlay-usr.service
66
enable overlay-etc.service
7+
enable fake-hwclock-overlay-support.service
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
[Unit]
2+
Description=Copy the fake-hwclock file from the overlay override during shutdown
3+
DefaultDependencies=no
4+
# This ensures that the shutdown part of this service will run after the `/etc` overlay is unmounted:
5+
Before=overlay-etc.service
6+
Conflicts=shutdown.target
7+
Before=shutdown.target
8+
ConditionPathExists=/var/lib/overlays/overrides/etc/fake-hwclock.data
9+
10+
[Service]
11+
Type=oneshot
12+
RemainAfterExit=true
13+
ExecStart=sleep 1
14+
ExecStopPost=cp /var/lib/overlays/overrides/etc/fake-hwclock.data /etc/fake-hwclock.data
15+
16+
[Install]
17+
WantedBy=overlay-etc.service

0 commit comments

Comments
 (0)