[plasmalnf] Run the lnftool in the target (user|system)
This commit is contained in:
parent
8a053f3c9b
commit
d3ef6b07d5
@ -34,6 +34,7 @@
|
|||||||
#include "JobQueue.h"
|
#include "JobQueue.h"
|
||||||
#include "GlobalStorage.h"
|
#include "GlobalStorage.h"
|
||||||
|
|
||||||
|
#include "utils/CalamaresUtilsSystem.h"
|
||||||
#include "utils/Logger.h"
|
#include "utils/Logger.h"
|
||||||
|
|
||||||
PlasmaLnfJob::PlasmaLnfJob( const QString& lnfPath, const QString& id )
|
PlasmaLnfJob::PlasmaLnfJob( const QString& lnfPath, const QString& id )
|
||||||
@ -71,6 +72,24 @@ PlasmaLnfJob::exec()
|
|||||||
{
|
{
|
||||||
cDebug() << "Plasma Look-and-Feel Job";
|
cDebug() << "Plasma Look-and-Feel Job";
|
||||||
|
|
||||||
|
int r = 0;
|
||||||
|
auto system = CalamaresUtils::System::instance();
|
||||||
|
Calamares::GlobalStorage* gs = Calamares::JobQueue::instance()->globalStorage();
|
||||||
|
|
||||||
|
if ( system->doChroot() )
|
||||||
|
{
|
||||||
|
r = system->targetEnvCall( QStringList( { m_lnfPath, "-a", m_id } ) );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
r = system->targetEnvCall( QStringList(
|
||||||
|
{ "sudo", "-u", gs->value("username").toString(), m_lnfPath, "-a", m_id } ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
if (r)
|
||||||
|
return Calamares::JobResult::error(
|
||||||
|
tr( "Could not select KDE Plasma Look-and-Feel package" ),
|
||||||
|
tr( "Could not select KDE Plasma Look-and-Feel package" ) );
|
||||||
return Calamares::JobResult::ok();
|
return Calamares::JobResult::ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user