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 \ |
William A. Kennington III | 6888f37 | 2023-04-12 16:42:28 -0700 | [diff] [blame] | 14 | file://40-gbmc-sysctl.conf \ |
William A. Kennington III | aa814b3 | 2022-10-26 16:50:30 -0700 | [diff] [blame] | 15 | file://40-gbmc-time.conf \ |
Willy Tu | 511ffa9 | 2023-05-03 17:35:04 -0700 | [diff] [blame] | 16 | file://10-gbmc.conf \ |
Willy Tu | dba9083 | 2021-02-10 11:55:58 -0800 | [diff] [blame] | 17 | " |
| 18 | |
Willy Tu | 4dd03ca | 2021-08-06 09:37:35 -0700 | [diff] [blame] | 19 | FILES:${PN}:append = " \ |
Willy Tu | dba9083 | 2021-02-10 11:55:58 -0800 | [diff] [blame] | 20 | ${systemd_unitdir}/coredump.conf.d/40-gbmc-coredump.conf \ |
| 21 | ${systemd_unitdir}/resolved.conf.d/40-gbmc-nomdns.conf \ |
William A. Kennington III | aa814b3 | 2022-10-26 16:50:30 -0700 | [diff] [blame] | 22 | ${systemd_unitdir}/timesyncd.conf.d/40-gbmc-time.conf \ |
William A. Kennington III | 6888f37 | 2023-04-12 16:42:28 -0700 | [diff] [blame] | 23 | ${libdir}/sysctl.d/40-gbmc-sysctl.conf \ |
William A. Kennington III | 5ba6d08 | 2021-03-10 19:24:22 -0800 | [diff] [blame] | 24 | ${libdir}/sysctl.d/40-gbmc-forward.conf \ |
Willy Tu | 511ffa9 | 2023-05-03 17:35:04 -0700 | [diff] [blame] | 25 | ${systemd_system_unitdir}/sysinit.target.wants/systemd-time-wait-sync.service \ |
Willy Tu | fbf0f45 | 2023-06-27 11:37:35 -0700 | [diff] [blame] | 26 | ${systemd_system_unitdir}/systemd-time-wait-sync.service.d/10-gbmc.conf \ |
Willy Tu | dba9083 | 2021-02-10 11:55:58 -0800 | [diff] [blame] | 27 | " |
| 28 | |
Willy Tu | 4dd03ca | 2021-08-06 09:37:35 -0700 | [diff] [blame] | 29 | FILES:${PN}:append:dev = " \ |
Willy Tu | dba9083 | 2021-02-10 11:55:58 -0800 | [diff] [blame] | 30 | ${libdir}/sysctl.d/40-gbmc-debug.conf \ |
| 31 | " |
| 32 | |
Willy Tu | 4dd03ca | 2021-08-06 09:37:35 -0700 | [diff] [blame] | 33 | SYSTEMD_SERVICE:${PN}:append = " \ |
Willy Tu | dba9083 | 2021-02-10 11:55:58 -0800 | [diff] [blame] | 34 | firmware-updates.target \ |
| 35 | firmware-updates-pre.target \ |
| 36 | " |
| 37 | |
Yuxiao Zhang | 1de1e91 | 2023-06-09 17:24:33 -0700 | [diff] [blame] | 38 | RDEPENDS:${PN}:append = " bash" |
Willy Tu | dba9083 | 2021-02-10 11:55:58 -0800 | [diff] [blame] | 39 | # Put coredumps in the journal to ensure they stay in ram |
| 40 | do_install() { |
William A. Kennington III | 5ba6d08 | 2021-03-10 19:24:22 -0800 | [diff] [blame] | 41 | install -d -m 0755 ${D}${systemd_unitdir}/coredump.conf.d |
| 42 | printf "[Coredump]\nStorage=journal\n" \ |
| 43 | >${D}${systemd_unitdir}/coredump.conf.d/40-gbmc-coredump.conf |
Willy Tu | dba9083 | 2021-02-10 11:55:58 -0800 | [diff] [blame] | 44 | |
William A. Kennington III | 5ba6d08 | 2021-03-10 19:24:22 -0800 | [diff] [blame] | 45 | install -d -m 0755 ${D}${systemd_unitdir}/resolved.conf.d |
| 46 | printf "[Resolve]\nLLMNR=no\nMulticastDNS=resolve\n" \ |
| 47 | >${D}${systemd_unitdir}/resolved.conf.d/40-gbmc-nomdns.conf |
Willy Tu | dba9083 | 2021-02-10 11:55:58 -0800 | [diff] [blame] | 48 | |
William A. Kennington III | 5ba6d08 | 2021-03-10 19:24:22 -0800 | [diff] [blame] | 49 | install -d -m 0755 ${D}${systemd_system_unitdir} |
| 50 | install -m 0644 ${WORKDIR}/firmware-updates.target ${D}${systemd_system_unitdir}/ |
| 51 | install -m 0644 ${WORKDIR}/firmware-updates-pre.target ${D}${systemd_system_unitdir}/ |
William A. Kennington III | 1cf2b96 | 2023-03-29 18:51:15 -0700 | [diff] [blame] | 52 | # mask systemd-pstore.service to avoid copying logs to SPI |
| 53 | mkdir -p ${D}${sysconfdir}/systemd/system |
| 54 | ln -sv /dev/null ${D}${sysconfdir}/systemd/system/systemd-pstore.service |
William A. Kennington III | 5ba6d08 | 2021-03-10 19:24:22 -0800 | [diff] [blame] | 55 | |
Yuxiao Zhang | aeae6a7 | 2023-06-14 15:01:21 -0700 | [diff] [blame] | 56 | # mask networkd-wait-online.service to avoid waiting |
| 57 | ln -sv /dev/null ${D}/${sysconfdir}/systemd/system/systemd-networkd-wait-online.service |
| 58 | |
William A. Kennington III | 5ba6d08 | 2021-03-10 19:24:22 -0800 | [diff] [blame] | 59 | install -d -m0755 ${D}${libdir}/sysctl.d |
| 60 | install -m 0644 ${WORKDIR}/40-gbmc-forward.conf ${D}${libdir}/sysctl.d/ |
William A. Kennington III | 6888f37 | 2023-04-12 16:42:28 -0700 | [diff] [blame] | 61 | install -m 0644 ${WORKDIR}/40-gbmc-sysctl.conf ${D}${libdir}/sysctl.d/ |
Willy Tu | 2696b0a | 2021-08-14 18:38:58 -0700 | [diff] [blame] | 62 | |
William A. Kennington III | aa814b3 | 2022-10-26 16:50:30 -0700 | [diff] [blame] | 63 | install -d -m 0755 ${D}${systemd_unitdir}/timesyncd.conf.d/ |
| 64 | install -D -m0644 ${WORKDIR}/40-gbmc-time.conf ${D}${systemd_unitdir}/timesyncd.conf.d/ |
Willy Tu | 511ffa9 | 2023-05-03 17:35:04 -0700 | [diff] [blame] | 65 | |
| 66 | mkdir -p ${D}${systemd_system_unitdir}/sysinit.target.wants/ |
| 67 | ln -sv ${systemd_system_unitdir}/systemd-time-wait-sync.service ${D}${systemd_system_unitdir}/sysinit.target.wants/ |
Willy Tu | fbf0f45 | 2023-06-27 11:37:35 -0700 | [diff] [blame] | 68 | mkdir -p ${D}${systemd_system_unitdir}/systemd-time-wait-sync.service.d/ |
| 69 | install -D -m0644 ${WORKDIR}/10-gbmc.conf ${D}${systemd_system_unitdir}/systemd-time-wait-sync.service.d/ |
Willy Tu | dba9083 | 2021-02-10 11:55:58 -0800 | [diff] [blame] | 70 | } |
| 71 | |
Willy Tu | 4dd03ca | 2021-08-06 09:37:35 -0700 | [diff] [blame] | 72 | do_install:append:dev() { |
William A. Kennington III | 5ba6d08 | 2021-03-10 19:24:22 -0800 | [diff] [blame] | 73 | printf "kernel.sysrq = 1\n" \ |
| 74 | >${D}${libdir}/sysctl.d/40-gbmc-debug.conf |
Willy Tu | dba9083 | 2021-02-10 11:55:58 -0800 | [diff] [blame] | 75 | } |