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
))
21 -e
's#@ROOT@#$(SIGNATURE)#g' \
22 -e
's#@DTB@#$(firstword $(DEVICE_DTS))#g' \
23 $(BOOT_SCRIPT
).bootscript
> $@
-new.bootscript
24 mkimage
-A arm
-O linux
-T script
-C none
-a
0 -e
0 -d
$@
-new.bootscript
$@
-boot.scr
29 mkfs.fat
-C
$@.boot
$$(( $(CONFIG_TARGET_KERNEL_PARTSIZE
) * 1024 ))
30 $(foreach dts
,$(DEVICE_DTS
), mcopy
-i
$@.boot
$(KDIR
)/image-
$(dts
).dtb
::$(dts
).dtb
;)
31 mcopy
-i
$@.boot
$(IMAGE_KERNEL
) ::$(KERNEL_NAME
)
32 -mcopy
-i
$@.boot
$@
-boot.scr
::boot.scr
35 define Build
/boot-img-ext4
38 $(foreach dts
,$(DEVICE_DTS
), $(CP
) $(KDIR
)/image-
$(dts
).dtb
$@.boot
/$(dts
).dtb
;)
39 $(CP
) $(IMAGE_KERNEL
) $@.boot
/$(KERNEL_NAME
)
40 -$(CP
) $@
-boot.scr
$@.boot
/boot.scr
41 make_ext4fs
-J
-l
$(CONFIG_TARGET_KERNEL_PARTSIZE
)M
$@.bootimg
$@.boot
44 define Build
/sdcard-img
45 if
[ -n
"$(UBOOT)" ]; then UBOOT
="$(STAGING_DIR_IMAGE)/$(UBOOT)"; fi
; \
46 BOOTFS_SIZE
=$$(( $(CONFIG_TARGET_KERNEL_PARTSIZE
) * 1024 * 2 )); \
47 ROOTFS_SIZE
=$$(( $(CONFIG_TARGET_ROOTFS_PARTSIZE
) * 1024 * 2 )); \
48 SIGNATURE
="$(SIGNATURE)" \
49 .
/gen_mvebu_sdcard_img.sh
$@ \
51 c
$$BOOTFS_SIZE $@.boot \
52 83 $$ROOTFS_SIZE $(IMAGE_ROOTFS
)
55 define Build
/sdcard-img-ext4
56 if
[ -n
"$(UBOOT)" ]; then UBOOT
="$(STAGING_DIR_IMAGE)/$(UBOOT)"; fi
; \
57 BOOTFS_SIZE
=$$(( $(CONFIG_TARGET_KERNEL_PARTSIZE
) * 1024 * 2 )); \
58 ROOTFS_SIZE
=$$(( $(CONFIG_TARGET_ROOTFS_PARTSIZE
) * 1024 * 2 )); \
59 SIGNATURE
="$(SIGNATURE)" \
60 .
/gen_mvebu_sdcard_img.sh
$@ \
62 83 $$BOOTFS_SIZE $@.bootimg \
63 83 $$ROOTFS_SIZE $(IMAGE_ROOTFS
)
66 define Build
/omnia-medkit-initramfs
67 $(TAR
) -c
-T
/dev
/null
-f
$@
68 rm -rf
$(dir $(IMAGE_KERNEL
))boot
69 mkdir
-p
$(dir $(IMAGE_KERNEL
))boot
/boot
/
70 cp
$(KDIR
)/zImage-initramfs
$(dir $(IMAGE_KERNEL
))boot
/boot
/zImage
71 cp
$(KDIR
)/image-
$(DEVICE_DTS
).dtb
$(dir $(IMAGE_KERNEL
))boot
/boot
/dtb
72 $(TAR
) -rp
--numeric-owner
--owner
=0 --group
=0 --sort=name \
73 $(if
$(SOURCE_DATE_EPOCH
),--mtime
="@$(SOURCE_DATE_EPOCH)") \
74 --file
=$@
-C
$(dir $(IMAGE_KERNEL
))boot
/ .
80 BOARD_NAME
= $$(DEVICE_DTS
)
82 KERNEL
:= kernel-bin | append-dtb | uImage none
83 IMAGES
:= sysupgrade.bin
84 IMAGE
/factory.img
:= append-kernel | pad-to
$$$$(KERNEL_SIZE
) | append-ubi | pad-to
$$$$(PAGESIZE
)
85 IMAGE
/sysupgrade.bin
:= sysupgrade-tar | append-metadata
86 SUPPORTED_DEVICES
= $$(firstword $$(DEVICE_DTS
))
91 DEVICE_VARS
+= BOOT_SCRIPT UBOOT
93 define Device
/Default-arm64
94 BOOT_SCRIPT
:= generic-arm64
95 DTS_DIR
:= $(DTS_DIR
)/marvell
96 IMAGES
:= sdcard.img.gz
97 IMAGE
/sdcard.img.gz
:= boot-scr | boot-img-ext4 | sdcard-img-ext4 | gzip | append-metadata
102 define Device
/NAND-128K
106 VID_HDR_OFFSET
:= 2048
109 define Device
/NAND-256K
114 define Device
/NAND-512K
120 include cortex-a53.mk
121 include cortex-a72.mk
123 $(eval
$(call BuildImage
))