Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge branch 'omp-jb46680' into 'master'
[ssuks] Pass repo-specific variables to Imager. Contributes to JB#46680

See merge request mer-core/ssu!30
  • Loading branch information
Andrew Branson committed Dec 3, 2019
2 parents 6dbb4ca + 83b6be8 commit 7deafcd
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion ssuks/ssukickstarter.cpp
Expand Up @@ -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;
Expand Down

0 comments on commit 7deafcd

Please sign in to comment.