summaryrefslogtreecommitdiff
path: root/network/rtl8821ce
diff options
context:
space:
mode:
authorAndrzej Telszewski <atelszewski@gmail.com>2020-10-15 21:03:17 +0100
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2020-10-17 09:36:18 +0700
commitac204e86ded627976b9835f80d6d14119651b576 (patch)
treedd51accd03b78077f9da78da30338aef0d0fb9db /network/rtl8821ce
parent7c80a6a6af5d36ba619ee77629f22f64d197862c (diff)
downloadslackbuilds-ac204e86ded627976b9835f80d6d14119651b576.tar.gz
network/rtl8821ce: Added (Realtek RTL8821CE Driver)
Signed-off-by: Dave Woodfall <dave@slackbuilds.org> Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'network/rtl8821ce')
-rw-r--r--network/rtl8821ce/README24
-rw-r--r--network/rtl8821ce/allow-kver-ksrc.patch15
-rw-r--r--network/rtl8821ce/doinst.sh1
-rw-r--r--network/rtl8821ce/opt-for-performance.patch11
-rw-r--r--network/rtl8821ce/rtl8821ce.SlackBuild82
-rw-r--r--network/rtl8821ce/rtl8821ce.info10
-rw-r--r--network/rtl8821ce/slack-desc19
7 files changed, 162 insertions, 0 deletions
diff --git a/network/rtl8821ce/README b/network/rtl8821ce/README
new file mode 100644
index 0000000000..0c7cf68af3
--- /dev/null
+++ b/network/rtl8821ce/README
@@ -0,0 +1,24 @@
+Realtek RTL8821CE Driver maintained by Tomás Pinho for Arch Linux.
+Still, can serve Slackers as well!
+
+NOTE:
+
+ Although the driver builds for kernel 4.4.x as found in -14.2,
+ I only tested it in the field on kernel 5.4.x as found in -current.
+ Also, upstream warns that the source is targeting kernels > 4.14.
+
+To build the package for a kernel different from the running one,
+start the script setting the KERNEL variable as in:
+
+ KERNEL=4.4.14 ./rtl8821ce.SlackBuild
+
+NOTE:
+
+1. If you experience problems using this driver (e.g. a non-working
+ WiFi or Bluetooth), visit project's homepage to learn about possible
+ solutions.
+2. If you want to use this driver on -14.2, but with the kernel from
+ -current, you will need to compile the kernel yourself on -14.2.
+ Otherwise, you will run into compilation errors while building
+ the driver. I have no intent of fixing that, unless you provide me
+ with a working patch. ;-)
diff --git a/network/rtl8821ce/allow-kver-ksrc.patch b/network/rtl8821ce/allow-kver-ksrc.patch
new file mode 100644
index 0000000000..0629f749ee
--- /dev/null
+++ b/network/rtl8821ce/allow-kver-ksrc.patch
@@ -0,0 +1,15 @@
+diff --git a/Makefile b/Makefile
+index 5b5dc9a..da26fdd 100755
+--- a/Makefile
++++ b/Makefile
+@@ -1218,8 +1218,8 @@ EXTRA_CFLAGS += -DCONFIG_IOCTL_CFG80211 -DRTW_USE_CFG80211_STA_EVENT
+ SUBARCH := $(shell uname -m | sed -e s/i.86/i386/)
+ ARCH ?= $(SUBARCH)
+ CROSS_COMPILE ?=
+-KVER := $(shell uname -r)
+-KSRC := /lib/modules/$(KVER)/build
++KVER ?= $(shell uname -r)
++KSRC ?= /lib/modules/$(KVER)/build
+ MODDESTDIR := /lib/modules/$(KVER)/kernel/drivers/net/wireless/
+ INSTALL_PREFIX :=
+ STAGINGMODDIR := /lib/modules/$(KVER)/kernel/drivers/staging
diff --git a/network/rtl8821ce/doinst.sh b/network/rtl8821ce/doinst.sh
new file mode 100644
index 0000000000..766ff48186
--- /dev/null
+++ b/network/rtl8821ce/doinst.sh
@@ -0,0 +1 @@
+chroot . /sbin/depmod -a @KERNEL@
diff --git a/network/rtl8821ce/opt-for-performance.patch b/network/rtl8821ce/opt-for-performance.patch
new file mode 100644
index 0000000000..636bab7f52
--- /dev/null
+++ b/network/rtl8821ce/opt-for-performance.patch
@@ -0,0 +1,11 @@
+diff --git a/Makefile b/Makefile
+index 5b5dc9a..4cfa841 100755
+--- a/Makefile
++++ b/Makefile
+@@ -1,5 +1,5 @@
+ EXTRA_CFLAGS += $(USER_EXTRA_CFLAGS)
+-EXTRA_CFLAGS += -O1
++EXTRA_CFLAGS += -O2
+ #EXTRA_CFLAGS += -O3
+ #EXTRA_CFLAGS += -Wall
+ #EXTRA_CFLAGS += -Wextra
diff --git a/network/rtl8821ce/rtl8821ce.SlackBuild b/network/rtl8821ce/rtl8821ce.SlackBuild
new file mode 100644
index 0000000000..7f0c62e51c
--- /dev/null
+++ b/network/rtl8821ce/rtl8821ce.SlackBuild
@@ -0,0 +1,82 @@
+#!/bin/sh
+
+# Slackware build script for Realtek RTL8821CE Driver
+
+# Copyright 2020 Andrzej Telszewski, Szczecin
+# All rights reserved.
+#
+# Redistribution and use of this script, with or without modification, is
+# permitted provided that the following conditions are met:
+#
+# 1. Redistributions of this script must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
+# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+PRGNAM=rtl8821ce
+VERSION=${VERSION:-20201006_fe97b50}
+BUILD=${BUILD:-1}
+TAG=${TAG:-_SBo}
+
+KERNEL=${KERNEL:-$(uname -r)}
+KERNELPATH=${KERNELPATH:-/lib/modules/${KERNEL}/build}
+PKG_VERS=${VERSION}_$(printf "%s" "${KERNEL}" | tr - _)
+
+if [ -z "$ARCH" ]; then
+ case "$( uname -m )" in
+ i?86) ARCH=i586 ;;
+ arm*) ARCH=arm ;;
+ *) ARCH=$( uname -m ) ;;
+ esac
+fi
+
+CWD=$(pwd)
+TMP=${TMP:-/tmp/SBo}
+PKG=${PKG:-$TMP/package-$PRGNAM}
+OUTPUT=${OUTPUT:-/tmp}
+
+set -e
+
+rm -rf $PKG
+mkdir -p $TMP $PKG $OUTPUT
+cd $TMP
+
+rm -rf $PRGNAM-$VERSION
+tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
+cd $PRGNAM-$VERSION
+
+chown -R root:root .
+chmod -R a-st,u+rwX,go-w+rX .
+
+# Optimize with -O2, inline with Slackware.
+
+patch -p1 < $CWD/opt-for-performance.patch
+
+# Allow building for kernels other than the running one.
+
+patch -p1 < $CWD/allow-kver-ksrc.patch
+
+make KVER=${KERNEL} KSRC=${KERNELPATH}
+
+mkdir -p $PKG/lib/modules/$KERNEL/kernel/drivers/net/wireless/realtek/rtlwifi/$PRGNAM
+install -m 0644 8821ce.ko $PKG/lib/modules/$KERNEL/kernel/drivers/net/wireless/realtek/rtlwifi/$PRGNAM
+
+mkdir -p $PKG/usr/doc/$PRGNAM-$PKG_VERS
+cp -a COPYING README.md $PKG/usr/doc/$PRGNAM-$PKG_VERS
+cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$PKG_VERS/$PRGNAM.SlackBuild
+
+mkdir -p $PKG/install
+cat $CWD/slack-desc > $PKG/install/slack-desc
+sed $CWD/doinst.sh -e "s%@KERNEL@%$KERNEL%" > $PKG/install/doinst.sh
+
+cd $PKG
+/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$PKG_VERS-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
diff --git a/network/rtl8821ce/rtl8821ce.info b/network/rtl8821ce/rtl8821ce.info
new file mode 100644
index 0000000000..a2c50137c9
--- /dev/null
+++ b/network/rtl8821ce/rtl8821ce.info
@@ -0,0 +1,10 @@
+PRGNAM="rtl8821ce"
+VERSION="20201006_fe97b50"
+HOMEPAGE="https://github.com/tomaspinho/rtl8821ce/"
+DOWNLOAD="http://sourceforge.net/projects/slackbuildsdirectlinks/files/rtl8821ce/rtl8821ce-20201006_fe97b50.tar.gz"
+MD5SUM="f467f778f099b0f7a1634fe2f8bf0af4"
+DOWNLOAD_x86_64=""
+MD5SUM_x86_64=""
+REQUIRES=""
+MAINTAINER="Andrzej Telszewski"
+EMAIL="atelszewski@gmail.com"
diff --git a/network/rtl8821ce/slack-desc b/network/rtl8821ce/slack-desc
new file mode 100644
index 0000000000..70df3960a0
--- /dev/null
+++ b/network/rtl8821ce/slack-desc
@@ -0,0 +1,19 @@
+# HOW TO EDIT THIS FILE:
+# The "handy ruler" below makes it easier to edit a package description.
+# Line up the first '|' above the ':' following the base package name, and
+# the '|' on the right side marks the last column you can put a character in.
+# You must make exactly 11 lines for the formatting to be correct. It's also
+# customary to leave one space after the ':' except on otherwise blank lines.
+
+ |-----handy-ruler------------------------------------------------------|
+rtl8821ce: rtl8821ce (Realtek RTL8821CE Driver)
+rtl8821ce:
+rtl8821ce: Realtek RTL8821CE Driver maintained by Tomás Pinho for Arch Linux.
+rtl8821ce: Still, can serve Slackers as well!
+rtl8821ce:
+rtl8821ce: If you experience problems using this driver, please visit
+rtl8821ce: project's homepage to learn about possible solutions.
+rtl8821ce:
+rtl8821ce: Homepage: https://github.com/tomaspinho/rtl8821ce/
+rtl8821ce:
+rtl8821ce: