Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame^] | 1 | require systemd.inc |
| 2 | |
| 3 | SUMMARY = "Systemd system configuration" |
| 4 | DESCRIPTION = "Systemd may require slightly different configuration for \ |
| 5 | different machines. For example, qemu machines require a longer \ |
| 6 | DefaultTimeoutStartSec setting." |
| 7 | |
| 8 | PACKAGE_ARCH = "${MACHINE_ARCH}" |
| 9 | |
| 10 | CONFFILES_${PN} = "${sysconfdir}/machine-id \ |
| 11 | ${sysconfdir}/systemd/coredump.conf \ |
| 12 | ${sysconfdir}/systemd/journald.conf \ |
| 13 | ${sysconfdir}/systemd/logind.conf \ |
| 14 | ${sysconfdir}/systemd/system.conf \ |
| 15 | ${sysconfdir}/systemd/user.conf" |
| 16 | |
| 17 | FILES_${PN} = "${sysconfdir}/machine-id ${sysconfdir}/systemd" |
| 18 | |
| 19 | do_configure[noexec] = '1' |
| 20 | do_compile[noexec] = '1' |
| 21 | |
| 22 | do_install() { |
| 23 | rm -rf ${D}/${sysconfdir}/systemd |
| 24 | install -d ${D}/${sysconfdir}/systemd |
| 25 | |
| 26 | # Create machine-id |
| 27 | # 20:12 < mezcalero> koen: you have three options: a) run systemd-machine-id-setup at install time, b) have / read-only and an empty file there (for stateless) and c) boot with / writable |
| 28 | touch ${D}${sysconfdir}/machine-id |
| 29 | |
| 30 | install -m 0644 ${S}/src/coredump/coredump.conf ${D}${sysconfdir}/systemd/coredump.conf |
| 31 | |
| 32 | install -m 0644 ${S}/src/journal/journald.conf ${D}${sysconfdir}/systemd/journald.conf |
| 33 | # Enable journal to forward message to syslog daemon |
| 34 | sed -i -e 's/.*ForwardToSyslog.*/ForwardToSyslog=yes/' ${D}${sysconfdir}/systemd/journald.conf |
| 35 | # Set the maximium size of runtime journal to 64M as default |
| 36 | sed -i -e 's/.*RuntimeMaxUse.*/RuntimeMaxUse=64M/' ${D}${sysconfdir}/systemd/journald.conf |
| 37 | |
| 38 | install -m 0644 ${S}/src/login/logind.conf.in ${D}${sysconfdir}/systemd/logind.conf |
| 39 | # Set KILL_USER_PROCESSES to yes |
| 40 | sed -i -e 's/@KILL_USER_PROCESSES@/yes/' ${D}${sysconfdir}/systemd/logind.conf |
| 41 | |
| 42 | install -m 0644 ${S}/src/core/system.conf.in ${D}${sysconfdir}/systemd/system.conf |
| 43 | # Set MEMORY_ACCOUNTING_DEFAULT to yes |
| 44 | sed -i -e 's/@MEMORY_ACCOUNTING_DEFAULT@/yes/' ${D}${sysconfdir}/systemd/system.conf |
| 45 | |
| 46 | install -m 0644 ${S}/src/core/user.conf ${D}${sysconfdir}/systemd/user.conf |
| 47 | } |
| 48 | |
| 49 | # Based on change from YP bug 8141, OE commit 5196d7bacaef1076c361adaa2867be31759c1b52 |
| 50 | do_install_append_qemuall() { |
| 51 | # Change DefaultTimeoutStartSec from 90s to 240s |
| 52 | echo "DefaultTimeoutStartSec = 240s" >> ${D}${sysconfdir}/systemd/system.conf |
| 53 | } |