also logically this part is also wrong in /etc/init.d/tc-config:
# After restore items
if [ -n "$NODHCP" ]; then
echo "${GREEN}Skipping DHCP broadcast/network detection as requested on boot commandline.${NORMAL}"
else
[ -z "$DHCP_RAN" ] && /etc/init.d/dhcp.sh &
[ -z "$NORTC" ] || /etc/init.d/settime.sh &
fi
by this logic, settime.sh won't be ran if "nodhcp" is set in boot option.
settime.sh has dependency for network availability (as it tries to set time by NTP), but network availability shouldn't be depending on using DHCP or not. Even static IP + gateway/route setting (use /etc/init.d/rcS as described in
http://forum.tinycorelinux.net/index.php?topic=21290.0), network becomes working state, then enable to sync time with NTP.
so my proposal is
--- tc-config.orig
+++ tc-config
@@ -613,8 +613,8 @@
echo "${GREEN}Skipping DHCP broadcast/network detection as requested on boot commandline.${NORMAL}"
else
[ -z "$DHCP_RAN" ] && /etc/init.d/dhcp.sh &
- [ -z "$NORTC" ] || /etc/init.d/settime.sh &
fi
+[ -n "$NTPSERVER" ] && /etc/init.d/settime.sh &
[ -n "$CRON" ] && /etc/init.d/services/crond start
--- settime.sh.orig
+++ settime.sh
@@ -16,14 +16,6 @@
NRT=0
while sleep 0
do
- XXX=$(/bin/date -I)
- XXX=${XXX:0:4}
-
- if [ "$XXX" -ge "2015" ];
- then
- break
- fi
-
if [ $CNT -gt 10 ];
then
/usr/bin/getTime.sh
tc@tc-008064c770c2:/etc/init.d$
and the rule is:
* if want to skip (do not want) setting OS/kernel time from RTC/hardware clock, then set "nortc"
* if want to set OS/kernel time from NTPserver, then set "ntpserver=(IPaddr)" or "ntpserver=(FQDN)"
do we see any problem with this rule for RPi devices ?