Makefile 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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. ER_CMDLINE:=-mtdparts=phys_mapped_flash:640k(boot0)ro,640k(boot1)ro,64k(eeprom)ro root=/dev/mmcblk0p2 rootfstype=squashfs,ext4 rootwait
  38. define Device/ubnt_edgerouter
  39. DEVICE_VENDOR := Ubiquiti
  40. DEVICE_MODEL := EdgeRouter
  41. BOARD_NAME := er
  42. CMDLINE := $(ER_CMDLINE)
  43. endef
  44. TARGET_DEVICES += ubnt_edgerouter
  45. define Device/ubnt_edgerouter-e300
  46. DEVICE_VENDOR := Ubiquiti
  47. DEVICE_PACKAGES += kmod-gpio-button-hotplug kmod-leds-gpio kmod-of-mdio kmod-sfp kmod-usb3 kmod-usb-dwc3 kmod-usb-storage-uas
  48. KERNEL := kernel-bin | patch-cmdline | append-dtb-to-elf
  49. KERNEL_DEPENDS := $$(wildcard $(DTS_DIR)/$(DEVICE_DTS).dts)
  50. CMDLINE := root=/dev/mmcblk0p2 rootfstype=squashfs,ext4 rootwait
  51. endef
  52. define Device/ubnt_edgerouter-4
  53. $(Device/ubnt_edgerouter-e300)
  54. DEVICE_MODEL := EdgeRouter 4
  55. DEVICE_DTS := cn7130_ubnt_edgerouter-4
  56. endef
  57. TARGET_DEVICES += ubnt_edgerouter-4
  58. define Device/ubnt_edgerouter-6p
  59. $(Device/ubnt_edgerouter-e300)
  60. DEVICE_MODEL := EdgeRouter 6P
  61. DEVICE_DTS := cn7130_ubnt_edgerouter-6p
  62. endef
  63. TARGET_DEVICES += ubnt_edgerouter-6p
  64. ERLITE_CMDLINE:=-mtdparts=phys_mapped_flash:512k(boot0)ro,512k(boot1)ro,64k(eeprom)ro root=/dev/sda2 rootfstype=squashfs,ext4 rootwait
  65. define Device/ubnt_edgerouter-lite
  66. DEVICE_VENDOR := Ubiquiti
  67. DEVICE_MODEL := EdgeRouter Lite
  68. BOARD_NAME := erlite
  69. CMDLINE := $(ERLITE_CMDLINE)
  70. endef
  71. TARGET_DEVICES += ubnt_edgerouter-lite
  72. $(eval $(call BuildImage))