Bug 4629 - Cannot set timezone in automated installation
: Cannot set timezone in automated installation
Status: RESOLVED FIXINSOURCE
Product: installer
autoinstall
: unspecified
: i86pc/i386 OpenSolaris
: P3 normal (vote)
: 2009.1H
Assigned To: William Schumann
:
:
: rn4
:
:
:
  Show dependency treegraph
 
Reported: 2008-11-07 02:43 UTC by Li Fan
Modified: 2009-03-19 09:44 UTC (History)
5 users (show)

See Also:


Attachments
ai_combined_manifest.xml (1.54 KB, text/xml)
2008-11-07 02:43 UTC, Li Fan
no flags Details
install_log (6.76 KB, application/octet-stream)
2008-11-07 02:44 UTC, Li Fan
no flags Details


Note

You need to log in before you can comment on or make changes to this bug.


Description Li Fan 2008-11-07 02:43:39 UTC
Created an attachment (id=772) [details]
ai_combined_manifest.xml

In automated installation, I used a manifest which specify the following line
to set timezone to US/Mountain:
  <propval name="timezone" type="astring" value="US/Mountain"/>

But after installation, the timezone is still the default value: PST
(US/Pacific).

I checked install_log and didn't find anything related to setting timezone.

I also tried setting timzone value to Asia/Shanghai in manifest. The result is
the same.
Comment 1 Li Fan 2008-11-07 02:44:02 UTC
Created an attachment (id=773) [details]
install_log
Comment 2 Jan Damborsky 2008-11-07 03:01:22 UTC
In LiveCD case, GUI takes care of setting timezone in following function:
datetimezone-screen.c:datetimezone_set_system_clock(). Timezone is set
on running system and changes are propagated to the target in /etc/default/init
file.

As different transfer mechanism is used for AI and we don't need to set
timezone within AI environment, different mechanism will have to be implemented
for AI - ICT seems to be the right place where we should take care of it.

Should be release noted for 2008.11.
Comment 3 Dave Miner 2008-11-07 06:29:04 UTC
One of the reasons we set it immediately in the graphical installer is so that
the installation logs will be in the "native" timezone, rather than whatever we
happen to default the boot image to.  I'd think the same reasoning would be
applicable to automated installation.
Comment 4 Alok Aggarwal 2008-11-10 14:44:56 UTC
It looks like orchestrator allows for setting the timezone via the
OM_ATTR_TIMEZONE_INFO attribute. The GUI installer sets it and so does the
automated installer.

However, it turns out that this attribute is never looked up by the
orchestrator let alone acted upon. Instead, out of band mechanisms are used to
set the timezone. liborchestrator needs to be fixed to accomodate setting the
timezone.
Comment 5 William Schumann 2009-02-13 03:12:15 UTC
(In reply to comment #4)
> It looks like orchestrator allows for setting the timezone via the
> OM_ATTR_TIMEZONE_INFO attribute. The GUI installer sets it and so does the
> automated installer.
> 
> However, it turns out that this attribute is never looked up by the
> orchestrator let alone acted upon. Instead, out of band mechanisms are used to
> set the timezone. liborchestrator needs to be fixed to accomodate setting the
> timezone.

Orchestrator in om_perform_install() changed to call om_set_time_zone() when
OM_ATTR_TIMEZONE_INFO attribute is set.

Since time zone already set in GUI, removed setting of OM_ATTR_TIMEZONE_INFO
attribute in GUI, so it will not be set in om_perform_install().
Comment 6 William Schumann 2009-02-16 03:58:07 UTC
Fixed in changeset 446:aa40e990c57a
Comment 7 David Comay 2009-03-10 11:09:53 UTC
Should this be reopened as it appears the fix was backed out in changeset
447:749da9554f27?
Comment 8 William Schumann 2009-03-11 04:05:13 UTC
Setting the timezone should be done in 3 places:
1) the local environment
2) the /etc/default/init of the running system
3) the /etc/default/init of the target system

This was not being done correctly in the previous fix, and a SPARC regression
was introduced (write to /etc/default/init was failing, since it is mounted
read-only), so the fix was backed out.  A workaround for this disables
compression for the file: consequently, it is somehow writable.  The code to
perform this is in ai_sparc_image.xml
418: <base_include type="file"
fiocompress="false">etc/default/init</base_include>

om_set_time_zone() seems to accomplish  1) and 2).  and set_timezone() should
be able to accomplish 3) (although I have as yet not been able to locate this
code - it is in libadmutil.so).

Reopening and setting 2009.1H milestone.
Comment 9 William Schumann 2009-03-19 09:44:13 UTC
Pushed in changeset 477:04c667d64a87 along with bug 5554 Cannot specify
hostname in automated installation, it is always opensolaris