Skip to content

Commit 0a9aaa7

Browse files
nabijaczlewelibehlendorf
authored andcommitted
cmd: move single-file binaries up, extract udev programs to udev/
Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #13316
1 parent eaf94bd commit 0a9aaa7

29 files changed

+107
-109
lines changed

cmd/Makefile.am

Lines changed: 91 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,38 +2,114 @@ bin_SCRIPTS =
22
bin_PROGRAMS =
33
sbin_SCRIPTS =
44
sbin_PROGRAMS =
5-
udev_PROGRAMS =
65
dist_bin_SCRIPTS =
76
zfsexec_PROGRAMS =
8-
dist_udev_SCRIPTS =
97
mounthelper_PROGRAMS =
108

11-
include $(srcdir)/%D%/fsck_zfs/Makefile.am
9+
10+
sbin_SCRIPTS += fsck.zfs
11+
SHELLCHECKSCRIPTS += fsck.zfs
12+
CLEANFILES += fsck.zfs
13+
EXTRA_DIST += %D%/fsck.zfs.in
14+
$(call SUBST,fsck.zfs,%D%/)
15+
16+
17+
sbin_PROGRAMS += zfs_ids_to_path
18+
CPPCHECKTARGETS += zfs_ids_to_path
19+
20+
zfs_ids_to_path_SOURCES = \
21+
%D%/zfs_ids_to_path.c
22+
23+
zfs_ids_to_path_LDADD = \
24+
libzfs.la
25+
26+
27+
zhack_CPPFLAGS = $(AM_CPPFLAGS) $(FORCEDEBUG_CPPFLAGS)
28+
29+
sbin_PROGRAMS += zhack
30+
CPPCHECKTARGETS += zhack
31+
32+
zhack_SOURCES = \
33+
%D%/zhack.c
34+
35+
zhack_LDADD = \
36+
libzpool.la \
37+
libzfs_core.la \
38+
libnvpair.la
39+
40+
41+
ztest_CFLAGS = $(AM_CFLAGS) $(KERNEL_CFLAGS)
42+
# Get rid of compiler warning for unchecked truncating snprintfs on gcc 7.1.1
43+
ztest_CFLAGS += $(NO_FORMAT_TRUNCATION)
44+
ztest_CPPFLAGS = $(AM_CPPFLAGS) $(FORCEDEBUG_CPPFLAGS)
45+
46+
sbin_PROGRAMS += ztest
47+
CPPCHECKTARGETS += ztest
48+
49+
ztest_SOURCES = \
50+
%D%/ztest.c
51+
52+
ztest_LDADD = \
53+
libzpool.la \
54+
libzfs_core.la \
55+
libnvpair.la
56+
57+
ztest_LDADD += -lm
58+
ztest_LDFLAGS = -pthread
59+
60+
1261
include $(srcdir)/%D%/raidz_test/Makefile.am
13-
include $(srcdir)/%D%/vdev_id/Makefile.am
1462
include $(srcdir)/%D%/zdb/Makefile.am
1563
include $(srcdir)/%D%/zfs/Makefile.am
16-
include $(srcdir)/%D%/zfs_ids_to_path/Makefile.am
17-
include $(srcdir)/%D%/zhack/Makefile.am
1864
include $(srcdir)/%D%/zinject/Makefile.am
1965
include $(srcdir)/%D%/zpool/Makefile.am
2066
include $(srcdir)/%D%/zpool_influxdb/Makefile.am
2167
include $(srcdir)/%D%/zstream/Makefile.am
22-
include $(srcdir)/%D%/ztest/Makefile.am
68+
2369

2470
if BUILD_LINUX
25-
include $(srcdir)/%D%/mount_zfs/Makefile.am
71+
mounthelper_PROGRAMS += mount.zfs
72+
CPPCHECKTARGETS += mount.zfs
73+
74+
mount_zfs_SOURCES = \
75+
%D%/mount_zfs.c
76+
77+
mount_zfs_LDADD = \
78+
libzfs.la \
79+
libzfs_core.la \
80+
libnvpair.la
81+
82+
mount_zfs_LDADD += $(LTLIBINTL)
83+
84+
CPPCHECKTARGETS += raidz_test
85+
86+
87+
sbin_PROGRAMS += zgenhostid
88+
CPPCHECKTARGETS += zgenhostid
89+
90+
zgenhostid_SOURCES = \
91+
%D%/zgenhostid.c
92+
93+
94+
dist_bin_SCRIPTS += %D%/zvol_wait
95+
SHELLCHECKSCRIPTS += %D%/zvol_wait
96+
97+
2698
include $(srcdir)/%D%/zed/Makefile.am
27-
include $(srcdir)/%D%/zgenhostid/Makefile.am
28-
include $(srcdir)/%D%/zvol_id/Makefile.am
29-
include $(srcdir)/%D%/zvol_wait/Makefile.am
3099
endif
31100

101+
32102
if USING_PYTHON
33-
include $(srcdir)/%D%/arc_summary/Makefile.am
34-
include $(srcdir)/%D%/arcstat/Makefile.am
35-
include $(srcdir)/%D%/dbufstat/Makefile.am
103+
bin_SCRIPTS += arc_summary arcstat dbufstat
104+
CLEANFILES += arc_summary arcstat dbufstat
105+
EXTRA_DIST += %D%/arc_summary %D%/arcstat.in %D%/dbufstat.in
106+
107+
$(call SUBST,arcstat,%D%/)
108+
$(call SUBST,dbufstat,%D%/)
109+
arc_summary: %D%/arc_summary
110+
$(AM_V_at)cp $< $@
36111
endif
37112

113+
38114
PHONY += cmd
39-
cmd: $(bin_SCRIPTS) $(bin_PROGRAMS) $(sbin_SCRIPTS) $(sbin_PROGRAMS) $(udev_PROGRAMS) $(dist_bin_SCRIPTS) $(zfsexec_PROGRAMS) $(dist_udev_SCRIPTS) $(mounthelper_PROGRAMS)
115+
cmd: $(bin_SCRIPTS) $(bin_PROGRAMS) $(sbin_SCRIPTS) $(sbin_PROGRAMS) $(dist_bin_SCRIPTS) $(zfsexec_PROGRAMS) $(mounthelper_PROGRAMS)
File renamed without changes.

cmd/arc_summary/Makefile.am

Lines changed: 0 additions & 8 deletions
This file was deleted.
File renamed without changes.

cmd/arcstat/Makefile.am

Lines changed: 0 additions & 4 deletions
This file was deleted.
File renamed without changes.

cmd/dbufstat/Makefile.am

Lines changed: 0 additions & 4 deletions
This file was deleted.
File renamed without changes.

cmd/fsck_zfs/Makefile.am

Lines changed: 0 additions & 5 deletions
This file was deleted.
File renamed without changes.

cmd/mount_zfs/Makefile.am

Lines changed: 0 additions & 20 deletions
This file was deleted.

cmd/vdev_id/Makefile.am

Lines changed: 0 additions & 2 deletions
This file was deleted.
File renamed without changes.

cmd/zfs_ids_to_path/Makefile.am

Lines changed: 0 additions & 8 deletions
This file was deleted.
File renamed without changes.

cmd/zgenhostid/Makefile.am

Lines changed: 0 additions & 5 deletions
This file was deleted.
File renamed without changes.

cmd/zhack/Makefile.am

Lines changed: 0 additions & 12 deletions
This file was deleted.
File renamed without changes.

cmd/ztest/Makefile.am

Lines changed: 0 additions & 18 deletions
This file was deleted.

cmd/zvol_id/Makefile.am

Lines changed: 0 additions & 5 deletions
This file was deleted.
File renamed without changes.

cmd/zvol_wait/Makefile.am

Lines changed: 0 additions & 2 deletions
This file was deleted.

scripts/Makefile.am

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ export GDB="libtool --mode=execute gdb"
3535
export LDMOD=/sbin/insmod
3636

3737
export CMD_DIR=$(abs_top_builddir)
38+
export UDEV_SCRIPT_DIR=$(abs_top_srcdir)/udev
39+
export UDEV_CMD_DIR=$(abs_top_builddir)/udev
3840
export UDEV_RULE_DIR=$(abs_top_builddir)/udev/rules.d
3941
export ZEDLET_ETC_DIR=$$CMD_DIR/cmd/zed/zed.d
4042
export ZEDLET_LIBEXEC_DIR=$$CMD_DIR/cmd/zed/zed.d

scripts/zfs-helpers.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ if [ "${INSTALL}" = "yes" ]; then
156156
for cmd in "mount.zfs" "fsck.zfs"; do
157157
install "$CMD_DIR/$cmd" "$INSTALL_MOUNT_HELPER_DIR/$cmd"
158158
done
159-
for udev in "$CMD_DIR/zvol_id" "$UDEV_SCRIPT_DIR/vdev_id"; do
159+
for udev in "$UDEV_CMD_DIR/zvol_id" "$UDEV_SCRIPT_DIR/vdev_id"; do
160160
install "$udev" "$INSTALL_UDEV_DIR/${udev##*/}"
161161
done
162162
for rule in "60-zvol.rules" "69-vdev.rules" "90-zfs.rules"; do

udev/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/zvol_id

udev/Makefile.am

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,15 @@ udevrule_DATA = \
44
%D%/rules.d/90-zfs.rules
55

66
SUBSTFILES += $(udevrule_DATA)
7+
8+
9+
dist_udev_SCRIPTS = %D%/vdev_id
10+
# TODO: #12084: SHELLCHECKSCRIPTS += %D%/vdev_id
11+
12+
13+
udev_PROGRAMS = %D%/zvol_id
14+
CPPCHECKTARGETS += %D%/zvol_id
15+
16+
17+
PHONY += udev
18+
udev: $(dist_udev_SCRIPTS) $(udev_PROGRAMS)
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)