diff mbox series

[OpenWrt-Devel,RFC] mac80211: Don't check for platform files with external kernel trees

Message ID 20180108023112.4010-1-f.fainelli@gmail.com
State RFC
Headers show
Series [OpenWrt-Devel,RFC] mac80211: Don't check for platform files with external kernel trees | expand

Commit Message

Florian Fainelli Jan. 8, 2018, 2:31 a.m. UTC
When building with an external kernel tree, do not check the different
platform files since this is almost guaranteed they are going to differ.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 package/kernel/mac80211/Makefile | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

Comments

Felix Fietkau Jan. 8, 2018, 5:57 a.m. UTC | #1
> On 8. Jan 2018, at 10:31, Florian Fainelli <f.fainelli@gmail.com> wrote:
> 
> When building with an external kernel tree, do not check the different
> platform files since this is almost guaranteed they are going to differ.
> 
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
But that also means it’s almost always going to break if platform data is involved on the external kernel tree.

- Felix
Hauke Mehrtens Jan. 11, 2018, 7:42 p.m. UTC | #2
On 01/08/2018 06:57 AM, Felix Fietkau wrote:
> 
> 
>> On 8. Jan 2018, at 10:31, Florian Fainelli <f.fainelli@gmail.com> wrote:
>>
>> When building with an external kernel tree, do not check the different
>> platform files since this is almost guaranteed they are going to differ.
>>
>> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
> But that also means it’s almost always going to break if platform data is involved on the external kernel tree.
> 
> - Felix

If these files are just getting removed from backports, then it will use
the kernel versions, this way the structures used by kernel and
backports will be the same and it we will run into a compile error in
case some member of a structure is accessed which is not in the kernel.

This will allow to compile all drivers except ath5k, ath9k and rt2x00
with external kernels and for these drivers it will work when the
appropriate changes to the kernel were added before. This will be
similar to how we handle bcma and ssb.

Hauke
diff mbox series

Patch

diff --git a/package/kernel/mac80211/Makefile b/package/kernel/mac80211/Makefile
index 385bea4d2f5d..1740c956fe9f 100644
--- a/package/kernel/mac80211/Makefile
+++ b/package/kernel/mac80211/Makefile
@@ -1751,11 +1751,16 @@  ifneq ($(CONFIG_PACKAGE_kmod-cfg80211)$(CONFIG_PACKAGE_kmod-lib80211),)
  endef
 endif
 
-define Build/Configure
+ifeq ($(strip $(CONFIG_EXTERNAL_KERNEL_TREE)),"")
+ define Build/Configure
 	cmp $(PKG_BUILD_DIR)/include/linux/ath9k_platform.h $(LINUX_DIR)/include/linux/ath9k_platform.h
 	cmp $(PKG_BUILD_DIR)/include/linux/ath5k_platform.h $(LINUX_DIR)/include/linux/ath5k_platform.h
 	cmp $(PKG_BUILD_DIR)/include/linux/rt2x00_platform.h $(LINUX_DIR)/include/linux/rt2x00_platform.h
-endef
+  endef
+else
+  define Build/Configure
+  endef
+endif
 
 define Build/Compile
 	$(SH_FUNC) var2file "$(call shvar,mac80211_config)" $(PKG_BUILD_DIR)/.config