|
|
|
@ -31,10 +31,10 @@ bool CalculateConfig::getDefaultConfig()
|
|
|
|
|
// start cl-install -v and parse out
|
|
|
|
|
QProcess cl_install;
|
|
|
|
|
|
|
|
|
|
qDebug() << "Start cl-install -v --xml --filter (os_install*|os_locale_lang|os_disk*|os_device*|cl_migrate_user)";
|
|
|
|
|
qDebug() << "Start cl-install -v --xml --filter \"os_install|os_locale_lang$|os_disk|os_device|^cl_migrate_user$\"";
|
|
|
|
|
|
|
|
|
|
cl_install.start(
|
|
|
|
|
"cl-install -v --xml --filter \"os_install*|os_locale_lang|*os_disk*|*os_device*|cl_migrate_user\""
|
|
|
|
|
"cl-install -v --xml --filter \"os_install|os_locale_lang|^os_lang$|os_disk|os_device|^cl_migrate_user$\""
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
if ( !cl_install.waitForStarted() )
|
|
|
|
@ -45,6 +45,8 @@ bool CalculateConfig::getDefaultConfig()
|
|
|
|
|
|
|
|
|
|
QString outVars = cl_install.readAll();
|
|
|
|
|
|
|
|
|
|
qDebug() << endl << outVars;
|
|
|
|
|
|
|
|
|
|
QDomDocument xmlVars;
|
|
|
|
|
QString errMsg;
|
|
|
|
|
int errLine;
|
|
|
|
@ -67,7 +69,7 @@ bool CalculateConfig::getDefaultConfig()
|
|
|
|
|
|
|
|
|
|
QStringList devs = m_Config["os_device_dev"].toStringList();
|
|
|
|
|
m_Config.remove("os_device_dev");
|
|
|
|
|
m_Config["os_device_dev"] = preparePartitions(devs);
|
|
|
|
|
m_Config["os_device_dev"] = devs;
|
|
|
|
|
|
|
|
|
|
if ( !m_Config["os_device_dev"].toStringList().isEmpty() )
|
|
|
|
|
m_Config["gui_os_device_dev"] = m_Config["os_device_dev"].toStringList().at(0);
|
|
|
|
@ -91,6 +93,20 @@ bool CalculateConfig::getDefaultConfig()
|
|
|
|
|
|
|
|
|
|
m_Config["def_cl_migrate_user"] = m_Config["cl_migrate_user"];
|
|
|
|
|
|
|
|
|
|
qDebug() << endl << "Start variables: ";
|
|
|
|
|
MapConfig::ConstIterator cfgIt = m_Config.constBegin();
|
|
|
|
|
while(cfgIt != m_Config.constEnd())
|
|
|
|
|
{
|
|
|
|
|
qDebug() <<
|
|
|
|
|
cfgIt.key() +
|
|
|
|
|
" = " +
|
|
|
|
|
(( QString(cfgIt.value().typeName()) == "QStringList") ?
|
|
|
|
|
("[" + cfgIt.value().toStringList().join(", ") + "]") :
|
|
|
|
|
( cfgIt.value().toString() ) );
|
|
|
|
|
++cfgIt;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -100,8 +116,8 @@ bool CalculateConfig::getNewPartitioning()
|
|
|
|
|
MapConfig confDisk;
|
|
|
|
|
QProcess cl_install;
|
|
|
|
|
|
|
|
|
|
qDebug() << "Start cl-install -v --xml --filter (os_disk*|os_device*|os_install_disk*)";
|
|
|
|
|
cl_install.start( "cl-install -v --xml --filter \"(os_disk*|os_device*|os_install_disk*)\" " );
|
|
|
|
|
qDebug() << "Start cl-install -v --xml --filter (os_disk|os_device|os_install_disk)";
|
|
|
|
|
cl_install.start( "cl-install -v --xml --filter \"(os_disk|os_device|os_install_disk)\" " );
|
|
|
|
|
|
|
|
|
|
if ( !cl_install.waitForStarted() )
|
|
|
|
|
return false;
|
|
|
|
@ -130,7 +146,7 @@ bool CalculateConfig::getNewPartitioning()
|
|
|
|
|
QStringList devs = confDisk["os_device_dev"].toStringList();
|
|
|
|
|
|
|
|
|
|
m_Config.remove("os_device_dev");
|
|
|
|
|
m_Config["os_device_dev"] = preparePartitions(devs);
|
|
|
|
|
m_Config["os_device_dev"] = devs;
|
|
|
|
|
|
|
|
|
|
m_Config.remove("os_disk_dev");
|
|
|
|
|
m_Config["os_disk_dev"] = confDisk["os_disk_dev"];
|
|
|
|
@ -164,8 +180,8 @@ bool CalculateConfig::getNewMountpoints()
|
|
|
|
|
|
|
|
|
|
QStringList newMpParam = getDisksParameters();
|
|
|
|
|
|
|
|
|
|
qDebug() << "Start cl-install " + newMpParam.join(" ") + " -v --xml --filter os_install_disk_*";
|
|
|
|
|
cl_install.start("cl-install " + newMpParam.join(" ") + " --color never -v --xml --filter os_install_disk_*" );
|
|
|
|
|
qDebug() << "Start cl-install " + newMpParam.join(" ") + " -v --xml --filter os_install_disk_";
|
|
|
|
|
cl_install.start("cl-install " + newMpParam.join(" ") + " --color never -v --xml --filter os_install_disk_" );
|
|
|
|
|
|
|
|
|
|
if ( !cl_install.waitForStarted() )
|
|
|
|
|
return false;
|
|
|
|
@ -209,20 +225,6 @@ bool CalculateConfig::getNewMountpoints()
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QStringList CalculateConfig::preparePartitions(const QStringList& parts)
|
|
|
|
|
{
|
|
|
|
|
QStringList devs(parts);
|
|
|
|
|
QStringList::iterator dev = devs.begin();
|
|
|
|
|
|
|
|
|
|
while ( dev != devs.end() )
|
|
|
|
|
{
|
|
|
|
|
*dev = "/dev/"+*dev;
|
|
|
|
|
++dev;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return devs;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QStringList CalculateConfig::getPasswordUsers()
|
|
|
|
|
{
|
|
|
|
|
QStringList result;
|
|
|
|
@ -238,8 +240,8 @@ QStringList CalculateConfig::getPasswordUsers()
|
|
|
|
|
usersParam += " --user " + user;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
qDebug() << "Start cl-install" + usersParam + " -v --xml --filter *migrate*";
|
|
|
|
|
cl_install.start("cl-install" + usersParam + " -v --xml --filter *migrate*" );
|
|
|
|
|
qDebug() << "Start cl-install" + usersParam + " -v --xml --filter migrate";
|
|
|
|
|
cl_install.start("cl-install" + usersParam + " -v --xml --filter migrate" );
|
|
|
|
|
|
|
|
|
|
if ( !cl_install.waitForStarted() )
|
|
|
|
|
{
|
|
|
|
|