From 3d71c131f14d8bb83da965fb10d72bbdd48951ac Mon Sep 17 00:00:00 2001 From: liupei Date: Thu, 22 Feb 2024 16:19:47 +0800 Subject: [PATCH] Update scripts/drbd to fix "no such file" bug --- drbd-utils-9.21.4-fix-bug-no-such-file.patch | 21 ++++++++++++++++++++ drbd.spec | 8 +++++++- 2 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 drbd-utils-9.21.4-fix-bug-no-such-file.patch diff --git a/drbd-utils-9.21.4-fix-bug-no-such-file.patch b/drbd-utils-9.21.4-fix-bug-no-such-file.patch new file mode 100644 index 0000000..3478199 --- /dev/null +++ b/drbd-utils-9.21.4-fix-bug-no-such-file.patch @@ -0,0 +1,21 @@ +--- drbd-utils-9.21.4-ori/scripts/drbd 2024-02-22 15:12:35.464103000 +0800 ++++ drbd-utils-9.21.4/scripts/drbd 2024-02-22 15:47:10.763928000 +0800 +@@ -149,9 +149,15 @@ + local line dev file loop_mapping + + # new location +- loop_mapping=/var/lib/linstor.d/loop_device_mapping +- # fallback to old location +- [ -f "$loop_mapping" ] || loop_mapping=/var/lib/linstor/loop_device_mapping ++ if [ -f /var/lib/linstor.d/loop_device_mapping ]; then ++ loop_mapping=/var/lib/linstor.d/loop_device_mapping ++ # old location ++ elif [ -f /var/lib/linstor/loop_device_mapping ]; then ++ loop_mapping=/var/lib/linstor/loop_device_mapping ++ else ++ # nothing to do. ++ return 0 ++ fi + + # || [[ -n $line ]]: in case there is no newline at EOF + while read -r line || [[ -n $line ]] ; do diff --git a/drbd.spec b/drbd.spec index f5fc3f9..504fa1f 100644 --- a/drbd.spec +++ b/drbd.spec @@ -1,10 +1,12 @@ Name: drbd Summary: DRBD user-land tools and scripts Version: 9.21.4 -Release: 1 +Release: 2 Source0: http://www.linbit.com/downloads/%{name}/utils/%{name}-utils-%{version}.tar.gz Patch0: drbd-utils-9.12.2-disable_xsltproc_network_read.patch Patch1: drbd-utils-9.15.0-make_configure-workaround.patch +# https://github.com/LINBIT/drbd-utils/commit/0a825f1c859000b2143907b43a191e6dedb633f8 +Patch2: drbd-utils-9.21.4-fix-bug-no-such-file.patch License: GPLv2+ and MIT ExclusiveOS: linux @@ -40,6 +42,7 @@ This is a virtual package, installing the full user-land suite. # Don't let xsltproc make network calls during build %patch0 -p1 %patch1 -p1 +%patch2 -p1 %build %configure \ @@ -214,6 +217,9 @@ management utility. %systemd_preun drbd.service %changelog +* Thu Feb 22 2024 liupei - 9.21.4-2 +- Update scripts/drbd to fix "no such file" bug + * Mon Nov 27 2023 liupei - 9.21.4-1 - update to 9.21.4 -- Gitee