Makefile: use common Make definition for UDEVDIR and UDEVRULESDIR

UDEVDIR is used in both `chreipl-fcp-mpath` and `zdev`, but with a
different meaning. In the former it points to the base udev directory,
not the rules directory; in the later it points to the rules directory.
If someone was to call `make` from the top level directory, and set
UDEVDIR for the whole build/installation, it would either break `zdev`
or `chreipl-fcp-mpath` (depending on what it was set to).

Fix this by pulling the definition of it in the shared `common.mak`
file, and giving it a common meaning. Point UDEVDIR to the base udev
directory, and UDEVRULESDIR to the rules directory below it.

Semantically nothing changes for a default build/installation.

Signed-off-by: Benjamin Block <bblock@linux.ibm.com>
Reviewed-by: Peter Oberparleiter <oberpar@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
Benjamin Block
2022-06-29 19:15:12 +02:00
committed by Jan Höppner
parent 6ff8202fa9
commit 9eac2788d7
3 changed files with 4 additions and 5 deletions

View File

@@ -27,8 +27,6 @@ ENABLE_DOC = 0
# https://www.gnu.org/software/make/manual/make.html#Directory-Variables
CHREIPLZFCPMPDIR = $(USRLIBDIR)/chreipl-fcp-mpath
UDEVDIR = $(USRLIBDIR)/udev
UDEVRULESDIR = $(UDEVDIR)/rules.d
UDEVRUNDIR = /run/udev
DRACUTDIR = $(USRLIBDIR)/dracut
DRACUTCONFDIR = $(DRACUTDIR)/dracut.conf.d

View File

@@ -193,6 +193,8 @@ ZFCPDUMP_DIR = $(TOOLS_LIBDIR)/zfcpdump
SYSTEMDSYSTEMUNITDIR =
USRINCLUDEDIR = $(INSTALLDIR)/usr/include
ZKEYKMSPLUGINDIR = $(USRLIB64DIR)/zkey
UDEVDIR = $(USRLIBDIR)/udev
UDEVRULESDIR = $(UDEVDIR)/rules.d
ifeq ($(LIBDIR),$(INSTALLDIR)/lib)
SOINSTALLDIR = $(USRLIB64DIR)

View File

@@ -1,9 +1,8 @@
# Common definitions
include ../../common.mak
UDEVDIR := /usr/lib/udev/rules.d/
RULES := 81-dpm.rules
install:
$(INSTALL) -m 755 -d $(DESTDIR)$(UDEVDIR)
$(INSTALL) -m 644 $(RULES) $(DESTDIR)$(UDEVDIR)/
$(INSTALL) -m 755 -d $(DESTDIR)$(UDEVRULESDIR)
$(INSTALL) -m 644 $(RULES) $(DESTDIR)$(UDEVRULESDIR)/