8#include <QCoreApplication>
11#include <QLibraryInfo>
14#include <QDirIterator>
25 QStringList arguments = QCoreApplication::arguments();
27 arguments.removeFirst();
29 QTextStream qout(stdout);
30 QTextStream qerr(stderr);
31 QHash<QString, QString> repoParameters;
33 if (arguments.count() == 1 &&
34 (arguments.at(0) ==
"help" ||
35 arguments.at(0) ==
"--help" ||
36 arguments.at(0) ==
"-h")) {
42 if (arguments.count() >= 1 && !arguments.at(0).contains(
"=")) {
43 fileName = arguments.at(0);
44 arguments.removeFirst();
47 for (
int i = 0; i < arguments.count(); i++) {
48 if (arguments.at(i).count(
"=") != 1) {
49 qout <<
"Invalid flag: " << arguments.at(i) << endl;
50 QCoreApplication::exit(1);
53 QStringList split = arguments.at(i).split(
"=");
54 repoParameters.insert(split.at(0), split.at(1));
59 if (repoParameters.contains(
"sandbox")) {
60 sandbox = repoParameters.value(
"sandbox");
61 repoParameters.remove(
"sandbox");
63 sb =
new Sandbox(sandbox, Sandbox::UseDirectly, Sandbox::ThisProcess);
66 qerr <<
"Failed to copy files into sandbox, using empty sandbox" << endl;
70 qerr <<
"Using sandbox at " << sandbox << endl;
72 qerr <<
"Failed to activate sandbox" << endl;
73 QCoreApplication::exit(1);
82 SsuKickstarter kickstarter;
83 kickstarter.setRepoParameters(repoParameters);
84 QCoreApplication::exit(!kickstarter.write(fileName));
88 QCoreApplication::exit(0);
93 QTextStream qout(stdout);
94 qout <<
"\nUsage: ssuks <filename> <flags>" << endl
96 <<
"Flags are in the form key=value. 'model', 'force', 'rnd' and 'sandbox' keys have special meanings." << endl
97 <<
"To do a kickstart for N9 do 'ssuks model=N9'" << endl
98 <<
"To force generating a kickstart for a non-existant device add force=true" << endl
101 QCoreApplication::exit(1);
104int main(
int argc,
char **argv)
106 QCoreApplication app(argc, argv);
107 QCoreApplication::setOrganizationName(
"Jolla");
108 QCoreApplication::setOrganizationDomain(
"http://www.jollamobile.com");
109 QCoreApplication::setApplicationName(
"ssuks");
111 QTranslator qtTranslator;
112 qtTranslator.load(
"qt_" + QLocale::system().name(),
113 QLibraryInfo::location(QLibraryInfo::TranslationsPath));
114 app.installTranslator(&qtTranslator);
117 QTimer::singleShot(0, &mw, SLOT(run()));
bool addWorldFiles(const QString &directory, QDir::Filters filters=QDir::NoFilter, const QStringList &filterNames=QStringList(), bool recurse=true)
#define SSU_DATA_DIR
Directory where all the non-user modifiable data sits.
#define SSU_BOARD_MAPPING_CONFIGURATION
Path to board / device family mappings file.
#define SSU_BOARD_MAPPING_CONFIGURATION_DIR
Path to config.d for board mappings.