From 9eac2788d7d3e4943f7a0db0e1e0cbb148242247 Mon Sep 17 00:00:00 2001 From: Benjamin Block Date: Wed, 29 Jun 2022 19:15:12 +0200 Subject: [PATCH] Makefile: use common Make definition for UDEVDIR and UDEVRULESDIR MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Peter Oberparleiter Signed-off-by: Jan Höppner --- chreipl-fcp-mpath/chreipl-fcp-mpath.mak | 2 -- common.mak | 2 ++ zdev/udev/Makefile | 5 ++--- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/chreipl-fcp-mpath/chreipl-fcp-mpath.mak b/chreipl-fcp-mpath/chreipl-fcp-mpath.mak index d6299d39..d1e1ab1d 100644 --- a/chreipl-fcp-mpath/chreipl-fcp-mpath.mak +++ b/chreipl-fcp-mpath/chreipl-fcp-mpath.mak @@ -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 diff --git a/common.mak b/common.mak index 788717e2..fbcfdc1b 100644 --- a/common.mak +++ b/common.mak @@ -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) diff --git a/zdev/udev/Makefile b/zdev/udev/Makefile index 3372eee7..588801e5 100644 --- a/zdev/udev/Makefile +++ b/zdev/udev/Makefile @@ -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)/