From: Lennart Poettering Date: Fri, 30 Jun 2023 15:09:21 +0000 (+0200) Subject: battery-check: rework unit X-Git-Tag: v254-rc1~64 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=95dafd30da88bfeffdc3556dccc113709a13dbae;p=thirdparty%2Fsystemd.git 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 ;-) --- diff --git a/man/rules/meson.build b/man/rules/meson.build index e8c5a967ad9..8fc158bd910 100644 --- a/man/rules/meson.build +++ b/man/rules/meson.build @@ -23,7 +23,6 @@ manpages = [ ['hostname', '5', [], ''], ['hostnamectl', '1', [], 'ENABLE_HOSTNAMED'], ['hwdb', '7', [], 'ENABLE_HWDB'], - ['initrd-battery-check.service', '8', ['systemd-battery-check'], ''], ['integritytab', '5', [], 'HAVE_LIBCRYPTSETUP'], ['iocost.conf', '5', [], ''], ['journal-remote.conf', '5', ['journal-remote.conf.d'], 'HAVE_MICROHTTPD'], @@ -889,6 +888,7 @@ manpages = [ ''], ['systemd-ask-password', '1', [], ''], ['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-bless-boot-generator', '8', [], 'ENABLE_BOOTLOADER'], ['systemd-bless-boot.service', diff --git a/man/initrd-battery-check.service.xml b/man/systemd-battery-check.service.xml similarity index 83% rename from man/initrd-battery-check.service.xml rename to man/systemd-battery-check.service.xml index 582b2269fb5..2d9005696eb 100644 --- a/man/initrd-battery-check.service.xml +++ b/man/systemd-battery-check.service.xml @@ -3,7 +3,7 @@ "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> - + systemd-battery-check @@ -11,18 +11,18 @@ - initrd-battery-check.service + systemd-battery-check.service 8 - initrd-battery-check.service + systemd-battery-check.service systemd-battery-check Check battery level whether there's enough charge, and power off if not. - initrd-battery-check.service + systemd-battery-check.service /usr/lib/systemd/systemd-battery-check OPTIONS @@ -33,7 +33,7 @@ Description - initrd-battery-check.service is used to check the battery level during the early + systemd-battery-check.service 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. diff --git a/units/meson.build b/units/meson.build index a552dd6c3fb..5161ec50299 100644 --- a/units/meson.build +++ b/units/meson.build @@ -56,8 +56,9 @@ units = [ 'conditions' : ['ENABLE_HIBERNATE'], }, { - 'file' : 'initrd-battery-check.service.in', + 'file' : 'systemd-battery-check.service.in', 'conditions' : ['ENABLE_INITRD'], + 'symlinks' : ['initrd.target.wants/'], }, { 'file' : 'initrd-cleanup.service', diff --git a/units/initrd-battery-check.service.in b/units/systemd-battery-check.service.in similarity index 83% rename from units/initrd-battery-check.service.in rename to units/systemd-battery-check.service.in index 052586f3c78..3de8ba1d8eb 100644 --- a/units/initrd-battery-check.service.in +++ b/units/systemd-battery-check.service.in @@ -9,10 +9,11 @@ [Unit] Description=Check battery level during early boot -Documentation=man:initrd-battery-check.service(8) +Documentation=man:systemd-battery-check.service(8) DefaultDependencies=no AssertPathExists=/etc/initrd-release -Before=local-fs-pre.target +After=plymouth-start.service +Before=initrd-root-device.target [Service] Type=oneshot