2023-06-28 13:04:42 +00:00
|
|
|
# SPDX-License-Identifier: LGPL-2.1-or-later
|
|
|
|
#
|
|
|
|
# This file is part of systemd.
|
|
|
|
#
|
|
|
|
# systemd is free software; you can redistribute it and/or modify it
|
|
|
|
# under the terms of the GNU Lesser General Public License as published by
|
|
|
|
# the Free Software Foundation; either version 2.1 of the License, or
|
|
|
|
# (at your option) any later version.
|
|
|
|
|
|
|
|
[Unit]
|
|
|
|
Description=Check battery level during early boot
|
2023-06-30 15:09:21 +00:00
|
|
|
Documentation=man:systemd-battery-check.service(8)
|
2023-07-03 11:36:08 +00:00
|
|
|
ConditionVirtualization=no
|
|
|
|
ConditionDirectoryNotEmpty=/sys/class/power_supply/
|
2024-02-28 14:31:27 +00:00
|
|
|
ConditionKernelCommandLine=!systemd.battery_check=0
|
2024-03-19 08:11:45 +00:00
|
|
|
ConditionKernelCommandLine=!systemd.battery-check=0
|
2023-06-28 13:04:42 +00:00
|
|
|
AssertPathExists=/etc/initrd-release
|
2023-07-03 11:36:08 +00:00
|
|
|
DefaultDependencies=no
|
2023-06-30 15:09:21 +00:00
|
|
|
After=plymouth-start.service
|
2023-09-02 11:16:44 +00:00
|
|
|
Before=initrd-root-device.target systemd-hibernate-resume.service
|
2023-06-28 13:04:42 +00:00
|
|
|
|
|
|
|
[Service]
|
|
|
|
Type=oneshot
|
|
|
|
RemainAfterExit=yes
|
2023-06-12 01:15:19 +00:00
|
|
|
ExecStart={{LIBEXECDIR}}/systemd-battery-check
|
2023-06-28 13:04:42 +00:00
|
|
|
FailureAction=poweroff-force
|