|
|
|
@ -25,9 +25,9 @@
|
|
|
|
|
#include <QFile>
|
|
|
|
|
#include <QDir>
|
|
|
|
|
|
|
|
|
|
SetHostNameJob::SetHostNameJob(const QString& hostname)
|
|
|
|
|
SetHostNameJob::SetHostNameJob( const QString& hostname )
|
|
|
|
|
: Calamares::Job()
|
|
|
|
|
, m_hostname(hostname)
|
|
|
|
|
, m_hostname( hostname )
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -53,14 +53,14 @@ Calamares::JobResult SetHostNameJob::exec()
|
|
|
|
|
return Calamares::JobResult::error( tr( "Internal Error" ) );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QFile hostfile(destDir + "/etc/hostname");
|
|
|
|
|
if (!hostfile.open(QFile::WriteOnly))
|
|
|
|
|
QFile hostfile( destDir + "/etc/hostname" );
|
|
|
|
|
if ( !hostfile.open( QFile::WriteOnly ) )
|
|
|
|
|
{
|
|
|
|
|
cLog() << "Can't write to hostname file";
|
|
|
|
|
return Calamares::JobResult::error( tr( "Cannot write hostname to target system" ) );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QTextStream out(&hostfile);
|
|
|
|
|
QTextStream out( &hostfile );
|
|
|
|
|
out << m_hostname << "\n";
|
|
|
|
|
hostfile.close();
|
|
|
|
|
|
|
|
|
|