| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143 |
- # SPDX-License-Identifier: GPL-2.0-only
- include $(TOPDIR)/rules.mk
- include $(INCLUDE_DIR)/image.mk
- KERNEL_LOADADDR = 0x80100000
- DEVICE_VARS += \
- BELKIN_HEADER \
- BELKIN_MODEL \
- CAMEO_BOARD_MODEL \
- CAMEO_BOARD_VERSION \
- CAMEO_CUSTOMER_SIGNATURE \
- CAMEO_KERNEL_PART \
- CAMEO_KERNEL_PART_SIZE \
- CAMEO_ROOTFS_PART \
- H3C_DEVICE_ID \
- H3C_PRODUCT_ID \
- LINKSYS_HEADER \
- ZYXEL_VERS
- define Build/rt-compress
- $(STAGING_DIR_HOST)/bin/xz -9 --format=lzma --stdout "$@" > "[email protected]"
- mv "[email protected]" "$@"
- endef
- define Build/rt-loader
- $(MAKE) all clean -C rt-loader CROSS_COMPILE="$(TARGET_CROSS)" \
- KERNEL_IMG_IN="$@" KERNEL_IMG_OUT="[email protected]" BUILD_DIR="[email protected]"
- mv "[email protected]" "$@"
- endef
- define Build/zyxel-vers
- ( echo VERS;\
- for hw in $(ZYXEL_VERS); do\
- echo -n "V9.99($$hw.0) | ";\
- date -d @$(SOURCE_DATE_EPOCH) +%m/%d/%Y;\
- done ) >> $@
- endef
- define Build/cameo-tag
- $(SCRIPT_DIR)/cameo-tag.py $@ $(CAMEO_KERNEL_PART_SIZE)
- endef
- define Build/cameo-version
- echo -n "OpenWrt" >> $@
- dd if=/dev/zero bs=25 count=1 >> $@
- endef
- define Build/cameo-headers
- dd if=$@ bs=$(CAMEO_KERNEL_PART_SIZE) count=1 [email protected]_part; \
- dd if=$@ bs=$(CAMEO_KERNEL_PART_SIZE) skip=1 [email protected]_part; \
- $(SCRIPT_DIR)/cameo-imghdr.py [email protected]_part [email protected]_part.hex \
- "$(CAMEO_BOARD_MODEL)" os $(CAMEO_KERNEL_PART) \
- $(CAMEO_CUSTOMER_SIGNATURE) \
- $(CAMEO_BOARD_VERSION) \
- $(KERNEL_LOADADDR); \
- $(SCRIPT_DIR)/cameo-imghdr.py [email protected]_part [email protected]_part.hex \
- "$(CAMEO_BOARD_MODEL)" squashfs $(CAMEO_ROOTFS_PART) \
- $(CAMEO_CUSTOMER_SIGNATURE) \
- $(CAMEO_BOARD_VERSION); \
- cat [email protected]_part.hex [email protected]_part.hex > $@
- endef
- define Build/7z
- $(STAGING_DIR_HOST)/bin/7zr a $(@).new -t7z -m0=lzma $(@)
- mv [email protected] $@
- endef
- define Build/h3c-image
- $(STAGING_DIR_HOST)/bin/mkh3cimg \
- -i $(@) \
- -o $(@).new \
- -c 7z \
- -p $(H3C_PRODUCT_ID) \
- -d $(H3C_DEVICE_ID)
- mv [email protected] $@
- endef
- define Build/h3c-vfs
- $(STAGING_DIR_HOST)/bin/mkh3cvfs \
- -i $(@) \
- -o $(@).new \
- -f openwrt-kernel.bin
- mv [email protected] $@
- endef
- define Build/belkin-header
- $(SCRIPT_DIR)/belkin-header.py $(@) $(@).new $(BELKIN_HEADER) ${BELKIN_MODEL}
- mv [email protected] $@
- endef
- define Build/linksys-image
- $(SCRIPT_DIR)/linksys-image.sh $(@) $(@).new $(LINKSYS_MODEL)
- mv [email protected] $@
- endef
- define Device/Default
- PROFILES = Default
- KERNEL := \
- kernel-bin | \
- append-dtb | \
- libdeflate-gzip | \
- uImage gzip
- KERNEL_INITRAMFS := \
- kernel-bin | \
- append-dtb | \
- libdeflate-gzip | \
- uImage gzip
- DEVICE_DTS_DIR := ../dts
- DEVICE_DTS = $$(SOC)_$(1)
- IMAGES := sysupgrade.bin
- IMAGE/sysupgrade.bin := \
- append-kernel | \
- pad-to 64k | \
- append-rootfs | \
- pad-rootfs | \
- check-size | \
- append-metadata
- endef
- define Device/kernel-lzma
- KERNEL := \
- kernel-bin | \
- append-dtb | \
- lzma | \
- uImage lzma
- KERNEL_INITRAMFS := \
- kernel-bin | \
- append-dtb | \
- lzma | \
- uImage lzma
- endef
- define Device/uimage-rt-loader
- KERNEL/rt-loader := kernel-bin | append-dtb | rt-compress | rt-loader
- KERNEL := $$(KERNEL/rt-loader) | uImage none
- KERNEL_INITRAMFS := $$(KERNEL/rt-loader) | uImage none
- endef
- include $(SUBTARGET).mk
- $(eval $(call BuildImage))
|