Makefile 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. # SPDX-License-Identifier: GPL-2.0-only
  2. #
  3. # Copyright (C) 2009-2010 OpenWrt.org
  4. include $(TOPDIR)/rules.mk
  5. include $(INCLUDE_DIR)/image.mk
  6. define Build/append-dtb-to-elf
  7. $(TARGET_CROSS)objcopy --update-section .appended_dtb=$(KDIR)/image-$(DEVICE_DTS).dtb $@
  8. endef
  9. define Build/strip-kernel
  10. # Workaround pre-SDK-1.9.0 u-boot versions not handling the .notes section
  11. $(TARGET_CROSS)strip -R .notes $@ -o [email protected] && mv [email protected] $@
  12. endef
  13. DTS_DIR := $(DTS_DIR)/cavium-octeon
  14. define Device/Default
  15. PROFILES = Default $$(DEVICE_NAME)
  16. KERNEL_NAME := vmlinux.elf
  17. KERNEL_INITRAMFS_NAME := vmlinux-initramfs.elf
  18. KERNEL := kernel-bin | strip-kernel | patch-cmdline
  19. IMAGES := sysupgrade.tar
  20. IMAGE/sysupgrade.tar/squashfs := append-rootfs | pad-extra 128k | sysupgrade-tar rootfs=$$$$@
  21. IMAGE/sysupgrade.tar := sysupgrade-tar
  22. endef
  23. define Device/generic
  24. DEVICE_VENDOR := Generic
  25. DEVICE_MODEL := Octeon
  26. FILESYSTEMS := ext4
  27. endef
  28. TARGET_DEVICES += generic
  29. ITUSROUTER_CMDLINE:=console=ttyS0,115200 root=/dev/mmcblk1p2 rootfstype=squashfs,ext4,f2fs rootwait
  30. define Device/itus_shield-router
  31. DEVICE_VENDOR := Itus Networks
  32. DEVICE_MODEL := Shield Router
  33. CMDLINE := $(ITUSROUTER_CMDLINE)
  34. IMAGE/sysupgrade.tar/squashfs += | append-metadata
  35. endef
  36. TARGET_DEVICES += itus_shield-router
  37. # Disable PCIe on ER as it doesn't have PCIe peripherals and some devices lock up on initialization
  38. ER_CMDLINE:=-mtdparts=phys_mapped_flash:640k(boot0)ro,640k(boot1)ro,64k(eeprom)ro root=/dev/mmcblk0p2 rootfstype=squashfs,ext4 rootwait pcie_octeon.pcie_disable=1
  39. define Device/ubnt_edgerouter
  40. DEVICE_VENDOR := Ubiquiti
  41. DEVICE_MODEL := EdgeRouter
  42. BOARD_NAME := er
  43. CMDLINE := $(ER_CMDLINE)
  44. SUPPORTED_DEVICES += er
  45. endef
  46. TARGET_DEVICES += ubnt_edgerouter
  47. define Device/ubnt_edgerouter-e300
  48. DEVICE_VENDOR := Ubiquiti
  49. DEVICE_PACKAGES += kmod-gpio-button-hotplug kmod-leds-gpio kmod-of-mdio kmod-sfp kmod-usb3 kmod-usb-dwc3 kmod-usb-storage-uas
  50. KERNEL := kernel-bin | patch-cmdline | append-dtb-to-elf
  51. KERNEL_DEPENDS := $$(wildcard $(DTS_DIR)/$(DEVICE_DTS).dts)
  52. CMDLINE := root=/dev/mmcblk0p2 rootfstype=squashfs,ext4 rootwait
  53. endef
  54. define Device/ubnt_edgerouter-4
  55. $(Device/ubnt_edgerouter-e300)
  56. DEVICE_MODEL := EdgeRouter 4
  57. DEVICE_DTS := cn7130_ubnt_edgerouter-4
  58. endef
  59. TARGET_DEVICES += ubnt_edgerouter-4
  60. define Device/ubnt_edgerouter-6p
  61. $(Device/ubnt_edgerouter-e300)
  62. DEVICE_MODEL := EdgeRouter 6P
  63. DEVICE_DTS := cn7130_ubnt_edgerouter-6p
  64. endef
  65. TARGET_DEVICES += ubnt_edgerouter-6p
  66. ERLITE_CMDLINE:=-mtdparts=phys_mapped_flash:512k(boot0)ro,512k(boot1)ro,64k(eeprom)ro root=/dev/sda2 rootfstype=squashfs,ext4 rootwait
  67. define Device/ubnt_edgerouter-lite
  68. DEVICE_VENDOR := Ubiquiti
  69. DEVICE_MODEL := EdgeRouter Lite
  70. BOARD_NAME := erlite
  71. CMDLINE := $(ERLITE_CMDLINE)
  72. SUPPORTED_DEVICES += erlite
  73. endef
  74. TARGET_DEVICES += ubnt_edgerouter-lite
  75. define Device/ubnt_unifi-usg
  76. $(Device/ubnt_edgerouter-lite)
  77. DEVICE_MODEL := UniFi Security Gateway
  78. BOARD_NAME := ubnt,usg
  79. DEVICE_PACKAGES += kmod-gpio-button-hotplug kmod-leds-gpio
  80. DEVICE_DTS := cn5020_ubnt_usg
  81. KERNEL += | append-dtb-to-elf
  82. endef
  83. TARGET_DEVICES += ubnt_unifi-usg
  84. define Device/cisco_vedge1000
  85. DEVICE_VENDOR := Cisco Viptela
  86. DEVICE_MODEL := vEdge 1000
  87. BOARD_NAME := cisco,vedge1000
  88. DEVICE_PACKAGES += \
  89. blkid \
  90. kmod-hwmon-jc42 \
  91. kmod-hwmon-max6697 \
  92. kmod-of-mdio \
  93. kmod-rtc-ds1307 \
  94. kmod-usb-dwc3 \
  95. kmod-usb-storage-uas \
  96. kmod-usb3 \
  97. sfdisk \
  98. uboot-envtools
  99. KERNEL := kernel-bin | append-dtb-elf
  100. KERNEL_DEPENDS := $$(wildcard $(DTS_DIR)/$(DEVICE_DTS).dts)
  101. DEVICE_DTS := cn6130_cisco_vedge1000
  102. endef
  103. TARGET_DEVICES += cisco_vedge1000
  104. $(eval $(call BuildImage))