Initial commit

This commit is contained in:
Your Name
2026-04-23 17:07:55 +08:00
commit b7e39e063b
16725 changed files with 1625565 additions and 0 deletions
@@ -0,0 +1,17 @@
SUMMARY = "Phosphor systemd configuration overrides"
DESCRIPTION = "Overrides for systemd and its applications"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"
DEPENDS += "systemd"
PR = "r1"
SRC_URI += "file://service-restart-policy.conf"
SRC_URI += "file://journald-maxlevel-policy.conf"
do_install() {
install -m 644 -D ${WORKDIR}/service-restart-policy.conf ${D}${systemd_unitdir}/system.conf.d/service-restart-policy.conf
install -m 644 -D ${WORKDIR}/journald-maxlevel-policy.conf ${D}${systemd_unitdir}/journald.conf.d/journald-maxlevel-policy.conf
}
FILES:${PN} += "${systemd_unitdir}/system.conf.d/service-restart-policy.conf"
FILES:${PN} += "${systemd_unitdir}/journald.conf.d/journald-maxlevel-policy.conf"
@@ -0,0 +1,6 @@
# Don't store "debug" messages, only "info" and below.
# Reference: journald.conf(5)
[Journal]
MaxLevelStore=info
MaxLevelSyslog=info
@@ -0,0 +1,31 @@
# This file overrides some defaults for systemd
#
# - Change the RestartSec from 100ms to 1s.
# When a service hits a failure, our new debug collection service kicks
# in. When a core file is involved, it's been found that generating 5 core
# files within ~500ms puts a huge strain on the BMC. Also, if the bmc is
# going to get a fix on a restart of a service, the more time the better
# (think retries on device driver scenarios).
#
# - Change the StartLimitBurst to 2
# Five just seems excessive for our services in openbmc. In all fail
# scenarios seen so far (other then with phosphor-hwmon), either
# restarting once does the job or restarting all 5 times does not help
# and we just end up hitting the 5 limit anyway.
#
# - Change the StartLimitIntervalSec to 30s
# The BMC CPU performance is already challenged. When a service is
# failing and a core dump is being generated and collected into a dump,
# it's even more challenged. Recent failures have shown situations where
# the service does not fail again until 15-20 seconds after the initial
# failure which means the default of 10s for this results in the service
# being restarted indefinitely. Change this to 30s to only allow a service
# to be restarted StartLimitBurst times within a 30s interval before
# being put in a permanent fail state.
#
# See systemd-system.conf(5) for details on the conf files
[Manager]
DefaultRestartSec=1s
DefaultStartLimitBurst=2
DefaultStartLimitIntervalSec=30s
@@ -0,0 +1,5 @@
[Manager]
RuntimeWatchdogSec=120s
RuntimeWatchdogPreSec=90s
RuntimeWatchdogPreGovernor=panic
WatchdogDevice=/dev/watchdog
@@ -0,0 +1,54 @@
FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
PACKAGECONFIG = "\
cgroupv2 \
coredump \
hostnamed \
networkd \
nss \
pam \
pstore \
randomseed \
resolved \
seccomp \
sysusers \
timedated \
timesyncd \
zstd \
"
EXTRA_OEMESON:append = " -Ddns-servers=''"
PACKAGES =+ "${PN}-catalog-extralocales"
RRECOMMENDS:${PN}:append:openbmc-phosphor = " phosphor-systemd-policy"
FILES:${PN}-catalog-extralocales = "\
${exec_prefix}/lib/systemd/catalog/*.*.catalog \
"
SRC_URI:append = " \
file://40-hardware-watchdog.conf \
"
FILES:${PN}:append = " \
${systemd_unitdir}/system.conf.d/40-hardware-watchdog.conf \
"
do_install:append() {
install -d -m 0755 ${D}${systemd_unitdir}/system.conf.d/
install -m 0644 ${WORKDIR}/40-hardware-watchdog.conf ${D}${systemd_unitdir}/system.conf.d/
}
# udev is added to the USERADD_PACKAGES due to some 'render' group
# being necessary to create for /dev/dri handling, which we don't
# have to worry about. A side-effect of this is udev would RDEPEND on
# 'shadow' which prevents us from putting it into the initramfs. We
# have plenty of other stuff that RDEPENDS on 'shadow' so, remove udev
# from USERADD_PACKAGES to get around that.
USERADD_PACKAGES:remove = "udev"
ALTERNATIVE_LINK_NAME[init] = "${base_sbindir}/init"
ALTERNATIVE_PRIORITY[init] ?= "300"
ALTERNATIVE:${PN} += "init"
ALTERNATIVE_TARGET[init] = "${rootlibexecdir}/systemd/systemd"