Skip to content

Commit fc88af5

Browse files
johannbgharaldh
authored andcommitted
feat(systemd-sysext): introducing the systemd-sysext module
Introducing the systemd-sysext module.
1 parent 5a04bd2 commit fc88af5

File tree

2 files changed

+48
-0
lines changed

2 files changed

+48
-0
lines changed
+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
#!/bin/bash
2+
# This file is part of dracut.
3+
# SPDX-License-Identifier: GPL-2.0-or-later
4+
5+
# Prerequisite check(s) for module.
6+
check() {
7+
8+
# If the binary(s) requirements are not fulfilled the module can't be installed.
9+
require_binaries systemd-sysext || return 1
10+
11+
# Return 255 to only include the module, if another module requires it.
12+
return 255
13+
14+
}
15+
16+
# Module dependency requirements.
17+
depends() {
18+
19+
# This module has external dependency on other module(s).
20+
echo systemd
21+
# Return 0 to include the dependent module(s) in the initramfs.
22+
return 0
23+
24+
}
25+
26+
# Install the required file(s) and directories for the module in the initramfs.
27+
install() {
28+
29+
inst_multiple -o \
30+
"/usr/lib/extensions/*" \
31+
"/usr/lib/extension-release.d/extension-release.*" \
32+
"$systemdsystemunitdir"/systemd-sysext.service \
33+
"$systemdsystemunitdir/systemd-sysext.service.d/*.conf" \
34+
systemd-sysext
35+
36+
# Enable systemd type unit(s)
37+
$SYSTEMCTL -q --root "$initdir" enable systemd-sysext.service
38+
39+
# Install the hosts local user configurations if enabled.
40+
if [[ $hostonly ]]; then
41+
inst_multiple -H -o \
42+
"/etc/extensions/*" \
43+
"$systemdsystemconfdir"/systemd-sysext.service \
44+
"$systemdsystemconfdir/systemd-sysext.service.d/*.conf"
45+
fi
46+
47+
}

pkgbuild/dracut.spec

+1
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,7 @@ echo 'dracut_rescue_image="yes"' > $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/
334334
%{dracutlibdir}/modules.d/01systemd-repart
335335
%{dracutlibdir}/modules.d/01systemd-resolved
336336
%{dracutlibdir}/modules.d/01systemd-rfkill
337+
%{dracutlibdir}/modules.d/01systemd-sysext
337338
%{dracutlibdir}/modules.d/01systemd-sysctl
338339
%{dracutlibdir}/modules.d/01systemd-sysusers
339340
%{dracutlibdir}/modules.d/01systemd-timedated

0 commit comments

Comments
 (0)