Commit 8166af9f authored by Aard's avatar Aard

[ssuks] Add support for attachment section

parent bb83192e
......@@ -127,18 +127,23 @@ QStringList SsuKickstarter::repos(){
return result;
}
QStringList SsuKickstarter::packages(){
QStringList SsuKickstarter::packagesSection(QString name){
QStringList result;
// insert @vendor configuration device
QString configuration = QString("@%1 Configuration %2")
.arg(repoOverride.value("brand"))
.arg(deviceModel);
result.append(configuration);
if (name == "packages") {
// insert @vendor configuration device
QString configuration = QString("@%1 Configuration %2")
.arg(repoOverride.value("brand"))
.arg(deviceModel);
result.append(configuration);
result.sort();
result.removeDuplicates();
} else {
result = commandSection(name);
}
result.sort();
result.removeDuplicates();
result.prepend("%packages");
result.prepend("%" + name);
result.append("%end");
return result;
}
......@@ -324,7 +329,8 @@ bool SsuKickstarter::write(QString kickstart){
kout << commandSection(section).join("\n") << endl << endl;
}
kout << repos().join("\n") << endl << endl;
kout << packages().join("\n") << endl << endl;
kout << packagesSection("packages").join("\n") << endl << endl;
kout << packagesSection("attachment").join("\n") << endl << endl;
// TODO: now that extending scriptlet section is might make sense to make it configurable
kout << scriptletSection("pre", Chroot).join("\n") << endl << endl;
kout << scriptletSection("post", Chroot).join("\n") << endl << endl;
......
......@@ -36,7 +36,7 @@ class SsuKickstarter {
QStringList commands();
/// read a command section from file system
QStringList commandSection(const QString &section, const QString &description="");
QStringList packages();
QStringList packagesSection(QString name);
QString replaceSpaces(const QString &value);
QStringList repos();
QStringList scriptletSection(QString name, int flags=Chroot);
......
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