diff --git a/cmd/Makefile.am b/cmd/Makefile.am index 2fa281cad..9959760b5 100644 --- a/cmd/Makefile.am +++ b/cmd/Makefile.am @@ -2,38 +2,114 @@ bin_SCRIPTS = bin_PROGRAMS = sbin_SCRIPTS = sbin_PROGRAMS = -udev_PROGRAMS = dist_bin_SCRIPTS = zfsexec_PROGRAMS = -dist_udev_SCRIPTS = mounthelper_PROGRAMS = -include $(srcdir)/%D%/fsck_zfs/Makefile.am + +sbin_SCRIPTS += fsck.zfs +SHELLCHECKSCRIPTS += fsck.zfs +CLEANFILES += fsck.zfs +EXTRA_DIST += %D%/fsck.zfs.in +$(call SUBST,fsck.zfs,%D%/) + + +sbin_PROGRAMS += zfs_ids_to_path +CPPCHECKTARGETS += zfs_ids_to_path + +zfs_ids_to_path_SOURCES = \ + %D%/zfs_ids_to_path.c + +zfs_ids_to_path_LDADD = \ + libzfs.la + + +zhack_CPPFLAGS = $(AM_CPPFLAGS) $(FORCEDEBUG_CPPFLAGS) + +sbin_PROGRAMS += zhack +CPPCHECKTARGETS += zhack + +zhack_SOURCES = \ + %D%/zhack.c + +zhack_LDADD = \ + libzpool.la \ + libzfs_core.la \ + libnvpair.la + + +ztest_CFLAGS = $(AM_CFLAGS) $(KERNEL_CFLAGS) +# Get rid of compiler warning for unchecked truncating snprintfs on gcc 7.1.1 +ztest_CFLAGS += $(NO_FORMAT_TRUNCATION) +ztest_CPPFLAGS = $(AM_CPPFLAGS) $(FORCEDEBUG_CPPFLAGS) + +sbin_PROGRAMS += ztest +CPPCHECKTARGETS += ztest + +ztest_SOURCES = \ + %D%/ztest.c + +ztest_LDADD = \ + libzpool.la \ + libzfs_core.la \ + libnvpair.la + +ztest_LDADD += -lm +ztest_LDFLAGS = -pthread + + include $(srcdir)/%D%/raidz_test/Makefile.am -include $(srcdir)/%D%/vdev_id/Makefile.am include $(srcdir)/%D%/zdb/Makefile.am include $(srcdir)/%D%/zfs/Makefile.am -include $(srcdir)/%D%/zfs_ids_to_path/Makefile.am -include $(srcdir)/%D%/zhack/Makefile.am include $(srcdir)/%D%/zinject/Makefile.am include $(srcdir)/%D%/zpool/Makefile.am include $(srcdir)/%D%/zpool_influxdb/Makefile.am include $(srcdir)/%D%/zstream/Makefile.am -include $(srcdir)/%D%/ztest/Makefile.am + if BUILD_LINUX -include $(srcdir)/%D%/mount_zfs/Makefile.am +mounthelper_PROGRAMS += mount.zfs +CPPCHECKTARGETS += mount.zfs + +mount_zfs_SOURCES = \ + %D%/mount_zfs.c + +mount_zfs_LDADD = \ + libzfs.la \ + libzfs_core.la \ + libnvpair.la + +mount_zfs_LDADD += $(LTLIBINTL) + +CPPCHECKTARGETS += raidz_test + + +sbin_PROGRAMS += zgenhostid +CPPCHECKTARGETS += zgenhostid + +zgenhostid_SOURCES = \ + %D%/zgenhostid.c + + +dist_bin_SCRIPTS += %D%/zvol_wait +SHELLCHECKSCRIPTS += %D%/zvol_wait + + include $(srcdir)/%D%/zed/Makefile.am -include $(srcdir)/%D%/zgenhostid/Makefile.am -include $(srcdir)/%D%/zvol_id/Makefile.am -include $(srcdir)/%D%/zvol_wait/Makefile.am endif + if USING_PYTHON -include $(srcdir)/%D%/arc_summary/Makefile.am -include $(srcdir)/%D%/arcstat/Makefile.am -include $(srcdir)/%D%/dbufstat/Makefile.am +bin_SCRIPTS += arc_summary arcstat dbufstat +CLEANFILES += arc_summary arcstat dbufstat +EXTRA_DIST += %D%/arc_summary %D%/arcstat.in %D%/dbufstat.in + +$(call SUBST,arcstat,%D%/) +$(call SUBST,dbufstat,%D%/) +arc_summary: %D%/arc_summary + $(AM_V_at)cp $< $@ endif + PHONY += cmd -cmd: $(bin_SCRIPTS) $(bin_PROGRAMS) $(sbin_SCRIPTS) $(sbin_PROGRAMS) $(udev_PROGRAMS) $(dist_bin_SCRIPTS) $(zfsexec_PROGRAMS) $(dist_udev_SCRIPTS) $(mounthelper_PROGRAMS) +cmd: $(bin_SCRIPTS) $(bin_PROGRAMS) $(sbin_SCRIPTS) $(sbin_PROGRAMS) $(dist_bin_SCRIPTS) $(zfsexec_PROGRAMS) $(mounthelper_PROGRAMS) diff --git a/cmd/arc_summary/arc_summary3 b/cmd/arc_summary similarity index 100% rename from cmd/arc_summary/arc_summary3 rename to cmd/arc_summary diff --git a/cmd/arc_summary/Makefile.am b/cmd/arc_summary/Makefile.am deleted file mode 100644 index 90dd981d9..000000000 --- a/cmd/arc_summary/Makefile.am +++ /dev/null @@ -1,8 +0,0 @@ -bin_SCRIPTS += arc_summary -CLEANFILES += arc_summary - -EXTRA_DIST += %D%/arc_summary3 -ARC_SUMMARY = %D%/arc_summary3 - -arc_summary: $(ARC_SUMMARY) - $(AM_V_at)cp $< $@ diff --git a/cmd/arcstat/arcstat.in b/cmd/arcstat.in similarity index 100% rename from cmd/arcstat/arcstat.in rename to cmd/arcstat.in diff --git a/cmd/arcstat/Makefile.am b/cmd/arcstat/Makefile.am deleted file mode 100644 index d7fd81074..000000000 --- a/cmd/arcstat/Makefile.am +++ /dev/null @@ -1,4 +0,0 @@ -bin_SCRIPTS += arcstat -CLEANFILES += arcstat -EXTRA_DIST += %D%/arcstat.in -$(call SUBST,arcstat,%D%/) diff --git a/cmd/dbufstat/dbufstat.in b/cmd/dbufstat.in similarity index 100% rename from cmd/dbufstat/dbufstat.in rename to cmd/dbufstat.in diff --git a/cmd/dbufstat/Makefile.am b/cmd/dbufstat/Makefile.am deleted file mode 100644 index 107f35573..000000000 --- a/cmd/dbufstat/Makefile.am +++ /dev/null @@ -1,4 +0,0 @@ -bin_SCRIPTS += dbufstat -CLEANFILES += dbufstat -EXTRA_DIST += %D%/dbufstat.in -$(call SUBST,dbufstat,%D%/) diff --git a/cmd/fsck_zfs/fsck.zfs.in b/cmd/fsck.zfs.in similarity index 100% rename from cmd/fsck_zfs/fsck.zfs.in rename to cmd/fsck.zfs.in diff --git a/cmd/fsck_zfs/Makefile.am b/cmd/fsck_zfs/Makefile.am deleted file mode 100644 index a252e3d0c..000000000 --- a/cmd/fsck_zfs/Makefile.am +++ /dev/null @@ -1,5 +0,0 @@ -sbin_SCRIPTS += fsck.zfs -SHELLCHECKSCRIPTS += fsck.zfs -CLEANFILES += fsck.zfs -EXTRA_DIST += %D%/fsck.zfs.in -$(call SUBST,fsck.zfs,%D%/) diff --git a/cmd/mount_zfs/mount_zfs.c b/cmd/mount_zfs.c similarity index 100% rename from cmd/mount_zfs/mount_zfs.c rename to cmd/mount_zfs.c diff --git a/cmd/mount_zfs/Makefile.am b/cmd/mount_zfs/Makefile.am deleted file mode 100644 index 0ba61abe5..000000000 --- a/cmd/mount_zfs/Makefile.am +++ /dev/null @@ -1,20 +0,0 @@ -# -# Ignore the prefix for the mount helper. It must be installed in /sbin/ -# because this path is hardcoded in the mount(8) for security reasons. -# However, if needed, the configure option --with-mounthelperdir= can be used -# to override the default install location. -# -mounthelper_PROGRAMS += mount.zfs -CPPCHECKTARGETS += mount.zfs - -mount_zfs_SOURCES = \ - %D%/mount_zfs.c - -mount_zfs_LDADD = \ - libzfs.la \ - libzfs_core.la \ - libnvpair.la - -mount_zfs_LDADD += $(LTLIBINTL) - -CPPCHECKTARGETS += raidz_test diff --git a/cmd/vdev_id/Makefile.am b/cmd/vdev_id/Makefile.am deleted file mode 100644 index ca57a9107..000000000 --- a/cmd/vdev_id/Makefile.am +++ /dev/null @@ -1,2 +0,0 @@ -dist_udev_SCRIPTS += %D%/vdev_id -# TODO: #12084: SHELLCHECKSCRIPTS += %D%/vdev_id diff --git a/cmd/zfs_ids_to_path/zfs_ids_to_path.c b/cmd/zfs_ids_to_path.c similarity index 100% rename from cmd/zfs_ids_to_path/zfs_ids_to_path.c rename to cmd/zfs_ids_to_path.c diff --git a/cmd/zfs_ids_to_path/Makefile.am b/cmd/zfs_ids_to_path/Makefile.am deleted file mode 100644 index 09ddd8116..000000000 --- a/cmd/zfs_ids_to_path/Makefile.am +++ /dev/null @@ -1,8 +0,0 @@ -sbin_PROGRAMS += zfs_ids_to_path -CPPCHECKTARGETS += zfs_ids_to_path - -zfs_ids_to_path_SOURCES = \ - %D%/zfs_ids_to_path.c - -zfs_ids_to_path_LDADD = \ - libzfs.la diff --git a/cmd/zgenhostid/zgenhostid.c b/cmd/zgenhostid.c similarity index 100% rename from cmd/zgenhostid/zgenhostid.c rename to cmd/zgenhostid.c diff --git a/cmd/zgenhostid/Makefile.am b/cmd/zgenhostid/Makefile.am deleted file mode 100644 index 722950eb7..000000000 --- a/cmd/zgenhostid/Makefile.am +++ /dev/null @@ -1,5 +0,0 @@ -sbin_PROGRAMS += zgenhostid -CPPCHECKTARGETS += zgenhostid - -zgenhostid_SOURCES = \ - %D%/zgenhostid.c diff --git a/cmd/zhack/zhack.c b/cmd/zhack.c similarity index 100% rename from cmd/zhack/zhack.c rename to cmd/zhack.c diff --git a/cmd/zhack/Makefile.am b/cmd/zhack/Makefile.am deleted file mode 100644 index 94fa76d14..000000000 --- a/cmd/zhack/Makefile.am +++ /dev/null @@ -1,12 +0,0 @@ -zhack_CPPFLAGS = $(AM_CPPFLAGS) $(FORCEDEBUG_CPPFLAGS) - -sbin_PROGRAMS += zhack -CPPCHECKTARGETS += zhack - -zhack_SOURCES = \ - %D%/zhack.c - -zhack_LDADD = \ - libzpool.la \ - libzfs_core.la \ - libnvpair.la diff --git a/cmd/ztest/ztest.c b/cmd/ztest.c similarity index 100% rename from cmd/ztest/ztest.c rename to cmd/ztest.c diff --git a/cmd/ztest/Makefile.am b/cmd/ztest/Makefile.am deleted file mode 100644 index e27643a44..000000000 --- a/cmd/ztest/Makefile.am +++ /dev/null @@ -1,18 +0,0 @@ -ztest_CFLAGS = $(AM_CFLAGS) $(KERNEL_CFLAGS) -# Get rid of compiler warning for unchecked truncating snprintfs on gcc 7.1.1 -ztest_CFLAGS += $(NO_FORMAT_TRUNCATION) -ztest_CPPFLAGS = $(AM_CPPFLAGS) $(FORCEDEBUG_CPPFLAGS) - -sbin_PROGRAMS += ztest -CPPCHECKTARGETS += ztest - -ztest_SOURCES = \ - %D%/ztest.c - -ztest_LDADD = \ - libzpool.la \ - libzfs_core.la \ - libnvpair.la - -ztest_LDADD += -lm -ztest_LDFLAGS = -pthread diff --git a/cmd/zvol_id/Makefile.am b/cmd/zvol_id/Makefile.am deleted file mode 100644 index 7ba13205b..000000000 --- a/cmd/zvol_id/Makefile.am +++ /dev/null @@ -1,5 +0,0 @@ -udev_PROGRAMS += zvol_id -CPPCHECKTARGETS += zvol_id - -zvol_id_SOURCES = \ - %D%/zvol_id_main.c diff --git a/cmd/zvol_wait/zvol_wait b/cmd/zvol_wait similarity index 100% rename from cmd/zvol_wait/zvol_wait rename to cmd/zvol_wait diff --git a/cmd/zvol_wait/Makefile.am b/cmd/zvol_wait/Makefile.am deleted file mode 100644 index 2d3736f75..000000000 --- a/cmd/zvol_wait/Makefile.am +++ /dev/null @@ -1,2 +0,0 @@ -dist_bin_SCRIPTS += %D%/zvol_wait -SHELLCHECKSCRIPTS += %D%/zvol_wait diff --git a/scripts/Makefile.am b/scripts/Makefile.am index 586ead05b..5a409484f 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -35,6 +35,8 @@ export GDB="libtool --mode=execute gdb" export LDMOD=/sbin/insmod export CMD_DIR=$(abs_top_builddir) +export UDEV_SCRIPT_DIR=$(abs_top_srcdir)/udev +export UDEV_CMD_DIR=$(abs_top_builddir)/udev export UDEV_RULE_DIR=$(abs_top_builddir)/udev/rules.d export ZEDLET_ETC_DIR=$$CMD_DIR/cmd/zed/zed.d export ZEDLET_LIBEXEC_DIR=$$CMD_DIR/cmd/zed/zed.d diff --git a/scripts/zfs-helpers.sh b/scripts/zfs-helpers.sh index 5fa932dcc..8dcb06301 100755 --- a/scripts/zfs-helpers.sh +++ b/scripts/zfs-helpers.sh @@ -156,7 +156,7 @@ if [ "${INSTALL}" = "yes" ]; then for cmd in "mount.zfs" "fsck.zfs"; do install "$CMD_DIR/$cmd" "$INSTALL_MOUNT_HELPER_DIR/$cmd" done - for udev in "$CMD_DIR/zvol_id" "$UDEV_SCRIPT_DIR/vdev_id"; do + for udev in "$UDEV_CMD_DIR/zvol_id" "$UDEV_SCRIPT_DIR/vdev_id"; do install "$udev" "$INSTALL_UDEV_DIR/${udev##*/}" done for rule in "60-zvol.rules" "69-vdev.rules" "90-zfs.rules"; do diff --git a/udev/.gitignore b/udev/.gitignore new file mode 100644 index 000000000..4f5af11ae --- /dev/null +++ b/udev/.gitignore @@ -0,0 +1 @@ +/zvol_id diff --git a/udev/Makefile.am b/udev/Makefile.am index 27d45a36a..6fd645b5c 100644 --- a/udev/Makefile.am +++ b/udev/Makefile.am @@ -4,3 +4,15 @@ udevrule_DATA = \ %D%/rules.d/90-zfs.rules SUBSTFILES += $(udevrule_DATA) + + +dist_udev_SCRIPTS = %D%/vdev_id +# TODO: #12084: SHELLCHECKSCRIPTS += %D%/vdev_id + + +udev_PROGRAMS = %D%/zvol_id +CPPCHECKTARGETS += %D%/zvol_id + + +PHONY += udev +udev: $(dist_udev_SCRIPTS) $(udev_PROGRAMS) diff --git a/cmd/vdev_id/vdev_id b/udev/vdev_id similarity index 100% rename from cmd/vdev_id/vdev_id rename to udev/vdev_id diff --git a/cmd/zvol_id/zvol_id_main.c b/udev/zvol_id.c similarity index 100% rename from cmd/zvol_id/zvol_id_main.c rename to udev/zvol_id.c