diff --git a/src/modules/locale/SetTimezoneJob.cpp b/src/modules/locale/SetTimezoneJob.cpp index c2fba9151..419690780 100644 --- a/src/modules/locale/SetTimezoneJob.cpp +++ b/src/modules/locale/SetTimezoneJob.cpp @@ -88,16 +88,17 @@ SetTimezoneJob::exec() .arg( zoneinfoPath ) .arg( "/etc/localtime" ) ); - QFile timezoneFile( "/etc/timezone" ); - if ( timezoneFile.exists() ) - { - if (!timezoneFile.open(QIODevice::WriteOnly | QIODevice::Text | QIODevice::Truncate)) - return Calamares::JobResult::error( tr( "Cannot set timezone,"), - tr( "Cannot open /etc/timezone for writing")); + QFile timezoneFile( gs->value( "rootMountPoint" ).toString() + "/etc/timezone" ); + + if ( !timezoneFile.open( QIODevice::WriteOnly | + QIODevice::Text | + QIODevice::Truncate ) ) + return Calamares::JobResult::error( tr( "Cannot set timezone,"), + tr( "Cannot open /etc/timezone for writing")); + + QTextStream out(&timezoneFile); + out << m_region << '/' << m_zone << "\n"; + timezoneFile.close(); - QTextStream out(&timezoneFile); - out << m_region << '/' << m_zone << "\n"; - timezoneFile.close(); - } return Calamares::JobResult::ok(); }