- changed-files:
- any-glob-to-any-file: 'modules.d/[0-9][0-9]fips-crypto-policies/*'
+systemd-battery-check:
+ - changed-files:
+ - any-glob-to-any-file: 'modules.d/[0-9][0-9]systemd-battery-check/*'
+
systemd-ac-power:
- changed-files:
- any-glob-to-any-file: 'modules.d/[0-9][0-9]systemd-ac-power/*'
--- /dev/null
+#!/bin/bash
+# This file is part of dracut.
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+# Prerequisite check(s) for module.
+check() {
+ # If the binary(s) requirements are not fulfilled the module can't be installed
+ require_binaries "$systemdutildir"/systemd-battery-check || return 1
+
+ # Return 255 to only include the module, if another module requires it.
+ return 255
+}
+
+# Module dependency requirements.
+depends() {
+ # This module has external dependency on other module(s).
+ echo systemd
+ # Return 0 to include the dependent module(s) in the initramfs.
+ return 0
+}
+
+# Install the required file(s) for the module in the initramfs.
+install() {
+ inst_multiple \
+ "$systemdsystemunitdir"/systemd-battery-check.service \
+ "$systemdsystemunitdir"/initrd.target.wants/systemd-battery-check.service \
+ "$systemdutildir"/systemd-battery-check
+}
# TODO enable systemd-bsod for Gentoo
test_dracut \
- -m "resume dracut-systemd systemd-ac-power systemd-coredump systemd-creds systemd-cryptsetup systemd-integritysetup systemd-ldconfig systemd-pcrphase systemd-pstore systemd-repart systemd-sysext systemd-veritysetup" \
+ -m "systemd-battery-check resume dracut-systemd systemd-ac-power systemd-coredump systemd-creds systemd-cryptsetup systemd-integritysetup systemd-ldconfig systemd-pcrphase systemd-pstore systemd-repart systemd-sysext systemd-veritysetup" \
--add-drivers "btrfs" \
"$TESTDIR"/initramfs.testing