From: Jóhann B. Guðmundsson Date: Thu, 22 Apr 2021 19:29:13 +0000 (+0000) Subject: refactor: check() in systemd modules X-Git-Tag: 054~84 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2f217abdb36cc5ace9c136101d5a5e10fcd3feda;p=thirdparty%2Fdracut.git refactor: check() in systemd modules Refactoring require_binaries in check() for systemd modules --- diff --git a/modules.d/01systemd-ask-password/module-setup.sh b/modules.d/01systemd-ask-password/module-setup.sh index 228cadbb1..c8b59e9a6 100755 --- a/modules.d/01systemd-ask-password/module-setup.sh +++ b/modules.d/01systemd-ask-password/module-setup.sh @@ -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 diff --git a/modules.d/01systemd-coredump/module-setup.sh b/modules.d/01systemd-coredump/module-setup.sh index c6b8be879..6dde78f90 100755 --- a/modules.d/01systemd-coredump/module-setup.sh +++ b/modules.d/01systemd-coredump/module-setup.sh @@ -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 diff --git a/modules.d/01systemd-hostnamed/module-setup.sh b/modules.d/01systemd-hostnamed/module-setup.sh index ff73a4a26..2082f295c 100755 --- a/modules.d/01systemd-hostnamed/module-setup.sh +++ b/modules.d/01systemd-hostnamed/module-setup.sh @@ -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 diff --git a/modules.d/01systemd-resolved/module-setup.sh b/modules.d/01systemd-resolved/module-setup.sh index 9fd1dc18c..044164b36 100755 --- a/modules.d/01systemd-resolved/module-setup.sh +++ b/modules.d/01systemd-resolved/module-setup.sh @@ -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 diff --git a/modules.d/01systemd-timesyncd/module-setup.sh b/modules.d/01systemd-timesyncd/module-setup.sh index 277fa024f..0b0bb1cfe 100755 --- a/modules.d/01systemd-timesyncd/module-setup.sh +++ b/modules.d/01systemd-timesyncd/module-setup.sh @@ -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