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_SYSTEM_ROCKPI4_PLUS
)$(ADK_TARGET_SYSTEM_RASPBERRY_PI5
),y
)
28 ifeq ($(ADK_RUNTIME_DATA_PARTITION
),y
)
29 @echo
"Use following command to install with a writable data partition"
30 @echo
"sudo ./scripts/install.sh -d 256 $(ADK_TARGET_SYSTEM) /dev/sdX $(FW_DIR)/$(ROOTFSTARBALL)"
31 @echo
"If you want to update a card without loosing existing data on the writable partition use:"
32 @echo
"sudo ./scripts/install.sh -k -d 256 $(ADK_TARGET_SYSTEM) /dev/sdX $(FW_DIR)/$(ROOTFSTARBALL)"
33 @echo
"In both cases the cfgfs partition is _not_ removed!"
35 @echo
"Use following command to install it on SD card:"
36 @echo
"sudo ./scripts/install.sh $(ADK_TARGET_SYSTEM) /dev/sdX $(FW_DIR)/$(ROOTFSTARBALL)"
39 ifeq ($(ADK_TARGET_QEMU
),y
)
40 @echo
'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
41 @echo
"Use following command to create a QEMU Image:"
42 @echo
"./scripts/create.sh qemu-${ADK_TARGET_CPU_ARCH}.img $(FW_DIR)/$(ROOTFSTARBALL)"
43 @echo
"Start qemu with following options:"
44 @echo
'qemu-system-${ADK_TARGET_CPU_ARCH} ${QEMU_ARGS} -kernel $(FW_DIR)/$(TARGET_KERNEL)'
47 ifeq ($(ADK_TARGET_FS
),initramfs
)
49 @echo
'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
50 @echo
'The initramfs image is: ${FW_DIR}/${INITRAMFS}'
51 ifeq ($(ADK_TARGET_QEMU
),y
)
52 @echo
"Start qemu with following command line:"
53 @echo
'qemu-system-${ADK_TARGET_CPU_ARCH} ${QEMU_ARGS} -kernel $(FW_DIR)/$(TARGET_KERNEL) -initrd ${FW_DIR}/${INITRAMFS}'
56 ifeq ($(ADK_TARGET_FS
),initramfsarchive
)
58 @echo
'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
59 @echo
"The RootFS tarball is: $(FW_DIR)/$(ROOTFSUSERTARBALL)"
61 ifeq ($(ADK_TARGET_FS
),initramfspiggyback
)
63 @echo
'The kernel+initramfs file is: $(FW_DIR)/${TARGET_KERNEL}'
64 ifeq ($(ADK_TARGET_QEMU
),y
)
65 @echo
"Start qemu with following command line:"
66 @echo
'qemu-system-${ADK_TARGET_CPU_ARCH} ${QEMU_ARGS} -kernel $(FW_DIR)/$(TARGET_KERNEL)'
69 ifeq ($(ADK_TARGET_FS
),nfsroot
)
71 @echo
'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
72 @echo
"The RootFS tarball is: $(FW_DIR)/$(ROOTFSUSERTARBALL)"
74 ifeq ($(ADK_TARGET_FS
),genimage
)
76 @echo
"The disk image is: $(FW_DIR)/sdcard.img"
77 @echo
"Use following command to install it on SD card:"
78 @echo
'sudo dd if=$(FW_DIR)/sdcard.img of=/dev/sdX bs=2048k'
80 ifeq ($(ADK_TARGET_FS
),nfsroot
)
81 imageinstall
: kernel-install
$(FW_DIR
)/$(ROOTFSUSERTARBALL
) targethelp
85 @cp
$(KERNEL
) $(BUILD_DIR
)/$(TARGET_KERNEL
)
87 kernel-install
: kernel-strip
88 @cp
$(BUILD_DIR
)/$(TARGET_KERNEL
) $(FW_DIR
)/$(TARGET_KERNEL
)
91 ifeq ($(ADK_TARGET_BOARD_BCM28XX
),y
)
92 ${KERNEL_MAKE} dtbs
$(MAKE_TRACE
)
93 mkdir
-p
$(FW_DIR
)/overlays
94 for x in
$(LINUX_DIR
)/arch
/arm64
/boot
/dts
/overlays
/*.dtbo
; do \
95 [[ -e
"$$x" ]] && cp
$(LINUX_DIR
)/arch
/arm64
/boot
/dts
/overlays
/*.dtbo
$(FW_DIR
)/overlays
; \
98 for x in
$(LINUX_DIR
)/arch
/arm64
/boot
/dts
/broadcom
/*.dtb
; do \
99 [[ -e
"$$x" ]] && cp
$(LINUX_DIR
)/arch
/arm64
/boot
/dts
/broadcom
/*.dtb
$(FW_DIR
); \
103 ifeq ($(ADK_TARGET_SYSTEM_ROCKPI4_PLUS
),y
)
104 ${KERNEL_MAKE} rockchip
/rk3399-rock-pi-4b-plus.dtb
$(MAKE_TRACE
)
106 for x in
$(LINUX_DIR
)/arch
/arm64
/boot
/dts
/*/*.dtb
; do \
107 [[ -e
"$$x" ]] && cp
$(LINUX_DIR
)/arch
/arm64
/boot
/dts
/*/*.dtb
$(FW_DIR
); \
111 # filesystem specific targets
112 ifeq ($(ADK_TARGET_FS
),archive
)
113 imageinstall
: dtb-install
$(FW_DIR
)/$(ROOTFSTARBALL
) targethelp
115 ifeq ($(ADK_TARGET_FS
),initramfs
)
116 imageinstall
: kernel-install
$(FW_DIR
)/$(INITRAMFS
) targethelp
118 ifeq ($(ADK_TARGET_FS
),initramfsarchive
)
119 imageinstall
: kernel-install
$(FW_DIR
)/$(ROOTFSUSERTARBALL
) targethelp
121 ifeq ($(ADK_TARGET_FS
),initramfspiggyback
)
122 imageinstall
: createinitramfs targethelp
124 ifeq ($(ADK_TARGET_FS
),genimage
)
125 imageinstall
: dtb-install
$(FW_DIR
)/$(GENIMAGE
) targethelp