Skip to content

Commit 3d4dea5

Browse files
johannbgharaldh
authored andcommitted
feat(systemd-verity): introducing the systemd-verity module
Introducing the systemd-verity module.
1 parent ec18a3e commit 3d4dea5

File tree

2 files changed

+61
-0
lines changed

2 files changed

+61
-0
lines changed

dracut.spec

+1
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,7 @@ echo 'dracut_rescue_image="yes"' > $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/
335335
%{dracutlibdir}/modules.d/01systemd-sysusers
336336
%{dracutlibdir}/modules.d/01systemd-timedated
337337
%{dracutlibdir}/modules.d/01systemd-timesyncd
338+
%{dracutlibdir}/modules.d/01systemd-verity
338339
%{dracutlibdir}/modules.d/03modsign
339340
%{dracutlibdir}/modules.d/03rescue
340341
%{dracutlibdir}/modules.d/04watchdog
+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
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 \
10+
"$systemdutildir"/systemd-veritysetup \
11+
"$systemdutildir"/system-generators/systemd-veritysetup-generator \
12+
|| return 1
13+
14+
# Return 255 to only include the module, if another module requires it.
15+
return 255
16+
17+
}
18+
19+
# Module dependency requirements.
20+
depends() {
21+
22+
# This module has external dependency on other module(s).
23+
echo systemd dm
24+
# Return 0 to include the dependent module(s) in the initramfs.
25+
return 0
26+
27+
}
28+
29+
# Install the required file(s) and directories for the module in the initramfs.
30+
install() {
31+
32+
inst_multiple -o \
33+
"$systemdutildir"/systemd-veritysetup \
34+
"$systemdutildir"/system-generators/systemd-veritysetup-generator \
35+
"$systemdsystemunitdir"/remote-veritysetup.target \
36+
"$systemdsystemunitdir"/veritysetup-pre.target \
37+
"$systemdsystemunitdir"/veritysetup.target \
38+
"$systemdsystemunitdir"/sysinit.target.wants/veritysetup.target \
39+
"$systemdsystemunitdir"/initrd-root-device.target.wants/remote-veritysetup.target
40+
41+
# Install the hosts local user configurations if enabled.
42+
if [[ $hostonly ]]; then
43+
inst_multiple -H -o \
44+
/etc/veritytab \
45+
"$systemdsystemconfdir"/veritysetup.target \
46+
"$systemdsystemconfdir/veritysetup.target.wants/*.target" \
47+
"$systemdsystemconfdir"/veritysetup-pre.target \
48+
"$systemdsystemconfdir/veritysetup-pre.target.wants/*.target" \
49+
"$systemdsystemconfdir"/remote-veritysetup.target \
50+
"$systemdsystemconfdir/remote-veritysetup.target.wants/*.target" \
51+
"$systemdsystemconfdir"/sysinit.target.wants/veritysetup.target \
52+
"$systemdsystemconfdir/sysinit.target.wants/veritysetup.target.wants/*.target" \
53+
"$systemdsystemconfdir"/initrd-root-device.target.wants/remote-cryptsetup.target
54+
fi
55+
56+
# Install required libraries.
57+
_arch=${DRACUT_ARCH:-$(uname -m)}
58+
inst_libdir_file {"tls/$_arch/",tls/,"$_arch/",}"libcryptsetup.so.*"
59+
60+
}

0 commit comments

Comments
 (0)