1 # This file is part of the OpenADK project. OpenADK is copyrighted
2 # material, please see the LICENCE file in the top-level directory.
4 include $(ADK_TOPDIR
)/rules.mk
5 include $(ADK_TOPDIR
)/mk
/kernel-build.mk
6 include $(ADK_TOPDIR
)/mk
/image.mk
8 KERNEL
:=$(LINUX_DIR
)/arch
/riscv
/boot
/Image
9 QEMU_ARGS
:=-M virt
-m
512 -nographic
10 ifeq ($(ADK_TARGET_WITH_MMU
),)
13 ifeq ($(ADK_TARGET_QEMU_WITH_VIRTIO
),y
)
14 QEMU_ARGS
+=-netdev user
,id
=eth0
-device virtio-net-device
,netdev
=eth0
16 ifeq ($(ADK_TARGET_FS
),archive
)
17 QEMU_ARGS
+=-device virtio-blk-device
,drive
=vda
-drive file
=qemu-
${ADK_TARGET_CPU_ARCH}.img
,if
=none
,id
=vda
,format
=raw
21 ifeq ($(ADK_TARGET_FS
),archive
)
23 @echo
"The RootFS tarball is: $(FW_DIR)/$(ROOTFSTARBALL)"
24 ifeq ($(ADK_TARGET_QEMU
),y
)
25 @echo
'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
26 @echo
"Use following command to create a QEMU Image:"
27 @echo
"./scripts/create.sh qemu-${ADK_TARGET_CPU_ARCH}.img $(FW_DIR)/$(ROOTFSTARBALL)"
28 @echo
"Start qemu with following options:"
29 @echo
'qemu-system-${ADK_TARGET_CPU_ARCH} ${QEMU_ARGS} -kernel $(FW_DIR)/fw_jump.elf'
32 ifeq ($(ADK_TARGET_FS
),initramfs
)
34 @echo
'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
35 @echo
'The initramfs image is: ${FW_DIR}/${INITRAMFS}'
36 ifeq ($(ADK_TARGET_QEMU
),y
)
37 @echo
"Start qemu with following command line:"
38 @echo
'qemu-system-riscv32 ${QEMU_ARGS} -kernel $(FW_DIR)/fw_jump.elf -initrd ${FW_DIR}/${INITRAMFS}'
41 ifeq ($(ADK_TARGET_FS
),initramfsarchive
)
43 @echo
'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
44 @echo
"The RootFS tarball is: $(FW_DIR)/$(ROOTFSUSERTARBALL)"
46 ifeq ($(ADK_TARGET_FS
),initramfspiggyback
)
48 @echo
'The kernel+initramfs file is: $(FW_DIR)/${TARGET_KERNEL}'
49 ifeq ($(ADK_TARGET_QEMU
),y
)
50 @echo
"Start qemu with following command line:"
51 @echo
'qemu-system-riscv32 ${QEMU_ARGS} -kernel $(FW_DIR)/$(TARGET_KERNEL)'
57 kernel-install
: kernel-strip
58 @cp
$(KERNEL
) $(FW_DIR
)/$(TARGET_KERNEL
)
60 # filesystem specific targets
61 ifeq ($(ADK_TARGET_FS
),initramfs
)
62 imageinstall
: kernel-install
$(FW_DIR
)/$(INITRAMFS
) targethelp
64 ifeq ($(ADK_TARGET_FS
),initramfsarchive
)
65 imageinstall
: kernel-install
$(FW_DIR
)/$(ROOTFSUSERTARBALL
) targethelp
67 ifeq ($(ADK_TARGET_FS
),initramfspiggyback
)
68 imageinstall
: createinitramfs targethelp