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
)/$(ADK_TARGET_KERNEL
)
9 ifeq ($(ADK_TARGET_KERNEL_ZIMAGE
),y
)
10 KERNEL
:=$(LINUX_DIR
)/arch
/arm
/boot
/zImage
12 ifeq ($(ADK_TARGET_KERNEL_UIMAGE
),y
)
13 KERNEL
:=$(LINUX_DIR
)/arch
/arm
/boot
/uImage
15 ifeq ($(ADK_TARGET_KERNEL_XIPIMAGE
),y
)
16 KERNEL
:=$(LINUX_DIR
)/arch
/arm
/boot
/xipImage
18 ifeq ($(ADK_TARGET_KERNEL_IMAGE
),y
)
19 KERNEL
:=$(LINUX_DIR
)/arch
/arm
/boot
/Image
22 QEMU_ARGS
:=${ADK_QEMU_ARGS}
23 ifeq ($(ADK_TARGET_SYSTEM_QEMU_ARM_XILINX_ZYNQ
),y
)
24 QEMU_ARGS
+=-M xilinx-zynq-a9
-dtb
$(FW_DIR
)/zynq-zc702.dtb
-serial null
-serial mon
:stdio
26 ifeq ($(ADK_TARGET_SYSTEM_QEMU_ARM_SPITZ
),y
)
29 ifeq ($(ADK_TARGET_SYSTEM_QEMU_ARM_TERRIER
),y
)
32 ifeq ($(ADK_TARGET_SYSTEM_QEMU_ARM_REALVIEW_EB_MPCORE
),y
)
33 QEMU_ARGS
+=-M realview-eb-mpcore
-net user
-net nic
35 ifeq ($(ADK_TARGET_SYSTEM_QEMU_ARM_VERSATILEPB
)$(ADK_TARGET_SYSTEM_QEMU_ARM_VERSATILEPB_NOMMU
),y
)
36 ifeq ($(ADK_TARGET_WITH_DEVICETREE
),y
)
37 QEMU_ARGS
+=-M versatilepb
-net user
-net nic
,model
=smc91c111
-dtb
$(FW_DIR
)/versatile-pb.dtb
39 QEMU_ARGS
+=-M versatilepb
-net user
-net nic
,model
=smc91c111
42 ifeq ($(ADK_TARGET_SYSTEM_QEMU_ARM_VEXPRESS_A9
),y
)
43 QEMU_ARGS
+=-M vexpress-a9
-cpu cortex-a9
-m
256 -net user
-net nic
,model
=lan9118
-dtb
$(FW_DIR
)/vexpress-v2p-ca9.dtb
44 ifeq ($(ADK_TARGET_ROOTFS_ARCHIVE
),y
)
45 QEMU_ARGS
+=-drive file
=qemu-arm.img
,if
=sd
,format
=raw
48 ifeq ($(ADK_TARGET_QEMU_WITH_VIRTIO
),y
)
49 QEMU_ARGS
+=-drive file
=qemu-
${ADK_TARGET_CPU_ARCH}.img
,if
=virtio
,index
=0 -net nic
,model
=virtio
-net user
53 ifeq ($(ADK_TARGET_FS
),archive
)
55 @echo
"The RootFS tarball is: $(FW_DIR)/$(ROOTFSTARBALL)"
56 ifeq ($(ADK_TARGET_SYSTEM_QEMU_ARM_VEXPRESS_A9
)$(ADK_TARGET_SYSTEM_QEMU_ARM_VERSATILEPB
)$(ADK_TARGET_SYSTEM_QEMU_ARM_TERRIER
)$(ADK_TARGET_SYSTEM_QEMU_ARM_SPITZ
),y
)
57 @echo
'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
58 @echo
"Use following command to create a QEMU Image:"
59 @echo
"./scripts/create.sh qemu-${ADK_TARGET_CPU_ARCH}.img $(FW_DIR)/$(ROOTFSTARBALL)"
60 @echo
"Start qemu with following options:"
61 @echo
'qemu-system-${ADK_TARGET_CPU_ARCH} ${QEMU_ARGS} -kernel $(FW_DIR)/$(TARGET_KERNEL) qemu-${ADK_TARGET_CPU_ARCH}.img'
63 ifeq ($(ADK_TARGET_BOARD_BCM28XX
)$(ADK_TARGET_SYSTEM_SOLIDRUN_IMX6
)$(ADK_TARGET_SYSTEM_SOLIDRUN_CLEARFOG
),y
)
64 ifeq ($(ADK_APPLIANCE_KODI
),y
)
65 @echo
"Use following command to install with a writable data partition"
66 @echo
"sudo ./scripts/install.sh -d 256 $(ADK_TARGET_SYSTEM) /dev/sdX $(FW_DIR)/$(ROOTFSTARBALL)"
67 @echo
"If you want to update a card without loosing existing data on the writable partition use:"
68 @echo
"sudo ./scripts/install.sh -k -d 256 $(ADK_TARGET_SYSTEM) /dev/sdX $(FW_DIR)/$(ROOTFSTARBALL)"
69 @echo
"In both cases the cfgfs partition is _not_ removed!"
71 @echo
"Use following command to install it on SD card:"
72 @echo
"sudo ./scripts/install.sh $(ADK_TARGET_SYSTEM) /dev/sdX $(FW_DIR)/$(ROOTFSTARBALL)"
75 ifeq ($(ADK_TARGET_SYSTEM_BANANA_PRO
),y
)
76 @echo
"Use following command to install it on SD card:"
77 @echo
"sudo ./scripts/install.sh banana-pro /dev/sdX $(FW_DIR)/$(ROOTFSTARBALL)"
78 @echo
"Use following command to install with a writable data partition"
79 @echo
"sudo ./scripts/install.sh -d 256 banana-pro /dev/sdX $(FW_DIR)/$(ROOTFSTARBALL)"
82 ifeq ($(ADK_TARGET_FS
),initramfs
)
84 @echo
'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
85 @echo
'The initramfs image is: ${FW_DIR}/${INITRAMFS}'
86 ifeq ($(ADK_TARGET_QEMU
),y
)
87 @echo
"Start qemu with following command line:"
88 @echo
'qemu-system-arm ${QEMU_ARGS} -kernel $(FW_DIR)/$(TARGET_KERNEL) -initrd ${FW_DIR}/${INITRAMFS}'
91 ifeq ($(ADK_TARGET_FS
),initramfsarchive
)
93 @echo
'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
94 @echo
"The RootFS tarball is: $(FW_DIR)/$(ROOTFSUSERTARBALL)"
96 ifeq ($(ADK_TARGET_FS
),initramfspiggyback
)
98 @echo
'The kernel+initramfs file is: $(FW_DIR)/${TARGET_KERNEL}'
99 ifeq ($(ADK_TARGET_QEMU
),y
)
100 @echo
"Start qemu with following command line:"
101 @echo
'qemu-system-arm ${QEMU_ARGS} -kernel $(FW_DIR)/$(TARGET_KERNEL)'
104 ifeq ($(ADK_TARGET_FS
),nfsroot
)
106 @echo
'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
107 @echo
"The RootFS tarball is: $(FW_DIR)/$(ROOTFSUSERTARBALL)"
108 ifeq ($(ADK_TARGET_SYSTEM_LINKSYS_NSLU2
),y
)
109 @echo
"Use following in RedBoot bootloader:"
110 @echo
"RedBoot> ip_address -l <localip> -h <serverip>; load -r -v -b 0x01d00000 ${TARGET_KERNEL}; exec 0x01d00000"
113 ifeq ($(ADK_TARGET_FS
),squashfs
)
115 @echo
'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
116 @echo
"The RootFS image is: $(FW_DIR)/$(ROOTFSSQUASHFS)"
117 ifeq ($(ADK_TARGET_QEMU
),y
)
118 @echo
"Start qemu with following options:"
119 @echo
'qemu-system-arm $(QEMU_ARGS) -nographic -kernel $(FW_DIR)/$(TARGET_KERNEL) $(FW_DIR)/$(ROOTFSSQUASHFS)'
122 ifeq ($(ADK_TARGET_FS
),jffs2
)
124 @echo
'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
125 @echo
"The RootFS image is: $(FW_DIR)/$(ROOTFSJFFS2)"
126 ifeq ($(ADK_TARGET_QEMU
),y
)
127 @echo
"Start qemu with following options:"
128 @echo
'qemu-system-arm $(QEMU_ARGS) -nographic -kernel $(FW_DIR)/$(TARGET_KERNEL) $(FW_DIR)/$(ROOTFSJFFS2)'
131 ifeq ($(ADK_TARGET_FS
),genimage
)
133 @echo
"The disk image is: $(FW_DIR)/disk.img"
134 @echo
"Use following command to install it on SD card:"
135 @echo
'sudo dd if=$(FW_DIR)/disk.img of=/dev/sdX bs=2048k'
139 ifeq ($(ADK_TARGET_KERNEL_REPO_NAME
),rpi
)
140 @echo adding DT trailer to kernel
$(MAKE_TRACE
)
141 PATH
='$(HOST_PATH)' perl
$(LINUX_DIR
)/scripts
/mkknlimg
--dtok
$(KERNEL
) $(BUILD_DIR
)/$(TARGET_KERNEL
)
143 @cp
$(KERNEL
) $(BUILD_DIR
)/$(TARGET_KERNEL
)
146 kernel-install
: kernel-strip
147 @cp
$(BUILD_DIR
)/$(TARGET_KERNEL
) $(FW_DIR
)/$(TARGET_KERNEL
)
148 ifeq ($(ADK_TARGET_FS
),squashfs
)
149 env PATH
=$(HOST_PATH
) qemu-img create
-f raw
$(FW_DIR
)/$(ROOTFSSQUASHFS
) $(ADK_TARGET_MTD_SIZE
)
150 dd conv
=notrunc if
=$(BUILD_DIR
)/root.squashfs of
=$(FW_DIR
)/$(ROOTFSSQUASHFS
)
154 ifeq ($(ADK_TARGET_SYSTEM_QEMU_ARM_XILINX_ZYNQ
),y
)
155 env
$(KERNEL_MAKE_ENV
) $(MAKE
) -C
"${LINUX_DIR}" $(KERNEL_MAKE_OPTS
) \
158 ifeq ($(ADK_TARGET_SYSTEM_QEMU_ARM_VEXPRESS_A9
),y
)
159 env
$(KERNEL_MAKE_ENV
) $(MAKE
) -C
"${LINUX_DIR}" $(KERNEL_MAKE_OPTS
) \
162 ifeq ($(ADK_TARGET_SYSTEM_QEMU_ARM_VERSATILEPB
)$(ADK_TARGET_SYSTEM_QEMU_ARM_VERSATILEPB_NOMMU
),y
)
163 env
$(KERNEL_MAKE_ENV
) $(MAKE
) -C
"${LINUX_DIR}" $(KERNEL_MAKE_OPTS
) \
166 ifeq ($(ADK_TARGET_SYSTEM_BEAGLEBONE_BLACK
),y
)
167 env
$(KERNEL_MAKE_ENV
) $(MAKE
) -C
"${LINUX_DIR}" $(KERNEL_MAKE_OPTS
) \
169 cp
$(LINUX_DIR
)/arch
/arm
/boot
/dts
/am335x-boneblack.dtb
${TARGET_DIR}/boot
171 ifeq ($(ADK_TARGET_BOARD_BCM28XX
),y
)
172 env
$(KERNEL_MAKE_ENV
) $(MAKE
) -C
"${LINUX_DIR}" $(KERNEL_MAKE_OPTS
) \
174 mkdir
-p
$(FW_DIR
)/overlays
175 for x in
$(LINUX_DIR
)/arch
/arm
/boot
/dts
/overlays
/*.dtb
; do \
176 [[ -e
"$$x" ]] && cp
$(LINUX_DIR
)/arch
/arm
/boot
/dts
/overlays
/*.dtb
$(FW_DIR
)/overlays
; \
180 ifeq ($(ADK_TARGET_SYSTEM_BANANA_PRO
),y
)
181 env
$(KERNEL_MAKE_ENV
) $(MAKE
) -C
"${LINUX_DIR}" $(KERNEL_MAKE_OPTS
) \
182 sun7i-a20-bananapro.dtb
$(MAKE_TRACE
)
184 ifeq ($(ADK_TARGET_SYSTEM_SOLIDRUN_IMX6
),y
)
185 env
$(KERNEL_MAKE_ENV
) $(MAKE
) -C
"${LINUX_DIR}" $(KERNEL_MAKE_OPTS
) \
186 imx6q-cubox-i.dtb imx6dl-cubox-i.dtb imx6dl-hummingboard.dtb imx6q-hummingboard.dtb
$(MAKE_TRACE
)
188 ifeq ($(ADK_TARGET_SYSTEM_SOLIDRUN_CLEARFOG
),y
)
189 env
$(KERNEL_MAKE_ENV
) $(MAKE
) -C
"${LINUX_DIR}" $(KERNEL_MAKE_OPTS
) \
190 armada-388-clearfog.dtb
$(MAKE_TRACE
)
192 for x in
$(LINUX_DIR
)/arch
/arm
/boot
/dts
/*.dtb
; do \
193 [[ -e
"$$x" ]] && cp
$(LINUX_DIR
)/arch
/arm
/boot
/dts
/*.dtb
$(FW_DIR
); \
197 # filesystem specific targets
198 ifeq ($(ADK_TARGET_FS
),archive
)
199 imageinstall
: dtb-install
$(FW_DIR
)/$(ROOTFSTARBALL
) targethelp
201 ifeq ($(ADK_TARGET_FS
),initramfs
)
202 imageinstall
: kernel-install dtb-install
$(FW_DIR
)/$(INITRAMFS
) targethelp
204 ifeq ($(ADK_TARGET_FS
),initramfsarchive
)
205 imageinstall
: kernel-install dtb-install
$(FW_DIR
)/$(ROOTFSUSERTARBALL
) targethelp
207 ifeq ($(ADK_TARGET_FS
),initramfspiggyback
)
208 imageinstall
: dtb-install createinitramfs targethelp
210 ifeq (${ADK_TARGET_FS},genimage
)
211 imageinstall
: dtb-install
$(FW_DIR
)/$(GENIMAGE
) targethelp
213 ifeq ($(ADK_TARGET_FS
),nfsroot
)
214 imageinstall
: kernel-install
$(FW_DIR
)/$(ROOTFSUSERTARBALL
) targethelp
216 ifeq ($(ADK_TARGET_FS
),squashfs
)
217 imageinstall
: $(BUILD_DIR
)/root.squashfs kernel-install dtb-install targethelp
219 ifeq ($(ADK_TARGET_FS
),jffs2
)
220 imageinstall
: kernel-install dtb-install
$(FW_DIR
)/$(ROOTFSJFFS2
) targethelp
222 ifeq ($(ADK_TARGET_FS
),usb
)
223 imageinstall
: $(FW_DIR
)/$(ROOTFSTARBALL
) targethelp