Skip to content

Commit 254d4b3

Browse files
Update Makefile related to virtio-fs
When `make check`, if MOUNT_FOLDER is not exist, then create a new one.
1 parent 7ecd171 commit 254d4b3

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

Makefile

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,10 @@ endif
4444
# virtio-fs
4545
ENABLE_VIRTIOFS ?= 1
4646
$(call set-feature, VIRTIOFS)
47+
MOUNT_FOLDER ?= ./shared
4748
ifeq ($(call has, VIRTIOFS), 1)
4849
OBJS_EXTRA += virtio-fs.o
49-
OPTS += -s ./shared
50+
OPTS += -s $(MOUNT_FOLDER)
5051
endif
5152

5253
NETDEV ?= tap
@@ -205,7 +206,14 @@ ext4.img:
205206
$(Q)dd if=/dev/zero of=$@ bs=4k count=600
206207
$(Q)$(MKFS_EXT4) -F $@
207208

208-
check: $(BIN) minimal.dtb $(KERNEL_DATA) $(INITRD_DATA) $(DISKIMG_FILE)
209+
.PHONY: $(MOUNT_FOLDER)
210+
$(MOUNT_FOLDER):
211+
@if [ ! -d $@ ]; then \
212+
echo "Creating mount folder: $@"; \
213+
mkdir -p $@; \
214+
fi
215+
216+
check: $(BIN) minimal.dtb $(KERNEL_DATA) $(INITRD_DATA) $(DISKIMG_FILE) $(MOUNT_FOLDER)
209217
@$(call notice, Ready to launch Linux kernel. Please be patient.)
210218
$(Q)./$(BIN) -k $(KERNEL_DATA) -c $(SMP) -b minimal.dtb -i $(INITRD_DATA) -n $(NETDEV) $(OPTS)
211219

0 commit comments

Comments
 (0)