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-4
56 DEVICE_VENDOR
:= Ubiquiti
57 DEVICE_MODEL
:= EdgeRouter
4
58 DEVICE_DTS
:= cn7130_ubnt_edgerouter-4
59 DEVICE_PACKAGES
+= kmod-gpio-button-hotplug kmod-leds-gpio kmod-of-mdio kmod-sfp kmod-usb3 kmod-usb-dwc3 kmod-usb-storage-uas
60 KERNEL
:= kernel-bin | patch-cmdline | append-dtb-to-elf
61 KERNEL_DEPENDS
:= $$(wildcard $(DTS_DIR
)/$(DEVICE_DTS
).dts
)
62 CMDLINE
:= root
=/dev
/mmcblk0p2 rootfstype
=squashfs
,ext4 rootwait
64 TARGET_DEVICES
+= ubnt_edgerouter-4
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
71 CMDLINE
:= $(ERLITE_CMDLINE
)
72 SUPPORTED_DEVICES
+= erlite
74 TARGET_DEVICES
+= ubnt_edgerouter-lite
76 $(eval
$(call BuildImage
))