Commit 440090f0 authored by Andrew Branson's avatar Andrew Branson

Merge branch 'jb47252' into 'master'

[ssu] Add repos.d to allow other packages to install ssu domains. Fixes JB#47252

See merge request !35
parents babcc97c 8b738840
...@@ -10,8 +10,10 @@ ...@@ -10,8 +10,10 @@
/// The group ID ssu expects to run as. This is usually the GID of the main phone user /// The group ID ssu expects to run as. This is usually the GID of the main phone user
#define SSU_GROUP_ID 1000 #define SSU_GROUP_ID 1000
/// Path to the main ssu configuration file /// Path to the ssu domain configuration file
#define SSU_REPO_CONFIGURATION "/usr/share/ssu/repos.ini" #define SSU_REPO_CONFIGURATION "/var/cache/ssu/repos.ini"
/// Path to config.d for ssu domain configurations
#define SSU_REPO_CONFIGURATION_DIR "/usr/share/ssu/repos.d"
/// Path to board / device family mappings file /// Path to board / device family mappings file
#define SSU_BOARD_MAPPING_CONFIGURATION "/var/cache/ssu/board-mappings.ini" #define SSU_BOARD_MAPPING_CONFIGURATION "/var/cache/ssu/board-mappings.ini"
/// Path to config.d for board mappings /// Path to config.d for board mappings
......
...@@ -85,7 +85,7 @@ QPair<QString, QString> Ssu::credentials(const QString &scope) ...@@ -85,7 +85,7 @@ QPair<QString, QString> Ssu::credentials(const QString &scope)
QString Ssu::credentialsScope(const QString &repoName, bool rndRepo) QString Ssu::credentialsScope(const QString &repoName, bool rndRepo)
{ {
SsuCoreConfig *settings = SsuCoreConfig::instance(); SsuCoreConfig *settings = SsuCoreConfig::instance();
SsuSettings repoSettings(SSU_REPO_CONFIGURATION, QSettings::IniFormat); SsuSettings repoSettings(SSU_REPO_CONFIGURATION, SSU_REPO_CONFIGURATION_DIR);
// hardcoded magic for doing special privileges store repositories // hardcoded magic for doing special privileges store repositories
if (repoName == "store" || repoName.startsWith("store-c-")) if (repoName == "store" || repoName.startsWith("store-c-"))
......
...@@ -426,7 +426,7 @@ QStringList SsuDeviceInfo::repos(bool rnd, int filter) ...@@ -426,7 +426,7 @@ QStringList SsuDeviceInfo::repos(bool rnd, int filter)
result.append(QString("adaptation%1").arg(i)); result.append(QString("adaptation%1").arg(i));
// now read the release/rnd repos // now read the release/rnd repos
SsuSettings repoSettings(SSU_REPO_CONFIGURATION, QSettings::IniFormat); SsuSettings repoSettings(SSU_REPO_CONFIGURATION, SSU_REPO_CONFIGURATION_DIR);
QString repoKey = (rnd ? "default-repos/rnd" : "default-repos/release"); QString repoKey = (rnd ? "default-repos/rnd" : "default-repos/release");
if (repoSettings.contains(repoKey)) if (repoSettings.contains(repoKey))
result.append(repoSettings.value(repoKey).toStringList()); result.append(repoSettings.value(repoKey).toStringList());
......
...@@ -61,7 +61,7 @@ int SsuRepoManager::add(const QString &repo, const QString &repoUrl) ...@@ -61,7 +61,7 @@ int SsuRepoManager::add(const QString &repo, const QString &repoUrl)
QString SsuRepoManager::caCertificatePath(const QString &domain) QString SsuRepoManager::caCertificatePath(const QString &domain)
{ {
SsuCoreConfig *settings = SsuCoreConfig::instance(); SsuCoreConfig *settings = SsuCoreConfig::instance();
SsuSettings repoSettings(SSU_REPO_CONFIGURATION, QSettings::IniFormat); SsuSettings repoSettings(SSU_REPO_CONFIGURATION, SSU_REPO_CONFIGURATION_DIR);
QString ca = SsuVariables::variable(&repoSettings, QString ca = SsuVariables::variable(&repoSettings,
(domain.isEmpty() ? settings->domain() : domain) + "-domain", (domain.isEmpty() ? settings->domain() : domain) + "-domain",
...@@ -352,7 +352,7 @@ QStringList SsuRepoManager::repoVariables(QHash<QString, QString> *storageHash, ...@@ -352,7 +352,7 @@ QStringList SsuRepoManager::repoVariables(QHash<QString, QString> *storageHash,
SsuVariables var; SsuVariables var;
SsuCoreConfig *settings = SsuCoreConfig::instance(); SsuCoreConfig *settings = SsuCoreConfig::instance();
QStringList configSections; QStringList configSections;
SsuSettings repoSettings(SSU_REPO_CONFIGURATION, QSettings::IniFormat); SsuSettings repoSettings(SSU_REPO_CONFIGURATION, SSU_REPO_CONFIGURATION_DIR);
// fill in all arbitrary repo specific variables from ssu.ini // fill in all arbitrary repo specific variables from ssu.ini
var.variableSection(settings, "repository-url-variables", storageHash); var.variableSection(settings, "repository-url-variables", storageHash);
...@@ -431,7 +431,7 @@ QString SsuRepoManager::url(const QString &repoName, bool rndRepo, ...@@ -431,7 +431,7 @@ QString SsuRepoManager::url(const QString &repoName, bool rndRepo,
repoParameters.insert("brand", settings->brand()); repoParameters.insert("brand", settings->brand());
// variableSection does autodetection for the domain default section // variableSection does autodetection for the domain default section
SsuSettings repoSettings(SSU_REPO_CONFIGURATION, QSettings::IniFormat); SsuSettings repoSettings(SSU_REPO_CONFIGURATION, SSU_REPO_CONFIGURATION_DIR);
SsuVariables var; SsuVariables var;
var.variableSection(&repoSettings, domain + "-domain", &repoParameters); var.variableSection(&repoSettings, domain + "-domain", &repoParameters);
......
Name: ssu Name: ssu
Version: 0.43.10 Version: 0.44.6
Release: 1 Release: 1
Summary: SSU enabler for RND Summary: SSU enabler for RND
Group: System/Base Group: System/Base
...@@ -42,6 +42,7 @@ Requires: ssu-network-proxy ...@@ -42,6 +42,7 @@ Requires: ssu-network-proxy
%dir %{_datarootdir}/%{name} %dir %{_datarootdir}/%{name}
%dir %{_datarootdir}/%{name}/board-mappings.d %dir %{_datarootdir}/%{name}/board-mappings.d
%dir %{_datarootdir}/%{name}/features.d %dir %{_datarootdir}/%{name}/features.d
%dir %{_datarootdir}/%{name}/repos.d
%dir %{_sysconfdir}/%{name}/ %dir %{_sysconfdir}/%{name}/
%{_sysconfdir}/dbus-1/system.d/*.conf %{_sysconfdir}/dbus-1/system.d/*.conf
%doc COPYING.GPL COPYING.LGPL COPYING.BSD %doc COPYING.GPL COPYING.LGPL COPYING.BSD
...@@ -180,6 +181,7 @@ cd build && make INSTALL_ROOT=%{buildroot} install ...@@ -180,6 +181,7 @@ cd build && make INSTALL_ROOT=%{buildroot} install
mkdir -p %{buildroot}/%{_sysconfdir}/zypp/credentials.d mkdir -p %{buildroot}/%{_sysconfdir}/zypp/credentials.d
mkdir -p %{buildroot}/%{_datarootdir}/%{name}/board-mappings.d mkdir -p %{buildroot}/%{_datarootdir}/%{name}/board-mappings.d
mkdir -p %{buildroot}/%{_datarootdir}/%{name}/features.d mkdir -p %{buildroot}/%{_datarootdir}/%{name}/features.d
mkdir -p %{buildroot}/%{_datarootdir}/%{name}/repos.d
mkdir -p %{buildroot}/%{_docdir}/%{name} mkdir -p %{buildroot}/%{_docdir}/%{name}
mkdir -p %{buildroot}/%{_sysconfdir}/%{name} mkdir -p %{buildroot}/%{_sysconfdir}/%{name}
cd .. && cp -R doc/html/* %{buildroot}/%{_docdir}/%{name}/ cd .. && cp -R doc/html/* %{buildroot}/%{_docdir}/%{name}/
...@@ -209,3 +211,6 @@ fi ...@@ -209,3 +211,6 @@ fi
if [ -f /usr/share/ssu/features.ini ]; then if [ -f /usr/share/ssu/features.ini ]; then
rm -f /usr/share/ssu/features.ini rm -f /usr/share/ssu/features.ini
fi fi
if [ -f /usr/share/ssu/repos.ini ]; then
rm -f /usr/share/ssu/repos.ini
fi
...@@ -18,7 +18,7 @@ ssud.depends = libssu ...@@ -18,7 +18,7 @@ ssud.depends = libssu
ssuslipstream.depends = libssu ssuslipstream.depends = libssu
declarative.depends = libssu declarative.depends = libssu
config.files = ssu.ini config.files = examples/ssu.ini
config.path = /etc/ssu config.path = /etc/ssu
oneshot.files = ssu-update-repos oneshot.files = ssu-update-repos
...@@ -27,7 +27,9 @@ oneshot.path = /usr/lib/oneshot.d ...@@ -27,7 +27,9 @@ oneshot.path = /usr/lib/oneshot.d
macros.files = macros.ssuks macros.files = macros.ssuks
macros.path = /etc/rpm/ macros.path = /etc/rpm/
static_config.files = repos.ini ssu-defaults.ini board-mappings.ini static_config.files = examples/repos.ini \
examples/ssu-defaults.ini \
examples/board-mappings.ini
static_config.path = /usr/share/ssu static_config.path = /usr/share/ssu
INSTALLS += config static_config oneshot macros INSTALLS += config static_config oneshot macros
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