2 # Copyright (C) 2012-2016 OpenWrt.org
3 # Copyright (C) 2016 LEDE-project.org
5 # This is free software, licensed under the GNU General Public License v2.
6 # See /LICENSE for more information.
11 include $(TOPDIR
)/rules.mk
12 include $(INCLUDE_DIR
)/image.mk
14 KERNEL_LOADADDR
:= 0x00008000
16 SIGNATURE
:=$(shell printf
"%.8s" $(SOURCE_DATE_EPOCH
))
19 $(call Image
/BuildDTB
,$(DTS_DIR
)/$(DEVICE_DTS
).dts
,$@.dtb
)
23 # these values are optimized for a 4GB labeled sdcard that actually holds 7744512 sectors of 512 byte
25 # Partition 1: 32768 sectors
26 # Partition 2: 98304 sectors (configurable)
30 mkimage
-A arm
-O linux
-T script
-C none
-a
0 -e
0 -d
$(DEVICE_NAME
).bootscript
$@
-boot.scr
35 mkfs.fat
-C
$@.boot
16384
36 $(foreach dts
,$(DEVICE_DTS
), mcopy
-i
$@.boot
$(DTS_DIR
)/$(dts
).dtb
::$(dts
).dtb
;)
37 mcopy
-i
$@.boot
$(IMAGE_KERNEL
) ::zImage
38 -mcopy
-i
$@.boot
$@
-boot.scr
::boot.scr
41 define Build
/sdcard-img
42 if
[ -n
"$(UBOOT)" ]; then UBOOT
="$(STAGING_DIR_IMAGE)/$(UBOOT)"; fi
; \
43 ROOTFS_SIZE
=$$(( $(CONFIG_TARGET_ROOTFS_PARTSIZE
) * 1024 * 2 )); \
44 SIGNATURE
="$(SIGNATURE)" \
45 .
/gen_mvebu_sdcard_img.sh
$@ \
48 83 $$ROOTFS_SIZE $(IMAGE_ROOTFS
)
51 define Build
/omnia-medkit-initramfs
52 $(TAR
) -c
-T
/dev
/null
-f
$@
53 rm -rf
$(dir $(IMAGE_KERNEL
))boot
54 mkdir
-p
$(dir $(IMAGE_KERNEL
))boot
/boot
/
55 cp
$(KDIR
)/zImage-initramfs
$(dir $(IMAGE_KERNEL
))boot
/boot
/zImage
56 cp
$(DTS_DIR
)/$(DEVICE_DTS
).dtb
$(dir $(IMAGE_KERNEL
))boot
/boot
/dtb
57 $(TAR
) -rp
--numeric-owner
--owner
=0 --group
=0 --sort=name \
58 $(if
$(SOURCE_DATE_EPOCH
),--mtime
="@$(SOURCE_DATE_EPOCH)") \
59 --file
=$@
-C
$(dir $(IMAGE_KERNEL
))boot
/ .
65 BOARD_NAME
= $$(DEVICE_DTS
)
67 KERNEL
:= kernel-bin | append-dtb | uImage none
68 SUPPORTED_DEVICES
= $$(DEVICE_DTS
)
72 IMAGES
:= sysupgrade.bin
73 IMAGE
/sysupgrade.bin
:= sysupgrade-tar | append-metadata
76 define Device
/UBI-factory
80 IMAGE
/factory.img
:= append-kernel | pad-to
$$$$(KERNEL_SIZE
) | append-ubi | pad-to
$$$$(PAGESIZE
)
83 define Device
/NAND-128K
88 VID_HDR_OFFSET
:= 2048
91 define Device
/NAND-256K
97 define Device
/NAND-512K
105 $(eval
$(call BuildImage
))