-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 <[email protected]> Signed-off-by: Arvind Sankar <[email protected]> Closes #10559
- Loading branch information
1 parent
bdb518c
commit 38e2e9c
Showing
38 changed files
with
155 additions
and
288 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
arc_summary |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,13 @@ | ||
transform = $(program_transform_name) | ||
bin_SCRIPTS = arc_summary | ||
|
||
CLEANFILES = arc_summary | ||
EXTRA_DIST = arc_summary2 arc_summary3 | ||
|
||
if USING_PYTHON_2 | ||
SCRIPT = arc_summary2 | ||
else | ||
SCRIPT = arc_summary3 | ||
endif | ||
|
||
dist_bin_SCRIPTS = $(SCRIPT) | ||
|
||
install-exec-hook: | ||
before=$$(echo $(SCRIPT) | sed '$(transform)'); \ | ||
after=$$(echo arc_summary | sed '$(transform)'); \ | ||
mv "$(DESTDIR)$(bindir)/$$before" "$(DESTDIR)$(bindir)/$$after" | ||
arc_summary: $(SCRIPT) | ||
cp $< $@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
arcstat |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,5 @@ | ||
dist_bin_SCRIPTS = arcstat | ||
include $(top_srcdir)/config/Substfiles.am | ||
|
||
# | ||
# The arcstat script is compatible with both Python 2.6 and 3.4. | ||
# As such the python 3 shebang can be replaced at install time when | ||
# targeting a python 2 system. This allows us to maintain a single | ||
# version of the source. | ||
# | ||
if USING_PYTHON_2 | ||
install-exec-hook: | ||
$(SED) ${ac_inplace} -e 's|^#!/usr/bin/env python3|#!/usr/bin/env python2|' \ | ||
$(DESTDIR)$(bindir)/arcstat | ||
endif | ||
bin_SCRIPTS = arcstat | ||
|
||
SUBSTFILES += $(bin_SCRIPTS) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
dbufstat |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,5 @@ | ||
dist_bin_SCRIPTS = dbufstat | ||
include $(top_srcdir)/config/Substfiles.am | ||
|
||
# | ||
# The dbufstat script is compatible with both Python 2.6 and 3.4. | ||
# As such the python 3 shebang can be replaced at install time when | ||
# targeting a python 2 system. This allows us to maintain a single | ||
# version of the source. | ||
# | ||
if USING_PYTHON_2 | ||
install-exec-hook: | ||
$(SED) ${ac_inplace} -e 's|^#!/usr/bin/env python3|#!/usr/bin/env python2|' \ | ||
$(DESTDIR)$(bindir)/dbufstat | ||
endif | ||
bin_SCRIPTS = dbufstat | ||
|
||
SUBSTFILES += $(bin_SCRIPTS) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
subst_sed_cmd = \ | ||
-e 's|@bindir[@]|$(bindir)|g' \ | ||
-e 's|@sbindir[@]|$(sbindir)|g' \ | ||
-e 's|@datadir[@]|$(datadir)|g' \ | ||
-e 's|@sysconfdir[@]|$(sysconfdir)|g' \ | ||
-e 's|@runstatedir[@]|$(runstatedir)|g' \ | ||
-e 's|@initconfdir[@]|$(initconfdir)|g' \ | ||
-e 's|@initdir[@]|$(initdir)|g' \ | ||
-e 's|@mounthelperdir[@]|$(mounthelperdir)|g' \ | ||
-e 's|@systemdgeneratordir[@]|$(systemdgeneratordir)|g' \ | ||
-e 's|@systemdunitdir[@]|$(systemdunitdir)|g' \ | ||
-e 's|@udevdir[@]|$(udevdir)|g' \ | ||
-e 's|@udevruledir[@]|$(udevruledir)|g' \ | ||
-e 's|@zfsexecdir[@]|$(zfsexecdir)|g' \ | ||
-e 's|@PYTHON[@]|$(PYTHON)|g' \ | ||
-e 's|@PYTHON_SHEBANG[@]|$(PYTHON_SHEBANG)|g' \ | ||
-e 's|@DEFAULT_INIT_NFS_SERVER[@]|$(DEFAULT_INIT_NFS_SERVER)|g' \ | ||
-e 's|@DEFAULT_INIT_SHELL[@]|$(DEFAULT_INIT_SHELL)|g' | ||
|
||
SUBSTFILES = | ||
CLEANFILES = $(SUBSTFILES) | ||
EXTRA_DIST = $(SUBSTFILES:=.in) | ||
|
||
$(SUBSTFILES):%:%.in Makefile | ||
$(AM_V_GEN)set -e; \ | ||
$(MKDIR_P) $$(dirname $@); \ | ||
$(RM) $@~; \ | ||
$(SED) $(subst_sed_cmd) $< >$@~; \ | ||
if grep -E '@[a-zA-Z0-9_]+@' $@~ >&2; then \ | ||
echo "Undefined substitution" >&2; \ | ||
exit 1; \ | ||
else test $$? -eq 1; fi; \ | ||
test -x $< && chmod +x $@~; \ | ||
mv -f $@~ $@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,7 @@ | ||
include $(top_srcdir)/config/Substfiles.am | ||
|
||
pkgdracutdir = $(dracutdir)/modules.d/02zfsexpandknowledge | ||
pkgdracut_SCRIPTS = \ | ||
module-setup.sh | ||
|
||
EXTRA_DIST = \ | ||
module-setup.sh.in | ||
|
||
$(pkgdracut_SCRIPTS):%:%.in | ||
-$(SED) -e 's,@bindir\@,$(bindir),g' \ | ||
-e 's,@sbindir\@,$(sbindir),g' \ | ||
-e 's,@datadir\@,$(datadir),g' \ | ||
-e 's,@dracutdir\@,$(dracutdir),g' \ | ||
-e 's,@udevdir\@,$(udevdir),g' \ | ||
-e 's,@udevruledir\@,$(udevruledir),g' \ | ||
-e 's,@sysconfdir\@,$(sysconfdir),g' \ | ||
$< >'$@' | ||
|
||
CLEANFILES = $(pkgdracut_SCRIPTS) | ||
SUBSTFILES += $(pkgdracut_SCRIPTS) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,9 @@ | ||
include $(top_srcdir)/config/Substfiles.am | ||
|
||
hooksdir = /usr/share/initramfs-tools/hooks | ||
|
||
hooks_SCRIPTS = \ | ||
zfs \ | ||
zfsunlock | ||
|
||
EXTRA_DIST = \ | ||
zfs.in \ | ||
zfsunlock.in | ||
|
||
$(hooks_SCRIPTS):%:%.in Makefile | ||
-$(SED) -e 's,@sbindir\@,$(sbindir),g' \ | ||
-e 's,@sysconfdir\@,$(sysconfdir),g' \ | ||
-e 's,@udevdir\@,$(udevdir),g' \ | ||
-e 's,@udevruledir\@,$(udevruledir),g' \ | ||
-e 's,@mounthelperdir\@,$(mounthelperdir),g' \ | ||
-e 's,@DEFAULT_INITCONF_DIR\@,$(DEFAULT_INITCONF_DIR),g' \ | ||
$< >'$@' | ||
|
||
CLEANFILES = $(hooks_SCRIPTS) | ||
SUBSTFILES += $(hooks_SCRIPTS) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,5 @@ | ||
initconfdir = $(DEFAULT_INITCONF_DIR) | ||
initconf_SCRIPTS = zfs | ||
|
||
EXTRA_DIST = \ | ||
zfs.in | ||
include $(top_srcdir)/config/Substfiles.am | ||
|
||
$(initconf_SCRIPTS):%:%.in Makefile | ||
$(SED) \ | ||
-e 's,@sysconfdir\@,$(sysconfdir),g' \ | ||
$< >'$@' | ||
initconf_SCRIPTS = zfs | ||
|
||
CLEANFILES = $(initconf_SCRIPTS) | ||
SUBSTFILES += $(initconf_SCRIPTS) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,7 @@ | ||
initdir = $(DEFAULT_INIT_DIR) | ||
init_SCRIPTS = zfs-import zfs-mount zfs-share zfs-zed | ||
|
||
initconfdir = $(DEFAULT_INITCONF_DIR) | ||
include $(top_srcdir)/config/Substfiles.am | ||
|
||
EXTRA_DIST = \ | ||
zfs-share.in \ | ||
zfs-import.in \ | ||
zfs-mount.in \ | ||
zfs-zed.in \ | ||
README.md | ||
EXTRA_DIST += 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 '$@') | ||
init_SCRIPTS = zfs-import zfs-mount zfs-share zfs-zed | ||
|
||
CLEANFILES = $(init_SCRIPTS) | ||
SUBSTFILES += $(init_SCRIPTS) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#!@SHELL@ | ||
#!@DEFAULT_INIT_SHELL@ | ||
# | ||
# zfs-import This script will import ZFS pools | ||
# | ||
|
Oops, something went wrong.