summaryrefslogtreecommitdiffstats
path: root/meta-networking/recipes-support/drbd/drbd-utils/0001-fix-the-hardcoded-legacy-helper-path.patch
blob: 3d7c95b4a8675987db27d2eef7fdf1315cc1d901 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
From 301e64db17466316ac34a28e30867cc7853777b5 Mon Sep 17 00:00:00 2001
From: Haiqing Bai <Haiqing.Bai@windriver.com>
Date: Thu, 16 Apr 2026 10:00:19 +0000
Subject: [PATCH] Fix the hardcoded legacy helper path

Fix the below issue:
"~# drbdadm --version
execvp() failed to exec drbdadm-84: No such file or directory"

The legacy helper path was hardcoded to "/lib/drbd", which does not exist
on systems where LIBDIR is configured to a different location (e.g.
/usr/lib). This caused drbdadm to fail when attempting to exec drbdadm-84.
Use the build-configured DRBD_LEGACY_LIB_DIR (derived from LIBDIR) instead
of the hardcoded path, so the legacy helper lookup respects the actual
install prefix.

Upstream-Status: Pending

Signed-off-by: Haiqing Bai <haiqing.bai@windriver.com>
---
 user/v9/Makefile.in       | 1 +
 user/v9/drbdtool_common.c | 3 +--
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/user/v9/Makefile.in b/user/v9/Makefile.in
index fa12f79..980c67c 100644
--- a/user/v9/Makefile.in
+++ b/user/v9/Makefile.in
@@ -70,6 +70,7 @@ CFLAGS += -DKEYUTILS
 endif
 ifeq ($(WITH_84_SUPPORT),yes)
 CFLAGS += -DWITH_84_SUPPORT
+CFLAGS += -DDRBD_LEGACY_LIB_DIR=\"$(LIBDIR)\"
 endif
 CFLAGS += $(EXTRA_CFLAGS)
 
diff --git a/user/v9/drbdtool_common.c b/user/v9/drbdtool_common.c
index d07d054..ea95a16 100644
--- a/user/v9/drbdtool_common.c
+++ b/user/v9/drbdtool_common.c
@@ -332,8 +332,7 @@ void add_component_to_path(const char *path)
 
 void add_lib_drbd_to_path(void)
 {
-		/* TODO: if exec-prefix != "/" ? */
-	add_component_to_path("/lib/drbd");
+	add_component_to_path(DRBD_LEGACY_LIB_DIR);
 }
 
 /* from linux/crypto/crc32.c */
-- 
2.53.0