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
/arm64
/boot
/Image
10 QEMU_ARGS
:=${ADK_QEMU_ARGS}
11 QEMU_ARGS
+=-M virt
-cpu cortex-a57
-smp
1
12 ifeq ($(ADK_TARGET_QEMU_WITH_VIRTIO
),y
)
13 QEMU_ARGS
+=-netdev user
,id
=eth0
-device virtio-net-device
,netdev
=eth0
15 ifeq ($(ADK_TARGET_FS
),archive
)
16 QEMU_ARGS
+=-device virtio-blk-device
,drive
=vda
-drive file
=qemu-
${ADK_TARGET_CPU_ARCH}.img
,if
=none
,id
=vda
,format
=raw
20 ifeq ($(ADK_TARGET_FS
),archive
)
22 @echo
"The RootFS tarball is: $(FW_DIR)/$(ROOTFSTARBALL)"
23 ifeq ($(ADK_TARGET_BOARD_BCM28XX
),y
)
24 @echo
"Use following command to install it on SD card:"
25 @echo
"sudo ./scripts/install.sh $(ADK_TARGET_SYSTEM) /dev/sdX $(FW_DIR)/$(ROOTFSTARBALL)"
27 ifeq ($(ADK_TARGET_QEMU
),y
)
28 @echo
'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
29 @echo
"Use following command to create a QEMU Image:"
30 @echo
"./scripts/create.sh qemu-${ADK_TARGET_CPU_ARCH}.img $(FW_DIR)/$(ROOTFSTARBALL)"
31 @echo
"Start qemu with following options:"
32 @echo
'qemu-system-${ADK_TARGET_CPU_ARCH} ${QEMU_ARGS} -kernel $(FW_DIR)/$(TARGET_KERNEL)'
35 ifeq ($(ADK_TARGET_FS
),initramfs
)
37 @echo
'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
38 @echo
'The initramfs image is: ${FW_DIR}/${INITRAMFS}'
39 ifeq ($(ADK_TARGET_QEMU
),y
)
40 @echo
"Start qemu with following command line:"
41 @echo
'qemu-system-${ADK_TARGET_CPU_ARCH} ${QEMU_ARGS} -kernel $(FW_DIR)/$(TARGET_KERNEL) -initrd ${FW_DIR}/${INITRAMFS}'
44 ifeq ($(ADK_TARGET_FS
),initramfsarchive
)
46 @echo
'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
47 @echo
"The RootFS tarball is: $(FW_DIR)/$(ROOTFSUSERTARBALL)"
49 ifeq ($(ADK_TARGET_FS
),initramfspiggyback
)
51 @echo
'The kernel+initramfs file is: $(FW_DIR)/${TARGET_KERNEL}'
52 ifeq ($(ADK_TARGET_QEMU
),y
)
53 @echo
"Start qemu with following command line:"
54 @echo
'qemu-system-${ADK_TARGET_CPU_ARCH} ${QEMU_ARGS} -kernel $(FW_DIR)/$(TARGET_KERNEL)'
59 @cp
$(KERNEL
) $(BUILD_DIR
)/$(TARGET_KERNEL
)
61 kernel-install
: kernel-strip
62 @cp
$(BUILD_DIR
)/$(TARGET_KERNEL
) $(FW_DIR
)/$(TARGET_KERNEL
)
65 ifeq ($(ADK_TARGET_BOARD_BCM28XX
),y
)
66 env
$(KERNEL_MAKE_ENV
) $(MAKE
) -C
"${LINUX_DIR}" $(KERNEL_MAKE_OPTS
) \
68 mkdir
-p
$(FW_DIR
)/overlays
69 for x in
$(LINUX_DIR
)/arch
/arm64
/boot
/dts
/overlays
/*.dtbo
; do \
70 [[ -e
"$$x" ]] && cp
$(LINUX_DIR
)/arch
/arm64
/boot
/dts
/overlays
/*.dtbo
$(FW_DIR
)/overlays
; \
73 for x in
$(LINUX_DIR
)/arch
/arm64
/boot
/dts
/broadcom
/*.dtb
; do \
74 [[ -e
"$$x" ]] && cp
$(LINUX_DIR
)/arch
/arm64
/boot
/dts
/broadcom
/*.dtb
$(FW_DIR
); \
79 # filesystem specific targets
80 ifeq ($(ADK_TARGET_FS
),archive
)
81 imageinstall
: dtb-install
$(FW_DIR
)/$(ROOTFSTARBALL
) targethelp
83 ifeq ($(ADK_TARGET_FS
),initramfs
)
84 imageinstall
: kernel-install
$(FW_DIR
)/$(INITRAMFS
) targethelp
86 ifeq ($(ADK_TARGET_FS
),initramfsarchive
)
87 imageinstall
: kernel-install
$(FW_DIR
)/$(ROOTFSUSERTARBALL
) targethelp
89 ifeq ($(ADK_TARGET_FS
),initramfspiggyback
)
90 imageinstall
: createinitramfs targethelp