mirror of
https://github.com/parchlinux/calamares.git
synced 2025-06-30 02:45:37 -04:00
[locale] New setting *adjustLiveTimezone*
- allow finer-grained control over whether-or-not to adjust the timezone in the live system. - handle some special cases at the point of loading-configuration. - document the setting in locale.conf - correct some documentation bugs - adjust the YAML schema for locale.conf so it's legal YAML syntax **and** validates the current file.
This commit is contained in:
parent
995ebd5c83
commit
f6419d5de1
4 changed files with 69 additions and 13 deletions
|
@ -177,15 +177,11 @@ Config::Config( QObject* parent )
|
|||
gs->insert( "locationRegion", location->region() );
|
||||
gs->insert( "locationZone", location->zone() );
|
||||
|
||||
// If we're in chroot mode (normal install mode), then we immediately set the
|
||||
// timezone on the live system. When debugging timezones, don't bother.
|
||||
#ifndef DEBUG_TIMEZONES
|
||||
if ( locationChanged && Calamares::Settings::instance()->doChroot() )
|
||||
if ( locationChanged && m_adjustLiveTimezone )
|
||||
{
|
||||
QProcess::execute( "timedatectl", // depends on systemd
|
||||
{ "set-timezone", location->region() + '/' + location->zone() } );
|
||||
}
|
||||
#endif
|
||||
} );
|
||||
}
|
||||
|
||||
|
@ -325,6 +321,23 @@ Config::setConfigurationMap( const QVariantMap& configurationMap )
|
|||
localeGenPath = QStringLiteral( "/etc/locale.gen" );
|
||||
}
|
||||
m_localeGenLines = loadLocales( localeGenPath );
|
||||
|
||||
m_adjustLiveTimezone
|
||||
= CalamaresUtils::getBool( configurationMap, "adjustLiveTimezone", Calamares::Settings::instance()->doChroot() );
|
||||
#ifdef DEBUG_TIMEZONES
|
||||
if ( m_adjustLiveTimezone )
|
||||
{
|
||||
cDebug() << "Turning off live-timezone adjustments because debugging is on.";
|
||||
m_adjustLiveTimezone = false;
|
||||
}
|
||||
#endif
|
||||
#ifdef __FreeBSD__
|
||||
if ( m_adjustLiveTimezone )
|
||||
{
|
||||
cDebug() << "Turning off live-timezone adjustments on FreeBSD.";
|
||||
m_adjustLiveTimezone = false;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
Calamares::JobList
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue