Makefile 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  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. DEVICE_DTS := cn5020_ubnt_edgerouter-lite
  71. KERNEL := kernel-bin | patch-cmdline | append-dtb-to-elf
  72. KERNEL_DEPENDS := $$(wildcard $(DTS_DIR)/$(DEVICE_DTS).dts)
  73. CMDLINE := $(ERLITE_CMDLINE)
  74. SUPPORTED_DEVICES += erlite ubnt,erlite
  75. endef
  76. TARGET_DEVICES += ubnt_edgerouter-lite
  77. define Device/ubnt_unifi-usg
  78. DEVICE_VENDOR := Ubiquiti
  79. DEVICE_MODEL := UniFi Security Gateway
  80. BOARD_NAME := ubnt,usg
  81. DEVICE_PACKAGES += kmod-gpio-button-hotplug kmod-leds-gpio
  82. DEVICE_DTS := cn5020_ubnt_usg
  83. CMDLINE := $(ERLITE_CMDLINE)
  84. KERNEL += | append-dtb-to-elf
  85. SUPPORTED_DEVICES += ubnt,usg
  86. endef
  87. TARGET_DEVICES += ubnt_unifi-usg
  88. define Device/cisco_vedge1000
  89. DEVICE_VENDOR := Cisco Viptela
  90. DEVICE_MODEL := vEdge 1000
  91. BOARD_NAME := cisco,vedge1000
  92. DEVICE_PACKAGES += \
  93. blkid \
  94. kmod-hwmon-jc42 \
  95. kmod-hwmon-max6697 \
  96. kmod-of-mdio \
  97. kmod-rtc-ds1307 \
  98. kmod-usb-dwc3 \
  99. kmod-usb-storage-uas \
  100. kmod-usb3 \
  101. sfdisk \
  102. uboot-envtools
  103. KERNEL := kernel-bin | append-dtb-elf
  104. KERNEL_DEPENDS := $$(wildcard $(DTS_DIR)/$(DEVICE_DTS).dts)
  105. DEVICE_DTS := cn6130_cisco_vedge1000
  106. endef
  107. TARGET_DEVICES += cisco_vedge1000
  108. $(eval $(call BuildImage))