2
0

Makefile 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. # SPDX-License-Identifier: GPL-2.0-only
  2. include $(TOPDIR)/rules.mk
  3. include $(INCLUDE_DIR)/image.mk
  4. KERNEL_LOADADDR = 0x80000000
  5. KERNEL_ENTRY = 0x80000400
  6. DEVICE_VARS += ZYXEL_VERS DLINK_KERNEL_PART_SIZE
  7. DEVICE_VARS += CAMEO_KERNEL_PART CAMEO_ROOTFS_PART CAMEO_CUSTOMER_SIGNATURE CAMEO_BOARD_VERSION
  8. define Build/zyxel-vers
  9. ( echo VERS;\
  10. for hw in $(ZYXEL_VERS); do\
  11. echo -n "V9.99($$hw.0) | ";\
  12. date -d @$(SOURCE_DATE_EPOCH) +%m/%d/%Y;\
  13. done ) >> $@
  14. endef
  15. define Build/dlink-cameo
  16. $(SCRIPT_DIR)/cameo-tag.py $@ $(DLINK_KERNEL_PART_SIZE)
  17. endef
  18. define Build/dlink-headers
  19. dd if=$@ bs=$(DLINK_KERNEL_PART_SIZE) count=1 [email protected]_part; \
  20. dd if=$@ bs=$(DLINK_KERNEL_PART_SIZE) skip=1 [email protected]_part; \
  21. $(SCRIPT_DIR)/cameo-imghdr.py [email protected]_part [email protected]_part.hex \
  22. "$(DEVICE_MODEL)" os $(CAMEO_KERNEL_PART) \
  23. $(CAMEO_CUSTOMER_SIGNATURE) \
  24. $(CAMEO_BOARD_VERSION) \
  25. $(KERNEL_LOADADDR); \
  26. $(SCRIPT_DIR)/cameo-imghdr.py [email protected]_part [email protected]_part.hex \
  27. "$(DEVICE_MODEL)" squashfs $(CAMEO_ROOTFS_PART) \
  28. $(CAMEO_CUSTOMER_SIGNATURE) \
  29. $(CAMEO_BOARD_VERSION); \
  30. cat [email protected]_part.hex [email protected]_part.hex > $@
  31. endef
  32. define Device/Default
  33. PROFILES = Default
  34. KERNEL := kernel-bin | append-dtb | gzip | uImage gzip
  35. KERNEL_INITRAMFS := kernel-bin | append-dtb | gzip | uImage gzip
  36. DEVICE_DTS_DIR := ../dts-$(KERNEL_PATCHVER)
  37. DEVICE_DTS = $$(SOC)_$(1)
  38. IMAGES := sysupgrade.bin
  39. IMAGE/sysupgrade.bin := append-kernel | pad-to 64k | append-rootfs | pad-rootfs | \
  40. check-size | append-metadata
  41. endef
  42. # "NGE" refers to the uImage magic
  43. define Device/netgear_nge
  44. KERNEL := kernel-bin | append-dtb | lzma | uImage lzma
  45. KERNEL_INITRAMFS := kernel-bin | append-dtb | lzma | uImage lzma
  46. SOC := rtl8380
  47. IMAGE_SIZE := 14848k
  48. UIMAGE_MAGIC := 0x4e474520
  49. DEVICE_VENDOR := NETGEAR
  50. endef
  51. include $(SUBTARGET).mk
  52. $(eval $(call BuildImage))