From patchwork Sat Mar 17 09:45:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michel Stempin X-Patchwork-Id: 887267 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.138; helo=whitealder.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=wanadoo.fr Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 403HWQ1vhYz9sR1 for ; Sat, 17 Mar 2018 20:45:36 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 861C489CBB; Sat, 17 Mar 2018 09:45:33 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id K1DvOgrvIrY7; Sat, 17 Mar 2018 09:45:31 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id B411389C4D; Sat, 17 Mar 2018 09:45:31 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 26EEC1C00C1 for ; Sat, 17 Mar 2018 09:45:30 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 2402589C4D for ; Sat, 17 Mar 2018 09:45:30 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Xb8VHou-oYk0 for ; Sat, 17 Mar 2018 09:45:28 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from smtp.smtpout.orange.fr (smtp11.smtpout.orange.fr [80.12.242.133]) by whitealder.osuosl.org (Postfix) with ESMTPS id 647D589B7A for ; Sat, 17 Mar 2018 09:45:28 +0000 (UTC) Received: from [192.168.0.42] ([78.213.147.18]) by mwinf5d89 with ME id NxlS1x0030Q2xJ603xlSyM; Sat, 17 Mar 2018 10:45:26 +0100 X-ME-Helo: [192.168.0.42] X-ME-Auth: bWljaGVsLnN0ZW1waW5Ad2FuYWRvby5mcg== X-ME-Date: Sat, 17 Mar 2018 10:45:26 +0100 X-ME-IP: 78.213.147.18 To: buildroot@busybox.net From: Michel Stempin Message-ID: <4ea4dce5-c4ac-29af-616a-b134a198770b@wanadoo.fr> Date: Sat, 17 Mar 2018 10:45:26 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 Content-Language: en-US Subject: [Buildroot] [1/1] package/rtl8723bs: Wi-Fi driver is now a Linux staging driver X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.24 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" From 7cb67b022d1dbdbbac2ec06dbd7f7fdf3fd09fd3 Mon Sep 17 00:00:00 2001 From: Michel Stempin Date: Sat, 17 Mar 2018 10:02:34 +0100 Subject: [PATCH 1/1] The rtl8723bs is now a Linux staging driver since kernel 4.12. The old git commit is used for kernel < 4.12 with patches applied, but for kernel >= 4.12, the newest commit featuring only binary firmwares is fetched and only the firmwares are installed into the target directory. Getting the kernel version this early in the post-patch hook is only possible from the configuration, as the kernel is not yet configured and cannot be probed for the actual version. Signed-off-by: Michel Stempin --- ...tl8723bs-add-debug-level-modparam.patch.conditional} | 0 package/rtl8723bs/rtl8723bs.mk | 17 +++++++++++++++++ 2 files changed, 17 insertions(+) rename package/rtl8723bs/{0001-rtl8723bs-add-debug-level-modparam.patch => 0001-rtl8723bs-add-debug-level-modparam.patch.conditional} (100%) diff --git a/package/rtl8723bs/0001-rtl8723bs-add-debug-level-modparam.patch b/package/rtl8723bs/0001-rtl8723bs-add-debug-level-modparam.patch.conditional similarity index 100% rename from package/rtl8723bs/0001-rtl8723bs-add-debug-level-modparam.patch rename to package/rtl8723bs/0001-rtl8723bs-add-debug-level-modparam.patch.conditional diff --git a/package/rtl8723bs/rtl8723bs.mk b/package/rtl8723bs/rtl8723bs.mk index 4c6303c..bc6dd4f 100644 --- a/package/rtl8723bs/rtl8723bs.mk +++ b/package/rtl8723bs/rtl8723bs.mk @@ -4,7 +4,16 @@ # ################################################################################ +RTL8723BS_NEEDS_SOURCES=$(shell read -r MAJ MIN \ + <<< $$(echo "$(BR2_LINUX_KERNEL_VERSION)" | \ + sed -nr 's/[^0-9]*([0-9]+)\.([0-9]+).*/\1 \2/p') && \ + [ "0$$MAJ" -lt 4 -o "0$$MAJ" -eq 4 -a "0$$MIN" -lt 12 ] && echo 1 ||echo 0) +ifeq ($(RTL8723BS_NEEDS_SOURCES),1) RTL8723BS_VERSION = 11ab92d8ccd71c80f0102828366b14ef6b676fb2 +else +RTL8723BS_VERSION = cc77e7b6092c54500058cd027b679421b9399905 +endif + RTL8723BS_SITE = $(call github,hadess,rtl8723bs,$(RTL8723BS_VERSION)) RTL8723BS_LICENSE = GPL-2.0, proprietary (*.bin firmware blobs) @@ -16,6 +25,14 @@ RTL8723BS_MODULE_MAKE_OPTS = \ RTL8723BS_BINS = rtl8723bs_ap_wowlan.bin rtl8723bs_wowlan.bin \ rtl8723bs_bt.bin rtl8723bs_nic.bin +define RTL8723BS_CONDITIONAL_PATCH + if [ $(RTL8723BS_NEEDS_SOURCES) -eq 1 ]; then \ + $(APPLY_PATCHES) $(@D) package/rtl8723bs 0001-rtl8723bs-add-debug-level-modparam.patch.conditional; \ + fi; +endef + +RTL8723BS_POST_PATCH_HOOKS += RTL8723BS_CONDITIONAL_PATCH + define RTL8723BS_INSTALL_FIRMWARE $(foreach bin, $(RTL8723BS_BINS), \ $(INSTALL) -D -m 644 $(@D)/$(bin) $(TARGET_DIR)/lib/firmware/rtlwifi/$(bin)