From f8e2152db7cac536727ed7dcae5873b0d8126137 Mon Sep 17 00:00:00 2001 From: Shengqi Chen Date: Wed, 3 Sep 2025 23:58:42 +0800 Subject: [PATCH] Install zarcstat and zarcsummary symlinks in Makefile Reviewed-by: Brian Behlendorf Reviewed-by: Tony Hutter Signed-off-by: Shengqi Chen Closes #16357 Closes #17695 --- Makefile.am | 4 ++++ cmd/Makefile.am | 6 +++++- cmd/zstream/Makefile.am | 5 +++-- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/Makefile.am b/Makefile.am index 5f09d170e..30f78e490 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,6 +1,7 @@ CLEANFILES = dist_noinst_DATA = INSTALL_DATA_HOOKS = +INSTALL_EXEC_HOOKS = ALL_LOCAL = CLEAN_LOCAL = CHECKS = shellcheck checkbashisms @@ -71,6 +72,9 @@ all: gitrev PHONY += install-data-hook $(INSTALL_DATA_HOOKS) install-data-hook: $(INSTALL_DATA_HOOKS) +PHONY += install-exec-hook $(INSTALL_EXEC_HOOKS) +install-exec-hook: $(INSTALL_EXEC_HOOKS) + PHONY += maintainer-clean-local maintainer-clean-local: -$(RM) $(GITREV) diff --git a/cmd/Makefile.am b/cmd/Makefile.am index 96040976e..45cc75ac1 100644 --- a/cmd/Makefile.am +++ b/cmd/Makefile.am @@ -107,8 +107,12 @@ $(call SUBST,dbufstat,%D%/) $(call SUBST,zilstat,%D%/) arc_summary: %D%/arc_summary $(AM_V_at)cp $< $@ -endif +cmd-rename-install-exec-hook: + $(LN_S) arcstat $(DESTDIR)$(bindir)/zarcstat + $(LN_S) arc_summary $(DESTDIR)$(bindir)/zarcsummary +INSTALL_EXEC_HOOKS += cmd-rename-install-exec-hook +endif PHONY += cmd cmd: $(bin_SCRIPTS) $(bin_PROGRAMS) $(sbin_SCRIPTS) $(sbin_PROGRAMS) $(dist_bin_SCRIPTS) $(zfsexec_PROGRAMS) $(mounthelper_PROGRAMS) diff --git a/cmd/zstream/Makefile.am b/cmd/zstream/Makefile.am index be3539fe9..80ef1ea7c 100644 --- a/cmd/zstream/Makefile.am +++ b/cmd/zstream/Makefile.am @@ -18,6 +18,7 @@ zstream_LDADD = \ libzpool.la \ libnvpair.la -PHONY += install-exec-hook -install-exec-hook: +cmd-zstream-install-exec-hook: cd $(DESTDIR)$(sbindir) && $(LN_S) -f zstream zstreamdump + +INSTALL_EXEC_HOOKS += cmd-zstream-install-exec-hook