[OpenWrt-Devel] [PATCH 3/3] treewide: rename DEVICE_TYPE to DEFAULT_TYPE

Adrian Schmutzler freifunk at adrianschmutzler.de
Fri May 29 13:22:38 EDT 2020


The prefix "DEVICE_" for Make variables is only used for per-device
variables with the only exception of DEVICE_TYPE. This is misleading
as it leads people to incorrectly assume it can be set per device like
all the other DEVICE_* variables, as has been observed in the past.

This renames this (rarely used) variable to clearly indicate that
it's not a device-dependent variable, and stays in line with the
DEFAULT_PACKAGES variable.

Note that there is also a (single) package in the packages feed that
needs to be updated.

Cc: Linus Walleij <linus.walleij at linaro.org>
Signed-off-by: Adrian Schmutzler <freifunk at adrianschmutzler.de>
---
 include/target.mk              | 4 ++--
 package/utils/busybox/Makefile | 2 +-
 target/linux/arc770/Makefile   | 2 +-
 target/linux/archs38/Makefile  | 2 +-
 target/linux/oxnas/Makefile    | 2 +-
 5 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/include/target.mk b/include/target.mk
index a2ceb7f783..8374de2ebd 100644
--- a/include/target.mk
+++ b/include/target.mk
@@ -10,7 +10,7 @@ ifneq ($(__target_inc),1)
 __target_inc=1
 
 # default device type
-DEVICE_TYPE?=router
+DEFAULT_TYPE?=router
 
 # Default packages - the really basic set
 DEFAULT_PACKAGES:=base-files libc libgcc busybox dropbear mtd uci opkg netifd fstools uclient-fetch logd urandom-seed urngd
@@ -53,7 +53,7 @@ else
 endif
 
 # Add device specific packages (here below to allow device type set from subtarget)
-DEFAULT_PACKAGES += $(DEFAULT_PACKAGES.$(DEVICE_TYPE))
+DEFAULT_PACKAGES += $(DEFAULT_PACKAGES.$(DEFAULT_TYPE))
 
 filter_packages = $(filter-out -% $(patsubst -%,%,$(filter -%,$(1))),$(1))
 extra_packages = $(if $(filter wpad-mini wpad-basic wpad nas,$(1)),iwinfo)
diff --git a/package/utils/busybox/Makefile b/package/utils/busybox/Makefile
index 01441d1e87..81dde74d0b 100644
--- a/package/utils/busybox/Makefile
+++ b/package/utils/busybox/Makefile
@@ -94,7 +94,7 @@ endif
 define Build/Configure
 	rm -f $(PKG_BUILD_DIR)/.config
 	touch $(PKG_BUILD_DIR)/.config
-ifeq ($(DEVICE_TYPE),nas)
+ifeq ($(DEFAULT_TYPE),nas)
 	echo "CONFIG_HDPARM=y" >> $(PKG_BUILD_DIR)/.config
 endif
 	grep 'CONFIG_BUSYBOX_$(BUSYBOX_SYM)' $(TOPDIR)/.config | sed -e "s,\\(# \)\\?CONFIG_BUSYBOX_$(BUSYBOX_SYM)_\\(.*\\),\\1CONFIG_\\2,g" >> $(PKG_BUILD_DIR)/.config
diff --git a/target/linux/arc770/Makefile b/target/linux/arc770/Makefile
index 018d6e5448..d1f3e2dc82 100644
--- a/target/linux/arc770/Makefile
+++ b/target/linux/arc770/Makefile
@@ -13,7 +13,7 @@ SUBTARGETS:=generic
 
 KERNEL_PATCHVER:=4.14
 
-DEVICE_TYPE:=basic
+DEFAULT_TYPE:=basic
 
 define Target/Description
 	Synopsys DesignWare boards
diff --git a/target/linux/archs38/Makefile b/target/linux/archs38/Makefile
index 5b3650ef8d..891583b2d2 100644
--- a/target/linux/archs38/Makefile
+++ b/target/linux/archs38/Makefile
@@ -14,7 +14,7 @@ SUBTARGETS:=generic
 
 KERNEL_PATCHVER:=5.4
 
-DEVICE_TYPE:=basic
+DEFAULT_TYPE:=basic
 
 define Target/Description
 	Synopsys DesignWare boards
diff --git a/target/linux/oxnas/Makefile b/target/linux/oxnas/Makefile
index 750eddbcbb..10d05e914f 100644
--- a/target/linux/oxnas/Makefile
+++ b/target/linux/oxnas/Makefile
@@ -5,7 +5,7 @@ BOARD:=oxnas
 BOARDNAME:=PLXTECH/Oxford NAS782x/OX8xx
 SUBTARGETS:=ox810se ox820
 FEATURES:=gpio ramdisk rtc squashfs
-DEVICE_TYPE:=nas
+DEFAULT_TYPE:=nas
 
 KERNEL_PATCHVER:=5.4
 
-- 
2.20.1


_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list