[OpenWrt-Devel] [PATCH] bcm53xx: allow building single device images

Álvaro Fernández Rojas noltari at gmail.com
Sun Sep 13 07:06:19 EDT 2015


While keeping the default build profile, this allows users to generate only
their device image instead of every bcm53xx supported device image
This way we can also define the proper packages for each device (USB, WiFi...)

Signed-off-by: Álvaro Fernández Rojas <noltari at gmail.com>
---
 target/linux/bcm53xx/Makefile                |  4 +--
 target/linux/bcm53xx/image/Makefile          |  3 +-
 target/linux/bcm53xx/profiles/100-Generic.mk |  5 ++--
 target/linux/bcm53xx/profiles/ASUS.mk        | 43 ++++++++++++++++++++++++++
 target/linux/bcm53xx/profiles/Buffalo.mk     | 45 ++++++++++++++++++++++++++++
 target/linux/bcm53xx/profiles/NETGEAR.mk     | 45 ++++++++++++++++++++++++++++
 target/linux/bcm53xx/profiles/SmartRG.mk     | 16 ++++++++++
 7 files changed, 155 insertions(+), 6 deletions(-)
 create mode 100644 target/linux/bcm53xx/profiles/ASUS.mk
 create mode 100644 target/linux/bcm53xx/profiles/Buffalo.mk
 create mode 100644 target/linux/bcm53xx/profiles/NETGEAR.mk
 create mode 100644 target/linux/bcm53xx/profiles/SmartRG.mk

diff --git a/target/linux/bcm53xx/Makefile b/target/linux/bcm53xx/Makefile
index 68cfa63..6b916ce 100644
--- a/target/linux/bcm53xx/Makefile
+++ b/target/linux/bcm53xx/Makefile
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2013 OpenWrt.org
+# Copyright (C) 2013-2015 OpenWrt.org
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -23,7 +23,7 @@ endef
 
 KERNELNAME:=zImage dtbs
 
-DEFAULT_PACKAGES += swconfig wpad-mini nvram otrx \
+DEFAULT_PACKAGES += swconfig nvram otrx \
 	kmod-gpio-button-hotplug \
 	kmod-leds-gpio kmod-ledtrig-default-on kmod-ledtrig-timer
 
diff --git a/target/linux/bcm53xx/image/Makefile b/target/linux/bcm53xx/image/Makefile
index 7aa9fc2..d692520 100644
--- a/target/linux/bcm53xx/image/Makefile
+++ b/target/linux/bcm53xx/image/Makefile
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2013 OpenWrt.org
+# Copyright (C) 2013-2015 OpenWrt.org
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -66,6 +66,7 @@ define Device/Default
   # .dtb files are prefixed by SoC type, e.g. bcm4708- which is not included in device/image names
   # extract the full dtb name based on the device info
   DT := $(patsubst %.dtb,%,$(notdir $(wildcard $(if $(IB),$(KDIR),$(DTS_DIR))/*-$(1).dtb)))
+  PROFILES = Generic $$(DEVICE_NAME)
   KERNEL := kernel-bin | append-dtb | lzma-d16
   FILESYSTEMS := squashfs
   KERNEL_NAME := zImage
diff --git a/target/linux/bcm53xx/profiles/100-Generic.mk b/target/linux/bcm53xx/profiles/100-Generic.mk
index d7e9005..fb6527f 100644
--- a/target/linux/bcm53xx/profiles/100-Generic.mk
+++ b/target/linux/bcm53xx/profiles/100-Generic.mk
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2013 OpenWrt.org
+# Copyright (C) 2013-2015 OpenWrt.org
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -7,7 +7,7 @@
 
 define Profile/Generic
   NAME:=Broadcom SoC, BCM43xx WiFi (b43, brcmfmac, default)
-  PACKAGES:=kmod-b43 kmod-brcmfmac
+  PACKAGES:=kmod-b43 kmod-brcmfmac wpad-mini
 endef
 
 define Profile/Generic/Description
@@ -16,4 +16,3 @@ define Profile/Generic/Description
 endef
 
 $(eval $(call Profile,Generic))
-
diff --git a/target/linux/bcm53xx/profiles/ASUS.mk b/target/linux/bcm53xx/profiles/ASUS.mk
new file mode 100644
index 0000000..51aa412
--- /dev/null
+++ b/target/linux/bcm53xx/profiles/ASUS.mk
@@ -0,0 +1,43 @@
+#
+# Copyright (C) 2015 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+define Profile/asus-rt-ac56u
+  NAME:=ASUS RT-AC56U
+  PACKAGES:=kmod-b43 wpad-mini \
+	kmod-usb-ohci kmod-usb2
+endef
+define Profile/asus-rt-ac56u/Description
+  Package set optimized for ASUS RT-AC56U.
+endef
+$(eval $(call Profile,asus-rt-ac56u))
+
+define Profile/asus-rt-ac68u
+  NAME:=ASUS RT-AC68U
+  PACKAGES:=kmod-usb-ohci kmod-usb2
+endef
+define Profile/asus-rt-ac68u/Description
+  Package set optimized for ASUS RT-AC68U.
+endef
+$(eval $(call Profile,asus-rt-ac68u))
+
+define Profile/asus-rt-ac87u
+  NAME:=ASUS RT-AC87U
+  PACKAGES:=kmod-usb-ohci kmod-usb2
+endef
+define Profile/asus-rt-ac87u/Description
+  Package set optimized for ASUS RT-AC87U.
+endef
+$(eval $(call Profile,asus-rt-ac87u))
+
+define Profile/asus-rt-n18u
+  NAME:=ASUS RT-N18U
+  PACKAGES:=kmod-usb-ohci kmod-usb2
+endef
+define Profile/asus-rt-n18u/Description
+  Package set optimized for ASUS RT-N18U.
+endef
+$(eval $(call Profile,asus-rt-n18u))
diff --git a/target/linux/bcm53xx/profiles/Buffalo.mk b/target/linux/bcm53xx/profiles/Buffalo.mk
new file mode 100644
index 0000000..704eefd
--- /dev/null
+++ b/target/linux/bcm53xx/profiles/Buffalo.mk
@@ -0,0 +1,45 @@
+#
+# Copyright (C) 2015 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+define Profile/buffalo-wzr-600dhp2
+  NAME:=Buffalo WZR-600DHP2
+  PACKAGES:=kmod-b43 wpad-mini \
+	kmod-usb-ohci kmod-usb2
+endef
+define Profile/buffalo-wzr-600dhp2/Description
+  Package set optimized for Buffalo WZR-600DHP2.
+endef
+$(eval $(call Profile,buffalo-wzr-600dhp2))
+
+define Profile/buffalo-wzr-900dhp
+  NAME:=Buffalo WZR-900DHP
+  PACKAGES:=kmod-b43 wpad-mini \
+	kmod-usb-ohci kmod-usb2
+endef
+define Profile/buffalo-wzr-900dhp/Description
+  Package set optimized for Buffalo WZR-900DHP.
+endef
+$(eval $(call Profile,buffalo-wzr-900dhp))
+
+define Profile/buffalo-wzr-1750dhp
+  NAME:=Buffalo WZR-1750DHP
+  PACKAGES:=kmod-b43 wpad-mini \
+	kmod-usb-ohci kmod-usb2
+endef
+define Profile/buffalo-wzr-1750dhp/Description
+  Package set optimized for Buffalo WZR-1750DHP.
+endef
+$(eval $(call Profile,buffalo-wzr-1750dhp))
+
+define Profile/buffalo-wxr-1900dhp
+  NAME:=Buffalo WXR-1900DHP
+  PACKAGES:=kmod-usb-ohci kmod-usb2
+endef
+define Profile/buffalo-wxr-1900dhp/Description
+  Package set optimized for Buffalo WXR-1900DHP.
+endef
+$(eval $(call Profile,buffalo-wxr-1900dhp))
diff --git a/target/linux/bcm53xx/profiles/NETGEAR.mk b/target/linux/bcm53xx/profiles/NETGEAR.mk
new file mode 100644
index 0000000..74edb3a
--- /dev/null
+++ b/target/linux/bcm53xx/profiles/NETGEAR.mk
@@ -0,0 +1,45 @@
+#
+# Copyright (C) 2015 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+define Profile/netgear-r6250
+  NAME:=NETGEAR R6250
+  PACKAGES:=kmod-b43 wpad-mini \
+	kmod-usb-ohci kmod-usb2
+endef
+define Profile/netgear-r6250/Description
+  Package set optimized for NETGEAR R6250.
+endef
+$(eval $(call Profile,netgear-r6250))
+
+define Profile/netgear-r6300-v2
+  NAME:=NETGEAR R6300 v2
+  PACKAGES:=kmod-b43 wpad-mini \
+	kmod-usb-ohci kmod-usb2
+endef
+define Profile/netgear-r6300-v2/Description
+  Package set optimized for NETGEAR R6300 v2.
+endef
+$(eval $(call Profile,netgear-r6300-v2))
+
+define Profile/netgear-r7000
+  NAME:=NETGEAR R7000
+  PACKAGES:=kmod-usb-ohci kmod-usb2
+endef
+define Profile/netgear-r7000/Description
+  Package set optimized for NETGEAR R7000.
+endef
+$(eval $(call Profile,netgear-r7000))
+
+define Profile/netgear-r8000
+  NAME:=NETGEAR R8000
+  PACKAGES:=kmod-brcmfmac wpad-mini \
+	kmod-usb-ohci kmod-usb2
+endef
+define Profile/netgear-r8000/Description
+  Package set optimized for NETGEAR R8000.
+endef
+$(eval $(call Profile,netgear-r8000))
diff --git a/target/linux/bcm53xx/profiles/SmartRG.mk b/target/linux/bcm53xx/profiles/SmartRG.mk
new file mode 100644
index 0000000..2de26b2
--- /dev/null
+++ b/target/linux/bcm53xx/profiles/SmartRG.mk
@@ -0,0 +1,16 @@
+#
+# Copyright (C) 2015 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+define Profile/smartrg-sr400ac
+  NAME:=SmartRG SR400ac
+  PACKAGES:=kmod-b43 wpad-mini \
+	kmod-usb-ohci kmod-usb2
+endef
+define Profile/smartrg-sr400ac/Description
+  Package set optimized for SmartRG SR400ac.
+endef
+$(eval $(call Profile,smartrg-sr400ac))
-- 
1.9.1
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


More information about the openwrt-devel mailing list