1SUMMARY = "Systemd system configuration"
2DESCRIPTION = "Systemd may require slightly different configuration for \
3different machines.  For example, qemu machines require a longer \
4DefaultTimeoutStartSec setting."
5LICENSE = "MIT"
6LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
7
8inherit features_check
9REQUIRED_DISTRO_FEATURES += "usrmerge"
10
11PE = "1"
12
13PACKAGECONFIG ??= "dhcp-ethernet"
14PACKAGECONFIG[dhcp-ethernet] = ""
15
16SRC_URI = "\
17    file://journald.conf \
18    file://logind.conf \
19    file://system.conf \
20    file://system.conf-qemuall \
21    file://wired.network \
22"
23
24do_install() {
25	install -D -m0644 ${WORKDIR}/journald.conf ${D}${systemd_unitdir}/journald.conf.d/00-${PN}.conf
26	install -D -m0644 ${WORKDIR}/logind.conf ${D}${systemd_unitdir}/logind.conf.d/00-${PN}.conf
27	install -D -m0644 ${WORKDIR}/system.conf ${D}${systemd_unitdir}/system.conf.d/00-${PN}.conf
28
29        if ${@bb.utils.contains('PACKAGECONFIG', 'dhcp-ethernet', 'true', 'false', d)}; then
30		install -D -m0644 ${WORKDIR}/wired.network ${D}${systemd_unitdir}/network/80-wired.network
31        fi
32}
33
34# Based on change from YP bug 8141, OE commit 5196d7bacaef1076c361adaa2867be31759c1b52
35do_install:append:qemuall() {
36	install -D -m0644 ${WORKDIR}/system.conf-qemuall ${D}${systemd_unitdir}/system.conf.d/01-${PN}.conf
37}
38
39PACKAGE_ARCH = "${MACHINE_ARCH}"
40
41FILES:${PN} = "\
42    ${systemd_unitdir}/journald.conf.d/ \
43    ${systemd_unitdir}/logind.conf.d/ \
44    ${systemd_unitdir}/system.conf.d/ \
45    ${systemd_unitdir}/network/ \
46"
47