]> git.ipfire.org Git - thirdparty/dracut.git/blob - modules.d/01systemd-tmpfiles/module-setup.sh
fix: codespell
[thirdparty/dracut.git] / modules.d / 01systemd-tmpfiles / module-setup.sh
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-tmpfiles || 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 # Return 0 to include the dependent module(s) in the initramfs.
20 return 0
21
22 }
23
24 # Install the required file(s) and directories for the module in the initramfs.
25 install() {
26
27 # Excluding "$tmpfilesdir/home.conf", sets up /home /srv
28 # Excluding "$tmpfilesdir/journal-nocow.conf", requires specific btrfs setup
29 # Excluding "$tmpfilesdir/legacy.conf", belongs in separated legacy module
30 # Excluding "$tmpfilesdir/systemd-nologin.conf", belongs in separated pam module
31 # Excluding "$tmpfilesdir/systemd-nspawn.conf", belongs in separated machined module
32 # Excluding "$tmpfilesdir/x11.conf", belongs in separated x11 module
33
34 inst_multiple -o \
35 /usr/lib/group \
36 /usr/lib/passwd \
37 "$tmpfilesdir/etc.conf" \
38 "$tmpfilesdir/static-nodes-permissions.conf" \
39 "$tmpfilesdir/systemd-tmp.conf" \
40 "$tmpfilesdir/systemd.conf" \
41 "$tmpfilesdir/var.conf" \
42 "$systemdsystemunitdir"/systemd-tmpfiles-clean.service \
43 "$systemdsystemunitdir/systemd-tmpfiles-clean.service.d/*.conf" \
44 "$systemdsystemunitdir"/systemd-tmpfiles-setup.service \
45 "$systemdsystemunitdir/systemd-tmpfiles-setup.service.d/*.conf" \
46 "$systemdsystemunitdir"/systemd-tmpfiles-setup-dev.service \
47 "$systemdsystemunitdir/systemd-tmpfiles-setup-dev.service.d/*.conf" \
48 "$systemdsystemunitdir"/systemd-tmpfiles-setup-dev-early.service \
49 "$systemdsystemunitdir/systemd-tmpfiles-setup-dev-early.service.d/*.conf" \
50 "$systemdsystemunitdir"/sysinit.target.wants/systemd-tmpfiles-setup.service \
51 "$systemdsystemunitdir"/sysinit.target.wants/systemd-tmpfiles-setup-dev.service \
52 "$systemdsystemunitdir"/sysinit.target.wants/systemd-tmpfiles-setup-dev-early.service \
53 systemd-tmpfiles
54
55 # Install the hosts local user configurations if enabled.
56 if [[ $hostonly ]]; then
57 inst_multiple -H -o \
58 /etc/group \
59 /etc/passwd \
60 "$tmpfilesconfdir/*.conf" \
61 "$systemdsystemconfdir"/systemd-tmpfiles-clean.service \
62 "$systemdsystemconfdir/systemd-tmpfiles-clean.service.d/*.conf" \
63 "$systemdsystemconfdir"/systemd-tmpfiles-setup.service \
64 "$systemdsystemconfdir/systemd-tmpfiles-setup.service.d/*.conf" \
65 "$systemdsystemconfdir"/systemd-tmpfiles-setup-dev.service \
66 "$systemdsystemconfdir/systemd-tmpfiles-setup-dev.service.d/*.conf" \
67 "$systemdsystemconfdir"/systemd-tmpfiles-setup-dev-early.service \
68 "$systemdsystemconfdir/systemd-tmpfiles-setup-dev-early.service.d/*.conf"
69 fi
70
71 }