qoriq: new target
[openwrt/staging/mkresin.git] / target / linux / qoriq / image / Makefile
1 # SPDX-License-Identifier: GPL-2.0-only
2
3 include $(TOPDIR)/rules.mk
4 include $(INCLUDE_DIR)/image.mk
5
6 SQUASHFSCOMP := xz $(LZMA_XZ_OPTIONS)
7
8 define Build/sdcard-img
9 rm -fR $@.boot
10 mkdir -p $@.boot
11 $(CP) $(KDIR)/$(DEVICE_NAME)-kernel.bin $@.boot
12 $(if $(DEVICE_DTS),\
13 $(foreach dtb,$(DEVICE_DTS),$(CP) $(KDIR)/image-$(dtb).dtb $@.boot), \
14 $(CP) $(KDIR)/image-/*.dtb $@.boot)
15
16 $(SCRIPT_DIR)/gen_image_generic.sh \
17 $@ \
18 $(CONFIG_TARGET_KERNEL_PARTSIZE) $@.boot \
19 $(CONFIG_TARGET_ROOTFS_PARTSIZE) $(IMAGE_ROOTFS) \
20 2048
21
22 $(if $(UBOOT),dd if=$(STAGING_DIR_IMAGE)/$(UBOOT).img of=$@ bs=512 skip=1 seek=1 conv=notrunc)
23 endef
24
25 define Device/Default
26 PROFILES := Default
27 DEVICE_DTS := $(subst _,-,$(1))
28 KERNEL_DEPENDS = $$(wildcard $(DTS_DIR)/$$(DEVICE_DTS).dts)
29 KERNEL_ENTRY := 0x00000000
30 KERNEL_LOADADDR := 0x00000000
31 KERNEL := kernel-bin
32 endef
33
34 include $(SUBTARGET).mk
35
36 $(eval $(call BuildImage))