From d0cea309e7e2c3de7d08be017341b6c42f3366c9 Mon Sep 17 00:00:00 2001 From: Harald van Dijk Date: Sat, 12 Sep 2020 16:22:07 +0100 Subject: [PATCH] config/zfs-build.m4: never define _initramfs in RPM_DEFINE_UTIL The zfs-initramfs package has never worked as no RPM-based distribution uses initramfs-tools, which is listed as a dependency of zfs-initramfs. This would not ordinarily be a problem, as it is only enabled when /usr/share/initramfs-tools is present, which should not normally be the case on RPM-based distributions. However, other packages may install unused files there even if initramfs-tools is not used, so remove this auto-detection for the rpm-utils target. This does not fully remove the logic for the zfs-initramfs package. This splits it out into a separate rpm-utils-initramfs target so that the Debian builds can still use it. Reviewed-by: Kjeld Schouten Reviewed-by: Brian Behlendorf Signed-off-by: Harald van Dijk Closes #10898 --- config/deb.am | 2 +- config/rpm.am | 14 +++++++++++++- config/zfs-build.m4 | 7 +++---- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/config/deb.am b/config/deb.am index 88679545a..79063e407 100644 --- a/config/deb.am +++ b/config/deb.am @@ -35,7 +35,7 @@ deb-dkms: deb-local rpm-dkms fakeroot $(ALIEN) --bump=0 --scripts --to-deb --target=$$debarch $$pkg1 || exit 1; \ $(RM) $$pkg1 -deb-utils: deb-local rpm-utils +deb-utils: deb-local rpm-utils-initramfs name=${PACKAGE}; \ version=${VERSION}-${RELEASE}; \ arch=`$(RPM) -qp $${name}-$${version}.src.rpm --qf %{arch} | tail -1`; \ diff --git a/config/rpm.am b/config/rpm.am index 9dd69ade3..13bd54a62 100644 --- a/config/rpm.am +++ b/config/rpm.am @@ -7,7 +7,7 @@ ############################################################################### PHONY += srpm srpms srpm-kmod srpm-dkms srpm-utils -PHONY += rpm rpms rpm-kmod rpm-dkms rpm-utils +PHONY += rpm rpms rpm-kmod rpm-dkms rpm-utils rpm-utils-initramfs PHONY += srpm-common rpm-common rpm-local srpm-kmod srpm-dkms srpm-utils: dist @@ -35,10 +35,22 @@ rpm-dkms: srpm-dkms $(MAKE) $(AM_MAKEFLAGS) pkg="${PACKAGE}-dkms" \ def='${RPM_DEFINE_COMMON} ${RPM_DEFINE_DKMS}' rpm-common +# The rpm-utils and rpm-utils-initramfs targets are identical except for the +# zfs-initramfs package: rpm-utils never includes it, rpm-utils-initramfs +# includes it if detected at configure time. The zfs-initramfs package does +# not work on any known RPM-based distribution and the resulting RPM is only +# used to create a Debian package. The rpm-utils-initramfs target is not +# intended to be specified by the user directly, it is provided as a +# dependency of the deb-utils target. + rpm-utils: srpm-utils $(MAKE) $(AM_MAKEFLAGS) pkg="${PACKAGE}" \ def='${RPM_DEFINE_COMMON} ${RPM_DEFINE_UTIL}' rpm-common +rpm-utils-initramfs: srpm-utils + $(MAKE) $(AM_MAKEFLAGS) pkg="${PACKAGE}" \ + def='${RPM_DEFINE_COMMON} ${RPM_DEFINE_UTIL} ${RPM_DEFINE_INITRAMFS}' rpm-common + rpm: rpm-kmod rpm-dkms rpm-utils rpms: rpm-kmod rpm-dkms rpm-utils diff --git a/config/zfs-build.m4 b/config/zfs-build.m4 index 2f0aca830..7754eda3f 100644 --- a/config/zfs-build.m4 +++ b/config/zfs-build.m4 @@ -282,7 +282,6 @@ AC_DEFUN([ZFS_AC_RPM], [ AS_IF([test -n "$udevruledir" ], [ RPM_DEFINE_UTIL=${RPM_DEFINE_UTIL}' --define "_udevruledir $(udevruledir)"' ]) - RPM_DEFINE_UTIL=${RPM_DEFINE_UTIL}' $(DEFINE_INITRAMFS)' RPM_DEFINE_UTIL=${RPM_DEFINE_UTIL}' $(DEFINE_SYSTEMD)' RPM_DEFINE_UTIL=${RPM_DEFINE_UTIL}' $(DEFINE_PYZFS)' RPM_DEFINE_UTIL=${RPM_DEFINE_UTIL}' $(DEFINE_PAM)' @@ -542,13 +541,13 @@ AC_DEFUN([ZFS_AC_DEFAULT_PACKAGE], [ AC_MSG_CHECKING([whether initramfs-tools is available]) if test -d /usr/share/initramfs-tools ; then - DEFINE_INITRAMFS='--define "_initramfs 1"' + RPM_DEFINE_INITRAMFS='--define "_initramfs 1"' AC_MSG_RESULT([yes]) else - DEFINE_INITRAMFS='' + RPM_DEFINE_INITRAMFS='' AC_MSG_RESULT([no]) fi - AC_SUBST(DEFINE_INITRAMFS) + AC_SUBST(RPM_DEFINE_INITRAMFS) ]) dnl #