Tiny Core Linux

Tiny Core Extensions => TCE Q&A Forum => Topic started by: ordep on July 13, 2012, 09:33:04 PM

Title: [SOLVED] Confusing Local Time
Post by: ordep on July 13, 2012, 09:33:04 PM
I have not yet been able to tweak TCL that it will give my local time as
such. TCL insists of naming it UTC. I have followed the instruction of FAQ, 
Wiki, and those posted in the forum. TCL keeps insisting my time is UTC even
if it shows the correct local time. I have wmCalClock set to show UTC time, 
yes it does except it is the local time.

The solution is that after booting I set the time with the date command     
for the localtime and immediately it is set correctly to PHT and and
wmCalClock gives the real UTC time.

I don't mind giving this date command after booting, however, it would be   
nice to have it done by TCL. The command is     

Quote
sudo date -s "H:M"

H for hour and M for minutes. How could that be executed. I tried a number 
of variations on consulting the man date, however, can't get it right.

My BIOS is set to local time which is Asia/Manila or 8 hours ahead  of UTC.

Anyone knows?
Title: Re: Confusing Local Time
Post by: Juanito on July 14, 2012, 01:26:11 AM
In linux you're meant to set your bios time to utc
Title: Re: Confusing Local Time
Post by: tinypoodle on July 14, 2012, 02:38:01 AM
See boot codes "tz=" and "noutc".
Title: Re: Confusing Local Time
Post by: ordep on July 14, 2012, 04:49:03 AM
In linux you're meant to set your bios time to utc

That is new to me. ;) In 15 years Linux my BIOS was always set to local time and no distro ever gave such  weird time indications.  :D
Title: Re: Confusing Local Time
Post by: ordep on July 14, 2012, 05:34:47 AM
See boot codes "tz=" and "noutc".

That's how I installed and now again booted from CD and the time
indicated by "date" was 00:15 when local time was in fact 16:15 and tzclock
showed GMT which was wrong as well. On booting tz=Asia/Manila showed as
being accepted. Are we on the same planet?  ;)  I must admit 16 + 8 = 00 on
a clock calculation.  Something somewhere is not right with the time in TCL.

If for TCL I would have to change my BIOS time I rather stay with setting   
the correct time with my "date" command after X started in TCL.
Title: Re: Confusing Local Time
Post by: curaga on July 14, 2012, 05:52:38 AM
If linux does not know what is what (and it can't unless the bios is in UTC time), then it usually can't do automatic DST transitions. That's the only thing you'll lose if you set the time manually.
Title: Re: Confusing Local Time
Post by: tinypoodle on July 14, 2012, 06:36:32 AM
In fact core was for me the first (and only, so far) linux system where I got automatic DST transitions working seamlessly, and that even with BIOS clock kept in localtime ;)             
Title: Re: Confusing Local Time
Post by: tinypoodle on July 14, 2012, 06:49:38 AM
See boot codes "tz=" and "noutc".

On booting tz=Asia/Manila showed as
being accepted. Are we on the same planet?  ;) 

Nope, we are not ;)

No tz-data with geographical aliases in base, so you have to specify all parameters of the real tz.
Search forum for a post which explains tz very analytically.
Title: Re: Confusing Local Time
Post by: Rich on July 14, 2012, 11:43:28 AM
Hi ordep
Reply #26 and #27 in this thread might be helpful:
http://forum.tinycorelinux.net/index.php/topic,5017.msg27012.html#msg27012
Title: Re: Confusing Local Time
Post by: tinypoodle on July 14, 2012, 12:04:43 PM
That is exactly the post which I had in mind - and it has been copied to the wiki in the meantime as article "Time Zone" - which OP implies to have followed instructions of...
Title: Re: Confusing Local Time
Post by: ordep on July 14, 2012, 11:57:44 PM
Thanks all!

Made a new install with correct tz=PHT-8 and noutc. True it now showed the correct local time, yet still calling it stupidly (sorry) UTC.  That means I cannot use wmCalClock to give me the real UTC. 'date' command gives UTC instead of PHT.
 
I give up. Worked on it all morning. I will stay with my "date" command after starting X. BTW then the 'date' command correctly gives PHT: Sun Jul 15 11:44:43 PHT 2012, that is the system knows it. That's after canceling above install.
Title: Re: Confusing Local Time
Post by: tinypoodle on July 15, 2012, 01:24:44 AM
To check your real (synced) system time, you can do something like this:
rdate -p nist1-ny.ustiming.org
Title: Re: Confusing Local Time
Post by: curaga on July 15, 2012, 06:07:23 AM
Interesting, since when I just tested "tz=PHT-8 noutc", date gave the bios time and said it was PHT.

Are you sure the boot options are correctly passed? Do they show in "showbootcodes"?
Title: Re: Confusing Local Time
Post by: ordep on July 16, 2012, 03:00:03 AM
Interesting, since when I just tested "tz=PHT-8 noutc", date gave the bios time and said it was PHT.

Are you sure the boot options are correctly passed? Do they show in "showbootcodes"?

That might be the problem. tz=PHT-8 is not found in extlinux.conf on my HD. However, I made a new install to USB flash drive from CD with TCL-4.5.6 that code is in extlinux.conf on the flash drive. I will attempt a new install on my HD. If I boot from the newly burned CD with cheatcode tz=PHT-8 it does now show the correct local time and command "date" gives correctly PHT.
Title: Re: Confusing Local Time
Post by: ordep on July 17, 2012, 04:09:00 AM
I think I can confirm now that when TCL is booted from a CD and then trying to intall on a hard drive
the given cheat codes such as noutc, tz= or vga= are ignored or not passed. I tried it 3 times
to make sure I had not made a typing error. Each time the same reult. Time shows as UTC and display
is too large and not vga=791 which I use in my PC.

However, installing to a USB flash drive the cheat codes are passed correctly.
Title: Re: Confusing Local Time
Post by: tinypoodle on July 17, 2012, 04:26:21 AM
You can use "vga=ask" to see if the kernel will prompt you at the very beginning of boot.
Title: Re: Confusing Local Time
Post by: Rich on July 17, 2012, 09:07:28 AM
Hi ordep
When you enter your boot codes at the boot prompt, you need to enter   tc tz=whatever vga=whatever
After you have booted, entering   showbootcodes   at the command line will show you if your boot
codes where seen.
Title: Re: Confusing Local Time
Post by: coreplayer2 on July 17, 2012, 11:14:30 AM
I'm confused, isn't Philippine Time  +8 hours  (not -8 hours) ??
Title: Re: Confusing Local Time
Post by: tinypoodle on July 17, 2012, 11:17:32 AM
"-" in tz means ahead of UTC.
Title: Re: Confusing Local Time
Post by: curaga on July 17, 2012, 12:25:21 PM
Just to be sure, you mean bootcodes entered in the installer window don't get passed? (and not those entered for the live cd session, at the cd's boot prompt)
Title: Re: Confusing Local Time
Post by: ordep on July 22, 2012, 01:09:58 AM
Just up from a bad bout of flue. :)

OK then:

-- Booting from the live CD with bootcodes "noutc tz=PHT-8 vga=791" brings up TCL
-- with these settings showing correct Manla time and resolution.

-- Installing TCL to a USB flash drive with bootcodes "noutc tz=PHT-8 vga=791"
-- installs TCL correctly with those codes and when booting from flash
-- drive time is set correctly to Manila time and resolution.

-- Installing TCL to a hard drive with bootcodes "noutc tz=PHT-8 vga=791"
-- installs TCL with time set to UTC and incorrect, unusable large
-- resolution.

-- Installing TCL from the flash drive to the hard drive with bootcodes
-- "noutc tz=PHT-8 vga=791" installs TCL with time showing as PHT, however,
-- 8 hours off and correct resolution. Time can easily be corrected with
-- command "date -s "HH:MM". showbootcodes shows none of the given codes.

I cannot show the bootcodes in HD installation since I am running now TCL
on the HD from the flash drive install which I would have to destroy again with a new
install from the CD since booting from the CD it will always mount the HD
TCL partion which I am not able to unmount. 

If I know how to boot from the CD w/o mounting the TCL HD partion I can make
an install on another partion. TCL will not install if on a given drive a partion
is mounted.
Title: Re: Confusing Local Time
Post by: tinypoodle on July 22, 2012, 04:41:24 AM
Compare your bootloader config files.
Boot code "base" to prevent automounting.
Title: Re: Confusing Local Time
Post by: curaga on July 22, 2012, 12:44:05 PM
I'll leave the bug in the installer for Brian.

Please edit your bootloader config file directly, no need to do repeat installs.
Title: Re: Confusing Local Time
Post by: ordep on July 23, 2012, 02:34:10 AM
Found the file I had saved the bootcodes of HD install:

Quote
$ showbootcodes
BOOT_IMAGE=TCL-sdb9 ro root=819 quiet vt.default_utf8=1

Given codes

noswap noutc tz-PHT-8 vga=791

are all missing unlike in flash drive install or on CD boot. they show with "showbootcodes" command.
Title: Re: Confusing Local Time
Post by: Juanito on July 23, 2012, 02:42:48 AM
..which would tend to indicate that your hd install is not reading the boot codes from where you expect...
Title: Re: Confusing Local Time
Post by: tinypoodle on July 23, 2012, 03:55:56 AM
Found the file I had saved the bootcodes of HD install:

Quote
$ showbootcodes
BOOT_IMAGE=TCL-sdb9 ro root=819 quiet vt.default_utf8=1
It appears to me you have some rather uncommon boot codes there, are you sure about those?
Why would you want to use "ro" with tc??
Title: Re: Confusing Local Time
Post by: ordep on July 23, 2012, 04:15:22 AM
I made a new install from the CD booted with "base" to a new partition on the drive. The only codes given were those already mentioned and the outcome is the same. The codes are not acted on. I did not put "ro"
or anything else that shows in showbootcodes.

Title: Re: Confusing Local Time
Post by: curaga on July 23, 2012, 04:28:18 AM
Those bootcodes definitely don't come from our installer. Do you have an old install somewhere, made by a third party util?
Title: Re: Confusing Local Time
Post by: ordep on July 23, 2012, 04:59:18 AM
Those bootcodes definitely don't come from our installer. Do you have an old install somewhere, made by a third party util?

Nothing of that sort. I made at least 6 installs of TCL always on a newly formatted partition and now once more on another partion.

On that drive I have my working box Salix and VL7 for testing. It is a brand new SATA drive.
On a second IDE HD I have the latest KNOPPIX installed.
Title: Re: Confusing Local Time
Post by: tinypoodle on July 23, 2012, 05:24:32 AM
While you get the output of 'showbootcodes' as posted above, what is the output of 'uname -a'?
Title: Re: Confusing Local Time
Post by: ordep on July 23, 2012, 05:54:34 AM
While you get the output of 'showbootcodes' as posted above, what is the output of 'uname -a'?


Linux box 3.0.21-tinycore #3021 SMP Sat Feb 18 11:54:11 EET 2012 i686 GNU/Linux
Title: Re: Confusing Local Time
Post by: tinypoodle on July 23, 2012, 06:29:08 AM
Any idea where that "BOOT_IMAGE=TCL-sdb9" could come from?
Have you manually ever given such a name anywhere?
Title: Re: Confusing Local Time
Post by: ordep on July 23, 2012, 07:10:36 AM
Any idea where that "BOOT_IMAGE=TCL-sdb9" could come from?
Have you manually ever given such a name anywhere?

In my working box Salix in lilo.conf the section for TCl reads:
Quote
image = /mnt/TCL/tce/boot/vmlinuz
initrd = /mnt/TCL/tce/boot/core.gz
root = /dev/sdb9
label = TCL-sdb9
read-only

Aha, and there is the

Quote
append="quiet vt.default_utf8=1"

at the beginning of lilo.conf.

So it seems those bootcodes come from the lilo.conf. 
Title: Re: Confusing Local Time
Post by: tinypoodle on July 23, 2012, 10:57:19 AM
There you go!

What started as "Confusing Local Time" eventually turns out to be "Confusion about a misconfigured bootloader".

Better fix your boot configuration...
I seem to vaguely remember that one may have to update or rerun lilo after installing a new kernel or changing config. Consult documentation.
Title: Re: Confusing Local Time
Post by: ordep on July 23, 2012, 07:26:04 PM
There you go!

What started as "Confusing Local Time" eventually turns out to be "Confusion about a misconfigured bootloader".

Better fix your boot configuration...
I seem to vaguely remember that one may have to update or rerun lilo after installing a new kernel or changing config. Consult documentation.

Yes that is SOP in my Linux book!  ;)
It is then still confusing why TCL uses those codes and not the once give. Godfather DSL or KNOPPIX will not do it with the same lilo.conf settings.
Title: Re: Confusing Local Time
Post by: ordep on July 23, 2012, 11:15:01 PM
Now how about these codes:

Quote
~$ showbootcodes
BOOT_IMAGE=TCL-sdb9 ro root=819 noswap noutc tz=PHT-8

or now

Quote
~$ date
Tue Jul 24 11:07:11 PHT 2012

Added in lilo.conf in TCL section
Quote
append = "noswap noutc tz=PHT-8"

Hopefully this ends all confusions. :D :D :D
Title: Re: Confusing Local Time
Post by: tinypoodle on July 24, 2012, 02:34:00 AM
Also delete "root =" & "read-only"
Any system based on initramfs must not have such options.

Title: Re: [SOLVED] Confusing Local Time
Post by: ordep on July 24, 2012, 11:25:41 PM
Can we then say that if TCL is installed on a hard drive and boot loader is lilo the boot codes have to be placed into the /etc/lilo.conf file as append = .

In my lilo.conf the section for TCL reads now:
Quote
image = /mnt/TCL/tce/boot/vmlinuz
initrd = /mnt/TCL/tce/boot/core.gz
root = /dev/sdb9
append = "quiet noswap noutc tz=PHT-8"
label = TCL-sdb9

The vga=mode, in my case vga=791, is placed before the Linux bootable partition config begins at the end of the global section.
Title: Re: [SOLVED] Confusing Local Time
Post by: tinypoodle on July 25, 2012, 01:55:25 AM
What is the output of "showbootcodes" now?
Title: Re: [SOLVED] Confusing Local Time
Post by: ordep on July 25, 2012, 03:44:10 AM
What is the output of "showbootcodes" now?

Quote
BOOT_IMAGE=TCL-sdb9 quiet noswap noutc tz=PHT-8
Title: Re: [SOLVED] Confusing Local Time
Post by: tinypoodle on July 25, 2012, 08:16:19 AM
Looks much better now.  :)

Still not sure if that "root = /dev/sdb9" should be in there though...
Title: Re: [SOLVED] Confusing Local Time
Post by: ordep on July 26, 2012, 09:21:00 PM
root = /dev/sdb9 there or not does not seem to make any difference.

Just to double check for the whole concept of bootcodes in lilo.conf I booted from CD with "base". Installed to HD w/o any bootcodes.  Used the bootcodes in lilo.conf as outlined as "append = *". Run lilo, booted into the new TCL partition and all was set correctly such as set to local time.