Makefile 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. # SPDX-License-Identifier: GPL-2.0-only
  2. #
  3. # Copyright (C) 2006-2021 OpenWrt.org
  4. include $(TOPDIR)/rules.mk
  5. include $(INCLUDE_DIR)/image.mk
  6. # Cook a Linksys NSLU2 etc image
  7. define Build/linksys-ixp425-image
  8. touch [email protected]
  9. $(TOPDIR)/scripts/slugimage.pl -L $(STAGING_DIR_IMAGE)/apex/apex-$(1)-armeb.bin -k $@ -r [email protected] -p -o [email protected]
  10. mv [email protected] $@
  11. endef
  12. define Build/freecom-image
  13. mkdir -p [email protected]
  14. # Add kernel
  15. cp $@ [email protected]/zImage
  16. cd [email protected] && tar -c -j -f [email protected] --numeric-owner --owner=0 --group=0 *
  17. rm -rf [email protected]
  18. encode_crc [email protected] $@
  19. rm -f [email protected]
  20. endef
  21. # Build sysupgrade image
  22. define BuildFirmware/Generic
  23. dd if=$(KDIR)/zImage of=$(KDIR)/zImage.pad bs=64k conv=sync; \
  24. dd if=$(KDIR)/root.$(1) of=$(KDIR)/root.$(1).pad bs=128k conv=sync; \
  25. sh $(TOPDIR)/scripts/combined-image.sh \
  26. $(KDIR)/zImage.pad \
  27. $(KDIR)/root.$(1).pad \
  28. $(BIN_DIR)/$(IMG_PREFIX)-$(patsubst jffs2-%,jffs2,$(patsubst squashfs-%,squashfs,$(1)))-sysupgrade.bin
  29. endef
  30. define Image/Build
  31. $(call Image/Build/$(1),$(1))
  32. $(call BuildFirmware/Generic,$(1))
  33. endef
  34. define Device/Default
  35. PROFILES := Default
  36. DEVICE_DTS_DIR = $$(DTS_DIR)/intel/ixp
  37. KERNEL_DEPENDS = $$(wildcard $(DTS_DIR)/$$(DEVICE_DTS).dts)
  38. KERNEL_NAME := zImage
  39. KERNEL := kernel-bin | append-dtb
  40. BLOCKSIZE := 128k
  41. endef
  42. define Device/dlink_dsm_g600_a
  43. DEVICE_VENDOR := D-Link
  44. DEVICE_MODEL := DSM G600 A
  45. DEVICE_PACKAGES := ixp4xx-microcode-ethernet kmod-rtc-pcf8563 kmod-via-velocity kmod-ata-artop kmod-ath5k wpad-basic-mbedtls
  46. DEVICE_DTS := intel-ixp42x-dlink-dsm-g600
  47. KERNEL := kernel-bin | append-dtb
  48. IMAGES := kernel.bin rootfs.bin
  49. IMAGE/kernel.bin := append-kernel
  50. IMAGE/rootfs.bin := append-rootfs | pad-rootfs | pad-to 128k
  51. endef
  52. TARGET_DEVICES += dlink_dsm_g600_a
  53. define Device/freecom_fsg_3
  54. DEVICE_VENDOR := Freecom
  55. DEVICE_MODEL := FSG-3
  56. DEVICE_PACKAGES := ixp4xx-microcode-ethernet kmod-rtc-isl1208 kmod-ath5k wpad-basic-mbedtls
  57. # Only 4 MB of Flash so not building by default
  58. DEFAULT := n
  59. DEVICE_DTS := intel-ixp42x-freecom-fsg-3
  60. KERNEL := kernel-bin | append-dtb
  61. IMAGES := factory.bin
  62. # This has to boot from harddisk so just append the kernel
  63. IMAGE/factory.bin := append-kernel | freecom-image
  64. endef
  65. TARGET_DEVICES += freecom_fsg_3
  66. define Device/gateworks_avila
  67. DEVICE_VENDOR := Gateworks
  68. DEVICE_MODEL := Avila GW2348-4
  69. DEVICE_PACKAGES := ixp4xx-microcode-ethernet kmod-rtc-ds1672 kmod-eeprom-at24 kmod-hwmon-ad7418
  70. DEVICE_DTS := intel-ixp42x-gateworks-gw2348
  71. KERNEL := kernel-bin | append-dtb
  72. IMAGES := kernel.bin rootfs.bin
  73. IMAGE/kernel.bin := append-kernel
  74. IMAGE/rootfs.bin := append-rootfs | pad-rootfs | pad-to 128k
  75. endef
  76. TARGET_DEVICES += gateworks_avila
  77. define Device/gateworks_cambria
  78. DEVICE_VENDOR := Gateworks
  79. DEVICE_MODEL := Cambria GW2358-4
  80. DEVICE_PACKAGES := ixp4xx-microcode-ethernet kmod-rtc-ds1672 kmod-eeprom-at24 kmod-hwmon-ad7418
  81. DEVICE_DTS := intel-ixp43x-gateworks-gw2358
  82. KERNEL := kernel-bin | append-dtb
  83. IMAGES := kernel.bin rootfs.bin
  84. IMAGE/kernel.bin := append-kernel
  85. IMAGE/rootfs.bin := append-rootfs | pad-rootfs | pad-to 128k
  86. endef
  87. TARGET_DEVICES += gateworks_cambria
  88. define Device/iomega_nas100d
  89. DEVICE_VENDOR := Iomega
  90. DEVICE_MODEL := NAS100d
  91. # USB2 is compiled in and needs no package
  92. DEVICE_PACKAGES := ixp4xx-microcode-ethernet kmod-rtc-pcf8563
  93. DEVICE_DTS := intel-ixp42x-iomega-nas100d
  94. KERNEL := kernel-bin | append-dtb
  95. IMAGES := factory.bin
  96. # This has to boot from harddisk so just append the kernel
  97. IMAGE/factory.bin := append-kernel | linksys-ixp425-image "nas100d"
  98. endef
  99. TARGET_DEVICES += iomega_nas100d
  100. define Device/linksys_nslu2
  101. DEVICE_VENDOR := Linksys
  102. DEVICE_MODEL := NSLU2
  103. # USB2 is compiled in and needs no package
  104. DEVICE_PACKAGES := ixp4xx-microcode-ethernet kmod-rtc-x1205
  105. # Only 32 MB of RAM so not building by default
  106. DEFAULT := n
  107. DEVICE_DTS := intel-ixp42x-linksys-nslu2
  108. KERNEL := kernel-bin | append-dtb
  109. IMAGES := factory.bin
  110. # This has to boot from harddisk so just append the kernel
  111. IMAGE/factory.bin := append-kernel | linksys-ixp425-image "nslu2"
  112. endef
  113. TARGET_DEVICES += linksys_nslu2
  114. define Device/netgear_wg302v1
  115. DEVICE_VENDOR := Netgear
  116. DEVICE_MODEL := WG302 v1
  117. DEVICE_PACKAGES := ixp4xx-microcode-ethernet kmod-phy-amd kmod-ath5k \
  118. wpad-basic-mbedtls kmod-input-gpio-keys-polled
  119. # Only 32 MB of RAM and small flash so not building by default
  120. DEFAULT := n
  121. DEVICE_DTS := intel-ixp42x-netgear-wg302v1
  122. KERNEL := kernel-bin | append-dtb
  123. IMAGES := kernel.bin rootfs.bin
  124. IMAGE/kernel.bin := append-kernel
  125. IMAGE/rootfs.bin := append-rootfs | pad-rootfs | pad-to 128k
  126. IMAGE/sysupgrade.bin := append-rootfs | pad-rootfs | pad-to 128k | append-metadata
  127. endef
  128. TARGET_DEVICES += netgear_wg302v1
  129. define Device/usrobotics_usr8200
  130. DEVICE_VENDOR := USRobotics
  131. DEVICE_MODEL := USR8200
  132. # USB2 is compiled in and needs no package
  133. DEVICE_PACKAGES := ixp4xx-microcode-ethernet kmod-rtc-r7301 kmod-firewire kmod-firewire-ohci kmod-dsa-mv88e6060
  134. DEVICE_DTS := intel-ixp42x-usrobotics-usr8200
  135. KERNEL := kernel-bin | append-dtb
  136. IMAGES := kernel.bin rootfs.bin
  137. IMAGE/kernel.bin := append-kernel
  138. IMAGE/rootfs.bin := append-rootfs | pad-rootfs | pad-to 128k
  139. endef
  140. TARGET_DEVICES += usrobotics_usr8200
  141. $(eval $(call BuildImage))