b91c262447c9db60da1c1321e9223b96769f4ba2
[openwrt/staging/wigyori.git] / target / linux / octeon / image / Makefile
1 #
2 # Copyright (C) 2009-2010 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7 include $(TOPDIR)/rules.mk
8 include $(INCLUDE_DIR)/image.mk
9
10 define Build/append-dtb-to-elf
11 $(TARGET_CROSS)objcopy --update-section .appended_dtb=$(KDIR)/image-$(DEVICE_DTS).dtb $@
12 endef
13
14 define Build/strip-kernel
15 # Workaround pre-SDK-1.9.0 u-boot versions not handling the .notes section
16 $(TARGET_CROSS)strip -R .notes $@ -o $@.stripped && mv $@.stripped $@
17 endef
18
19 DTS_DIR := $(DTS_DIR)/cavium-octeon
20
21 define Device/Default
22 PROFILES = Default $$(DEVICE_NAME)
23 KERNEL_NAME := vmlinux.elf
24 KERNEL_INITRAMFS_NAME := vmlinux-initramfs.elf
25 KERNEL := kernel-bin | strip-kernel | patch-cmdline
26 IMAGES := sysupgrade.tar
27 IMAGE/sysupgrade.tar/squashfs := append-rootfs | pad-extra 128k | sysupgrade-tar rootfs=$$$$@
28 IMAGE/sysupgrade.tar := sysupgrade-tar
29 endef
30
31 define Device/generic
32 DEVICE_VENDOR := Generic
33 DEVICE_MODEL := Octeon
34 FILESYSTEMS := ext4
35 endef
36 TARGET_DEVICES += generic
37
38 ITUSROUTER_CMDLINE:=console=ttyS0,115200 root=/dev/mmcblk1p2 rootfstype=squashfs,ext4,f2fs rootwait
39 define Device/itus_shield-router
40 DEVICE_VENDOR := Itus Networks
41 DEVICE_MODEL := Shield Router
42 CMDLINE := $(ITUSROUTER_CMDLINE)
43 IMAGE/sysupgrade.tar/squashfs += | append-metadata
44 endef
45 TARGET_DEVICES += itus_shield-router
46
47 ER_CMDLINE:=-mtdparts=phys_mapped_flash:640k(boot0)ro,640k(boot1)ro,64k(eeprom)ro root=/dev/mmcblk0p2 rootfstype=squashfs,ext4 rootwait
48 define Device/ubnt_edgerouter
49 DEVICE_VENDOR := Ubiquiti
50 DEVICE_MODEL := EdgeRouter
51 BOARD_NAME := er
52 CMDLINE := $(ER_CMDLINE)
53 DEFAULT := n
54 endef
55 TARGET_DEVICES += ubnt_edgerouter
56
57 define Device/ubnt_edgerouter-4
58 DEVICE_VENDOR := Ubiquiti
59 DEVICE_MODEL := EdgeRouter 4
60 DEVICE_DTS := cn7130_ubnt_edgerouter-4
61 DEVICE_PACKAGES += kmod-gpio-button-hotplug kmod-leds-gpio kmod-of-mdio kmod-sfp kmod-usb3 kmod-usb-dwc3 kmod-usb-storage-uas
62 KERNEL := kernel-bin | patch-cmdline | append-dtb-to-elf
63 KERNEL_DEPENDS := $$(wildcard $(DTS_DIR)/$(DEVICE_DTS).dts)
64 CMDLINE := root=/dev/mmcblk0p2 rootfstype=squashfs,ext4 rootwait
65 endef
66 TARGET_DEVICES += ubnt_edgerouter-4
67
68 ERLITE_CMDLINE:=-mtdparts=phys_mapped_flash:512k(boot0)ro,512k(boot1)ro,64k(eeprom)ro root=/dev/sda2 rootfstype=squashfs,ext4 rootwait
69 define Device/ubnt_edgerouter-lite
70 DEVICE_VENDOR := Ubiquiti
71 DEVICE_MODEL := EdgeRouter Lite
72 BOARD_NAME := erlite
73 CMDLINE := $(ERLITE_CMDLINE)
74 endef
75 TARGET_DEVICES += ubnt_edgerouter-lite
76
77 $(eval $(call BuildImage))