FS#10075 - [ISO] Add tzselect in installation process

Attached to Project: Arch Linux
Opened by Gerhard Brauer (GerBra) - Friday, 04 April 2008, 09:11 GMT
Last edited by Simo Leone (neotuli) - Wednesday, 22 October 2008, 02:16 GMT
Task Type Feature Request
Category Installation
Status Closed
Assigned To Tobias Powalowski (tpowa)
Simo Leone (neotuli)
Aaron Griffin (phrakture)
Roman Kyrylych (Romashka)
Architecture All
Severity Medium
Priority Normal
Reported Version 2007.08-2
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 4
Private No

Details

Description:
Installation starts with the clock set from BIOS clock. During install process the timezone is changed (ex. from UTC to CEST) but the clock/time remains the same.
This leads often to a filesystem error (ex. ext3), which claims a superblock time stamp in the future and do a fsck directly after the first boot if the hardware clock wasn't UTC.

Solution is to set the timezone and the therefor resulting time before starting the installer. It could be done easily by:
a) date -s "hh:mm CEST"
This result in an correct UTC time when using data afterwards.
b) or let the user select correct timezone interactiv with tzselect. For this the packet tzdate(with tzselect) should be available on the install ISO. This could be handled like the keyboard layout selection with km. I prefer a hint for the user, so the /etc/motd on ISO could have an issue like:
Timezone:
- to set your time(zone) correctly during installlation, type tzselect on console.

Additional info:
* package version(s)
ISO 2008.03
See also discussion on arch-general mailing list:
http://archlinux.org/pipermail/arch-general/2008-March/017177.html

This task depends upon

This task blocks these from closing
 FS#10702 - 2008 RC ISO related bugs 
Closed by  Simo Leone (neotuli)
Wednesday, 22 October 2008, 02:16 GMT
Reason for closing:  Implemented
Comment by Simo Leone (neotuli) - Sunday, 06 April 2008, 10:20 GMT
The documentation is lacking a bit at this point, but you can handle this using boot parameters.

HARDWARECLOCK="$(cmdline_param clock ${CLOCK_DEFAULT})"
TIMEZONE="$(cmdline_param timezone ${TIMEZONE_DEFAULT})"

That is, add things like "clock=utc timezone=America/Chicago" to the boot parameters.

Besides that there isn't a whole lot we can do about this, and it really isn't our biggest problem right now...
Comment by Greg (dolby) - Saturday, 03 May 2008, 17:39 GMT
adding the above in the grub kernel line didnt work for me
Comment by Aaron Griffin (phrakture) - Thursday, 15 May 2008, 19:56 GMT
Can you check to see if this fixes things BEFORE running the installer? That is, if the installer is manually breaking this, then we can fix that, but we just need to know if it's rc.conf or the installer that is balking.
Comment by Gerhard Brauer (GerBra) - Thursday, 15 May 2008, 21:02 GMT
I'm not have tested Simos hint this time (forgotten ;-)

Yes, this must be set before the installer. Exactly during installation before fdisk'ing and configuring rc.conf, cause after configure the partitions are re-mountet. Therefor this tzselect/date -s could also be a part of the installer.
During installation we must have a correct timezone and a properly time based on this zone. At the moment the installer changes the TZ (if the user does this in rc.conf) but leaves the time itself as it is.
Comment by Aaron Griffin (phrakture) - Thursday, 15 May 2008, 21:06 GMT
I'm not sure what you mean by "leaves the time as is"? Could you tell me what commands should be run?
Comment by Gerhard Brauer (GerBra) - Thursday, 15 May 2008, 21:33 GMT
Ah, my english...

Assume after boot there ist 07:00 CET. That is what date says.
When changing TZ in rc.conf during installer maybe to CEST then it is
still 07:00 CEST. TZ is changed but not the time = wrong time, future time...
Maybe it's better explained in the Link above
http://archlinux.org/pipermail/arch-general/2008-March/017177.html
and the next mail in this thread.
Comment by Aaron Griffin (phrakture) - Thursday, 15 May 2008, 21:35 GMT
Right, but there's no way of knowing what the system clock is set to. That's why we have the boot param (which needs documentation).

We could, perhaps, assume system clocks are in UTC.
Comment by Gerhard Brauer (GerBra) - Thursday, 15 May 2008, 21:41 GMT
But with tzselect or date -s "hh:mm CEST" the user could set the right CLOCK(time) and the right TZ for this
clock/time. Side effect is that this would also result in a correct utc time for installing.

Comment by Aaron Griffin (phrakture) - Thursday, 15 May 2008, 21:53 GMT
Is it possibly related to this:
http://projects.archlinux.org/?p=installer.git;a=blob;f=setup#l1665

Notice that the installer tries to set things inside the chroot after you edit rc.conf
Comment by Gerhard Brauer (GerBra) - Thursday, 15 May 2008, 22:05 GMT
Yes, this must be the point, especially the umount/mount after.

Most(?) PCs have localtime as their HWCLOCK. So we could not automatically assume that this time is also the UTC time. The user/admin must select/set this.
And IMHO there will never be a problem with remounting during install if UTC-time is correctly suitable to users time/TZ - when set.
Comment by Gerhard Brauer (GerBra) - Thursday, 15 May 2008, 22:12 GMT
Sorry, forgotten something (discussing in bugtracker is ...)
I think we have 3 options where one could set the time:
a) kernel boot parameter
You must think of user with non-US keyboards. It's not easy sometimes to find the right keys on an other layout for chars like " / ' ( and so on. So it think this is not the best solution
b) date -s
Works, but the user must known his timezone shortname (EST,CEST,...)
c) tzselect (from tzdate)
interactiv! userfriendly ;-)
Comment by Aaron Griffin (phrakture) - Thursday, 15 May 2008, 22:19 GMT
regarding the first point, we DO have the ability to swap keyboard layouts in grub, but not everything is there (feel free to give us more mappings if you're bored: http://projects.archlinux.org/?p=archiso.git;a=blob;f=default-config/boot/grub/keyboards.lst)

But, I think it's best if we just add a new menu to the installer that allows a user to set their timezone. We can just call tzselect, get the output, and set things before we do FS creation.
Comment by Gerhard Brauer (GerBra) - Thursday, 15 May 2008, 22:32 GMT
If we not want changing the installer, a hint in /etc/motd could also be enough. Similar the current ISOs (incl. the 2008.03) does it with km for language select. Such a thing could be easily documented - when the user doesn't read or notice such docu than this is not our problem.

In your test ISOs (you and Simo provide) you do a lot of things by grub/kernel parameters, i see.
But IMHO such a tool like km is a "little" better for setting things:
Want to change the language: type km
Want to change the TZ/time: type tzselect
Want to install arch? type /arch/setup
Have fun!
Comment by Aaron Griffin (phrakture) - Thursday, 15 May 2008, 22:33 GMT
I agree. Allowing these things to be set in the live system is very good and we should definitely do it.
Comment by Simo Leone (neotuli) - Saturday, 17 May 2008, 09:24 GMT
We added a hint to the next batch of installers tonight. It needs to be fleshed out a bit though.

Specifically, this script needs to be included somewhere:

$/bin/sh
export TZ="$(tzselect)"
Comment by Aaron Griffin (phrakture) - Wednesday, 21 May 2008, 23:29 GMT Comment by name withheld (Gullible Jones) - Friday, 27 June 2008, 08:42 GMT
tz script does not work properly. Setting timezone to America/New York + UTC sets system clock four hours behind instead of four hours ahead.
Comment by Simo Leone (neotuli) - Friday, 27 June 2008, 09:44 GMT
err.... EDT is -4 relative to GMT, it's supposed to be behind, isn't it?
Comment by name withheld (Gullible Jones) - Friday, 27 June 2008, 10:07 GMT
Yeah, but if you're setting your clock to UTC the BIOS clock should be ahead of local time.
Comment by Aaron Griffin (phrakture) - Friday, 27 June 2008, 15:45 GMT
I don't think this is an issue with the tz script, but more with the installer (as you mentioned setting the bios to UTC, which the tz script most definitely does not do)
Comment by Roman Kyrylych (Romashka) - Wednesday, 16 July 2008, 07:44 GMT
This is related to installer.
There was an ugly hack to fix time-related problems.
Now it needs to be removed to not conflict with tzselect (and it seems it doesn't work for /dev/mapper/* partitions made by cryptsetup).
But it is important that user sets timezone correctly _before_mounting_anything_in_read-write_mode_,
thus it should become an obligatory step in install process, but still available separately for rescue-only using of LiveCD.
Since I was involved in previous time-related PITA-bugreports (more than 5 IIRC),
I feel it's my duty to fix this one again (doh!) before the next release.
@Simo: where can I grab the latest changes you've made to git tree of installer?

P.S.: haha, /me got his hands to bugtracker again :-P
Comment by Simo Leone (neotuli) - Wednesday, 16 July 2008, 13:39 GMT

Loading...