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.mk
6 include $(ADK_TOPDIR
)/mk
/modules.mk
7 include $(ADK_TOPDIR
)/mk
/kernel-build.mk
8 include $(ADK_TOPDIR
)/mk
/image.mk
10 KERNEL
:=$(LINUX_DIR
)/$(ADK_TARGET_KERNEL
)
11 ifeq ($(ADK_TARGET_KERNEL_ZIMAGE
),y
)
12 KERNEL
:=$(LINUX_DIR
)/arch
/arm
/boot
/zImage
14 ifeq ($(ADK_TARGET_KERNEL_UIMAGE
),y
)
15 KERNEL
:=$(LINUX_DIR
)/arch
/arm
/boot
/uImage
18 QEMU_ARGS
:=${ADK_QEMU_ARGS}
19 ifeq ($(ADK_TARGET_QEMU_ARM_MODEL_SPITZ
),y
)
22 ifeq ($(ADK_TARGET_QEMU_ARM_MODEL_TERRIER
),y
)
25 ifeq ($(ADK_TARGET_QEMU_ARM_MODEL_VERSATILEPB
),y
)
26 QEMU_ARGS
+=-M versatilepb
-net user
-net nic
,model
=smc91c111
28 ifeq ($(ADK_TARGET_QEMU_ARM_MODEL_VEXPRESS_A9
),y
)
29 QEMU_ARGS
+=-M vexpress-a9
-cpu cortex-a9
-m
256 -net user
-net nic
,model
=lan9118
-dtb
$(FW_DIR
)/vexpress-v2p-ca9.dtb
31 ifeq ($(ADK_TARGET_QEMU_WITH_VIRTIO
),y
)
32 QEMU_ARGS
+=-drive file
=qemu-
${ADK_TARGET_CPU_ARCH}.img
,if
=virtio
,index
=0 -net nic
,model
=virtio
-net user
36 ifeq ($(ADK_TARGET_FS
),archive
)
38 @echo
"The RootFS tarball is: $(FW_DIR)/$(ROOTFSTARBALL)"
39 ifeq ($(ADK_TARGET_QEMU_ARM_MODEL_VERSATILEPB
)$(ADK_TARGET_QEMU_ARM_MODEL_TERRIER
)$(ADK_TARGET_QEMU_ARM_MODEL_SPITZ
),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) qemu-${ADK_TARGET_CPU_ARCH}.img'
46 ifeq ($(ADK_TARGET_SYSTEM_RASPBERRY_PI
),y
)
47 ifeq ($(ADK_APPLIANCE_KODI
),y
)
48 @echo
"Use following command to install with a writable data partition"
49 @echo
"sudo ./scripts/install.sh -d 256 raspberry-pi /dev/sdX $(FW_DIR)/$(ROOTFSTARBALL)"
50 @echo
"If you want to update a card without loosing existing data on the writable partition use:"
51 @echo
"sudo ./scripts/install.sh -k -d 256 raspbrry-pi /dev/sdX $(FW_DIR)/$(ROOTFSTARBALL)"
52 @echo
"In both cases the cfgfs partition is _not_ removed!"
54 @echo
"Use following command to install it on SD card:"
55 @echo
"sudo ./scripts/install.sh raspberry-pi /dev/sdX $(FW_DIR)/$(ROOTFSTARBALL)"
58 ifeq ($(ADK_TARGET_SYSTEM_RASPBERRY_PI2
),y
)
59 ifeq ($(ADK_APPLIANCE_KODI
),y
)
60 @echo
"Use following command to install with a writable data partition"
61 @echo
"sudo ./scripts/install.sh -d 256 raspberry-pi2 /dev/sdX $(FW_DIR)/$(ROOTFSTARBALL)"
62 @echo
"If you want to update a card without loosing existing data on the writable partition use:"
63 @echo
"sudo ./scripts/install.sh -k -d 256 raspberry-pi2 /dev/sdX $(FW_DIR)/$(ROOTFSTARBALL)"
64 @echo
"In both cases the cfgfs partition is _not_ removed!"
66 @echo
"Use following command to install it on SD card:"
67 @echo
"sudo ./scripts/install.sh raspberry-pi2 /dev/sdX $(FW_DIR)/$(ROOTFSTARBALL)"
68 @echo
"Use following command to install with a writable data partition"
69 @echo
"sudo ./scripts/install.sh -d 256 raspberry-pi2 /dev/sdX $(FW_DIR)/$(ROOTFSTARBALL)"
72 ifeq ($(ADK_TARGET_SYSTEM_BANANA_PRO
),y
)
73 @echo
"Use following command to install it on SD card:"
74 @echo
"sudo ./scripts/install.sh banana-pro /dev/sdX $(FW_DIR)/$(ROOTFSTARBALL)"
75 @echo
"Use following command to install with a writable data partition"
76 @echo
"sudo ./scripts/install.sh -d 256 banana-pro /dev/sdX $(FW_DIR)/$(ROOTFSTARBALL)"
78 ifeq ($(ADK_TARGET_SYSTEM_SOLIDRUN_IMX6
),y
)
79 ifeq ($(ADK_APPLIANCE_KODI
),y
)
80 @echo
"Use following command to install with a writable data partition"
81 @echo
"sudo ./scripts/install.sh -d 256 solidrun-imx6 /dev/sdX $(FW_DIR)/$(ROOTFSTARBALL)"
82 @echo
"If you want to update a card without loosing existing data on the writable partition use:"
83 @echo
"sudo ./scripts/install.sh -k -d 256 solidrun-imx6 /dev/sdX $(FW_DIR)/$(ROOTFSTARBALL)"
84 @echo
"In both cases the cfgfs partition is _not_ removed!"
86 @echo
"Use following command to install it on SD card:"
87 @echo
"sudo ./scripts/install.sh solidrun-imx6 /dev/sdX $(FW_DIR)/$(ROOTFSTARBALL)"
91 ifeq ($(ADK_TARGET_FS
),initramfs
)
93 @echo
'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
94 @echo
'The initramfs image is: ${FW_DIR}/${INITRAMFS}'
95 ifeq ($(ADK_TARGET_QEMU
),y
)
96 @echo
"Start qemu with following command line:"
97 @echo
'qemu-system-${ADK_TARGET_CPU_ARCH} ${QEMU_ARGS} -kernel $(FW_DIR)/$(TARGET_KERNEL) -initrd ${FW_DIR}/${INITRAMFS}'
100 ifeq ($(ADK_TARGET_FS
),initramfsarchive
)
102 @echo
'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
103 @echo
"The RootFS tarball is: $(FW_DIR)/$(ROOTFSUSERTARBALL)"
105 ifeq ($(ADK_TARGET_FS
),initramfspiggyback
)
107 @echo
'The kernel+initramfs file is: $(FW_DIR)/${TARGET_KERNEL}'
108 ifeq ($(ADK_TARGET_QEMU
),y
)
109 @echo
"Start qemu with following command line:"
110 @echo
'qemu-system-${ADK_TARGET_CPU_ARCH} ${QEMU_ARGS} -kernel $(FW_DIR)/$(TARGET_KERNEL)'
113 ifeq ($(ADK_TARGET_FS
),nfsroot
)
115 @echo
'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
116 @echo
"The RootFS tarball is: $(FW_DIR)/$(ROOTFSUSERTARBALL)"
120 @cp
$(KERNEL
) $(BUILD_DIR
)/$(TARGET_KERNEL
)
121 ifeq ($(ADK_TARGET_SYSTEM_RASPBERRY_PI
),y
)
122 @echo adding DT trailer to kernel
$(MAKE_TRACE
)
123 -rm $(BUILD_DIR
)/$(TARGET_KERNEL
)
124 $(ADK_TOPDIR
)/scripts
/mkknlimg
--dtok
$(KERNEL
) $(BUILD_DIR
)/$(TARGET_KERNEL
) $(MAKE_TRACE
)
126 ifeq ($(ADK_TARGET_SYSTEM_RASPBERRY_PI2
),y
)
127 @echo adding DT trailer to kernel
$(MAKE_TRACE
)
128 -rm $(BUILD_DIR
)/$(TARGET_KERNEL
)
129 $(ADK_TOPDIR
)/scripts
/mkknlimg
--dtok
$(KERNEL
) $(BUILD_DIR
)/$(TARGET_KERNEL
) $(MAKE_TRACE
)
132 kernel-install
: kernel-strip
133 @cp
$(BUILD_DIR
)/$(TARGET_KERNEL
) $(FW_DIR
)/$(TARGET_KERNEL
)
136 ifeq ($(ADK_TARGET_QEMU_ARM_MODEL_VEXPRESS_A9
),y
)
137 env
$(KERNEL_MAKE_ENV
) $(MAKE
) -C
"${LINUX_DIR}" $(KERNEL_MAKE_OPTS
) \
140 ifeq ($(ADK_TARGET_SYSTEM_RASPBERRY_PI
),y
)
141 env
$(KERNEL_MAKE_ENV
) $(MAKE
) -C
"${LINUX_DIR}" $(KERNEL_MAKE_OPTS
) \
144 ifeq ($(ADK_TARGET_SYSTEM_RASPBERRY_PI2
),y
)
145 env
$(KERNEL_MAKE_ENV
) $(MAKE
) -C
"${LINUX_DIR}" $(KERNEL_MAKE_OPTS
) \
148 ifeq ($(ADK_TARGET_SYSTEM_SOLIDRUN_IMX6
),y
)
149 env
$(KERNEL_MAKE_ENV
) $(MAKE
) -C
"${LINUX_DIR}" $(KERNEL_MAKE_OPTS
) \
150 imx6q-cubox-i.dtb imx6dl-cubox-i.dtb imx6dl-hummingboard.dtb imx6q-hummingboard.dtb
$(MAKE_TRACE
)
152 for x in
$(LINUX_DIR
)/arch
/arm
/boot
/dts
/*.dtb
; do \
153 [[ -e
"$$x" ]] && cp
$(LINUX_DIR
)/arch
/arm
/boot
/dts
/*.dtb
$(FW_DIR
); \
157 # filesystem specific targets
158 ifeq ($(ADK_TARGET_FS
),archive
)
159 imageinstall
: dtb-install
$(FW_DIR
)/$(ROOTFSTARBALL
) targethelp
161 ifeq ($(ADK_TARGET_FS
),initramfs
)
162 imageinstall
: kernel-install dtb-install
$(FW_DIR
)/$(INITRAMFS
) targethelp
164 ifeq ($(ADK_TARGET_FS
),initramfsarchive
)
165 imageinstall
: kernel-install dtb-install
$(FW_DIR
)/$(ROOTFSUSERTARBALL
) targethelp
167 ifeq ($(ADK_TARGET_FS
),initramfspiggyback
)
168 imageinstall
: dtb-install createinitramfs targethelp
170 ifeq ($(ADK_TARGET_FS
),nfsroot
)
171 imageinstall
: kernel-install
$(FW_DIR
)/$(ROOTFSUSERTARBALL
) targethelp
173 ifeq ($(ADK_TARGET_FS
),usb
)
174 imageinstall
: $(FW_DIR
)/$(ROOTFSTARBALL
) targethelp