From fc53987bec1bc71b054d99072f62c1770a44bcca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B3hann=20B=2E=20Gu=C3=B0mundsson?= Date: Mon, 19 Apr 2021 19:19:39 +0000 Subject: [PATCH] fix(systemd): remove old systemd version requirements --- modules.d/00systemd/module-setup.sh | 37 +++++++---------------------- 1 file changed, 9 insertions(+), 28 deletions(-) diff --git a/modules.d/00systemd/module-setup.sh b/modules.d/00systemd/module-setup.sh index 0fd7481f5..809cd6c46 100755 --- a/modules.d/00systemd/module-setup.sh +++ b/modules.d/00systemd/module-setup.sh @@ -1,29 +1,14 @@ #!/bin/bash +# This file is part of dracut. +# SPDX-License-Identifier: GPL-2.0-or-later -getSystemdVersion() { - [ -z "$SYSTEMD_VERSION" ] && SYSTEMD_VERSION=$("$systemdutildir"/systemd --version | { - read -r _ b _ - echo "$b" - }) - # Check if the systemd version is a valid number - if ! [[ $SYSTEMD_VERSION =~ ^[0-9]+$ ]]; then - dfatal "systemd version is not a number ($SYSTEMD_VERSION)" - exit 1 - fi - - echo "$SYSTEMD_VERSION" -} - -# called by dracut +# Prerequisite check(s) for module. check() { [[ $mount_needs ]] && return 1 - if require_binaries "$systemdutildir"/systemd; then - SYSTEMD_VERSION=$(getSystemdVersion) - ((SYSTEMD_VERSION >= 198)) && return 0 - return 255 - fi - - return 1 + # If the binary(s) requirements are not fulfilled the module can't be installed + require_binaries "$systemdutildir"/systemd || return 1 + # Return 255 to only include the module, if another module requires it. + return 255 } # called by dracut @@ -45,12 +30,6 @@ install() { exit 1 fi - if [[ $(getSystemdVersion) -ge 240 ]]; then - inst_multiple -o \ - "$systemdutildir"/system-generators/systemd-debug-generator \ - "$systemdsystemunitdir"/debug-shell.service - fi - inst_multiple -o \ "$systemdutildir"/systemd \ "$systemdutildir"/systemd-coredump \ @@ -64,9 +43,11 @@ install() { "$systemdutildir"/systemd-modules-load \ "$systemdutildir"/systemd-vconsole-setup \ "$systemdutildir"/systemd-volatile-root \ + "$systemdutildir"/system-generators/systemd-debug-generator \ "$systemdutildir"/system-generators/systemd-fstab-generator \ "$systemdutildir"/system-generators/systemd-gpt-auto-generator \ \ + "$systemdsystemunitdir"/debug-shell.service \ "$systemdsystemunitdir"/cryptsetup.target \ "$systemdsystemunitdir"/cryptsetup-pre.target \ "$systemdsystemunitdir"/remote-cryptsetup.target \