The "set time" function within the date/time desktop setting does not work in Puppy 1.07. The "set time" function simply returns the current time without being reset.
Hail Puppy!
Raman
Time setting does not work in 1.07
The program is a very small shellscript, that uses "hwclock".
/usr/sbin/set-time-for-puppy
It seems there is a new version of hwclock in puppy.
It does not recognize --set , what can be replaced with -s
But I don't know how you could replace --date= ,that also is not supported in this version.
Anybody knows a solution?
Mark
/usr/sbin/set-time-for-puppy
It seems there is a new version of hwclock in puppy.
It does not recognize --set , what can be replaced with -s
But I don't know how you could replace --date= ,that also is not supported in this version.
Anybody knows a solution?
Mark
my set-time-from-the-internet program sets the system clock (using rdate) then sets the hardware clock from the system time
hwclock --systohc --localtime (assuming you are using localtime, not UTC)
hwclock --systohc --localtime (assuming you are using localtime, not UTC)
Last edited by GuestToo on Sun 01 Jan 2006, 04:39, edited 1 time in total.
/usr/sbin/set-time-for-puppy
Version for Puppy 107 (should work on older puppys, too)
Version for Puppy 107 (should work on older puppys, too)
Code: Select all
#!/bin/sh
# A small script used to set the time under Linux with hwclock...
# Title to be used for all Xdialog boxes.
TITLE="Set time tool"
# Now check for hwclock existence...
if ! [ -f /usr/sbin/hwclock ] ; then
Xdialog --title "$TITLE" --msgbox "/usr/sbin/hwclock not found..." 0 0
exit 0
fi
# Get the date (returned in DD/MM/YYYY format by Xdialog.
ENTEREDDATE=`Xdialog --stdout --title "$TITLE" --calendar "Please set the date..." 0 0 0 0 0`
if [ ! $? -eq 0 ]; then
exit
fi
# Convert the date to the MM/DD/YYYY format needed by hwclock.
NEWDATE=`echo "$ENTEREDDATE" | awk --source 'BEGIN { FS="/" }' --source '{ print $2 "/" $1 "/" $3 }'`
# Get the time in HH:MM:SS format.
NEWTIME=`Xdialog --stdout --title "$TITLE" --timebox "Please set the time..." 0 0`
if [ ! $? -eq 0 ]; then
Xdialog --title "$TITLE" --msgbox "Aborted." 0 0
exit
fi
# Set the hardware clock (RTC) and then the system clock
D=`echo $NEWDATE|sed "s/^...//" | sed "s/\/.*$//"`
M=`echo $NEWDATE|sed "s/\/.*$//"`
Y=`echo $NEWDATE|sed "s/^........//" | sed "s/ .*$//"`
H=`echo $NEWTIME|sed "s/^.* //" | sed "s/://g" | sed "s/..$//"`
DT=`echo $M$D$H$Y`
date $DT
Xdialog --title "info" --msgbox "Your screen might turn black now for some seconds, just wait..." 0 0
/usr/sbin/hwclock --systohc --localtime
THEDATE=`date`
Xdialog --title "info" --msgbox "Finished. Time was set to $THEDATE" 0 0
Making hwclock --utc or --localtime configurable
One further issue with time configuration in 1.0.7 is that there does not seem to be a way to set whether or not the hardware clock is using UTC or local time. The code just assumes it uses local time.
That is how Windows boxes work, but not how Linux machines are generally set up.
For now I just edited line 48 of /etc/rc.d/local0 -- but I think it would be more general if the config utility allowed the user to set a checkbox for "RTC uses UTC" or something like that, and the script(s) made use of that to use either --localtime or --utc when calling hwclock.
Is this worth pursuing?
Jonathan
That is how Windows boxes work, but not how Linux machines are generally set up.
For now I just edited line 48 of /etc/rc.d/local0 -- but I think it would be more general if the config utility allowed the user to set a checkbox for "RTC uses UTC" or something like that, and the script(s) made use of that to use either --localtime or --utc when calling hwclock.
Is this worth pursuing?
Jonathan