diff options
author | Alex Kiernan <alex.kiernan@hivehome.com> | 2019-05-02 22:09:41 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-05-03 06:11:57 +0100 |
commit | 92d9c493c47975c94cb159ee87574710bd0c1014 (patch) | |
tree | c3c40d5fc153c9dac3f3755792320c104e0dc373 /meta/recipes-core/systemd | |
parent | 119d310f36bfaba25ad99266ad41f5abca748b43 (diff) | |
download | poky-92d9c493c47975c94cb159ee87574710bd0c1014.tar.gz |
systemd-conf: simplify creation of machine-specific configuration
The configuration files that systemd installs are just skeletons
detailing the available options and their default values. The
recommended means of changing the configuration is to provide snippets
in configuration directories. For example, journald.conf settings are
best set in /usr/lib/system.d/journald.conf.d/ and can be overridden by
the user by providing overriding snippets in
/etc/systemd/journald.conf.d/.
The systemd-conf package is just providing machine-specific overrides
for some systemd defaults.
This patch restores the installation of config files by systemd and
reduces systemd-conf to just providing the config snippets in
/usr/lib/systemd/*.conf.d. This simpilfies the systemd-conf recipe
considerably since it now just sets up a couple of text files and
doesn't even need access to the systemd source anymore.
License-Update: configuration snippets licensing is independent of
systemd licensing
(From OE-Core rev: 3150253898babce70333376d22090b56b4a70bfb)
Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core/systemd')
6 files changed, 41 insertions, 44 deletions
diff --git a/meta/recipes-core/systemd/systemd-conf/journald.conf b/meta/recipes-core/systemd/systemd-conf/journald.conf new file mode 100644 index 0000000000..fd4d969fa7 --- /dev/null +++ b/meta/recipes-core/systemd/systemd-conf/journald.conf | |||
@@ -0,0 +1,3 @@ | |||
1 | [Journal] | ||
2 | ForwardToSyslog=yes | ||
3 | RuntimeMaxUse=64M | ||
diff --git a/meta/recipes-core/systemd/systemd-conf/logind.conf b/meta/recipes-core/systemd/systemd-conf/logind.conf new file mode 100644 index 0000000000..bf7f6920fa --- /dev/null +++ b/meta/recipes-core/systemd/systemd-conf/logind.conf | |||
@@ -0,0 +1,2 @@ | |||
1 | [Login] | ||
2 | KillUserProcesses=yes | ||
diff --git a/meta/recipes-core/systemd/systemd-conf/system.conf b/meta/recipes-core/systemd/systemd-conf/system.conf new file mode 100644 index 0000000000..554cab26c2 --- /dev/null +++ b/meta/recipes-core/systemd/systemd-conf/system.conf | |||
@@ -0,0 +1,2 @@ | |||
1 | [Manager] | ||
2 | DefaultMemoryAccounting=yes | ||
diff --git a/meta/recipes-core/systemd/systemd-conf/system.conf-qemuall b/meta/recipes-core/systemd/systemd-conf/system.conf-qemuall new file mode 100644 index 0000000000..741be27cb4 --- /dev/null +++ b/meta/recipes-core/systemd/systemd-conf/system.conf-qemuall | |||
@@ -0,0 +1,3 @@ | |||
1 | [Manager] | ||
2 | # Change DefaultTimeoutStartSec from 90s to 240s | ||
3 | DefaultTimeoutStartSec = 240s | ||
diff --git a/meta/recipes-core/systemd/systemd-conf_242.bb b/meta/recipes-core/systemd/systemd-conf_242.bb index 7fe2e1105b..96beea53a7 100644 --- a/meta/recipes-core/systemd/systemd-conf_242.bb +++ b/meta/recipes-core/systemd/systemd-conf_242.bb | |||
@@ -1,48 +1,32 @@ | |||
1 | require systemd.inc | ||
2 | |||
3 | SUMMARY = "Systemd system configuration" | 1 | SUMMARY = "Systemd system configuration" |
4 | DESCRIPTION = "Systemd may require slightly different configuration for \ | 2 | DESCRIPTION = "Systemd may require slightly different configuration for \ |
5 | different machines. For example, qemu machines require a longer \ | 3 | different machines. For example, qemu machines require a longer \ |
6 | DefaultTimeoutStartSec setting." | 4 | DefaultTimeoutStartSec setting." |
5 | LICENSE = "MIT" | ||
6 | LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" | ||
7 | 7 | ||
8 | PACKAGE_ARCH = "${MACHINE_ARCH}" | 8 | SRC_URI = "\ |
9 | 9 | file://journald.conf \ | |
10 | CONFFILES_${PN} = "${sysconfdir}/systemd/coredump.conf \ | 10 | file://logind.conf \ |
11 | ${sysconfdir}/systemd/journald.conf \ | 11 | file://system.conf \ |
12 | ${sysconfdir}/systemd/logind.conf \ | 12 | file://system.conf-qemuall \ |
13 | ${sysconfdir}/systemd/system.conf \ | 13 | " |
14 | ${sysconfdir}/systemd/user.conf" | ||
15 | |||
16 | FILES_${PN} = "${sysconfdir}/systemd" | ||
17 | |||
18 | do_configure[noexec] = '1' | ||
19 | do_compile[noexec] = '1' | ||
20 | 14 | ||
21 | do_install() { | 15 | do_install() { |
22 | rm -rf ${D}/${sysconfdir}/systemd | 16 | install -D -m0644 ${WORKDIR}/journald.conf ${D}${systemd_unitdir}/journald.conf.d/00-${PN}.conf |
23 | install -d ${D}/${sysconfdir}/systemd | 17 | install -D -m0644 ${WORKDIR}/logind.conf ${D}${systemd_unitdir}/logind.conf.d/00-${PN}.conf |
24 | 18 | install -D -m0644 ${WORKDIR}/system.conf ${D}${systemd_unitdir}/system.conf.d/00-${PN}.conf | |
25 | install -m 0644 ${S}/src/coredump/coredump.conf ${D}${sysconfdir}/systemd/coredump.conf | ||
26 | |||
27 | install -m 0644 ${S}/src/journal/journald.conf ${D}${sysconfdir}/systemd/journald.conf | ||
28 | # Enable journal to forward message to syslog daemon | ||
29 | sed -i -e 's/.*ForwardToSyslog.*/ForwardToSyslog=yes/' ${D}${sysconfdir}/systemd/journald.conf | ||
30 | # Set the maximium size of runtime journal to 64M as default | ||
31 | sed -i -e 's/.*RuntimeMaxUse.*/RuntimeMaxUse=64M/' ${D}${sysconfdir}/systemd/journald.conf | ||
32 | |||
33 | install -m 0644 ${S}/src/login/logind.conf.in ${D}${sysconfdir}/systemd/logind.conf | ||
34 | # Set KILL_USER_PROCESSES to yes | ||
35 | sed -i -e 's/@KILL_USER_PROCESSES@/yes/' ${D}${sysconfdir}/systemd/logind.conf | ||
36 | |||
37 | install -m 0644 ${S}/src/core/system.conf.in ${D}${sysconfdir}/systemd/system.conf | ||
38 | # Set MEMORY_ACCOUNTING_DEFAULT to yes | ||
39 | sed -i -e 's/@MEMORY_ACCOUNTING_DEFAULT@/yes/' ${D}${sysconfdir}/systemd/system.conf | ||
40 | |||
41 | install -m 0644 ${S}/src/core/user.conf ${D}${sysconfdir}/systemd/user.conf | ||
42 | } | 19 | } |
43 | 20 | ||
44 | # Based on change from YP bug 8141, OE commit 5196d7bacaef1076c361adaa2867be31759c1b52 | 21 | # Based on change from YP bug 8141, OE commit 5196d7bacaef1076c361adaa2867be31759c1b52 |
45 | do_install_append_qemuall() { | 22 | do_install_append_qemuall() { |
46 | # Change DefaultTimeoutStartSec from 90s to 240s | 23 | install -D -m0644 ${WORKDIR}/system.conf-qemuall ${D}${systemd_unitdir}/system.conf.d/01-${PN}.conf |
47 | echo "DefaultTimeoutStartSec = 240s" >> ${D}${sysconfdir}/systemd/system.conf | ||
48 | } | 24 | } |
25 | |||
26 | PACKAGE_ARCH = "${MACHINE_ARCH}" | ||
27 | |||
28 | FILES_${PN} = "\ | ||
29 | ${systemd_unitdir}/journald.conf.d/ \ | ||
30 | ${systemd_unitdir}/logind.conf.d/ \ | ||
31 | ${systemd_unitdir}/system.conf.d/ \ | ||
32 | " | ||
diff --git a/meta/recipes-core/systemd/systemd_242.bb b/meta/recipes-core/systemd/systemd_242.bb index 7d1b0ec13a..a6b39d57e8 100644 --- a/meta/recipes-core/systemd/systemd_242.bb +++ b/meta/recipes-core/systemd/systemd_242.bb | |||
@@ -277,13 +277,6 @@ do_install() { | |||
277 | fi | 277 | fi |
278 | fi | 278 | fi |
279 | 279 | ||
280 | # conf files are handled by systemd-conf | ||
281 | rm -f ${D}${sysconfdir}/systemd/coredump.conf | ||
282 | rm -f ${D}${sysconfdir}/systemd/journald.conf | ||
283 | rm -f ${D}${sysconfdir}/systemd/logind.conf | ||
284 | rm -f ${D}${sysconfdir}/systemd/system.conf | ||
285 | rm -f ${D}${sysconfdir}/systemd/user.conf | ||
286 | |||
287 | # duplicate udevadm for postinst script | 280 | # duplicate udevadm for postinst script |
288 | install -d ${D}${libexecdir} | 281 | install -d ${D}${libexecdir} |
289 | ln ${D}${base_bindir}/udevadm ${D}${libexecdir}/${MLPREFIX}udevadm | 282 | ln ${D}${base_bindir}/udevadm ${D}${libexecdir}/${MLPREFIX}udevadm |
@@ -486,6 +479,15 @@ FILES_${PN}-extra-utils = "\ | |||
486 | ${rootlibexecdir}/systemd/systemd-cgroups-agent \ | 479 | ${rootlibexecdir}/systemd/systemd-cgroups-agent \ |
487 | " | 480 | " |
488 | 481 | ||
482 | CONFFILES_${PN} = "${sysconfdir}/systemd/coredump.conf \ | ||
483 | ${sysconfdir}/systemd/journald.conf \ | ||
484 | ${sysconfdir}/systemd/logind.conf \ | ||
485 | ${sysconfdir}/systemd/system.conf \ | ||
486 | ${sysconfdir}/systemd/user.conf \ | ||
487 | ${sysconfdir}/systemd/resolved.conf \ | ||
488 | ${sysconfdir}/systemd/timesyncd.conf \ | ||
489 | " | ||
490 | |||
489 | FILES_${PN} = " ${base_bindir}/* \ | 491 | FILES_${PN} = " ${base_bindir}/* \ |
490 | ${base_sbindir}/shutdown \ | 492 | ${base_sbindir}/shutdown \ |
491 | ${base_sbindir}/halt \ | 493 | ${base_sbindir}/halt \ |
@@ -549,7 +551,7 @@ FILES_${PN}-dev += "${base_libdir}/security/*.la ${datadir}/dbus-1/interfaces/ $ | |||
549 | 551 | ||
550 | RDEPENDS_${PN} += "kmod dbus util-linux-mount util-linux-umount udev (= ${EXTENDPKGV}) util-linux-agetty util-linux-fsck" | 552 | RDEPENDS_${PN} += "kmod dbus util-linux-mount util-linux-umount udev (= ${EXTENDPKGV}) util-linux-agetty util-linux-fsck" |
551 | RDEPENDS_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'serial-getty-generator', '', 'systemd-serialgetty', d)}" | 553 | RDEPENDS_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'serial-getty-generator', '', 'systemd-serialgetty', d)}" |
552 | RDEPENDS_${PN} += "volatile-binds update-rc.d systemd-conf" | 554 | RDEPENDS_${PN} += "volatile-binds update-rc.d" |
553 | RDEPENDS_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'myhostname', 'libnss-myhostname', '', d)}" | 555 | RDEPENDS_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'myhostname', 'libnss-myhostname', '', d)}" |
554 | 556 | ||
555 | RRECOMMENDS_${PN} += "systemd-extra-utils \ | 557 | RRECOMMENDS_${PN} += "systemd-extra-utils \ |
@@ -557,6 +559,7 @@ RRECOMMENDS_${PN} += "systemd-extra-utils \ | |||
557 | e2fsprogs-e2fsck \ | 559 | e2fsprogs-e2fsck \ |
558 | kernel-module-autofs4 kernel-module-unix kernel-module-ipv6 \ | 560 | kernel-module-autofs4 kernel-module-unix kernel-module-ipv6 \ |
559 | os-release \ | 561 | os-release \ |
562 | systemd-conf \ | ||
560 | " | 563 | " |
561 | 564 | ||
562 | INSANE_SKIP_${PN} += "dev-so libdir" | 565 | INSANE_SKIP_${PN} += "dev-so libdir" |