]> git.ipfire.org Git - thirdparty/dracut.git/blob - modules.d/01systemd-initrd/module-setup.sh
feat(dracut.sh): allow overriding the systemctl command for sysroot
[thirdparty/dracut.git] / modules.d / 01systemd-initrd / module-setup.sh
1 #!/bin/bash
2
3 # called by dracut
4 check() {
5 [[ $mount_needs ]] && return 1
6
7 if ! dracut_module_included "systemd"; then
8 derror "systemd-initrd needs systemd in the initramfs"
9 return 1
10 fi
11
12 return 0
13 }
14
15 # called by dracut
16 depends() {
17 echo "systemd"
18 }
19
20 installkernel() {
21 return 0
22 }
23
24 # called by dracut
25 install() {
26 local _mods
27
28 inst_multiple -o \
29 $systemdsystemunitdir/initrd.target \
30 $systemdsystemunitdir/initrd-fs.target \
31 $systemdsystemunitdir/initrd-root-device.target \
32 $systemdsystemunitdir/initrd-root-fs.target \
33 $systemdsystemunitdir/initrd-switch-root.target \
34 $systemdsystemunitdir/initrd-switch-root.service \
35 $systemdsystemunitdir/initrd-cleanup.service \
36 $systemdsystemunitdir/initrd-udevadm-cleanup-db.service \
37 $systemdsystemunitdir/initrd-parse-etc.service
38
39 $SYSTEMCTL -q --root "$initdir" set-default initrd.target
40 }