Tiny Core Base > TCB Bugs
enhance parsing dhcp supplied ntp-servers option
miesi:
When I log into piCorePlayer (based on tcl) I'm greeted with
The system date (Thu Jan 1 01:16:30 CET 1970) appears to be incorrect.
The current ntp server is being set to 10.2.215.5 10.2.215.10, by kernel commandline or dhcp.
Execute the command: 'sudo ntpd -dd -n -q -p 10.2.215.5 10.2.215.10' to debug.
my dhcpd.conf reads
option ntp-servers 10.2.215.5, 10.2.215.10;
sudo ntpd -dd -n -q -p 10.2.215.5 -p 10.2.215.10
would work.
Where can I find the source code of the tcl scripts as git so that I can provide a merge request with an enhanced script?
miesi:
Changing /usr/bin/getTime.sh to someting like this should do the trick
--- Code: ---#!/bin/busybox ash
# bmarkus - 26/02/2014
# miesi - 03/05/2024
if [ -f /etc/sysconfig/ntpserver ]; then
set $(cat /etc/sysconfig/ntpserver)
while [ "$1" != "" ]; do
NTPOPTS="$NTPOPTS -p $1"
shift
done
else
NTPOPTS=""
fi
/usr/sbin/ntpd -q $NTPOPTS
--- End code ---
I have no practical experience with busybox ash so this might not work
Juanito:
--- Quote from: miesi on May 03, 2024, 05:03:09 AM ---Where can I find the source code of the tcl scripts as git so that I can provide a merge request with an enhanced script?
--- End quote ---
https://github.com/tinycorelinux
Greg Erskine:
hi miesi,
Use https://forums.slimdevices.com/ for piCorePlayer support.
This forum is for piCore only.
Rich:
Hi Greg Erskine
True, but the issue miesi reported and offered a fix for is
relevant to piCore and Tinycore too, not just piCorePlayer.
The ntp daemon can handle multiple time sources:
--- Code: ---tc@E310:~$ ntpd --help
BusyBox v1.29.3 (2018-12-19 15:29:37 UTC) multi-call binary.
----- Snip -----
-p PEER Obtain time from PEER (may be repeated)
----- Snip -----
--- End code ---
The fix is designed to handle multiple entries separated by spaces
and preceding each entry with a -p switch.
The parsing code appears fine and worked correctly when tested.
Navigation
[0] Message Index
[#] Next page
Go to full version