Blog hébergé par Yves et Iris :-)

Aller au contenu | Aller au menu | Aller à la recherche

Time zone in TinyCore Linux

I want to use the French time zone on any computer I log onto using TinyCore Linux. Of course, this is not set up by default. The information is sparse and sometimes contradicting on this topic, but I seem to have achieved a working configuration. Here it is.

First, I installed the “tzdata” TCE extension, and ensured that it is loaded at boot. With my custom configuration of TinyCore, I did this by adding a “tzdata.tcz” line in the mod_lang.lst file, but the standard is to add this line to onboot.lst; whichever file you choose, it is in /etc/sysconfig/tcedir.

Next, I changed my Grub2 configuration to set the right time zone: “Europe/Paris”. Besides, I considered that my USB flash drive with TinyCore on it would get booted mostly on Windows computers, that is computers with a clock set to local time. But I added a boot option to switch to a configuration where the computer’s clock is set to UTC, for those cases when I boot TinyCore Linux on a pure-Linux computer. Considering the way I have Grub2 set up, here are the changes:

  • I appended my chosen time zone to my common options:
    set tcopt_common="lang=fr_FR.utf8 kmap=azerty/fr-latin1 showapps tz=Europe/Paris"
  • I added a variable for the choice between local time and UTC:
    set tcopt_clock="noutc"
  • I inserted this variable to the “linux” line of the main TinyCore “menuentry”:
    linux /.boot/corelnx/vmlinuz$tc_bits $tcopt_base $tcopt_common $tcopt_clock […]
  • I created a new Grub2 “menuentry” for changing the clock-mode variable:
    menuentry "- UTC internal clock (Linux)" {
    set tcopt_clock=""

The deed is done… mostly. I found that TinyCore Linux’ system clock is not synchronized with the hardware clock according to the time zone, by default. To do this, I had to add that line to the /opt/ file, preferably on top (not the first line, though):

if grep -q noutc /proc/cmdline; then
hwclock -s -l
hwclock -s -u

Ensure the /opt/ file is saved across reboots. As an alternative, you might want to configure NTP.

Ajouter un commentaire

Le code HTML est affiché comme du texte et les adresses web sont automatiquement transformées.

La discussion continue ailleurs

URL de rétrolien :

Fil des commentaires de ce billet