2 # Copyright (C) 2013 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
7 include $(TOPDIR
)/rules.mk
8 include $(INCLUDE_DIR
)/image.mk
10 #################################################
12 #################################################
14 DEVICE_VARS
+= MKUBIFS_OPTS UBOOT BOOT_SCRIPT
16 define Build
/boot-overlay
20 $(CP
) $@
$@.boot
/$(IMG_PREFIX
)-uImage
21 ln
-sf
$(IMG_PREFIX
)-uImage
$@.boot
/uImage
23 $(foreach dts
,$(DEVICE_DTS
), \
25 $(DTS_DIR
)/$(dts
).dtb \
26 $@.boot
/$(IMG_PREFIX
)-$(dts
).dtb
; \
28 $(IMG_PREFIX
)-$(dts
).dtb \
31 mkimage
-A arm
-O linux
-T script
-C none
-a
0 -e
0 \
32 -n
'$(DEVICE_ID) OpenWrt bootscript' \
33 -d .
/bootscript-
$(DEVICE_NAME
) \
34 $@.boot
/6x_bootscript-
$(DEVICE_NAME
)
36 $(STAGING_DIR_HOST
)/bin
/mkfs.ubifs \
37 --space-fixup
--compr
=zlib
--squash-uids \
38 $(MKUBIFS_OPTS
) -c
8124 \
39 -o
$@.boot.ubifs
-d
$@.boot
41 $(TAR
) -C
$@.boot
-cf
$@.boot.
tar .
44 define Build
/bootfs.
tar.gz
48 $(TAR
) -C
$@.boot
-xf
$(IMAGE_KERNEL
).boot.
tar
50 --numeric-owner
--owner
=0 --group
=0 --transform
"s,./,./boot/," \
55 mkimage
-A arm
-O linux
-T script
-C none
-a
0 -e
0 \
56 -n
'$(DEVICE_ID) OpenWrt bootscript' \
57 -d .
/bootscript-
$(DEVICE_NAME
) \
61 define Build
/imx6-combined-image-prepare
66 define Build
/imx6-combined-image-clean
70 define Build
/imx6-combined-image
71 $(CP
) $(IMAGE_KERNEL
) $@.boot
/uImage
73 $(foreach dts
,$(DEVICE_DTS
), \
75 $(DTS_DIR
)/$(dts
).dtb \
79 mkimage
-A arm
-O linux
-T script
-C none
-a
0 -e
0 \
80 -n
'$(DEVICE_ID) OpenWrt bootscript' \
86 $(SCRIPT_DIR
)/gen_image_generic.sh
$@ \
87 $(CONFIG_TARGET_KERNEL_PARTSIZE
) \
89 $(CONFIG_TARGET_ROOTFS_PARTSIZE
) \
94 define Build
/imx6-sdcard
95 $(Build
/imx6-combined-image-prepare
)
97 $(CP
) $(STAGING_DIR_IMAGE
)/$(UBOOT
)-u-boot.img
$@.boot
/u-boot.img
98 $(Build
/imx6-combined-image
)
99 dd if
=$(STAGING_DIR_IMAGE
)/$(UBOOT
)-SPL of
=$@ bs
=1024 seek
=1 conv
=notrunc
101 $(Build
/imx6-combined-image-clean
)
106 #################################################
108 #################################################
110 KERNEL_LOADADDR
=0x10008000
112 define Device
/Default
114 FILESYSTEMS
:= squashfs ext4
116 KERNEL_SUFFIX
:= -uImage
117 KERNEL_NAME
:= zImage
118 KERNEL_PREFIX
:= $$(IMAGE_PREFIX
)
119 KERNEL
:= kernel-bin | uImage none
123 define Device
/ventana
124 DEVICE_TITLE
:= Gateworks Ventana family
(normal NAND flash
)
143 DEVICE_PACKAGES
:= kmod-sky2 kmod-sound-core kmod-sound-soc-imx kmod-sound-soc-imx-sgtl5000 \
144 kmod-can kmod-can-flexcan kmod-can-raw \
146 kmod-leds-gpio kmod-pps-gpio \
148 KERNEL
+= | boot-overlay
149 IMAGES
:= nand.ubi bootfs.
tar.gz
150 IMAGE_NAME
= $$(IMAGE_PREFIX
)-$$(1).
$$(2)
151 UBINIZE_PARTS
= boot
=$$(KDIR_KERNEL_IMAGE
).boot.ubifs
=15
152 BOOT_SCRIPT
:= bootscript-ventana
153 IMAGE
/nand.ubi
:= append-ubi
154 IMAGE
/bootfs.
tar.gz
:= bootfs.
tar.gz | install-dtb
155 IMAGE_NAME
= $$(IMAGE_PREFIX
)-$$(1)-$$(2)
158 MKUBIFS_OPTS
:= -m
$$(PAGESIZE
) -e
124KiB
160 TARGET_DEVICES
+= ventana
162 define Device
/ventana-large
164 DEVICE_NAME
:= ventana
165 DEVICE_TITLE
:= Gateworks Ventana family
(large NAND flash
)
169 MKUBIFS_OPTS
:= -m
$$(PAGESIZE
) -e
248KiB
171 TARGET_DEVICES
+= ventana-large
173 define Device
/wandboard
174 DEVICE_TITLE
:= Wandboard Dual
175 DEVICE_DTS
:= imx6dl-wandboard
177 TARGET_DEVICES
+= wandboard
179 define Device
/cubox-i
180 KERNEL
:= kernel-bin | install-dtb
182 BOOT_SCRIPT
= bootscript-cubox
184 DEVICE_TITLE
:= SolidRun CuBox-i
185 DEVICE_PACKAGES
:= kmod-drm-imx kmod-drm-imx-hdmi kmod-usb-hid
186 DEVICE_DTS
:= imx6q-cubox-i imx6dl-cubox-i imx6q-hummingboard imx6dl-hummingboard
187 IMAGES
:= combined.bin
188 FILESYSTEMS
:= squashfs
189 IMAGE
/combined.bin
:= append-rootfs | pad-extra
128k | imx6-sdcard
191 TARGET_DEVICES
+= cubox-i
193 $(eval
$(call BuildImage
))