Makefile 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  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/actiontec_mi424wr_ac
  43. DEVICE_VENDOR := Actiontec
  44. DEVICE_MODEL := MI424WR rev A/C
  45. # Only 8 MB of Flash so not building by default
  46. DEFAULT := n
  47. DEVICE_PACKAGES := ixp4xx-microcode-ethernet kmod-dsa-ks8995
  48. DEVICE_DTS := intel-ixp42x-actiontec-mi424wr-ac
  49. KERNEL := kernel-bin | append-dtb
  50. IMAGES := kernel.bin rootfs.bin
  51. IMAGE/kernel.bin := append-kernel
  52. IMAGE/rootfs.bin := append-rootfs | pad-rootfs | pad-to 128k
  53. endef
  54. TARGET_DEVICES += actiontec_mi424wr_ac
  55. define Device/actiontec_mi424wr_d
  56. DEVICE_VENDOR := Actiontec
  57. DEVICE_MODEL := MI424WR rev D
  58. # Only 8 MB of Flash so not building by default
  59. DEFAULT := n
  60. DEVICE_PACKAGES := ixp4xx-microcode-ethernet kmod-dsa-ks8995
  61. DEVICE_DTS := intel-ixp42x-actiontec-mi424wr-d
  62. KERNEL := kernel-bin | append-dtb
  63. IMAGES := kernel.bin rootfs.bin
  64. IMAGE/kernel.bin := append-kernel
  65. IMAGE/rootfs.bin := append-rootfs | pad-rootfs | pad-to 128k
  66. endef
  67. TARGET_DEVICES += actiontec_mi424wr_d
  68. define Device/dlink_dsm_g600_a
  69. DEVICE_VENDOR := D-Link
  70. DEVICE_MODEL := DSM G600 A
  71. DEVICE_PACKAGES := ixp4xx-microcode-ethernet kmod-rtc-pcf8563 kmod-via-velocity kmod-ata-artop kmod-ath5k wpad-basic-mbedtls
  72. DEVICE_DTS := intel-ixp42x-dlink-dsm-g600
  73. KERNEL := kernel-bin | append-dtb
  74. IMAGES := kernel.bin rootfs.bin
  75. IMAGE/kernel.bin := append-kernel
  76. IMAGE/rootfs.bin := append-rootfs | pad-rootfs | pad-to 128k
  77. endef
  78. TARGET_DEVICES += dlink_dsm_g600_a
  79. define Device/freecom_fsg_3
  80. DEVICE_VENDOR := Freecom
  81. DEVICE_MODEL := FSG-3
  82. DEVICE_PACKAGES := ixp4xx-microcode-ethernet kmod-rtc-isl1208 kmod-ath5k wpad-basic-mbedtls
  83. # Only 4 MB of Flash so not building by default
  84. DEFAULT := n
  85. DEVICE_DTS := intel-ixp42x-freecom-fsg-3
  86. KERNEL := kernel-bin | append-dtb
  87. IMAGES := factory.bin
  88. # This has to boot from harddisk so just append the kernel
  89. IMAGE/factory.bin := append-kernel | freecom-image
  90. endef
  91. TARGET_DEVICES += freecom_fsg_3
  92. define Device/gateworks_avila
  93. DEVICE_VENDOR := Gateworks
  94. DEVICE_MODEL := Avila GW2348-4
  95. DEVICE_PACKAGES := ixp4xx-microcode-ethernet kmod-rtc-ds1672 kmod-eeprom-at24 kmod-hwmon-ad7418
  96. DEVICE_DTS := intel-ixp42x-gateworks-gw2348
  97. KERNEL := kernel-bin | append-dtb
  98. IMAGES := kernel.bin rootfs.bin
  99. IMAGE/kernel.bin := append-kernel
  100. IMAGE/rootfs.bin := append-rootfs | pad-rootfs | pad-to 128k
  101. endef
  102. TARGET_DEVICES += gateworks_avila
  103. define Device/gateworks_cambria
  104. DEVICE_VENDOR := Gateworks
  105. DEVICE_MODEL := Cambria GW2358-4
  106. DEVICE_PACKAGES := ixp4xx-microcode-ethernet kmod-rtc-ds1672 kmod-eeprom-at24 kmod-hwmon-ad7418
  107. DEVICE_DTS := intel-ixp43x-gateworks-gw2358
  108. KERNEL := kernel-bin | append-dtb
  109. IMAGES := kernel.bin rootfs.bin
  110. IMAGE/kernel.bin := append-kernel
  111. IMAGE/rootfs.bin := append-rootfs | pad-rootfs | pad-to 128k
  112. endef
  113. TARGET_DEVICES += gateworks_cambria
  114. define Device/iomega_nas100d
  115. DEVICE_VENDOR := Iomega
  116. DEVICE_MODEL := NAS100d
  117. # USB2 is compiled in and needs no package
  118. DEVICE_PACKAGES := ixp4xx-microcode-ethernet kmod-rtc-pcf8563
  119. DEVICE_DTS := intel-ixp42x-iomega-nas100d
  120. KERNEL := kernel-bin | append-dtb
  121. IMAGES := factory.bin
  122. # This has to boot from harddisk so just append the kernel
  123. IMAGE/factory.bin := append-kernel | linksys-ixp425-image "nas100d"
  124. endef
  125. TARGET_DEVICES += iomega_nas100d
  126. define Device/linksys_nslu2
  127. DEVICE_VENDOR := Linksys
  128. DEVICE_MODEL := NSLU2
  129. # USB2 is compiled in and needs no package
  130. DEVICE_PACKAGES := ixp4xx-microcode-ethernet kmod-rtc-x1205
  131. # Only 32 MB of RAM so not building by default
  132. DEFAULT := n
  133. DEVICE_DTS := intel-ixp42x-linksys-nslu2
  134. KERNEL := kernel-bin | append-dtb
  135. IMAGES := factory.bin
  136. # This has to boot from harddisk so just append the kernel
  137. IMAGE/factory.bin := append-kernel | linksys-ixp425-image "nslu2"
  138. endef
  139. TARGET_DEVICES += linksys_nslu2
  140. define Device/netgear_wg302v1
  141. DEVICE_VENDOR := Netgear
  142. DEVICE_MODEL := WG302 v1
  143. DEVICE_PACKAGES := ixp4xx-microcode-ethernet kmod-phy-amd kmod-ath5k \
  144. wpad-basic-mbedtls kmod-input-gpio-keys-polled
  145. # Only 32 MB of RAM and small flash so not building by default
  146. DEFAULT := n
  147. DEVICE_DTS := intel-ixp42x-netgear-wg302v1
  148. KERNEL := kernel-bin | append-dtb
  149. IMAGES := kernel.bin rootfs.bin
  150. IMAGE/kernel.bin := append-kernel
  151. IMAGE/rootfs.bin := append-rootfs | pad-rootfs | pad-to 128k
  152. IMAGE/sysupgrade.bin := append-rootfs | pad-rootfs | pad-to 128k | append-metadata
  153. endef
  154. TARGET_DEVICES += netgear_wg302v1
  155. define Device/usrobotics_usr8200
  156. DEVICE_VENDOR := USRobotics
  157. DEVICE_MODEL := USR8200
  158. # USB2 is compiled in and needs no package
  159. DEVICE_PACKAGES := ixp4xx-microcode-ethernet kmod-rtc-r7301 kmod-firewire kmod-firewire-ohci kmod-dsa-mv88e6060
  160. DEVICE_DTS := intel-ixp42x-usrobotics-usr8200
  161. KERNEL := kernel-bin | append-dtb
  162. IMAGES := kernel.bin rootfs.bin
  163. IMAGE/kernel.bin := append-kernel
  164. IMAGE/rootfs.bin := append-rootfs | pad-rootfs | pad-to 128k
  165. endef
  166. TARGET_DEVICES += usrobotics_usr8200
  167. $(eval $(call BuildImage))