summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorSimon Rettberg2018-05-04 12:49:48 +0200
committerSimon Rettberg2018-05-04 12:49:48 +0200
commit26f23054e0bb68591eb4dbe373cd9806fbaeb83b (patch)
treea7ea8532f4ce772bc96446129d0ed9c35a287021 /core
parentsetup_target: get_link_chain for REQUIRED_SYSTEM_FILES (diff)
downloadmltk-26f23054e0bb68591eb4dbe373cd9806fbaeb83b.tar.gz
mltk-26f23054e0bb68591eb4dbe373cd9806fbaeb83b.tar.xz
mltk-26f23054e0bb68591eb4dbe373cd9806fbaeb83b.zip
[rfs-stage31] If BIOS clock is local and NTP failed, read clock again
Linux assumes RTC is UTC when booting up. In case the SLX config says to use localtime, read the hwclock again to get the right offset.
Diffstat (limited to 'core')
-rwxr-xr-xcore/rootfs/rootfs-stage31/data/inc/ntp_sync4
1 files changed, 4 insertions, 0 deletions
diff --git a/core/rootfs/rootfs-stage31/data/inc/ntp_sync b/core/rootfs/rootfs-stage31/data/inc/ntp_sync
index 410b56d2..ff2f0027 100755
--- a/core/rootfs/rootfs-stage31/data/inc/ntp_sync
+++ b/core/rootfs/rootfs-stage31/data/inc/ntp_sync
@@ -42,6 +42,10 @@ func_sync_net_time() {
date -s "@$TTS"
else
echo "No fallback option for timesync available, relying on correct RTC setup"
+ if [ "x$SLX_BIOS_CLOCK" = "xlocal" ]; then
+ # Linux defaults to RTC = UTC, so read again in this case
+ hwclock -l -s
+ fi
fi
fi
}