mirror of
https://github.com/systemd/systemd
synced 2024-10-06 16:21:34 +00:00
battery-check: rework unit
Let's rename the unit to systemd-battery-check.service. We usually want to name our own unit files like our tools they wrap, in particular if they are entirely defined by us (i.e. not just wrappers of foreign concepts) While we are at it, also hook this in from initrd.target, and order it against initrd-root-device.target so that it runs before the root device is possibly written to (i.e. mounted or fsck'ed). This is heavily inspired by @aafeijoo-suse's PR #28208, but quite different ;-)
This commit is contained in:
parent
a5e478b24c
commit
95dafd30da
|
@ -23,7 +23,6 @@ manpages = [
|
||||||
['hostname', '5', [], ''],
|
['hostname', '5', [], ''],
|
||||||
['hostnamectl', '1', [], 'ENABLE_HOSTNAMED'],
|
['hostnamectl', '1', [], 'ENABLE_HOSTNAMED'],
|
||||||
['hwdb', '7', [], 'ENABLE_HWDB'],
|
['hwdb', '7', [], 'ENABLE_HWDB'],
|
||||||
['initrd-battery-check.service', '8', ['systemd-battery-check'], ''],
|
|
||||||
['integritytab', '5', [], 'HAVE_LIBCRYPTSETUP'],
|
['integritytab', '5', [], 'HAVE_LIBCRYPTSETUP'],
|
||||||
['iocost.conf', '5', [], ''],
|
['iocost.conf', '5', [], ''],
|
||||||
['journal-remote.conf', '5', ['journal-remote.conf.d'], 'HAVE_MICROHTTPD'],
|
['journal-remote.conf', '5', ['journal-remote.conf.d'], 'HAVE_MICROHTTPD'],
|
||||||
|
@ -889,6 +888,7 @@ manpages = [
|
||||||
''],
|
''],
|
||||||
['systemd-ask-password', '1', [], ''],
|
['systemd-ask-password', '1', [], ''],
|
||||||
['systemd-backlight@.service', '8', ['systemd-backlight'], 'ENABLE_BACKLIGHT'],
|
['systemd-backlight@.service', '8', ['systemd-backlight'], 'ENABLE_BACKLIGHT'],
|
||||||
|
['systemd-battery-check.service', '8', ['systemd-battery-check'], ''],
|
||||||
['systemd-binfmt.service', '8', ['systemd-binfmt'], 'ENABLE_BINFMT'],
|
['systemd-binfmt.service', '8', ['systemd-binfmt'], 'ENABLE_BINFMT'],
|
||||||
['systemd-bless-boot-generator', '8', [], 'ENABLE_BOOTLOADER'],
|
['systemd-bless-boot-generator', '8', [], 'ENABLE_BOOTLOADER'],
|
||||||
['systemd-bless-boot.service',
|
['systemd-bless-boot.service',
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
|
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
|
||||||
<!-- SPDX-License-Identifier: LGPL-2.1-or-later -->
|
<!-- SPDX-License-Identifier: LGPL-2.1-or-later -->
|
||||||
|
|
||||||
<refentry id="initrd-battery-check.service" xmlns:xi="http://www.w3.org/2001/XInclude">
|
<refentry id="systemd-battery-check.service" xmlns:xi="http://www.w3.org/2001/XInclude">
|
||||||
|
|
||||||
<refentryinfo>
|
<refentryinfo>
|
||||||
<title>systemd-battery-check</title>
|
<title>systemd-battery-check</title>
|
||||||
|
@ -11,18 +11,18 @@
|
||||||
</refentryinfo>
|
</refentryinfo>
|
||||||
|
|
||||||
<refmeta>
|
<refmeta>
|
||||||
<refentrytitle>initrd-battery-check.service</refentrytitle>
|
<refentrytitle>systemd-battery-check.service</refentrytitle>
|
||||||
<manvolnum>8</manvolnum>
|
<manvolnum>8</manvolnum>
|
||||||
</refmeta>
|
</refmeta>
|
||||||
|
|
||||||
<refnamediv>
|
<refnamediv>
|
||||||
<refname>initrd-battery-check.service</refname>
|
<refname>systemd-battery-check.service</refname>
|
||||||
<refname>systemd-battery-check</refname>
|
<refname>systemd-battery-check</refname>
|
||||||
<refpurpose>Check battery level whether there's enough charge, and power off if not.</refpurpose>
|
<refpurpose>Check battery level whether there's enough charge, and power off if not.</refpurpose>
|
||||||
</refnamediv>
|
</refnamediv>
|
||||||
|
|
||||||
<refsynopsisdiv>
|
<refsynopsisdiv>
|
||||||
<para><filename>initrd-battery-check.service</filename></para>
|
<para><filename>systemd-battery-check.service</filename></para>
|
||||||
<cmdsynopsis>
|
<cmdsynopsis>
|
||||||
<command>/usr/lib/systemd/systemd-battery-check</command>
|
<command>/usr/lib/systemd/systemd-battery-check</command>
|
||||||
<arg choice="opt" rep="repeat">OPTIONS</arg>
|
<arg choice="opt" rep="repeat">OPTIONS</arg>
|
||||||
|
@ -33,7 +33,7 @@
|
||||||
<title>Description</title>
|
<title>Description</title>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
<filename>initrd-battery-check.service</filename> is used to check the battery level during the early
|
<filename>systemd-battery-check.service</filename> is used to check the battery level during the early
|
||||||
boot stage to determine whether there's sufficient battery power to carry on with the booting process.
|
boot stage to determine whether there's sufficient battery power to carry on with the booting process.
|
||||||
</para>
|
</para>
|
||||||
<para>
|
<para>
|
|
@ -56,8 +56,9 @@ units = [
|
||||||
'conditions' : ['ENABLE_HIBERNATE'],
|
'conditions' : ['ENABLE_HIBERNATE'],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'file' : 'initrd-battery-check.service.in',
|
'file' : 'systemd-battery-check.service.in',
|
||||||
'conditions' : ['ENABLE_INITRD'],
|
'conditions' : ['ENABLE_INITRD'],
|
||||||
|
'symlinks' : ['initrd.target.wants/'],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'file' : 'initrd-cleanup.service',
|
'file' : 'initrd-cleanup.service',
|
||||||
|
|
|
@ -9,10 +9,11 @@
|
||||||
|
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Check battery level during early boot
|
Description=Check battery level during early boot
|
||||||
Documentation=man:initrd-battery-check.service(8)
|
Documentation=man:systemd-battery-check.service(8)
|
||||||
DefaultDependencies=no
|
DefaultDependencies=no
|
||||||
AssertPathExists=/etc/initrd-release
|
AssertPathExists=/etc/initrd-release
|
||||||
Before=local-fs-pre.target
|
After=plymouth-start.service
|
||||||
|
Before=initrd-root-device.target
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=oneshot
|
Type=oneshot
|
Loading…
Reference in a new issue