blob: 8809a6ee6354df095c86472e9b0059f5a3a35c23 [file] [log] [blame]
Willy Tudba90832021-02-10 11:55:58 -08001SUMMARY = "Configures systemd settings for gBMC"
2PR = "r1"
3LICENSE = "Apache-2.0"
4LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"
5
6inherit systemd
7
8S = "${WORKDIR}"
9
Willy Tu4dd03ca2021-08-06 09:37:35 -070010SRC_URI:append = " \
Willy Tudba90832021-02-10 11:55:58 -080011 file://firmware-updates.target \
12 file://firmware-updates-pre.target \
William A. Kennington III1cf2b962023-03-29 18:51:15 -070013 file://gbmc-log-ramoops.service \
William A. Kennington III5ba6d082021-03-10 19:24:22 -080014 file://40-gbmc-forward.conf \
William A. Kennington III6888f372023-04-12 16:42:28 -070015 file://40-gbmc-sysctl.conf \
William A. Kennington IIIaa814b32022-10-26 16:50:30 -070016 file://40-gbmc-time.conf \
Willy Tu511ffa92023-05-03 17:35:04 -070017 file://10-gbmc.conf \
Willy Tudba90832021-02-10 11:55:58 -080018 "
19
Willy Tu4dd03ca2021-08-06 09:37:35 -070020FILES:${PN}:append = " \
Willy Tudba90832021-02-10 11:55:58 -080021 ${systemd_unitdir}/coredump.conf.d/40-gbmc-coredump.conf \
22 ${systemd_unitdir}/resolved.conf.d/40-gbmc-nomdns.conf \
William A. Kennington IIIaa814b32022-10-26 16:50:30 -070023 ${systemd_unitdir}/timesyncd.conf.d/40-gbmc-time.conf \
William A. Kennington III6888f372023-04-12 16:42:28 -070024 ${libdir}/sysctl.d/40-gbmc-sysctl.conf \
William A. Kennington III5ba6d082021-03-10 19:24:22 -080025 ${libdir}/sysctl.d/40-gbmc-forward.conf \
Willy Tu511ffa92023-05-03 17:35:04 -070026 ${systemd_system_unitdir}/sysinit.target.wants/systemd-time-wait-sync.service \
27 ${systemd_system_unitdir}/systemd-time-wait-sync.d/10-gbmc.conf \
Willy Tudba90832021-02-10 11:55:58 -080028 "
29
Willy Tu4dd03ca2021-08-06 09:37:35 -070030FILES:${PN}:append:dev = " \
Willy Tudba90832021-02-10 11:55:58 -080031 ${libdir}/sysctl.d/40-gbmc-debug.conf \
32 "
33
Willy Tu4dd03ca2021-08-06 09:37:35 -070034SYSTEMD_SERVICE:${PN}:append = " \
Willy Tudba90832021-02-10 11:55:58 -080035 firmware-updates.target \
36 firmware-updates-pre.target \
William A. Kennington III1cf2b962023-03-29 18:51:15 -070037 gbmc-log-ramoops.service \
Willy Tudba90832021-02-10 11:55:58 -080038 "
39
40# Put coredumps in the journal to ensure they stay in ram
41do_install() {
William A. Kennington III5ba6d082021-03-10 19:24:22 -080042 install -d -m 0755 ${D}${systemd_unitdir}/coredump.conf.d
43 printf "[Coredump]\nStorage=journal\n" \
44 >${D}${systemd_unitdir}/coredump.conf.d/40-gbmc-coredump.conf
Willy Tudba90832021-02-10 11:55:58 -080045
William A. Kennington III5ba6d082021-03-10 19:24:22 -080046 install -d -m 0755 ${D}${systemd_unitdir}/resolved.conf.d
47 printf "[Resolve]\nLLMNR=no\nMulticastDNS=resolve\n" \
48 >${D}${systemd_unitdir}/resolved.conf.d/40-gbmc-nomdns.conf
Willy Tudba90832021-02-10 11:55:58 -080049
William A. Kennington III5ba6d082021-03-10 19:24:22 -080050 install -d -m 0755 ${D}${systemd_system_unitdir}
51 install -m 0644 ${WORKDIR}/firmware-updates.target ${D}${systemd_system_unitdir}/
52 install -m 0644 ${WORKDIR}/firmware-updates-pre.target ${D}${systemd_system_unitdir}/
William A. Kennington III1cf2b962023-03-29 18:51:15 -070053 install -m 0644 ${WORKDIR}/gbmc-log-ramoops.service ${D}${systemd_system_unitdir}/
54
55 # mask systemd-pstore.service to avoid copying logs to SPI
56 mkdir -p ${D}${sysconfdir}/systemd/system
57 ln -sv /dev/null ${D}${sysconfdir}/systemd/system/systemd-pstore.service
William A. Kennington III5ba6d082021-03-10 19:24:22 -080058
59 install -d -m0755 ${D}${libdir}/sysctl.d
60 install -m 0644 ${WORKDIR}/40-gbmc-forward.conf ${D}${libdir}/sysctl.d/
William A. Kennington III6888f372023-04-12 16:42:28 -070061 install -m 0644 ${WORKDIR}/40-gbmc-sysctl.conf ${D}${libdir}/sysctl.d/
Willy Tu2696b0a2021-08-14 18:38:58 -070062
William A. Kennington IIIaa814b32022-10-26 16:50:30 -070063 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 Tu511ffa92023-05-03 17:35:04 -070065
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/
68 mkdir -p ${D}${systemd_system_unitdir}/systemd-time-wait-sync.d/
69 install -D -m0644 ${WORKDIR}/10-gbmc.conf ${D}${systemd_system_unitdir}/systemd-time-wait-sync.d/
Willy Tudba90832021-02-10 11:55:58 -080070}
71
Willy Tu4dd03ca2021-08-06 09:37:35 -070072do_install:append:dev() {
William A. Kennington III5ba6d082021-03-10 19:24:22 -080073 printf "kernel.sysrq = 1\n" \
74 >${D}${libdir}/sysctl.d/40-gbmc-debug.conf
Willy Tudba90832021-02-10 11:55:58 -080075}