diff --git a/stage2/06-dride-base/00-run.sh b/stage2/06-dride-base/00-run.sh index b246da3..db40c46 100755 --- a/stage2/06-dride-base/00-run.sh +++ b/stage2/06-dride-base/00-run.sh @@ -13,6 +13,7 @@ install -m 644 files/systemctl/record.service ${ROOTFS_DIR}/lib/systemd/system/r install -m 644 files/systemctl/ws.service ${ROOTFS_DIR}/lib/systemd/system/ws.service install -m 644 files/systemctl/live.service ${ROOTFS_DIR}/lib/systemd/system/live.service install -m 644 files/systemctl/led.service ${ROOTFS_DIR}/lib/systemd/system/led.service +install -m 644 files/systemctl/rtc.service ${ROOTFS_DIR}/lib/systemd/system/rtc.service on_chroot << EOF @@ -122,6 +123,7 @@ sudo update-rc.d dride-core defaults sudo systemctl enable record sudo systemctl enable ble sudo systemctl enable led +sudo systemctl enable rtc if [ ${OS_TYPE} == "dride-plus" ]; then ## GPS https://www.raspberrypi.org/forums/viewtopic.php?p=947968#p947968 diff --git a/stage2/06-dride-base/files/etc_initd_dride-core b/stage2/06-dride-base/files/etc_initd_dride-core index 6c5980a..ec03346 100644 --- a/stage2/06-dride-base/files/etc_initd_dride-core +++ b/stage2/06-dride-base/files/etc_initd_dride-core @@ -19,10 +19,6 @@ case "$1" in # TODO: refactor this to be done internally # pull up resistor on pin 16 sudo python /home/core/daemons/bluetooth/initPin.py - - echo "Setting up HwClock" - sudo hwclock -s || echo "RTC is not set." - ;; stop) echo "Stopping dride-core" diff --git a/stage2/06-dride-base/files/systemctl/rtc.service b/stage2/06-dride-base/files/systemctl/rtc.service new file mode 100644 index 0000000..ea8aa7e --- /dev/null +++ b/stage2/06-dride-base/files/systemctl/rtc.service @@ -0,0 +1,13 @@ +[Unit] +Description=Control the web service service of your Dride +Documentation=https://dride.io/documentation +After=network.target + +[Service] +Type=simple +User=pi +ExecStart=hwclock -s + + +[Install] +WantedBy=multi-user.target \ No newline at end of file