dracut-systemd/dracut-initqueue: only start service if really needed
[dracut.git] / modules.d / 98dracut-systemd / module-setup.sh
blobd9175573c777565cd8158623467b7a413c50bbd1
1 #!/bin/bash
3 # called by dracut
4 check() {
5 [[ $mount_needs ]] && return 1
7 if ! dracut_module_included "systemd-initrd"; then
8 derror "dracut-systemd needs systemd-initrd in the initramfs"
9 return 1
12 return 0
15 # called by dracut
16 depends() {
17 echo "systemd-initrd"
18 return 0
21 installkernel() {
22 return 0
25 # called by dracut
26 install() {
27 local _mods
28 inst_script "$moddir/dracut-emergency.sh" /bin/dracut-emergency
29 inst_simple "$moddir/emergency.service" ${systemdsystemunitdir}/emergency.service
30 inst_simple "$moddir/dracut-emergency.service" ${systemdsystemunitdir}/dracut-emergency.service
31 inst_simple "$moddir/emergency.service" ${systemdsystemunitdir}/rescue.service
33 ln_r "${systemdsystemunitdir}/initrd.target" "${systemdsystemunitdir}/default.target"
35 inst_script "$moddir/dracut-cmdline.sh" /bin/dracut-cmdline
36 inst_script "$moddir/dracut-cmdline-ask.sh" /bin/dracut-cmdline-ask
37 inst_script "$moddir/dracut-pre-udev.sh" /bin/dracut-pre-udev
38 inst_script "$moddir/dracut-pre-trigger.sh" /bin/dracut-pre-trigger
39 inst_script "$moddir/dracut-initqueue.sh" /bin/dracut-initqueue
40 inst_script "$moddir/dracut-pre-mount.sh" /bin/dracut-pre-mount
41 inst_script "$moddir/dracut-mount.sh" /bin/dracut-mount
42 inst_script "$moddir/dracut-pre-pivot.sh" /bin/dracut-pre-pivot
44 inst_script "$moddir/rootfs-generator.sh" $systemdutildir/system-generators/dracut-rootfs-generator
46 for i in \
47 emergency.target \
48 rescue.service \
49 systemd-ask-password-console.service \
50 systemd-ask-password-plymouth.service \
51 ; do
52 mkdir -p "${initdir}${systemdsystemunitdir}/${i}.wants"
53 ln_r "${systemdsystemunitdir}/systemd-vconsole-setup.service" \
54 "${systemdsystemunitdir}/${i}.wants/systemd-vconsole-setup.service"
55 done
57 mkdir -p "${initdir}/$systemdsystemunitdir/initrd.target.wants"
58 for i in \
59 dracut-cmdline.service \
60 dracut-cmdline-ask.service \
61 dracut-initqueue.service \
62 dracut-mount.service \
63 dracut-pre-mount.service \
64 dracut-pre-pivot.service \
65 dracut-pre-trigger.service \
66 dracut-pre-udev.service \
67 ; do
68 inst_simple "$moddir/${i}" "$systemdsystemunitdir/${i}"
69 ln_r "$systemdsystemunitdir/${i}" "$systemdsystemunitdir/initrd.target.wants/${i}"
70 done
72 inst_simple "$moddir/dracut-tmpfiles.conf" "$tmpfilesdir/dracut-tmpfiles.conf"