Add support for enabling services by default

This commit is contained in:
Colin Walters 2014-01-30 19:56:13 -05:00
parent 194e7365a9
commit 654cb99599
2 changed files with 15 additions and 0 deletions

View File

@ -25,6 +25,7 @@
"core":
{
"docker": { "packages": ["docker-io", "NetworkManager", "vim-minimal", "nano"],
"units": ["docker.service"],
"postprocess": ["remove-locales",
"remove-gpu-drivers",
"remove-docs"],

View File

@ -87,6 +87,20 @@ const TaskBuild = new Lang.Class({
argv.push.apply(argv, repos.map(function (a) { return '--enablerepo=' + a; }));
argv.push.apply(argv, postprocessSteps.map(function (a) { return '--post=' + a; }));
let enableUnitsScript = '#!/bin/sh\n';
let enabledUnits = treeData['units'];
if (enabledUnits) {
for (let i = 0; i < enabledUnits.length; i++) {
let unit = enabledUnits[i];
print("Enabling unit " + unit);
enableUnitsScript += 'ln -s /usr/lib/systemd/system/' + unit + ' ' + './usr/etc/systemd/system/multi-user.target.wants\n';
}
let enableUnitsScriptPath = Gio.File.new_for_path('enable-units.sh');
enableUnitsScriptPath.replace_contents(enableUnitsScript, null, false, 0, cancellable);
GSystem.file_chmod(enableUnitsScriptPath, 493, cancellable);
argv.push('--xpost=' + enableUnitsScriptPath.get_path());
}
let keyId = this._productData['gpg_key'];
if (keyId) {
print("Signing using " + keyId);