| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 |
- # SPDX-License-Identifier: GPL-2.0-only
- include $(TOPDIR)/rules.mk
- include $(INCLUDE_DIR)/image.mk
- KERNEL_LOADADDR = 0x80000000
- KERNEL_ENTRY = 0x80000400
- DEVICE_VARS += ZYXEL_VERS DLINK_KERNEL_PART_SIZE
- DEVICE_VARS += CAMEO_KERNEL_PART CAMEO_ROOTFS_PART CAMEO_CUSTOMER_SIGNATURE CAMEO_BOARD_VERSION
- DEVICE_VARS += H3C_PRODUCT_ID H3C_DEVICE_ID
- 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/dlink-cameo
- $(SCRIPT_DIR)/cameo-tag.py $@ $(DLINK_KERNEL_PART_SIZE)
- endef
- define Build/dlink-version
- echo -n "OpenWrt" >> $@
- dd if=/dev/zero bs=25 count=1 >> $@
- endef
- define Build/dlink-headers
- dd if=$@ bs=$(DLINK_KERNEL_PART_SIZE) count=1 [email protected]_part; \
- dd if=$@ bs=$(DLINK_KERNEL_PART_SIZE) skip=1 [email protected]_part; \
- $(SCRIPT_DIR)/cameo-imghdr.py [email protected]_part [email protected]_part.hex \
- "$(DEVICE_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 \
- "$(DEVICE_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/relocate-kernel
- rm -rf [email protected]
- $(CP) ../../generic/image/relocate [email protected]
- $(MAKE) -j1 -C [email protected] KERNEL_ADDR=$(KERNEL_LOADADDR) LZMA_TEXT_START=0x82000000 \
- CROSS_COMPILE=$(TARGET_CROSS)
- ( \
- dd [email protected]/loader.bin bs=32 conv=sync && \
- perl -e '@s = stat("$@"); print pack("N", @s[7])' && \
- cat "$@" \
- ) > "[email protected]"
- mv "[email protected]" "$@"
- rm -rf [email protected]
- endef
- define Device/Default
- PROFILES = Default
- KERNEL := kernel-bin | append-dtb | gzip | uImage gzip
- KERNEL_INITRAMFS := kernel-bin | append-dtb | gzip | uImage gzip
- DEVICE_DTS_DIR := ../dts-$(KERNEL_PATCHVER)
- DEVICE_DTS = $$(SOC)_$(1)
- IMAGES := sysupgrade.bin
- IMAGE/sysupgrade.bin := append-kernel | pad-to 64k | append-rootfs | pad-rootfs | \
- check-size | append-metadata
- endef
- include $(SUBTARGET).mk
- $(eval $(call BuildImage))
|