Skip to content

Commit dd55eba

Browse files
zhongchanghuikawasaki
authored andcommitted
src/Makefile: improve header check for miniublk
After make / make install, src/nvme-passthru-admin-uring is not built when linux/ublk_cmd.h is missing from userspace kernel headers, even if liburing is new enough (IORING_OP_URING_CMD). Tests such as nvme/067 then fail with sudo: src/nvme-passthru-admin-uring: command not found. nvme-passthru-admin-uring does not include linux/ublk_cmd.h; only miniublk needs it. The Makefile currently ties all C_URING_TARGETS to the same HAVE_LIBURING + HAVE_UBLK_HEADER gate (or equivalent), so the NVMe helper is skipped together with miniublk. When ublk stack is not available, still build metadata and nvme-passthru-admin-uring if HAVE_LIBURING is 1, and only skip miniublk with an explicit message when linux/ublk_cmd.h is missing. For that purpose, split miniublk from the variable C_URING_TARGETS. Link: #236 Signed-off-by: Shin'ichiro Kawasaki <[email protected]> Signed-off-by: Changhui Zhong <[email protected]>
1 parent 078a7ac commit dd55eba

1 file changed

Lines changed: 14 additions & 7 deletions

File tree

src/Makefile

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,21 +22,28 @@ C_TARGETS := \
2222
sg/syzkaller1 \
2323
zbdioctl
2424

25-
C_URING_TARGETS := miniublk \
26-
metadata \
27-
nvme-passthru-admin-uring
25+
C_URING_TARGETS := metadata \
26+
nvme-passthru-admin-uring
27+
C_UBLK_TARGETS := miniublk
2828

2929
HAVE_LIBURING := $(call HAVE_C_MACRO,liburing.h,IORING_OP_URING_CMD)
3030
HAVE_UBLK_HEADER := $(call HAVE_C_HEADER,linux/ublk_cmd.h,1)
3131

3232
CXX_TARGETS := \
3333
discontiguous-io
3434

35-
ifeq ($(HAVE_LIBURING)$(HAVE_UBLK_HEADER), 11)
36-
TARGETS := $(C_TARGETS) $(CXX_TARGETS) $(C_URING_TARGETS)
37-
else
38-
$(info Skip $(C_URING_TARGETS) build due to missing kernel header(v6.0+) or liburing(2.2+))
3935
TARGETS := $(C_TARGETS) $(CXX_TARGETS)
36+
37+
ifeq ($(HAVE_UBLK_HEADER), 1)
38+
C_URING_TARGETS += $(C_UBLK_TARGETS)
39+
else
40+
$(info Skip $(C_UBLK_TARGETS) build due to missing kernel header(v6.0+))
41+
endif
42+
43+
ifeq ($(HAVE_LIBURING), 1)
44+
TARGETS += $(C_URING_TARGETS)
45+
else
46+
$(info Skip $(C_URING_TARGETS) build due to missing liburing(2.2+))
4047
endif
4148

4249
CONFIG_DEFS := $(call HAVE_C_HEADER,linux/blkzoned.h,-DHAVE_LINUX_BLKZONED_H)

0 commit comments

Comments
 (0)