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 <kjeld@schouten-lebbing.nl>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Harald van Dijk <harald@gigawatt.nl>
Closes #10898
This commit is contained in:
Harald van Dijk 2020-09-12 16:22:07 +01:00 committed by GitHub
parent 9b77c57d5a
commit d0cea309e7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 6 deletions

View File

@ -35,7 +35,7 @@ deb-dkms: deb-local rpm-dkms
fakeroot $(ALIEN) --bump=0 --scripts --to-deb --target=$$debarch $$pkg1 || exit 1; \ fakeroot $(ALIEN) --bump=0 --scripts --to-deb --target=$$debarch $$pkg1 || exit 1; \
$(RM) $$pkg1 $(RM) $$pkg1
deb-utils: deb-local rpm-utils deb-utils: deb-local rpm-utils-initramfs
name=${PACKAGE}; \ name=${PACKAGE}; \
version=${VERSION}-${RELEASE}; \ version=${VERSION}-${RELEASE}; \
arch=`$(RPM) -qp $${name}-$${version}.src.rpm --qf %{arch} | tail -1`; \ arch=`$(RPM) -qp $${name}-$${version}.src.rpm --qf %{arch} | tail -1`; \

View File

@ -7,7 +7,7 @@
############################################################################### ###############################################################################
PHONY += srpm srpms srpm-kmod srpm-dkms srpm-utils 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 PHONY += srpm-common rpm-common rpm-local
srpm-kmod srpm-dkms srpm-utils: dist srpm-kmod srpm-dkms srpm-utils: dist
@ -35,10 +35,22 @@ rpm-dkms: srpm-dkms
$(MAKE) $(AM_MAKEFLAGS) pkg="${PACKAGE}-dkms" \ $(MAKE) $(AM_MAKEFLAGS) pkg="${PACKAGE}-dkms" \
def='${RPM_DEFINE_COMMON} ${RPM_DEFINE_DKMS}' rpm-common 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 rpm-utils: srpm-utils
$(MAKE) $(AM_MAKEFLAGS) pkg="${PACKAGE}" \ $(MAKE) $(AM_MAKEFLAGS) pkg="${PACKAGE}" \
def='${RPM_DEFINE_COMMON} ${RPM_DEFINE_UTIL}' rpm-common 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 rpm: rpm-kmod rpm-dkms rpm-utils
rpms: rpm-kmod rpm-dkms rpm-utils rpms: rpm-kmod rpm-dkms rpm-utils

View File

@ -282,7 +282,6 @@ AC_DEFUN([ZFS_AC_RPM], [
AS_IF([test -n "$udevruledir" ], [ AS_IF([test -n "$udevruledir" ], [
RPM_DEFINE_UTIL=${RPM_DEFINE_UTIL}' --define "_udevruledir $(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_SYSTEMD)'
RPM_DEFINE_UTIL=${RPM_DEFINE_UTIL}' $(DEFINE_PYZFS)' RPM_DEFINE_UTIL=${RPM_DEFINE_UTIL}' $(DEFINE_PYZFS)'
RPM_DEFINE_UTIL=${RPM_DEFINE_UTIL}' $(DEFINE_PAM)' 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]) AC_MSG_CHECKING([whether initramfs-tools is available])
if test -d /usr/share/initramfs-tools ; then if test -d /usr/share/initramfs-tools ; then
DEFINE_INITRAMFS='--define "_initramfs 1"' RPM_DEFINE_INITRAMFS='--define "_initramfs 1"'
AC_MSG_RESULT([yes]) AC_MSG_RESULT([yes])
else else
DEFINE_INITRAMFS='' RPM_DEFINE_INITRAMFS=''
AC_MSG_RESULT([no]) AC_MSG_RESULT([no])
fi fi
AC_SUBST(DEFINE_INITRAMFS) AC_SUBST(RPM_DEFINE_INITRAMFS)
]) ])
dnl # dnl #