summaryrefslogtreecommitdiff
path: root/libopeniscsiusr
diff options
context:
space:
mode:
authorLee Duncan <lduncan@suse.com>2021-10-28 09:15:37 -0700
committerLee Duncan <lduncan@suse.com>2021-10-28 09:15:37 -0700
commita5f09ce5855d448d14148dfe46ce595bfb18cea8 (patch)
treec39c0d5d67cd4522dc19aa039af4b82a0fe436d2 /libopeniscsiusr
parent4353670c281ccd4dd1c028be8c806797580ecd66 (diff)
downloadopen-iscsi-a5f09ce5855d448d14148dfe46ce595bfb18cea8.tar.gz
Finish ability to have binary location configurable.
A Recent commit, fff82c57f5df ("Use "sbindir" for path in systemd service files") added the ability to have our binaries in another location rather than /sbin (e.g. /usr/sbin), but it was incomplete. This commit finishes the job. Fixes: fff82c57f5dfe6d3db795f1195b4d2ebc497d33c
Diffstat (limited to 'libopeniscsiusr')
-rw-r--r--libopeniscsiusr/Makefile4
-rw-r--r--libopeniscsiusr/iface.c5
2 files changed, 8 insertions, 1 deletions
diff --git a/libopeniscsiusr/Makefile b/libopeniscsiusr/Makefile
index 06b09f5..ae4c364 100644
--- a/libopeniscsiusr/Makefile
+++ b/libopeniscsiusr/Makefile
@@ -11,6 +11,8 @@ endif
DESTDIR ?=
prefix ?= /usr
INSTALL ?= install
+exec_prefix = /
+sbindir = $(exec_prefix)/sbin
ifndef LIB_DIR
ifeq ($(shell test -d /lib64 && echo 1),1)
@@ -24,6 +26,7 @@ INCLUDE_DIR ?= $(prefix)/include
PKGCONF_DIR ?= $(LIB_DIR)/pkgconfig
PKG_CONFIG = /usr/bin/pkg-config
+SED = /usr/bin/sed
LIBISCSI_USR_DIR=$(TOPDIR)/libopeniscsiusr
@@ -47,6 +50,7 @@ OBJS = context.o misc.o session.o sysfs.o iface.o idbm.o node.o default.o
CFLAGS ?= -O2 -g
CFLAGS += -Wall -Werror -Wextra -fvisibility=hidden -fPIC
CFLAGS += $(shell $(PKG_CONFIG) --cflags libkmod)
+CFLAGS += -DSBINDIR=$(sbindir)
LDFLAGS += $(shell $(PKG_CONFIG) --libs libkmod)
diff --git a/libopeniscsiusr/iface.c b/libopeniscsiusr/iface.c
index 63f9c61..a8c004c 100644
--- a/libopeniscsiusr/iface.c
+++ b/libopeniscsiusr/iface.c
@@ -44,7 +44,10 @@
#include "idbm.h"
#include "default.h"
-#define ISCSIUIO_PATH "/sbin/iscsiuio"
+#ifndef SBINDIR
+#define SBINDIR "/sbin"
+#endif
+#define ISCSIUIO_PATH SBINDIR "/iscsiuio"
struct _iscsi_net_drv {
const char *net_driver_name; // Ethernet driver.