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 ER_CMDLINE
:=-mtdparts
=phys_mapped_flash
:640k
(boot0
)ro
,640k
(boot1
)ro
,64k
(eeprom
)ro root
=/dev
/mmcblk0p2 rootfstype
=squashfs
,ext4 rootwait
46 define Device
/ubnt_edgerouter
47 DEVICE_VENDOR
:= Ubiquiti
48 DEVICE_MODEL
:= EdgeRouter
50 CMDLINE
:= $(ER_CMDLINE
)
51 SUPPORTED_DEVICES
+= er
53 TARGET_DEVICES
+= ubnt_edgerouter
55 define Device
/ubnt_edgerouter-e300
56 DEVICE_VENDOR
:= Ubiquiti
57 DEVICE_PACKAGES
+= kmod-gpio-button-hotplug kmod-leds-gpio kmod-of-mdio kmod-sfp kmod-usb3 kmod-usb-dwc3 kmod-usb-storage-uas
58 KERNEL
:= kernel-bin | patch-cmdline | append-dtb-to-elf
59 KERNEL_DEPENDS
:= $$(wildcard $(DTS_DIR
)/$(DEVICE_DTS
).dts
)
60 CMDLINE
:= root
=/dev
/mmcblk0p2 rootfstype
=squashfs
,ext4 rootwait
63 define Device
/ubnt_edgerouter-4
64 $(Device
/ubnt_edgerouter-e300
)
65 DEVICE_MODEL
:= EdgeRouter
4
66 DEVICE_DTS
:= cn7130_ubnt_edgerouter-4
68 TARGET_DEVICES
+= ubnt_edgerouter-4
70 define Device
/ubnt_edgerouter-6p
71 $(Device
/ubnt_edgerouter-e300
)
72 DEVICE_MODEL
:= EdgeRouter
6P
73 DEVICE_DTS
:= cn7130_ubnt_edgerouter-6p
75 TARGET_DEVICES
+= ubnt_edgerouter-6p
77 ERLITE_CMDLINE
:=-mtdparts
=phys_mapped_flash
:512k
(boot0
)ro
,512k
(boot1
)ro
,64k
(eeprom
)ro root
=/dev
/sda2 rootfstype
=squashfs
,ext4 rootwait
78 define Device
/ubnt_edgerouter-lite
79 DEVICE_VENDOR
:= Ubiquiti
80 DEVICE_MODEL
:= EdgeRouter Lite
82 CMDLINE
:= $(ERLITE_CMDLINE
)
83 SUPPORTED_DEVICES
+= erlite
85 TARGET_DEVICES
+= ubnt_edgerouter-lite
87 define Device
/ubnt_unifi-usg
88 $(Device
/ubnt_edgerouter-lite
)
89 DEVICE_MODEL
:= UniFi Security Gateway
90 BOARD_NAME
:= ubnt
,usg
91 DEVICE_PACKAGES
+= kmod-gpio-button-hotplug kmod-leds-gpio
92 DEVICE_DTS
:= cn5020_ubnt_usg
93 KERNEL
+= | append-dtb-to-elf
95 TARGET_DEVICES
+= ubnt_unifi-usg
97 $(eval
$(call BuildImage
))