Skip to content

Commit cce3a04

Browse files
sharkczrarbab
authored andcommitted
external/opal-prd: generate path to opal-prd in its service file
Currently the path where to install the opal-prd binary is defined in the Makefile by the $sbindir variable, but its service files hard-codes the path to /usr/sbin/opal-prd. The build should generate the service file based on the actual $sbindir value. Also strip the trailing slash from the $prefix variable. Signed-off-by: Dan Horák <[email protected]> Signed-off-by: Reza Arbab <[email protected]>
1 parent 0b17fc2 commit cce3a04

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

external/opal-prd/Makefile

+5-2
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ LDFLAGS += -m64
44
ASFLAGS = -m64
55
CPPFLAGS += -I. -I../../include -I../../
66

7-
prefix = /usr/local/
7+
prefix = /usr/local
88
sbindir = $(prefix)/sbin
99
datadir = $(prefix)/share
1010
mandir = $(datadir)/man
1111

12-
all: links arch_links | opal-prd
12+
all: links arch_links | opal-prd opal-prd.service
1313

1414
GET_ARCH = ../../external/common/get_arch.sh
1515
include ../../external/common/rules.mk
@@ -51,6 +51,9 @@ version.c: ../../make_version.sh .version
5151
echo "const char version[] = \"$(OPAL_PRD_VERSION)\";" ;\
5252
fi) > $@
5353

54+
opal-prd.service: opal-prd.service.in
55+
sed -e 's|@sbindir@|$(sbindir)|g' $< > $@
56+
5457
.PHONY: VERSION-always
5558
.version: VERSION-always
5659
@echo $(OPAL_PRD_VERSION) > $@.tmp

external/opal-prd/opal-prd.service external/opal-prd/opal-prd.service.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ ConditionVirtualization=false
44
ConditionPathExists=/sys/firmware/devicetree/base/ibm,opal/diagnostics
55

66
[Service]
7-
ExecStart=/usr/sbin/opal-prd
7+
ExecStart=@sbindir@/opal-prd
88
Restart=always
99

1010
[Install]

0 commit comments

Comments
 (0)