If dont-chroot is set, don't chroot target env calls.
This commit is contained in:
parent
2c9524aebd
commit
2e3751ffa7
@ -99,12 +99,19 @@ targetEnvOutput( const QStringList& args,
|
|||||||
return -3;
|
return -3;
|
||||||
|
|
||||||
Calamares::GlobalStorage* gs = Calamares::JobQueue::instance()->globalStorage();
|
Calamares::GlobalStorage* gs = Calamares::JobQueue::instance()->globalStorage();
|
||||||
if ( !gs || !gs->contains( "rootMountPoint" ) )
|
if ( !gs ||
|
||||||
|
( doChroot && !gs->contains( "rootMountPoint" ) ) )
|
||||||
{
|
{
|
||||||
cLog() << "No rootMountPoint in global storage";
|
cLog() << "No rootMountPoint in global storage";
|
||||||
return -3;
|
return -3;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QProcess process;
|
||||||
|
QString program;
|
||||||
|
QStringList arguments;
|
||||||
|
|
||||||
|
if ( doChroot )
|
||||||
|
{
|
||||||
QString destDir = gs->value( "rootMountPoint" ).toString();
|
QString destDir = gs->value( "rootMountPoint" ).toString();
|
||||||
if ( !QDir( destDir ).exists() )
|
if ( !QDir( destDir ).exists() )
|
||||||
{
|
{
|
||||||
@ -112,11 +119,17 @@ targetEnvOutput( const QStringList& args,
|
|||||||
return -3;
|
return -3;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString program( "chroot" );
|
program = "chroot";
|
||||||
QStringList arguments = { destDir };
|
arguments = QStringList( { destDir } );
|
||||||
arguments << args;
|
arguments << args;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
program = "sh";
|
||||||
|
arguments = QStringList( { "-c" } );
|
||||||
|
arguments << args;
|
||||||
|
}
|
||||||
|
|
||||||
QProcess process;
|
|
||||||
process.setProgram( program );
|
process.setProgram( program );
|
||||||
process.setArguments( arguments );
|
process.setArguments( arguments );
|
||||||
process.setProcessChannelMode( QProcess::MergedChannels );
|
process.setProcessChannelMode( QProcess::MergedChannels );
|
||||||
|
@ -24,6 +24,8 @@
|
|||||||
|
|
||||||
namespace CalamaresUtils
|
namespace CalamaresUtils
|
||||||
{
|
{
|
||||||
|
static bool doChroot = true;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Runs the mount utility with the specified parameters.
|
* Runs the mount utility with the specified parameters.
|
||||||
* @returns the program's exit code, or:
|
* @returns the program's exit code, or:
|
||||||
|
@ -19,6 +19,7 @@
|
|||||||
#include "Settings.h"
|
#include "Settings.h"
|
||||||
|
|
||||||
#include "utils/CalamaresUtils.h"
|
#include "utils/CalamaresUtils.h"
|
||||||
|
#include "utils/CalamaresUtilsSystem.h"
|
||||||
#include "utils/Logger.h"
|
#include "utils/Logger.h"
|
||||||
#include "utils/YamlUtils.h"
|
#include "utils/YamlUtils.h"
|
||||||
|
|
||||||
@ -95,6 +96,9 @@ Settings::Settings( const QString& settingsFilePath,
|
|||||||
m_brandingComponentName = QString::fromStdString( config[ "branding" ]
|
m_brandingComponentName = QString::fromStdString( config[ "branding" ]
|
||||||
.as< std::string >() );
|
.as< std::string >() );
|
||||||
m_promptInstall = config[ "prompt-install" ].as< bool >();
|
m_promptInstall = config[ "prompt-install" ].as< bool >();
|
||||||
|
|
||||||
|
bool doChroot = !config[ "dont-chroot" ].as< bool >();
|
||||||
|
CalamaresUtils::doChroot = doChroot;
|
||||||
}
|
}
|
||||||
catch ( YAML::Exception& e )
|
catch ( YAML::Exception& e )
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user