File tree Expand file tree Collapse file tree 1 file changed +14
-6
lines changed Expand file tree Collapse file tree 1 file changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -5,20 +5,28 @@ CFLAGS := -O2 -g -Wall -Wextra
5
5
CFLAGS += -include common.h
6
6
7
7
OBJS_EXTRA :=
8
+ # command line option
9
+ OPTS :=
8
10
9
11
# virtio-blk
10
12
ENABLE_VIRTIOBLK ?= 1
11
- OBJS_EXTRA += virtio-blk.o
12
13
$(call set-feature, VIRTIOBLK)
14
+ DISKIMG_FILE :=
15
+ ifeq ($(call has, VIRTIOBLK) , 1)
16
+ OBJS_EXTRA += virtio-blk.o
17
+ DISKIMG_FILE := ext4.img
18
+ OPTS += -d $(DISKIMG_FILE )
19
+ endif
13
20
14
21
# virtio-net
15
22
ENABLE_VIRTIONET ?= 1
16
- ifeq ($(UNAME_S ) ,Linux)
17
- OBJS_EXTRA += virtio-net.o
18
- else
23
+ ifneq ($(UNAME_S ) ,Linux)
19
24
ENABLE_VIRTIONET := 0
20
25
endif
21
26
$(call set-feature, VIRTIONET)
27
+ ifeq ($(call has, VIRTIONET) , 1)
28
+ OBJS_EXTRA += virtio-net.o
29
+ endif
22
30
23
31
BIN = semu
24
32
all : $(BIN ) minimal.dtb
@@ -64,9 +72,9 @@ ext4.img:
64
72
$(Q ) dd if=/dev/zero of=$@ bs=4k count=600
65
73
$(Q ) mkfs.ext4 -F $@
66
74
67
- check : $(BIN ) minimal.dtb $(KERNEL_DATA ) ext4.img
75
+ check : $(BIN ) minimal.dtb $(KERNEL_DATA ) $( DISKIMG_FILE )
68
76
@$(call notice, Ready to launch Linux kernel. Please be patient.)
69
- $(Q ) ./$(BIN ) -k $(KERNEL_DATA ) -b minimal.dtb -d ext4.img
77
+ $(Q ) ./$(BIN ) -k $(KERNEL_DATA ) -b minimal.dtb $( OPTS )
70
78
71
79
build-image :
72
80
scripts/build-image.sh
You can’t perform that action at this time.
0 commit comments