From eff30ed6608eceecfa8c589c151e3eefcb46a0d1 Mon Sep 17 00:00:00 2001 From: Adam Green Date: Wed, 13 Dec 2017 00:58:43 +0000 Subject: [PATCH] rtl8723bs_bt: new firmware package --- .../linux-firmware/rtl8723bs_bt/package.mk | 29 +++++++++++++++++++ .../patches/rtl8723bs_bt-001-Makefile.patch | 26 +++++++++++++++++ .../rtl8723bs_bt-002-firmware_path.patch | 20 +++++++++++++ .../system.d/rtl8723bs_bt-firmware.service | 8 +++++ .../rtl8723bs_bt/udev.d/80-rtl8723_bt.rules | 9 ++++++ 5 files changed, 92 insertions(+) create mode 100644 packages/linux-firmware/rtl8723bs_bt/package.mk create mode 100644 packages/linux-firmware/rtl8723bs_bt/patches/rtl8723bs_bt-001-Makefile.patch create mode 100644 packages/linux-firmware/rtl8723bs_bt/patches/rtl8723bs_bt-002-firmware_path.patch create mode 100644 packages/linux-firmware/rtl8723bs_bt/system.d/rtl8723bs_bt-firmware.service create mode 100644 packages/linux-firmware/rtl8723bs_bt/udev.d/80-rtl8723_bt.rules diff --git a/packages/linux-firmware/rtl8723bs_bt/package.mk b/packages/linux-firmware/rtl8723bs_bt/package.mk new file mode 100644 index 0000000000..4a4080870c --- /dev/null +++ b/packages/linux-firmware/rtl8723bs_bt/package.mk @@ -0,0 +1,29 @@ +################################################################################ +# This file is part of LibreELEC - https://libreelec.tv +# Copyright (C) 2017-present Team LibreELEC +# +# LibreELEC is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 2 of the License, or +# (at your option) any later version. +# +# LibreELEC is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with LibreELEC. If not, see . +################################################################################ + +PKG_NAME="rtl8723bs_bt" +PKG_VERSION="09eb91f" +PKG_SHA256="4bb8483c4a14a9e0dfc4a6ddca18486caab5f361be2441b91e9e2a399ca9f33e" +PKG_ARCH="any" +PKG_LICENSE="GPL" +PKG_SITE="https://github.com/lwfinger/rtl8723bs_bt" +PKG_URL="https://github.com/lwfinger/rtl8723bs_bt/archive/$PKG_VERSION.tar.gz" +PKG_DEPENDS_TARGET="toolchain" +PKG_SECTION="firmware" +PKG_SHORTDESC="rtl8723bs_bt Linux firmware" +PKG_LONGDESC="rtl8723bs_bt Linux firmware" diff --git a/packages/linux-firmware/rtl8723bs_bt/patches/rtl8723bs_bt-001-Makefile.patch b/packages/linux-firmware/rtl8723bs_bt/patches/rtl8723bs_bt-001-Makefile.patch new file mode 100644 index 0000000000..e4296c08e2 --- /dev/null +++ b/packages/linux-firmware/rtl8723bs_bt/patches/rtl8723bs_bt-001-Makefile.patch @@ -0,0 +1,26 @@ +diff --git a/Makefile b/Makefile +index 52506b9..fd196f3 100644 +--- a/Makefile ++++ b/Makefile +@@ -1,12 +1,15 @@ + rtk_hciattach:hciattach.c hciattach_rtk.o +- cc -o rtk_hciattach hciattach.c hciattach_rtk.o ++ $(CC) $(CFLAGS) $(LDFLAGS) -o rtk_hciattach hciattach.c hciattach_rtk.o + + hciattach_rtk.o:hciattach_rtk.c +- cc -c hciattach_rtk.c ++ $(CC) $(CFLAGS) $(LDFLAGS) -c hciattach_rtk.c + +-clean: +- rm -f *.o rtk_hciattach ++all: ++ rtk_hciattach + + install: +- mkdir -p /lib/firmware/rtl_bt +- cp -p rtlbt_* /lib/firmware/rtl_bt/. ++ mkdir -p $(DESTDIR)/usr/bin ++ cp -P rtk_hciattach $(DESTDIR)/usr/bin ++ ++clean: ++ rm -f *.o rtk_hciattach diff --git a/packages/linux-firmware/rtl8723bs_bt/patches/rtl8723bs_bt-002-firmware_path.patch b/packages/linux-firmware/rtl8723bs_bt/patches/rtl8723bs_bt-002-firmware_path.patch new file mode 100644 index 0000000000..cc57fbe371 --- /dev/null +++ b/packages/linux-firmware/rtl8723bs_bt/patches/rtl8723bs_bt-002-firmware_path.patch @@ -0,0 +1,20 @@ +--- a/hciattach_rtk.c 2016-07-18 00:47:52.000000000 +0100 ++++ b/hciattach_rtk.c 2017-12-15 04:27:39.481299996 +0000 +@@ -1419,7 +1419,7 @@ + int ret = 0; + struct stat st; + +- ret = sprintf(firmware_file_name, FIRMWARE_DIRECTORY"rtlbt_fw"); ++ ret = sprintf(firmware_file_name, FIRMWARE_DIRECTORY"rtl8723b_fw"); + + return firmware_file_name; + } +@@ -1504,7 +1504,7 @@ + int ret = 0; + int i = 0; + +- ret = sprintf(bt_config_file_name, BT_CONFIG_DIRECTORY"rtlbt_config"); ++ ret = sprintf(bt_config_file_name, BT_CONFIG_DIRECTORY"rtl8723b_config"); + if (stat(bt_config_file_name, &st) < 0) { + RS_ERR("can't access bt config file:%s, errno:%d\n", bt_config_file_name, errno); + return -1; diff --git a/packages/linux-firmware/rtl8723bs_bt/system.d/rtl8723bs_bt-firmware.service b/packages/linux-firmware/rtl8723bs_bt/system.d/rtl8723bs_bt-firmware.service new file mode 100644 index 0000000000..44f74a35c4 --- /dev/null +++ b/packages/linux-firmware/rtl8723bs_bt/system.d/rtl8723bs_bt-firmware.service @@ -0,0 +1,8 @@ +[Unit] +Description=Realtek sdio firmware update + +[Service] +Type=simple +RemainAfterExit=yes +EnvironmentFile=/usr/share/bttty.conf +ExecStart=/usr/bin/rtk_hciattach -n -s 115200 ${BTTTY} rtk_h5 2000000 diff --git a/packages/linux-firmware/rtl8723bs_bt/udev.d/80-rtl8723_bt.rules b/packages/linux-firmware/rtl8723bs_bt/udev.d/80-rtl8723_bt.rules new file mode 100644 index 0000000000..742f49cd37 --- /dev/null +++ b/packages/linux-firmware/rtl8723bs_bt/udev.d/80-rtl8723_bt.rules @@ -0,0 +1,9 @@ +################################################################################ +# udev rules file for loading rtl8723bs_bt-firmware +################################################################################ + +ACTION!="add", GOTO="end" +SUBSYSTEMS=="sdio", ATTRS{vendor}=="0x024c", ATTRS{device}=="0xb723", TAG+="systemd", ENV{SYSTEMD_WANTS}+="rtl8723bs_bt-firmware.service" +GOTO="end" + +LABEL="end"