mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2024-11-17 01:51:00 +03:00
autoconf: use include directives instead of recursing down etc
dist diff: -zfs-2.1.99/etc/systemd/system/50-zfs.preset.in +zfs-2.1.99/etc/systemd/system/50-zfs.preset Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz> Closes #13316
This commit is contained in:
parent
50d2c9e4fd
commit
48f4379974
@ -4,9 +4,9 @@ INSTALL_DATA_HOOKS =
|
||||
ALL_LOCAL =
|
||||
CHECKS = shellcheck checkbashisms
|
||||
|
||||
include $(top_srcdir)/config/Shellcheck.am
|
||||
include $(top_srcdir)/config/Rules.am
|
||||
include $(top_srcdir)/config/CppCheck.am
|
||||
include $(top_srcdir)/config/Shellcheck.am
|
||||
include $(top_srcdir)/config/Substfiles.am
|
||||
|
||||
ACLOCAL_AMFLAGS = -I config
|
||||
@ -16,11 +16,11 @@ if BUILD_LINUX
|
||||
include $(srcdir)/%D%/rpm/Makefile.am
|
||||
endif
|
||||
|
||||
CPPCHECKDIRS += etc/systemd/system-generators
|
||||
if CONFIG_USER
|
||||
SUBDIRS += . tests etc
|
||||
SUBDIRS += . tests
|
||||
include $(srcdir)/%D%/cmd/Makefile.am
|
||||
include $(srcdir)/%D%/contrib/Makefile.am
|
||||
include $(srcdir)/%D%/etc/Makefile.am
|
||||
include $(srcdir)/%D%/lib/Makefile.am
|
||||
include $(srcdir)/%D%/man/Makefile.am
|
||||
include $(srcdir)/%D%/scripts/Makefile.am
|
||||
@ -98,7 +98,7 @@ dist-hook:
|
||||
PHONY += codecheck $(CHECKS)
|
||||
codecheck: $(CHECKS)
|
||||
|
||||
SHELLCHECKDIRS = etc tests
|
||||
SHELLCHECKDIRS = tests
|
||||
SHELLCHECKSCRIPTS += autogen.sh
|
||||
|
||||
PHONY += checkstyle
|
||||
|
@ -13,9 +13,9 @@ CPPCHECKTARGETS =
|
||||
cppcheck-recursive-%:
|
||||
$(MAKE) -C $(subst ^,/,$(subst cppcheck-recursive-,,$@)) cppcheck
|
||||
|
||||
_CTGT = $(subst -,_,$(subst .,_,$(subst cppcheck-for-,,$@)))
|
||||
_CTGT = $(subst cppcheck-for-,,$@)
|
||||
cppcheck-for-%:
|
||||
@[ -n "$($(_CTGT)_SOURCES)$(dist_$(_CTGT)_SOURCES)$(nodist_$(_CTGT)_SOURCES)" ]
|
||||
$(CPPCHECK) -j$(CPU_COUNT) $(CPPCHECKFLAGS) $(patsubst -U%,,$(patsubst -D%,,$(filter-out $(AM_CPPFLAGS_NOCHECK),$(or $($(_CTGT)_CPPFLAGS),$(AM_CPPFLAGS))))) $($(_CTGT)_SOURCES) $(dist_$(_CTGT)_SOURCES) $(nodist_$(_CTGT)_SOURCES)
|
||||
|
||||
cppcheck: $(addprefix cppcheck-for-,$(CPPCHECKTARGETS)) $(addprefix cppcheck-recursive-,$(subst /,^,$(CPPCHECKDIRS)))
|
||||
cppcheck: $(addprefix cppcheck-for-,$(subst -,_,$(subst .,_,$(subst /,_,$(CPPCHECKTARGETS))))) $(addprefix cppcheck-recursive-,$(CPPCHECKDIRS))
|
||||
|
@ -12,7 +12,7 @@ JUST_SHELLCHECK_OPTS = $(addprefix shellcheck-here-,$(subst /,^,$(1)))
|
||||
JUST_CHECKBASHISMS_OPTS = $(addprefix checkbashisms-here-,$(subst /,^,$(1)))
|
||||
SHELLCHECK_OPTS = $(call JUST_SHELLCHECK_OPTS,$(1)) $(call JUST_CHECKBASHISMS_OPTS,$(1))
|
||||
|
||||
.PHONY: shellcheck shellcheck-recursive
|
||||
PHONY += shellcheck shellcheck-recursive
|
||||
|
||||
shellcheck-recursive:
|
||||
@set -e; for dir in $(SHELLCHECKDIRS); do $(MAKE) -C $$dir shellcheck; done
|
||||
@ -28,7 +28,7 @@ endif
|
||||
shellcheck: $(SHELLCHECKSCRIPTS) $(call JUST_SHELLCHECK_OPTS,$(SHELLCHECKSCRIPTS)) shellcheck-recursive
|
||||
|
||||
|
||||
.PHONY: checkbashisms checkbashisms-recursive
|
||||
PHONY += checkbashisms checkbashisms-recursive
|
||||
|
||||
checkbashisms-recursive:
|
||||
@set -e; for dir in $(SHELLCHECKDIRS); do $(MAKE) -C $$dir checkbashisms; done
|
||||
|
@ -35,16 +35,15 @@ AC_DEFUN([ZFS_AC_CONFIG_USER_SYSTEMD], [
|
||||
AC_MSG_RESULT([$enable_systemd])
|
||||
|
||||
AS_IF([test "x$enable_systemd" = xyes], [
|
||||
ZFS_INIT_SYSTEMD=systemd
|
||||
ZFS_MODULE_LOAD=modules-load.d
|
||||
DEFINE_SYSTEMD='--with systemd --define "_unitdir $(systemdunitdir)" --define "_presetdir $(systemdpresetdir)" --define "_generatordir $(systemdgeneratordir)"'
|
||||
modulesloaddir=$systemdmodulesloaddir
|
||||
],[
|
||||
DEFINE_SYSTEMD='--without systemd'
|
||||
])
|
||||
|
||||
AC_SUBST(ZFS_INIT_SYSTEMD)
|
||||
AC_SUBST(ZFS_MODULE_LOAD)
|
||||
ZFS_INIT_SYSTEMD=$enable_systemd
|
||||
ZFS_WANT_MODULES_LOAD_D=$enable_systemd
|
||||
|
||||
AC_SUBST(DEFINE_SYSTEMD)
|
||||
AC_SUBST(systemdunitdir)
|
||||
AC_SUBST(systemdpresetdir)
|
||||
|
@ -2,10 +2,7 @@ AC_DEFUN([ZFS_AC_CONFIG_USER_SYSVINIT], [
|
||||
AC_ARG_ENABLE(sysvinit,
|
||||
AS_HELP_STRING([--enable-sysvinit],
|
||||
[install SysV init scripts [default: yes]]),
|
||||
[],enable_sysvinit=yes)
|
||||
[], enable_sysvinit=yes)
|
||||
|
||||
AS_IF([test "x$enable_sysvinit" = xyes],
|
||||
[ZFS_INIT_SYSV=init.d])
|
||||
|
||||
AC_SUBST(ZFS_INIT_SYSV)
|
||||
ZFS_INIT_SYSV=$enable_sysvinit
|
||||
])
|
||||
|
@ -259,6 +259,10 @@ AC_DEFUN([ZFS_AC_CONFIG], [
|
||||
AC_SUBST(TEST_JOBS)
|
||||
])
|
||||
|
||||
ZFS_INIT_SYSV=
|
||||
ZFS_INIT_SYSTEMD=
|
||||
ZFS_WANT_MODULES_LOAD_D=
|
||||
|
||||
case "$ZFS_CONFIG" in
|
||||
kernel) ZFS_AC_CONFIG_KERNEL ;;
|
||||
user) ZFS_AC_CONFIG_USER ;;
|
||||
@ -271,6 +275,10 @@ AC_DEFUN([ZFS_AC_CONFIG], [
|
||||
user kernel|user|all|srpm]) ;;
|
||||
esac
|
||||
|
||||
AM_CONDITIONAL([INIT_SYSV], [test "x$ZFS_INIT_SYSV" = "xyes"])
|
||||
AM_CONDITIONAL([INIT_SYSTEMD], [test "x$ZFS_INIT_SYSTEMD" = "xyes"])
|
||||
AM_CONDITIONAL([WANT_MODULES_LOAD_D], [test "x$ZFS_WANT_MODULES_LOAD_D" = "xyes"])
|
||||
|
||||
AM_CONDITIONAL([CONFIG_USER],
|
||||
[test "$ZFS_CONFIG" = user -o "$ZFS_CONFIG" = all])
|
||||
AM_CONDITIONAL([CONFIG_KERNEL],
|
||||
|
@ -66,15 +66,6 @@ ZFS_AC_DEBUG_INVARIANTS
|
||||
|
||||
AC_CONFIG_FILES([
|
||||
Makefile
|
||||
etc/Makefile
|
||||
etc/default/Makefile
|
||||
etc/init.d/Makefile
|
||||
etc/modules-load.d/Makefile
|
||||
etc/sudoers.d/Makefile
|
||||
etc/systemd/Makefile
|
||||
etc/systemd/system-generators/Makefile
|
||||
etc/systemd/system/Makefile
|
||||
etc/zfs/Makefile
|
||||
include/Makefile
|
||||
lib/libzfs/libzfs.pc
|
||||
lib/libzfsbootenv/libzfsbootenv.pc
|
||||
|
@ -1,9 +1,95 @@
|
||||
include $(top_srcdir)/config/Shellcheck.am
|
||||
sudoersddir = $(sysconfdir)/sudoers.d
|
||||
sudoersd_DATA = \
|
||||
%D%/sudoers.d/zfs
|
||||
|
||||
EXTRA_DIST += $(sudoersd_DATA)
|
||||
|
||||
|
||||
sysconf_zfsdir = $(sysconfdir)/zfs
|
||||
|
||||
dist_sysconf_zfs_DATA = \
|
||||
%D%/zfs/vdev_id.conf.alias.example \
|
||||
%D%/zfs/vdev_id.conf.multipath.example \
|
||||
%D%/zfs/vdev_id.conf.sas_direct.example \
|
||||
%D%/zfs/vdev_id.conf.sas_switch.example \
|
||||
%D%/zfs/vdev_id.conf.scsi.example
|
||||
|
||||
sysconf_zfs_SCRIPTS = \
|
||||
%D%/zfs/zfs-functions
|
||||
|
||||
SUBSTFILES += $(sysconf_zfs_SCRIPTS)
|
||||
SHELLCHECKSCRIPTS += $(sysconf_zfs_SCRIPTS)
|
||||
$(call SHELLCHECK_OPTS,$(sysconf_zfs_SCRIPTS)): SHELLCHECK_SHELL = sh
|
||||
|
||||
SUBDIRS = zfs sudoers.d
|
||||
SHELLCHECKDIRS = default $(ZFS_INIT_SYSV) zfs
|
||||
|
||||
if BUILD_LINUX
|
||||
SUBDIRS += default $(ZFS_INIT_SYSTEMD) $(ZFS_INIT_SYSV) $(ZFS_MODULE_LOAD)
|
||||
initconf_SCRIPTS = \
|
||||
%D%/default/zfs
|
||||
|
||||
SUBSTFILES += $(initconf_SCRIPTS)
|
||||
SHELLCHECKSCRIPTS += $(initconf_SCRIPTS)
|
||||
$(call SHELLCHECK_OPTS,$(initconf_SCRIPTS)): SHELLCHECK_SHELL = sh
|
||||
|
||||
|
||||
if INIT_SYSV
|
||||
EXTRA_DIST += $(addprefix %D%/,init.d/README.md)
|
||||
|
||||
init_SCRIPTS = \
|
||||
%D%/init.d/zfs-import \
|
||||
%D%/init.d/zfs-load-key \
|
||||
%D%/init.d/zfs-mount \
|
||||
%D%/init.d/zfs-share \
|
||||
%D%/init.d/zfs-zed
|
||||
|
||||
SUBSTFILES += $(init_SCRIPTS)
|
||||
SHELLCHECKSCRIPTS += $(init_SCRIPTS)
|
||||
$(call SHELLCHECK_OPTS,$(init_SCRIPTS)): SHELLCHECK_SHELL = sh
|
||||
endif
|
||||
|
||||
|
||||
if INIT_SYSTEMD
|
||||
dist_systemdpreset_DATA = \
|
||||
%D%/systemd/system/50-zfs.preset
|
||||
|
||||
systemdunit_DATA = \
|
||||
%D%/systemd/system/zfs-import-cache.service \
|
||||
%D%/systemd/system/zfs-import-scan.service \
|
||||
%D%/systemd/system/zfs-import.target \
|
||||
%D%/systemd/system/zfs-mount.service \
|
||||
%D%/systemd/system/zfs-scrub-monthly@.timer \
|
||||
%D%/systemd/system/zfs-scrub-weekly@.timer \
|
||||
%D%/systemd/system/zfs-scrub@.service \
|
||||
%D%/systemd/system/zfs-share.service \
|
||||
%D%/systemd/system/zfs-volume-wait.service \
|
||||
%D%/systemd/system/zfs-volumes.target \
|
||||
%D%/systemd/system/zfs-zed.service \
|
||||
%D%/systemd/system/zfs.target
|
||||
|
||||
SUBSTFILES += $(systemdunit_DATA)
|
||||
|
||||
INSTALL_DATA_HOOKS += systemd-install-data-hook
|
||||
systemd-install-data-hook:
|
||||
$(MKDIR_P) "$(DESTDIR)$(systemdunitdir)"
|
||||
ln -sf /dev/null "$(DESTDIR)$(systemdunitdir)/zfs-import.service"
|
||||
|
||||
|
||||
systemdgenerator_PROGRAMS = \
|
||||
%D%/systemd/system-generators/zfs-mount-generator
|
||||
|
||||
%C%_systemd_system_generators_zfs_mount_generator_SOURCES = \
|
||||
%D%/systemd/system-generators/zfs-mount-generator.c
|
||||
|
||||
%C%_systemd_system_generators_zfs_mount_generator_LDADD = \
|
||||
libzfs.la
|
||||
|
||||
%C%_systemd_system_generators_zfs_mount_generator_LDFLAGS = -pthread
|
||||
|
||||
CPPCHECKTARGETS += $(systemdgenerator_PROGRAMS)
|
||||
endif
|
||||
|
||||
|
||||
if WANT_MODULES_LOAD_D
|
||||
dist_modulesload_DATA = \
|
||||
%D%/modules-load.d/zfs.conf
|
||||
endif
|
||||
endif
|
||||
DIST_SUBDIRS = default init.d zfs systemd modules-load.d sudoers.d
|
||||
|
@ -1,11 +0,0 @@
|
||||
CLEANFILES =
|
||||
EXTRA_DIST =
|
||||
include $(top_srcdir)/config/Substfiles.am
|
||||
include $(top_srcdir)/config/Shellcheck.am
|
||||
|
||||
initconf_SCRIPTS = zfs
|
||||
|
||||
SUBSTFILES += $(initconf_SCRIPTS)
|
||||
|
||||
SHELLCHECK_SHELL = sh
|
||||
SHELLCHECKSCRIPTS += $(initconf_SCRIPTS)
|
@ -1,13 +0,0 @@
|
||||
CLEANFILES =
|
||||
EXTRA_DIST =
|
||||
include $(top_srcdir)/config/Substfiles.am
|
||||
include $(top_srcdir)/config/Shellcheck.am
|
||||
|
||||
EXTRA_DIST += README.md
|
||||
|
||||
init_SCRIPTS = zfs-import zfs-load-key zfs-mount zfs-share zfs-zed
|
||||
|
||||
SUBSTFILES += $(init_SCRIPTS)
|
||||
|
||||
SHELLCHECK_SHELL = sh
|
||||
SHELLCHECKSCRIPTS += $(init_SCRIPTS)
|
1
etc/modules-load.d/.gitignore
vendored
1
etc/modules-load.d/.gitignore
vendored
@ -1 +0,0 @@
|
||||
*.conf
|
@ -1,2 +0,0 @@
|
||||
dist_modulesload_DATA = \
|
||||
zfs.conf
|
@ -1,5 +0,0 @@
|
||||
sudoersddir = $(sysconfdir)/sudoers.d
|
||||
sudoersd_DATA = zfs
|
||||
|
||||
EXTRA_DIST = \
|
||||
zfs
|
@ -1 +0,0 @@
|
||||
SUBDIRS = system system-generators
|
@ -1,15 +0,0 @@
|
||||
include $(top_srcdir)/config/Rules.am
|
||||
|
||||
systemdgenerator_PROGRAMS = \
|
||||
zfs-mount-generator
|
||||
|
||||
zfs_mount_generator_SOURCES = \
|
||||
zfs-mount-generator.c
|
||||
|
||||
zfs_mount_generator_LDADD = \
|
||||
$(abs_top_builddir)/libzfs.la
|
||||
|
||||
zfs_mount_generator_LDFLAGS = -pthread
|
||||
|
||||
include $(top_srcdir)/config/CppCheck.am
|
||||
CPPCHECKTARGETS += zfs-mount-generator
|
1
etc/systemd/system/.gitignore
vendored
1
etc/systemd/system/.gitignore
vendored
@ -1,4 +1,3 @@
|
||||
*.service
|
||||
*.target
|
||||
*.preset
|
||||
*.timer
|
||||
|
@ -1,26 +0,0 @@
|
||||
CLEANFILES =
|
||||
EXTRA_DIST =
|
||||
include $(top_srcdir)/config/Substfiles.am
|
||||
|
||||
systemdpreset_DATA = \
|
||||
50-zfs.preset
|
||||
|
||||
systemdunit_DATA = \
|
||||
zfs-zed.service \
|
||||
zfs-import-cache.service \
|
||||
zfs-import-scan.service \
|
||||
zfs-mount.service \
|
||||
zfs-share.service \
|
||||
zfs-volume-wait.service \
|
||||
zfs-import.target \
|
||||
zfs-volumes.target \
|
||||
zfs.target \
|
||||
zfs-scrub-monthly@.timer \
|
||||
zfs-scrub-weekly@.timer \
|
||||
zfs-scrub@.service
|
||||
|
||||
SUBSTFILES += $(systemdpreset_DATA) $(systemdunit_DATA)
|
||||
|
||||
install-data-hook:
|
||||
$(MKDIR_P) "$(DESTDIR)$(systemdunitdir)"
|
||||
ln -sf /dev/null "$(DESTDIR)$(systemdunitdir)/zfs-import.service"
|
@ -1,21 +0,0 @@
|
||||
CLEANFILES =
|
||||
EXTRA_DIST =
|
||||
include $(top_srcdir)/config/Substfiles.am
|
||||
include $(top_srcdir)/config/Shellcheck.am
|
||||
|
||||
pkgsysconfdir = $(sysconfdir)/zfs
|
||||
|
||||
dist_pkgsysconf_DATA = \
|
||||
vdev_id.conf.alias.example \
|
||||
vdev_id.conf.sas_direct.example \
|
||||
vdev_id.conf.sas_switch.example \
|
||||
vdev_id.conf.multipath.example \
|
||||
vdev_id.conf.scsi.example
|
||||
|
||||
pkgsysconf_SCRIPTS = \
|
||||
zfs-functions
|
||||
|
||||
SUBSTFILES += $(pkgsysconf_SCRIPTS)
|
||||
|
||||
SHELLCHECK_SHELL = sh
|
||||
SHELLCHECKSCRIPTS += $(pkgsysconf_SCRIPTS)
|
@ -1,3 +1,4 @@
|
||||
PHONY =
|
||||
include $(top_srcdir)/config/Shellcheck.am
|
||||
|
||||
SUBDIRS = runfiles test-runner zfs-tests
|
||||
|
Loading…
Reference in New Issue
Block a user