From: Lennart Poettering Date: Mon, 3 Jul 2023 11:36:08 +0000 (+0200) Subject: units: skip systemd-battery-check in environments where it doesn't make sense X-Git-Tag: v254-rc1~48 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c65e3d7a9b4f25f2e83ac859bab359b8f8377eb1;p=thirdparty%2Fsystemd.git units: skip systemd-battery-check in environments where it doesn't make sense Let's condition the service so that it doesn't run where we aren't directly run on baremetal, or where no power sources are discovered at all. --- diff --git a/units/systemd-battery-check.service.in b/units/systemd-battery-check.service.in index 3de8ba1d8eb..61f4ae16e08 100644 --- a/units/systemd-battery-check.service.in +++ b/units/systemd-battery-check.service.in @@ -10,8 +10,10 @@ [Unit] Description=Check battery level during early boot Documentation=man:systemd-battery-check.service(8) -DefaultDependencies=no +ConditionVirtualization=no +ConditionDirectoryNotEmpty=/sys/class/power_supply/ AssertPathExists=/etc/initrd-release +DefaultDependencies=no After=plymouth-start.service Before=initrd-root-device.target