From 71461d80bf7e72e446b2977d2a4f0c33d3e07f83 Mon Sep 17 00:00:00 2001 From: Benjamin Block Date: Wed, 29 Jun 2022 19:33:20 +0200 Subject: [PATCH] Makefile: use common Make definition for DRACUTDIR MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The dracut installation directory is referenced from `chreipl-fcp-mpath`, `zdev`, and `zipl`; in each with its own individual definition and variable name. This makes it unnecessarily hard to change it when installing from the top level directory of s390-tools and passing variable overwrites via the command line. Fix this by defining a common `DRACUTDIR` variable in the shared `common.mak` file, and referencing this in each tool as base directory. With this a user can simply pass `DRACUTDIR=/foo/bar/baz` on the commandline and change the installation for all three tools. Further, also derive common `DRACUTCONFDIR` and `DRACUTMODDIR` variables from `DRACUTDIR` in `common.mak`, so that `zdev` and `zipl` don't use different variable names for the same directory anymore, and all these are defined together in a common place. 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 | 3 +++ zdev/dracut/Makefile | 7 +++---- zipl/dracut/Makefile | 13 ++++++------- 4 files changed, 12 insertions(+), 13 deletions(-) diff --git a/chreipl-fcp-mpath/chreipl-fcp-mpath.mak b/chreipl-fcp-mpath/chreipl-fcp-mpath.mak index d1e1ab1d..b9db9c8e 100644 --- a/chreipl-fcp-mpath/chreipl-fcp-mpath.mak +++ b/chreipl-fcp-mpath/chreipl-fcp-mpath.mak @@ -28,8 +28,6 @@ ENABLE_DOC = 0 # https://www.gnu.org/software/make/manual/make.html#Directory-Variables CHREIPLZFCPMPDIR = $(USRLIBDIR)/chreipl-fcp-mpath UDEVRUNDIR = /run/udev -DRACUTDIR = $(USRLIBDIR)/dracut -DRACUTCONFDIR = $(DRACUTDIR)/dracut.conf.d DEBUGOUTDIR = $(UDEVRUNDIR) INSTALL_EXEC = $(INSTALL) -g $(GROUP) -o $(OWNER) --preserve-timestamps diff --git a/common.mak b/common.mak index fbcfdc1b..dabea8dc 100644 --- a/common.mak +++ b/common.mak @@ -195,6 +195,9 @@ USRINCLUDEDIR = $(INSTALLDIR)/usr/include ZKEYKMSPLUGINDIR = $(USRLIB64DIR)/zkey UDEVDIR = $(USRLIBDIR)/udev UDEVRULESDIR = $(UDEVDIR)/rules.d +DRACUTDIR = $(USRLIBDIR)/dracut +DRACUTCONFDIR = $(DRACUTDIR)/dracut.conf.d +DRACUTMODDIR = $(DRACUTDIR)/modules.d ifeq ($(LIBDIR),$(INSTALLDIR)/lib) SOINSTALLDIR = $(USRLIB64DIR) diff --git a/zdev/dracut/Makefile b/zdev/dracut/Makefile index 835de706..17329d22 100644 --- a/zdev/dracut/Makefile +++ b/zdev/dracut/Makefile @@ -1,7 +1,6 @@ # Common definitions include ../../common.mak -MODDIR := /usr/lib/dracut/modules.d/ ZDEVDIR := 95zdev # HAVE_DRACUT @@ -16,9 +15,9 @@ ZDEVDIR := 95zdev # ifeq ($(HAVE_DRACUT),1) install: - $(INSTALL) -m 755 -d $(DESTDIR)$(MODDIR) - $(INSTALL) -m 755 -d $(DESTDIR)$(MODDIR)/$(ZDEVDIR) + $(INSTALL) -m 755 -d $(DESTDIR)$(DRACUTMODDIR)/ + $(INSTALL) -m 755 -d $(DESTDIR)$(DRACUTMODDIR)/$(ZDEVDIR) $(INSTALL) -m 755 $(ZDEVDIR)/module-setup.sh \ $(ZDEVDIR)/parse-zdev.sh \ - $(DESTDIR)$(MODDIR)/$(ZDEVDIR)/ + $(DESTDIR)$(DRACUTMODDIR)/$(ZDEVDIR)/ endif diff --git a/zipl/dracut/Makefile b/zipl/dracut/Makefile index 16634fda..bcb6b1f9 100644 --- a/zipl/dracut/Makefile +++ b/zipl/dracut/Makefile @@ -1,7 +1,6 @@ include ../../common.mak -MODULESDIR := /usr/lib/dracut/modules.d/ NGDUMPDIR := 99ngdump # HAVE_DRACUT @@ -17,14 +16,14 @@ ifeq ($(HAVE_DRACUT),1) install: $(INSTALL) -m 755 zipl_helper.prepare-ngdump \ $(DESTDIR)$(TOOLS_LIBDIR) - $(INSTALL) -m 755 -d $(DESTDIR)$(MODULESDIR) - $(INSTALL) -m 755 -d $(DESTDIR)$(MODULESDIR)/$(NGDUMPDIR) + $(INSTALL) -m 755 -d $(DESTDIR)$(DRACUTMODDIR)/ + $(INSTALL) -m 755 -d $(DESTDIR)$(DRACUTMODDIR)/$(NGDUMPDIR) $(INSTALL) -m 755 $(NGDUMPDIR)/module-setup.sh \ - $(DESTDIR)$(MODULESDIR)/$(NGDUMPDIR)/ + $(DESTDIR)$(DRACUTMODDIR)/$(NGDUMPDIR)/ $(INSTALL) -m 644 $(NGDUMPDIR)/ngdump.service \ - $(DESTDIR)$(MODULESDIR)/$(NGDUMPDIR)/ + $(DESTDIR)$(DRACUTMODDIR)/$(NGDUMPDIR)/ $(INSTALL) -m 755 $(NGDUMPDIR)/ngdump.sh \ - $(DESTDIR)$(MODULESDIR)/$(NGDUMPDIR)/ + $(DESTDIR)$(DRACUTMODDIR)/$(NGDUMPDIR)/ $(INSTALL) -m 755 $(NGDUMPDIR)/ngdump-reipl.sh \ - $(DESTDIR)$(MODULESDIR)/$(NGDUMPDIR)/ + $(DESTDIR)$(DRACUTMODDIR)/$(NGDUMPDIR)/ endif