]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
Replace ln with systemctl
authorJan Macku <jamacku@redhat.com>
Fri, 8 Nov 2019 15:24:13 +0000 (16:24 +0100)
committerHarald Hoyer <harald@hoyer.xyz>
Tue, 14 Jan 2020 08:29:51 +0000 (09:29 +0100)
modules.d/00systemd/module-setup.sh
modules.d/01systemd-initrd/module-setup.sh
modules.d/02systemd-networkd/module-setup.sh
modules.d/06rngd/module-setup.sh
modules.d/90multipath/module-setup.sh
modules.d/90stratis/module-setup.sh
modules.d/95iscsi/module-setup.sh
modules.d/98dracut-systemd/module-setup.sh
modules.d/99squash/module-setup.sh

index 469f196db4b1076f4180d8272a8af5de1923722f..2e4274f2d83223bae4c15193aadfcb40065a0ff0 100755 (executable)
@@ -240,9 +240,7 @@ install() {
         systemd-ask-password-console.service \
         systemd-ask-password-plymouth.service \
         ; do
-        mkdir -p "${initdir}${systemdsystemunitdir}/${i}.wants"
-        ln_r "${systemdsystemunitdir}/systemd-vconsole-setup.service" \
-            "${systemdsystemunitdir}/${i}.wants/systemd-vconsole-setup.service"
+        systemctl -q --root "$initdir" add-wants "$i" systemd-vconsole-setup.service
     done
 
     mkdir -p "$initdir/etc/systemd"
@@ -254,6 +252,6 @@ install() {
         echo "RateLimitBurst=0"
     } >> "$initdir/etc/systemd/journald.conf"
 
-    ln_r "${systemdsystemunitdir}/multi-user.target" "${systemdsystemunitdir}/default.target"
+    systemctl -q --root "$initdir" set-default multi-user.target
 }
 
index 324009ccfba96246aa1b71a9fba81c3a6e51f434..c10e6ade57f1a9946438773ea9a6a4e9d2dd02be 100755 (executable)
@@ -36,6 +36,5 @@ install() {
         $systemdsystemunitdir/initrd-udevadm-cleanup-db.service \
         $systemdsystemunitdir/initrd-parse-etc.service
 
-    ln_r "${systemdsystemunitdir}/initrd.target" "${systemdsystemunitdir}/default.target"
+    systemctl -q --root "$initdir" set-default initrd.target
 }
-
index 1ab5902991a5d1b01a4f46c6f55e7a3c47b93cdd..d3e22f51ae0bd85d1ba3a7d1a5c2f487d8b07b72 100755 (executable)
@@ -61,11 +61,11 @@ install() {
 
     for i in \
         systemd-networkd-wait-online.service \
-            systemd-networkd.service \
-            systemd-networkd.socket
-#            systemd-timesyncd.service
+        systemd-networkd.service \
+        systemd-networkd.socket
+#       systemd-timesyncd.service
     do
-        systemctl --root "$initdir" enable "$i"
+        systemctl -q --root "$initdir" enable "$i"
     done
 }
 
index 43d5c2d3670c6d0513be174f0934626c0f7e3769..354bd0bb6554b3d484851a199fedcc5a1021afc7 100644 (file)
@@ -33,7 +33,6 @@ check() {
 install() {
     inst rngd
     inst_simple "${moddir}/rngd.service" "${systemdsystemunitdir}/rngd.service"
-    mkdir -p "${initdir}${systemdsystemunitdir}/sysinit.target.wants"
-    ln -rfs "${initdir}${systemdsystemunitdir}/rngd.service" \
-        "${initdir}${systemdsystemunitdir}/sysinit.target.wants/rngd.service"
+
+    systemctl -q --root "$initdir" add-wants sysinit.target rngd.service
 }
index f449052c7b6d393ced063504a15fcbfd470cf014..48a9d09a40af5b8faaf6f78302815b51993ecf0d 100755 (executable)
@@ -110,8 +110,7 @@ install() {
 
     if dracut_module_included "systemd"; then
         inst_simple "${moddir}/multipathd.service" "${systemdsystemunitdir}/multipathd.service"
-        mkdir -p "${initdir}${systemdsystemunitdir}/sysinit.target.wants"
-        ln -rfs "${initdir}${systemdsystemunitdir}/multipathd.service" "${initdir}${systemdsystemunitdir}/sysinit.target.wants/multipathd.service"
+        systemctl -q --root "$initdir" enable multipathd.service
     else
         inst_hook pre-trigger 02 "$moddir/multipathd.sh"
         inst_hook cleanup   02 "$moddir/multipathd-stop.sh"
index 29f0765b23a939c9130b0ca977b6eb6810690929..943f572ef7683e11bb07e1c6e69ddbb98cf387be 100755 (executable)
@@ -24,8 +24,7 @@ install() {
 
     if dracut_module_included "systemd"; then
         inst_simple "${moddir}/stratisd-init.service" "${systemdsystemunitdir}/stratisd-init.service"
-        mkdir -p "${initdir}${systemdsystemunitdir}/sysinit.target.wants"
-        ln -rfs "${initdir}${systemdsystemunitdir}/stratisd-init.service" "${initdir}${systemdsystemunitdir}/sysinit.target.wants/stratisd-init.service"
+        systemctl -q --root "$initdir" enable stratisd-init.service
     else
         inst_hook cmdline 25 "$moddir/stratisd-start.sh"
         inst_hook cleanup 25 "$moddir/stratisd-stop.sh"
index b172828d4f3b0bfd54a5b290b5ca021f0f4a6d36..19a8bdbd965e6f7a0d215b33a7d33636151fffe7 100755 (executable)
@@ -254,20 +254,18 @@ install() {
                       $systemdsystemunitdir/iscsiuio.socket \
                       iscsiadm iscsid
 
-        mkdir -p "${initdir}/$systemdsystemunitdir/sockets.target.wants"
         for i in \
                 iscsid.socket \
                 iscsiuio.socket \
             ; do
-            ln_r "$systemdsystemunitdir/${i}" "$systemdsystemunitdir/sockets.target.wants/${i}"
+            systemctl -q --root "$initdir" enable "$i"
         done
-
-        mkdir -p "${initdir}/$systemdsystemunitdir/basic.target.wants"
+        
         for i in \
                 iscsid.service \
                 iscsiuio.service \
             ; do
-            ln_r "$systemdsystemunitdir/${i}" "$systemdsystemunitdir/basic.target.wants/${i}"
+            systemctl -q --root "$initdir" add-wants basic.target "$i"
         done
 
         # Make sure iscsid is started after dracut-cmdline and ready for the initqueue
index 48779bf7d72c2ee97038b93d4d353d1c1ba1aa46..41b008e05f990034b9f6296f9b53aff0fca992d7 100755 (executable)
@@ -43,7 +43,6 @@ install() {
 
     inst_script "$moddir/rootfs-generator.sh" $systemdutildir/system-generators/dracut-rootfs-generator
 
-    mkdir -p "${initdir}/$systemdsystemunitdir/initrd.target.wants"
     for i in \
         dracut-cmdline.service \
         dracut-cmdline-ask.service \
@@ -55,7 +54,7 @@ install() {
         dracut-pre-udev.service \
         ; do
         inst_simple "$moddir/${i}" "$systemdsystemunitdir/${i}"
-        ln_r "$systemdsystemunitdir/${i}" "$systemdsystemunitdir/initrd.target.wants/${i}"
+        systemctl -q --root "$initdir" add-wants initrd.target "$i"
     done
 
     inst_simple "$moddir/dracut-tmpfiles.conf" "$tmpfilesdir/dracut-tmpfiles.conf"
index b79afb903ea149b6910c25afd4541e12561945ce..72fa81f07ca810901d3fd98af608fc3b80ae1b7c 100644 (file)
@@ -25,6 +25,5 @@ install() {
     inst $moddir/init.sh /squash/init.sh
 
     inst "$moddir/squash-mnt-clear.service" "$systemdsystemunitdir/squash-mnt-clear.service"
-    mkdir -p "$initdir$systemdsystemunitdir/initrd-switch-root.target.wants"
-    ln_r "$systemdsystemunitdir/squash-mnt-clear.service" "$systemdsystemunitdir/initrd-switch-root.target.wants/squash-mnt-clear.service"
+    systemctl -q --root "$initdir" add-wants initrd-switch-root.target squash-mnt-clear.service
 }