]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
refactor: check() in systemd modules
authorJóhann B. Guðmundsson <johannbg@gmail.com>
Thu, 22 Apr 2021 19:29:13 +0000 (19:29 +0000)
committerHarald Hoyer <harald@hoyer.xyz>
Fri, 23 Apr 2021 08:48:54 +0000 (10:48 +0200)
Refactoring require_binaries in check() for systemd modules

modules.d/01systemd-ask-password/module-setup.sh
modules.d/01systemd-coredump/module-setup.sh
modules.d/01systemd-hostnamed/module-setup.sh
modules.d/01systemd-resolved/module-setup.sh
modules.d/01systemd-timesyncd/module-setup.sh

index 228cadbb1f54f7a6981dba711839dcec8eafb56a..c8b59e9a6f8db042a49476e11f862fb65ccb2730 100755 (executable)
@@ -6,8 +6,10 @@
 check() {
 
     # If the binary(s) requirements are not fulfilled the module can't be installed
-    require_binaries systemd-ask-password || return 1
-    require_binaries systemd-tty-ask-password-agent || return 1
+    require_binaries \
+        systemd-ask-password \
+        systemd-tty-ask-password-agent \
+        || return 1
 
     # Return 255 to only include the module, if another module requires it.
     return 255
index c6b8be879491d73bbf6a31ef24418d5e2cfc5ca4..6dde78f90fbbb812d79a767f4ddfeff56fe0dca1 100755 (executable)
@@ -6,8 +6,10 @@
 check() {
 
     # If the binary(s) requirements are not fulfilled the module can't be installed
-    require_binaries coredumpctl || return 1
-    require_binaries "$systemdutildir"/systemd-coredump || return 1
+    require_binaries \
+        coredumpctl \
+        "$systemdutildir"/systemd-coredump \
+        || return 1
 
     # Return 255 to only include the module, if another module requires it.
     return 255
index ff73a4a269c3d8e3430800ac069e3985957a3ceb..2082f295cfdc580c890969907b925817f41b7fa5 100755 (executable)
@@ -6,8 +6,10 @@
 check() {
 
     # If the binary(s) requirements are not fulfilled the module can't be installed.
-    require_binaries hostnamectl || return 1
-    require_binaries "$systemdutildir"/systemd-hostnamed || return 1
+    require_binaries \
+        hostnamectl \
+        "$systemdutildir"/systemd-hostnamed \
+        || return 1
 
     # Return 255 to only include the module, if another module requires it.
     return 255
index 9fd1dc18c710fe7988fb3a5e49b43609c9c44dc2..044164b3603b5e291904b0062e2a42983b8cb06c 100755 (executable)
@@ -6,8 +6,10 @@
 check() {
 
     # If the binary(s) requirements are not fulfilled the module can't be installed
-    require_binaries resolvectl || return 1
-    require_binaries "$systemdutildir"/systemd-resolved || return 1
+    require_binaries \
+        resolvectl \
+        "$systemdutildir"/systemd-resolved \
+        || return 1
 
     # Return 255 to only include the module, if another module requires it.
     return 255
index 277fa024f410018a7527cb2c001f0b8c5e6b7c72..0b0bb1cfe038bc5f8cb3d1e60536cef29eca3efb 100755 (executable)
@@ -6,8 +6,10 @@
 check() {
 
     # If the binary(s) requirements are not fulfilled the module can't be installed
-    require_binaries "$systemdutildir"/systemd-timesyncd || return 1
-    require_binaries "$systemdutildir"/systemd-time-wait-sync || return 1
+    require_binaries \
+        "$systemdutildir"/systemd-timesyncd \
+        "$systemdutildir"/systemd-time-wait-sync \
+        || return 1
 
     # Return 255 to only include the module, if another module requires it.
     return 255