Commit 7deafcd8 authored by Andrew Branson's avatar Andrew Branson

Merge branch 'omp-jb46680' into 'master'

[ssuks] Pass repo-specific variables to Imager. Contributes to JB#46680

See merge request !30
parents 6dbb4caa 83b6be87
......@@ -377,13 +377,27 @@ bool SsuKickstarter::write(const QString &kickstart)
QString kickstartType = QString("# KickstartType: %1")
.arg((rndMode ? "rnd" : "release"));
const QString deviceModel = deviceInfo.deviceModel();
QTextStream kout;
kout.setDevice(&ks);
kout << displayName << endl;
kout << kickstartType << endl;
kout << "# DeviceModel: " << deviceInfo.deviceModel() << endl;
kout << "# DeviceModel: " << deviceModel << endl;
kout << "# DeviceVariant: " << deviceInfo.deviceVariant(true) << endl;
kout << "# Brand: " << repoOverride.value("brand") << endl;
// Repository-specific variables in format "# Var@<repo>@<var>: <value>"
for (auto const &repo : deviceInfo.value("repository-specific-variables").toStringList()) {
if (!repo.startsWith(deviceModel + '-'))
continue;
QHash<QString, QString> section;
deviceInfo.variableSection(repo, &section);
for (auto var = section.cbegin(); var != section.cend(); ++var)
kout << "# Var@" << repo.mid(deviceModel.size() + 1) << '@' << var.key() << ": " << var.value() << endl;
}
if (!suggestedFeatures.isEmpty())
kout << suggestedFeatures << endl;
kout << "# SuggestedImageType: " << imageType << endl;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment