From: T o n g on
On Tue, 13 Jul 2010 22:32:09 -0600, Dave Thayer wrote:

>> The camera is the same. Something get changed on Debian side? How can I
>> fix it? (photos are from mounted SD card via SD card reader).
>
> You could be getting bit by Bug #577597 - "system with UTC=yes in
> /etc/default/rcS mounts FAT USB disk with wrong file time".

Bingo!

$ grep UTC /etc/default/rcS
UTC=yes

Thanks a lot!

Let me try to understand the bug and its work-around,

Having UTC=yes in the /etc/default/rcS file means the Linux system is
using UTC time? Then how about?

$ date
Wed Jul 14 11:49:39 EDT 2010

> The bug
> report contains the following work-around, as root run these commands:
>
> hwclock --systohc --utc
> hwclock --hctosys --utc

This fix change my BIOS CMOS clock using UTC, correct? Then when I boot
into BIOS, will the time be correct localtime? How about when I boot into
Windows, will it get confused?

> My rockboxed ipod shows files with timestamps off by the time difference
> between localtime and UTC, as if the tz=UTC option was selected in
> mount, and when I apply the work-around in the bug report things are
> straightened out.

Wait a minute, from man page:

The tz=UTC option "disables the conversion of timestamps between local
time (as used by Windows on FAT) and UTC (which Linux uses internally).
This is particuluarly useful when mounting devices (like digital cameras)
that are set to UTC in order to avoid the pitfalls of local time."

This seems to be the fix for me, but you are saying that it get entirely
different effect at your side?

Thanks

--
Tong (remove underscore(s) to reply)
http://xpt.sourceforge.net/techdocs/
http://xpt.sourceforge.net/tools/


--
To UNSUBSCRIBE, email to debian-user-REQUEST(a)lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster(a)lists.debian.org
Archive: http://lists.debian.org/i1kmu2$o0s$5(a)dough.gmane.org
From: H.S. on
On 14/07/10 12:00 PM, T o n g wrote:
>
> Having UTC=yes in the /etc/default/rcS file means the Linux system is
> using UTC time? Then how about?

I don't think so.
"To change the computer to use UTC after installation, edit the file
/etc/default/rcS, change the variable UTC to no. If you happened to
install your system to use local time, just change the variable to yes
to start using UTC." ---
http://www.debian.org/doc/manuals/system-administrator/ch-sysadmin-time.html


>> hwclock --systohc --utc
>> hwclock --hctosys --utc
>
> This fix change my BIOS CMOS clock using UTC, correct? Then when I boot
> into BIOS, will the time be correct localtime? How about when I boot into
> Windows, will it get confused?


In the past I have kept my Linux distro installation to not use UTC by
specifying them not to change the hardware clock and to see it as local
time since my Windows installation use local time (demands that BIOS
clock be local time).

Now, however, I am trying the other way around. The windows partition
has Windows 7. I have changes its registry entry to make it use UTC time
(https://help.ubuntu.com/community/UbuntuTime#Make Windows use UTC).
However, I have had to make it get time over the network (from a time
server) to show the correct time. I have also had to make Fedora 13 and
Debian Testing check a time server to show the correct time. All OSes
now show the same correct time (unless something has changed between
reboots :-? ).

In Debian, I have:
~$ grep -i utc /etc/default/rcS
UTC=no
~$ date
Wed Jul 14 12:39:10 EDT 2010



--

Please reply to this list only. I read this list on its corresponding
newsgroup on gmane.org. Replies sent to my email address are just
filtered to a folder in my mailbox and get periodically deleted without
ever having been read.


--
To UNSUBSCRIBE, email to debian-user-REQUEST(a)lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster(a)lists.debian.org
Archive: http://lists.debian.org/i1kphf$hm0$1(a)dough.gmane.org
From: Dave Thayer on
On Wed, Jul 14, 2010 at 04:00:03PM +0000, T o n g wrote:
> On Tue, 13 Jul 2010 22:32:09 -0600, Dave Thayer wrote:
>
> >> The camera is the same. Something get changed on Debian side? How can I
> >> fix it? (photos are from mounted SD card via SD card reader).
> >
> > You could be getting bit by Bug #577597 - "system with UTC=yes in
> > /etc/default/rcS mounts FAT USB disk with wrong file time".
>[...\]
> Having UTC=yes in the /etc/default/rcS file means the Linux system is
> using UTC time? Then how about?
>
> $ date
> Wed Jul 14 11:49:39 EDT 2010

UTC=yes tells the system that the hardware clock is set in UTC, which
is a good idea on a linux-only system but can be a headache if you
dual-boot Windows. What is displayed when you use the date command
depends on how you answer the questions when you run tzselect. Under
the hood, the linux clock always works in UTC.

> > The bug
> > report contains the following work-around, as root run these commands:
> >
> > hwclock --systohc --utc
> > hwclock --hctosys --utc
>
> This fix change my BIOS CMOS clock using UTC, correct? Then when I boot
> into BIOS, will the time be correct localtime? How about when I boot into
> Windows, will it get confused?

>From reading the ubuntu bug linked to from Debian's bug #577597, what
appears to be happening is that an internal kernal flag which contains
timezone information is not getting properly set at startup. This
little routine must set the kernel flag.

> > My rockboxed ipod shows files with timestamps off by the time difference
> > between localtime and UTC, as if the tz=UTC option was selected in
> > mount, and when I apply the work-around in the bug report things are
> > straightened out.
>
> Wait a minute, from man page:
>
> The tz=UTC option "disables the conversion of timestamps between local
> time (as used by Windows on FAT) and UTC (which Linux uses internally).
> This is particuluarly useful when mounting devices (like digital cameras)
> that are set to UTC in order to avoid the pitfalls of local time."

I suspect that mount uses the kernel flag to obtain the timezone info
rather than the libc based information that the date and tzselect work
with. This makes sense since mount works at such a low level. If the
kernel timezone flag is not getting set then mount would be assuming
that you are in UTC, just as if the tz=UTC mount option had been used,
and incorrectly reports ctime and mtime.

Note that this is pure speculation on my part, perhaps there is a
lurking kernel hacker who can chime in and correct me.

dt


--
To UNSUBSCRIBE, email to debian-user-REQUEST(a)lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster(a)lists.debian.org
Archive: http://lists.debian.org/20100714200314.GA24217(a)thayer-boyle.com
From: T o n g on
Thanks a lot for your replies, H.S. and Dave.

On Wed, 14 Jul 2010 12:44:30 -0400, H.S. wrote:

> "To change the computer to use UTC after installation, edit the file
> /etc/default/rcS, change the variable UTC to no. . .

"Setting UTC to no to use UTC"? This is so confusing that I have to look
for its definition (man 5 rcS) to find out why. But having done that, I'm
more confused, by my Linux box this time:

>From the man page:

,-----
| The UTC is used to govern how the hardware real time clock is
| interpreted when it is read (e.g., at boot time, for the purpose
| of setting the system clock) and when it is written (e.g., at
| shutdown). If this option is set to no then the system clock is
| assumed to be set to local time.
`-----

Mine is UTC=yes:

$ grep UTC /etc/default/rcS
UTC=yes

So it should imply that my hardware real time clock is set to UTC.
However,

$ date; hwclock --show
Wed Jul 14 20:33:58 EDT 2010
Wed 14 Jul 2010 08:33:58 PM EDT -0.953730 seconds

Seems to me my hardware clock is set to local time here instead.

Any comment?

Thanks

--
Tong (remove underscore(s) to reply)
http://xpt.sourceforge.net/techdocs/
http://xpt.sourceforge.net/tools/


--
To UNSUBSCRIBE, email to debian-user-REQUEST(a)lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster(a)lists.debian.org
Archive: http://lists.debian.org/i1llm1$o0s$6(a)dough.gmane.org
From: John Hasler on
Tong writes:
> So it should imply that my hardware real time clock is set to UTC.
> However,

> $ date; hwclock --show
> Wed Jul 14 20:33:58 EDT 2010
> Wed 14 Jul 2010 08:33:58 PM EDT -0.953730 seconds

> Seems to me my hardware clock is set to local time here instead.

> Any comment?

man hwclock
--
John Hasler


--
To UNSUBSCRIBE, email to debian-user-REQUEST(a)lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster(a)lists.debian.org
Archive: http://lists.debian.org/87r5j5zhfb.fsf(a)thumper.dhh.gt.org