|
|
|
@ -99,12 +99,19 @@ targetEnvOutput( const QStringList& args,
|
|
|
|
|
return -3;
|
|
|
|
|
|
|
|
|
|
Calamares::GlobalStorage* gs = Calamares::JobQueue::instance()->globalStorage();
|
|
|
|
|
if ( !gs || !gs->contains( "rootMountPoint" ) )
|
|
|
|
|
if ( !gs ||
|
|
|
|
|
( doChroot && !gs->contains( "rootMountPoint" ) ) )
|
|
|
|
|
{
|
|
|
|
|
cLog() << "No rootMountPoint in global storage";
|
|
|
|
|
return -3;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QProcess process;
|
|
|
|
|
QString program;
|
|
|
|
|
QStringList arguments;
|
|
|
|
|
|
|
|
|
|
if ( doChroot )
|
|
|
|
|
{
|
|
|
|
|
QString destDir = gs->value( "rootMountPoint" ).toString();
|
|
|
|
|
if ( !QDir( destDir ).exists() )
|
|
|
|
|
{
|
|
|
|
@ -112,11 +119,17 @@ targetEnvOutput( const QStringList& args,
|
|
|
|
|
return -3;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QString program( "chroot" );
|
|
|
|
|
QStringList arguments = { destDir };
|
|
|
|
|
program = "chroot";
|
|
|
|
|
arguments = QStringList( { destDir } );
|
|
|
|
|
arguments << args;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
program = "sh";
|
|
|
|
|
arguments = QStringList( { "-c" } );
|
|
|
|
|
arguments << args;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QProcess process;
|
|
|
|
|
process.setProgram( program );
|
|
|
|
|
process.setArguments( arguments );
|
|
|
|
|
process.setProcessChannelMode( QProcess::MergedChannels );
|
|
|
|
|