Willy Tu | dba9083 | 2021-02-10 11:55:58 -0800 | [diff] [blame] | 1 | SUMMARY = "Configures systemd settings for gBMC" |
| 2 | PR = "r1" |
| 3 | LICENSE = "Apache-2.0" |
| 4 | LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10" |
| 5 | |
| 6 | inherit systemd |
| 7 | |
| 8 | S = "${WORKDIR}" |
| 9 | |
Willy Tu | 4dd03ca | 2021-08-06 09:37:35 -0700 | [diff] [blame] | 10 | SRC_URI:append = " \ |
Willy Tu | dba9083 | 2021-02-10 11:55:58 -0800 | [diff] [blame] | 11 | file://firmware-updates.target \ |
| 12 | file://firmware-updates-pre.target \ |
William A. Kennington III | 5ba6d08 | 2021-03-10 19:24:22 -0800 | [diff] [blame] | 13 | file://40-gbmc-forward.conf \ |
Willy Tu | 2696b0a | 2021-08-14 18:38:58 -0700 | [diff] [blame] | 14 | file://40-system.conf \ |
Willy Tu | dba9083 | 2021-02-10 11:55:58 -0800 | [diff] [blame] | 15 | " |
| 16 | |
Willy Tu | 4dd03ca | 2021-08-06 09:37:35 -0700 | [diff] [blame] | 17 | FILES:${PN}:append = " \ |
Willy Tu | dba9083 | 2021-02-10 11:55:58 -0800 | [diff] [blame] | 18 | ${systemd_unitdir}/coredump.conf.d/40-gbmc-coredump.conf \ |
| 19 | ${systemd_unitdir}/resolved.conf.d/40-gbmc-nomdns.conf \ |
Willy Tu | 2696b0a | 2021-08-14 18:38:58 -0700 | [diff] [blame] | 20 | ${systemd_unitdir}/system.conf.d/40-system.conf \ |
William A. Kennington III | 5ba6d08 | 2021-03-10 19:24:22 -0800 | [diff] [blame] | 21 | ${libdir}/sysctl.d/40-gbmc-forward.conf \ |
Willy Tu | dba9083 | 2021-02-10 11:55:58 -0800 | [diff] [blame] | 22 | " |
| 23 | |
Willy Tu | 4dd03ca | 2021-08-06 09:37:35 -0700 | [diff] [blame] | 24 | FILES:${PN}:append:dev = " \ |
Willy Tu | dba9083 | 2021-02-10 11:55:58 -0800 | [diff] [blame] | 25 | ${libdir}/sysctl.d/40-gbmc-debug.conf \ |
| 26 | " |
| 27 | |
Willy Tu | 4dd03ca | 2021-08-06 09:37:35 -0700 | [diff] [blame] | 28 | SYSTEMD_SERVICE:${PN}:append = " \ |
Willy Tu | dba9083 | 2021-02-10 11:55:58 -0800 | [diff] [blame] | 29 | firmware-updates.target \ |
| 30 | firmware-updates-pre.target \ |
| 31 | " |
| 32 | |
| 33 | # Put coredumps in the journal to ensure they stay in ram |
| 34 | do_install() { |
William A. Kennington III | 5ba6d08 | 2021-03-10 19:24:22 -0800 | [diff] [blame] | 35 | install -d -m 0755 ${D}${systemd_unitdir}/coredump.conf.d |
| 36 | printf "[Coredump]\nStorage=journal\n" \ |
| 37 | >${D}${systemd_unitdir}/coredump.conf.d/40-gbmc-coredump.conf |
Willy Tu | dba9083 | 2021-02-10 11:55:58 -0800 | [diff] [blame] | 38 | |
William A. Kennington III | 5ba6d08 | 2021-03-10 19:24:22 -0800 | [diff] [blame] | 39 | install -d -m 0755 ${D}${systemd_unitdir}/resolved.conf.d |
| 40 | printf "[Resolve]\nLLMNR=no\nMulticastDNS=resolve\n" \ |
| 41 | >${D}${systemd_unitdir}/resolved.conf.d/40-gbmc-nomdns.conf |
Willy Tu | dba9083 | 2021-02-10 11:55:58 -0800 | [diff] [blame] | 42 | |
William A. Kennington III | 5ba6d08 | 2021-03-10 19:24:22 -0800 | [diff] [blame] | 43 | install -d -m 0755 ${D}${systemd_system_unitdir} |
| 44 | install -m 0644 ${WORKDIR}/firmware-updates.target ${D}${systemd_system_unitdir}/ |
| 45 | install -m 0644 ${WORKDIR}/firmware-updates-pre.target ${D}${systemd_system_unitdir}/ |
| 46 | |
| 47 | install -d -m0755 ${D}${libdir}/sysctl.d |
| 48 | install -m 0644 ${WORKDIR}/40-gbmc-forward.conf ${D}${libdir}/sysctl.d/ |
Willy Tu | 2696b0a | 2021-08-14 18:38:58 -0700 | [diff] [blame] | 49 | |
| 50 | install -d -m 0755 ${D}${systemd_unitdir}/system.conf.d/ |
| 51 | install -D -m0644 ${WORKDIR}/40-system.conf ${D}${systemd_unitdir}/system.conf.d/ |
Willy Tu | dba9083 | 2021-02-10 11:55:58 -0800 | [diff] [blame] | 52 | } |
| 53 | |
Willy Tu | 4dd03ca | 2021-08-06 09:37:35 -0700 | [diff] [blame] | 54 | do_install:append:dev() { |
William A. Kennington III | 5ba6d08 | 2021-03-10 19:24:22 -0800 | [diff] [blame] | 55 | printf "kernel.sysrq = 1\n" \ |
| 56 | >${D}${libdir}/sysctl.d/40-gbmc-debug.conf |
Willy Tu | dba9083 | 2021-02-10 11:55:58 -0800 | [diff] [blame] | 57 | } |