]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
units: skip systemd-battery-check in environments where it doesn't make sense
authorLennart Poettering <lennart@poettering.net>
Mon, 3 Jul 2023 11:36:08 +0000 (13:36 +0200)
committerLuca Boccassi <luca.boccassi@gmail.com>
Mon, 3 Jul 2023 15:38:42 +0000 (16:38 +0100)
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.

units/systemd-battery-check.service.in

index 3de8ba1d8eb92b69cb94f9ec113a5d4bc52e183d..61f4ae16e08c92b948be65fcdddd9dca9c902ce0 100644 (file)
 [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