[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#702093: debian-installer: please allow the user to set the system time manually



Package: debian-installer
Version: 20130211
Severity: wishlist

There does not seem to be any way to set the system time manually in the
(expert, text-mode) installer. The "Configure the clock" selection
allows setting it from NTP (but my firewall blocks it), but I can't find
any way to set the time by hand.

Even from the shell prompt, the only way I could find was an ugly
workaround. The closest binaries I found were:

 - /sbin/hwclock from busybox, but it does not have a way to specify the
   time manually (only to read and write hardware RTCs)

 - /usr/bin/rdate can read the time from the network but not from the
   user

Just for reference in case someone else encounters this problem before
it is fixed and needs the ugly workaround: I used nc to emulate an rdate
server as follows:

1. On another already-installed Debian system, run:
   # printf '%x\n' $(expr $(date +%s) + 2208988800)
   (the magic number is from RFC 868, seconds from 1900 to 1970)

2. This gave me "d4dc4f85". Convert this to be suitable for echo, start
   a shell on one virtual console in the Debian installer, and run:
   # echo -e '\xd4\xdc\x4f\x85' | nc -l -p 37

3. To set the system time, start another shell on a second virtual
   console in the installer and run:
   # rdate -v -o 37 127.0.0.1
   (I had to use -o 37 because of bug #702061.)

4. Verify by running:
   # logger test
   and checking that the time on the last line in the syslog displayed
   in virtual console 4 has the correct time (it's in UTC).

In the past, before I found this workaround, I had installed a couple of
embedded systems ending up having file dates in the 1980s, because
that's what the hardware RTC happened to be set to by default, and the
BIOS/bootloader did not have a way of changing it...

I have two suggestions for fixing this bug:

 - Please include the "date" command in busybox in the initrd to allow
   setting the system time from the command line.

 - If the user answers "No" to the NTP question in the installer menus,
   please consider adding a dialog that shows the current time and asks
   the user for a new time if it is wrong. (Possibly also ask about
   writing the new time to the RTC using hwclock.)


Reply to: