mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 02:27:36 +03:00
Centralize variable substitution
A bunch of places need to edit files to incorporate the configured paths i.e. bindir, sbindir etc. Move this logic into a common file. Create arc_summary by copying arc_summary[23] as appropriate at build time instead of install time. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Arvind Sankar <nivedita@alum.mit.edu> Closes #10559
This commit is contained in:
committed by
Brian Behlendorf
parent
bdb518c13a
commit
38e2e9ce83
+3
-10
@@ -1,12 +1,5 @@
|
||||
initconfdir = $(DEFAULT_INITCONF_DIR)
|
||||
include $(top_srcdir)/config/Substfiles.am
|
||||
|
||||
initconf_SCRIPTS = zfs
|
||||
|
||||
EXTRA_DIST = \
|
||||
zfs.in
|
||||
|
||||
$(initconf_SCRIPTS):%:%.in Makefile
|
||||
$(SED) \
|
||||
-e 's,@sysconfdir\@,$(sysconfdir),g' \
|
||||
$< >'$@'
|
||||
|
||||
CLEANFILES = $(initconf_SCRIPTS)
|
||||
SUBSTFILES += $(initconf_SCRIPTS)
|
||||
|
||||
+5
-36
@@ -1,38 +1,7 @@
|
||||
initdir = $(DEFAULT_INIT_DIR)
|
||||
include $(top_srcdir)/config/Substfiles.am
|
||||
|
||||
EXTRA_DIST += README.md
|
||||
|
||||
init_SCRIPTS = zfs-import zfs-mount zfs-share zfs-zed
|
||||
|
||||
initconfdir = $(DEFAULT_INITCONF_DIR)
|
||||
|
||||
EXTRA_DIST = \
|
||||
zfs-share.in \
|
||||
zfs-import.in \
|
||||
zfs-mount.in \
|
||||
zfs-zed.in \
|
||||
README.md
|
||||
|
||||
$(init_SCRIPTS):%:%.in Makefile
|
||||
-(if [ -e /etc/debian_version ]; then \
|
||||
NFS_SRV=nfs-kernel-server; \
|
||||
else \
|
||||
NFS_SRV=nfs; \
|
||||
fi; \
|
||||
if [ -e /sbin/openrc-run ]; then \
|
||||
SHELL=/sbin/openrc-run; \
|
||||
else \
|
||||
SHELL=/bin/sh; \
|
||||
fi; \
|
||||
$(SED) \
|
||||
-e 's,@bindir\@,$(bindir),g' \
|
||||
-e 's,@sbindir\@,$(sbindir),g' \
|
||||
-e 's,@udevdir\@,$(udevdir),g' \
|
||||
-e 's,@udevruledir\@,$(udevruledir),g' \
|
||||
-e 's,@sysconfdir\@,$(sysconfdir),g' \
|
||||
-e 's,@initconfdir\@,$(initconfdir),g' \
|
||||
-e 's,@initdir\@,$(initdir),g' \
|
||||
-e 's,@runstatedir\@,$(runstatedir),g' \
|
||||
-e "s,@SHELL\@,$$SHELL,g" \
|
||||
-e "s,@NFS_SRV\@,$$NFS_SRV,g" \
|
||||
$< >'$@'; \
|
||||
chmod +x '$@')
|
||||
|
||||
CLEANFILES = $(init_SCRIPTS)
|
||||
SUBSTFILES += $(init_SCRIPTS)
|
||||
|
||||
Regular → Executable
+1
-1
@@ -1,4 +1,4 @@
|
||||
#!@SHELL@
|
||||
#!@DEFAULT_INIT_SHELL@
|
||||
#
|
||||
# zfs-import This script will import ZFS pools
|
||||
#
|
||||
|
||||
Regular → Executable
+1
-1
@@ -1,4 +1,4 @@
|
||||
#!@SHELL@
|
||||
#!@DEFAULT_INIT_SHELL@
|
||||
#
|
||||
# zfs-mount This script will mount/umount the zfs filesystems.
|
||||
#
|
||||
|
||||
Regular → Executable
+3
-3
@@ -1,4 +1,4 @@
|
||||
#!@SHELL@
|
||||
#!@DEFAULT_INIT_SHELL@
|
||||
#
|
||||
# zfs-share This script will network share zfs filesystems and volumes.
|
||||
#
|
||||
@@ -13,8 +13,8 @@
|
||||
# Required-Stop: $local_fs $network $remote_fs zfs-mount
|
||||
# Default-Start: 2 3 4 5
|
||||
# Default-Stop: 0 1 6
|
||||
# Should-Start: iscsi iscsitarget istgt scst @NFS_SRV@ samba samba4 zfs-mount zfs-zed
|
||||
# Should-Stop: iscsi iscsitarget istgt scst @NFS_SRV@ samba samba4 zfs-mount zfs-zed
|
||||
# Should-Start: iscsi iscsitarget istgt scst @DEFAULT_INIT_NFS_SERVER@ samba samba4 zfs-mount zfs-zed
|
||||
# Should-Stop: iscsi iscsitarget istgt scst @DEFAULT_INIT_NFS_SERVER@ samba samba4 zfs-mount zfs-zed
|
||||
# Short-Description: Network share ZFS datasets and volumes.
|
||||
# Description: Run the `zfs share -a` or `zfs unshare -a` commands
|
||||
# for controlling iSCSI, NFS, or CIFS network shares.
|
||||
|
||||
Regular → Executable
+1
-1
@@ -1,4 +1,4 @@
|
||||
#!@SHELL@
|
||||
#!@DEFAULT_INIT_SHELL@
|
||||
#
|
||||
# zfs-zed
|
||||
#
|
||||
|
||||
@@ -1,12 +1,2 @@
|
||||
modulesload_DATA = \
|
||||
dist_modulesload_DATA = \
|
||||
zfs.conf
|
||||
|
||||
EXTRA_DIST = \
|
||||
zfs.conf.in
|
||||
|
||||
$(modulesload_DATA):%:%.in
|
||||
-$(SED) \
|
||||
-e '' \
|
||||
$< >'$@'
|
||||
|
||||
CLEANFILES = $(modulesload_DATA)
|
||||
|
||||
@@ -1,14 +1,6 @@
|
||||
include $(top_srcdir)/config/Substfiles.am
|
||||
|
||||
systemdgenerator_SCRIPTS = \
|
||||
zfs-mount-generator
|
||||
|
||||
EXTRA_DIST = \
|
||||
zfs-mount-generator.in
|
||||
|
||||
$(systemdgenerator_SCRIPTS): %: %.in
|
||||
-$(SED) -e 's,@bindir\@,$(bindir),g' \
|
||||
-e 's,@runstatedir\@,$(runstatedir),g' \
|
||||
-e 's,@sbindir\@,$(sbindir),g' \
|
||||
-e 's,@sysconfdir\@,$(sysconfdir),g' \
|
||||
$< >'$@'
|
||||
|
||||
CLEANFILES = $(systemdgenerator_SCRIPTS)
|
||||
SUBSTFILES += $(systemdgenerator_SCRIPTS)
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
include $(top_srcdir)/config/Substfiles.am
|
||||
|
||||
systemdpreset_DATA = \
|
||||
50-zfs.preset
|
||||
|
||||
@@ -12,27 +14,8 @@ systemdunit_DATA = \
|
||||
zfs-volumes.target \
|
||||
zfs.target
|
||||
|
||||
EXTRA_DIST = \
|
||||
zfs-zed.service.in \
|
||||
zfs-import-cache.service.in \
|
||||
zfs-import-scan.service.in \
|
||||
zfs-mount.service.in \
|
||||
zfs-share.service.in \
|
||||
zfs-import.target.in \
|
||||
zfs-volume-wait.service.in \
|
||||
zfs-volumes.target.in \
|
||||
zfs.target.in \
|
||||
50-zfs.preset.in
|
||||
|
||||
$(systemdunit_DATA) $(systemdpreset_DATA):%:%.in
|
||||
-$(SED) -e 's,@bindir\@,$(bindir),g' \
|
||||
-e 's,@runstatedir\@,$(runstatedir),g' \
|
||||
-e 's,@sbindir\@,$(sbindir),g' \
|
||||
-e 's,@sysconfdir\@,$(sysconfdir),g' \
|
||||
$< >'$@'
|
||||
SUBSTFILES += $(systemdpreset_DATA) $(systemdunit_DATA)
|
||||
|
||||
install-data-hook:
|
||||
$(MKDIR_P) "$(DESTDIR)$(systemdunitdir)"
|
||||
ln -sf /dev/null "$(DESTDIR)$(systemdunitdir)/zfs-import.service"
|
||||
|
||||
CLEANFILES = $(systemdunit_DATA) $(systemdpreset_DATA)
|
||||
|
||||
+4
-11
@@ -1,5 +1,6 @@
|
||||
include $(top_srcdir)/config/Substfiles.am
|
||||
|
||||
pkgsysconfdir = $(sysconfdir)/zfs
|
||||
initconfdir = $(DEFAULT_INITCONF_DIR)
|
||||
|
||||
dist_pkgsysconf_DATA = \
|
||||
vdev_id.conf.alias.example \
|
||||
@@ -7,16 +8,8 @@ dist_pkgsysconf_DATA = \
|
||||
vdev_id.conf.sas_switch.example \
|
||||
vdev_id.conf.multipath.example \
|
||||
vdev_id.conf.scsi.example
|
||||
|
||||
pkgsysconf_SCRIPTS = \
|
||||
zfs-functions
|
||||
|
||||
EXTRA_DIST = zfs-functions.in
|
||||
|
||||
$(pkgsysconf_SCRIPTS):%:%.in Makefile
|
||||
-$(SED) \
|
||||
-e 's,@sbindir\@,$(sbindir),g' \
|
||||
-e 's,@sysconfdir\@,$(sysconfdir),g' \
|
||||
-e 's,@initconfdir\@,$(initconfdir),g' \
|
||||
$< >'$@'
|
||||
|
||||
CLEANFILES = $(pkgsysconf_SCRIPTS)
|
||||
SUBSTFILES += $(pkgsysconf_SCRIPTS)
|
||||
|
||||
Reference in New Issue
Block a user