mirror of
https://git.yoctoproject.org/poky
synced 2026-04-30 12:32:12 +02:00
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>
This commit is contained in:
committed by
Richard Purdie
parent
119d310f36
commit
92d9c493c4
3
meta/recipes-core/systemd/systemd-conf/journald.conf
Normal file
3
meta/recipes-core/systemd/systemd-conf/journald.conf
Normal file
@@ -0,0 +1,3 @@
|
||||
[Journal]
|
||||
ForwardToSyslog=yes
|
||||
RuntimeMaxUse=64M
|
||||
2
meta/recipes-core/systemd/systemd-conf/logind.conf
Normal file
2
meta/recipes-core/systemd/systemd-conf/logind.conf
Normal file
@@ -0,0 +1,2 @@
|
||||
[Login]
|
||||
KillUserProcesses=yes
|
||||
2
meta/recipes-core/systemd/systemd-conf/system.conf
Normal file
2
meta/recipes-core/systemd/systemd-conf/system.conf
Normal file
@@ -0,0 +1,2 @@
|
||||
[Manager]
|
||||
DefaultMemoryAccounting=yes
|
||||
@@ -0,0 +1,3 @@
|
||||
[Manager]
|
||||
# Change DefaultTimeoutStartSec from 90s to 240s
|
||||
DefaultTimeoutStartSec = 240s
|
||||
@@ -1,48 +1,32 @@
|
||||
require systemd.inc
|
||||
|
||||
SUMMARY = "Systemd system configuration"
|
||||
DESCRIPTION = "Systemd may require slightly different configuration for \
|
||||
different machines. For example, qemu machines require a longer \
|
||||
DefaultTimeoutStartSec setting."
|
||||
LICENSE = "MIT"
|
||||
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
|
||||
|
||||
PACKAGE_ARCH = "${MACHINE_ARCH}"
|
||||
|
||||
CONFFILES_${PN} = "${sysconfdir}/systemd/coredump.conf \
|
||||
${sysconfdir}/systemd/journald.conf \
|
||||
${sysconfdir}/systemd/logind.conf \
|
||||
${sysconfdir}/systemd/system.conf \
|
||||
${sysconfdir}/systemd/user.conf"
|
||||
|
||||
FILES_${PN} = "${sysconfdir}/systemd"
|
||||
|
||||
do_configure[noexec] = '1'
|
||||
do_compile[noexec] = '1'
|
||||
SRC_URI = "\
|
||||
file://journald.conf \
|
||||
file://logind.conf \
|
||||
file://system.conf \
|
||||
file://system.conf-qemuall \
|
||||
"
|
||||
|
||||
do_install() {
|
||||
rm -rf ${D}/${sysconfdir}/systemd
|
||||
install -d ${D}/${sysconfdir}/systemd
|
||||
|
||||
install -m 0644 ${S}/src/coredump/coredump.conf ${D}${sysconfdir}/systemd/coredump.conf
|
||||
|
||||
install -m 0644 ${S}/src/journal/journald.conf ${D}${sysconfdir}/systemd/journald.conf
|
||||
# Enable journal to forward message to syslog daemon
|
||||
sed -i -e 's/.*ForwardToSyslog.*/ForwardToSyslog=yes/' ${D}${sysconfdir}/systemd/journald.conf
|
||||
# Set the maximium size of runtime journal to 64M as default
|
||||
sed -i -e 's/.*RuntimeMaxUse.*/RuntimeMaxUse=64M/' ${D}${sysconfdir}/systemd/journald.conf
|
||||
|
||||
install -m 0644 ${S}/src/login/logind.conf.in ${D}${sysconfdir}/systemd/logind.conf
|
||||
# Set KILL_USER_PROCESSES to yes
|
||||
sed -i -e 's/@KILL_USER_PROCESSES@/yes/' ${D}${sysconfdir}/systemd/logind.conf
|
||||
|
||||
install -m 0644 ${S}/src/core/system.conf.in ${D}${sysconfdir}/systemd/system.conf
|
||||
# Set MEMORY_ACCOUNTING_DEFAULT to yes
|
||||
sed -i -e 's/@MEMORY_ACCOUNTING_DEFAULT@/yes/' ${D}${sysconfdir}/systemd/system.conf
|
||||
|
||||
install -m 0644 ${S}/src/core/user.conf ${D}${sysconfdir}/systemd/user.conf
|
||||
install -D -m0644 ${WORKDIR}/journald.conf ${D}${systemd_unitdir}/journald.conf.d/00-${PN}.conf
|
||||
install -D -m0644 ${WORKDIR}/logind.conf ${D}${systemd_unitdir}/logind.conf.d/00-${PN}.conf
|
||||
install -D -m0644 ${WORKDIR}/system.conf ${D}${systemd_unitdir}/system.conf.d/00-${PN}.conf
|
||||
}
|
||||
|
||||
# Based on change from YP bug 8141, OE commit 5196d7bacaef1076c361adaa2867be31759c1b52
|
||||
do_install_append_qemuall() {
|
||||
# Change DefaultTimeoutStartSec from 90s to 240s
|
||||
echo "DefaultTimeoutStartSec = 240s" >> ${D}${sysconfdir}/systemd/system.conf
|
||||
install -D -m0644 ${WORKDIR}/system.conf-qemuall ${D}${systemd_unitdir}/system.conf.d/01-${PN}.conf
|
||||
}
|
||||
|
||||
PACKAGE_ARCH = "${MACHINE_ARCH}"
|
||||
|
||||
FILES_${PN} = "\
|
||||
${systemd_unitdir}/journald.conf.d/ \
|
||||
${systemd_unitdir}/logind.conf.d/ \
|
||||
${systemd_unitdir}/system.conf.d/ \
|
||||
"
|
||||
|
||||
@@ -277,13 +277,6 @@ do_install() {
|
||||
fi
|
||||
fi
|
||||
|
||||
# conf files are handled by systemd-conf
|
||||
rm -f ${D}${sysconfdir}/systemd/coredump.conf
|
||||
rm -f ${D}${sysconfdir}/systemd/journald.conf
|
||||
rm -f ${D}${sysconfdir}/systemd/logind.conf
|
||||
rm -f ${D}${sysconfdir}/systemd/system.conf
|
||||
rm -f ${D}${sysconfdir}/systemd/user.conf
|
||||
|
||||
# duplicate udevadm for postinst script
|
||||
install -d ${D}${libexecdir}
|
||||
ln ${D}${base_bindir}/udevadm ${D}${libexecdir}/${MLPREFIX}udevadm
|
||||
@@ -486,6 +479,15 @@ FILES_${PN}-extra-utils = "\
|
||||
${rootlibexecdir}/systemd/systemd-cgroups-agent \
|
||||
"
|
||||
|
||||
CONFFILES_${PN} = "${sysconfdir}/systemd/coredump.conf \
|
||||
${sysconfdir}/systemd/journald.conf \
|
||||
${sysconfdir}/systemd/logind.conf \
|
||||
${sysconfdir}/systemd/system.conf \
|
||||
${sysconfdir}/systemd/user.conf \
|
||||
${sysconfdir}/systemd/resolved.conf \
|
||||
${sysconfdir}/systemd/timesyncd.conf \
|
||||
"
|
||||
|
||||
FILES_${PN} = " ${base_bindir}/* \
|
||||
${base_sbindir}/shutdown \
|
||||
${base_sbindir}/halt \
|
||||
@@ -549,7 +551,7 @@ FILES_${PN}-dev += "${base_libdir}/security/*.la ${datadir}/dbus-1/interfaces/ $
|
||||
|
||||
RDEPENDS_${PN} += "kmod dbus util-linux-mount util-linux-umount udev (= ${EXTENDPKGV}) util-linux-agetty util-linux-fsck"
|
||||
RDEPENDS_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'serial-getty-generator', '', 'systemd-serialgetty', d)}"
|
||||
RDEPENDS_${PN} += "volatile-binds update-rc.d systemd-conf"
|
||||
RDEPENDS_${PN} += "volatile-binds update-rc.d"
|
||||
RDEPENDS_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'myhostname', 'libnss-myhostname', '', d)}"
|
||||
|
||||
RRECOMMENDS_${PN} += "systemd-extra-utils \
|
||||
@@ -557,6 +559,7 @@ RRECOMMENDS_${PN} += "systemd-extra-utils \
|
||||
e2fsprogs-e2fsck \
|
||||
kernel-module-autofs4 kernel-module-unix kernel-module-ipv6 \
|
||||
os-release \
|
||||
systemd-conf \
|
||||
"
|
||||
|
||||
INSANE_SKIP_${PN} += "dev-so libdir"
|
||||
|
||||
Reference in New Issue
Block a user