[machineid] Implement systemd machine-id creation

This commit is contained in:
Adriaan de Groot 2019-10-04 13:48:24 +02:00
parent 2b9e1d6231
commit 145855a56f

View file

@ -142,7 +142,14 @@ createEntropy( const EntropyGeneration kind, const QString& rootMountPoint, cons
Calamares::JobResult
createSystemdMachineId( const QString& rootMountPoint, const QString& fileName )
{
return Calamares::JobResult::internalError( QObject::tr( "Internal Error" ), QObject::tr( "Not implemented" ), 0 );
auto cmd = QStringList { QStringLiteral( "systemd-machine-id-setup" ) };
auto r = CalamaresUtils::System::instance()->targetEnvCommand( cmd );
if ( r.getExitCode() )
{
return r.explainProcess( cmd, std::chrono::seconds( 0 ) );
}
return Calamares::JobResult::ok();
}
Calamares::JobResult