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