SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I'm testing a bunch of usb WiFi adapters.
One of the adapters had an rtl8812au chip that wasn't supported by the kernel.
It seems to be pretty common in usb WiFi adapters rated for higher transfer speeds and many even claim linux support.
After some searching and some testing i got it to work, so i made a quick SlackBuild for it.
Code:
#!/bin/sh
# Slackware build script for rtl8812au
# Copyright 2017 Niklas 'Nille' Åkerström <nille.kungen [at] gmail.com>
# 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=rtl8812au
BRANCH=${BRANCH:-master} #for original source use 4.3.20
BUILD=${BUILD:-1}
KERNELVERSION=${KERNELVERSION:-`uname -r`}
TAG=${TAG:-_Nille}
# Automatically determine the architecture we're building on:
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
i?86) ARCH=i586 ;;
arm*) ARCH=arm ;;
# Unless $ARCH is already set, use uname -m for all other archs:
*) ARCH=$( uname -m ) ;;
esac
fi
CWD=$(pwd)
TMP=${TMP:-/tmp/builds}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
set -e # Exit on most errors
rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf rtl8812au_rtl8821au
git clone git://github.com/Grawp/rtl8812au_rtl8821au.git
cd rtl8812au_rtl8821au
HEADISAT="$(cat .git/packed-refs | grep "refs/remotes/origin/${BRANCH}$" | cut -b1-7)"
set +e
find . -name ".git*" -exec rm -rf "{}" \;
set -e
chown -R root:root .
make
mkdir -p $PKG/lib/modules/${KERNELVERSION}/drivers/net/wireless
install -m 644 *.ko $PKG/lib/modules/${KERNELVERSION}/drivers/net/wireless/
mkdir -p $PKG/install
# Create the slack-desc file
cat << 'EOF' > $PKG/install/slack-desc
# 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 ':'.
|-----handy-ruler------------------------------------------------------|
rtl8812au:
rtl8812au: RealTek RTL8812AU and RTL8821AU driver
rtl8812au:
rtl8812au: This driver package is built with an fork of RealTek driver v4.3.20
rtl8812au:
rtl8812au: https://github.com/Grawp/rtl8812au_rtl8821au
rtl8812au:
rtl8812au:
rtl8812au:
rtl8812au:
rtl8812au:
EOF
#create doinst.sh that runs depmod with kernelversion
cat << 'EOF' > $PKG/install/doinst.sh
if [ -x sbin/depmod ]; then
chroot . /sbin/depmod -ae @KERNEL@ 1> /dev/null 2> /dev/null
fi
EOF
sed -i "s%@KERNEL@%${KERNELVERSION}%" $PKG/install/doinst.sh
cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$HEADISAT\_${KERNELVERSION}-${ARCH}-${BUILD}${TAG}.${PKGTYPE:-tgz}
I've had one of these 8812au wifi adapters for about 5 years. After finding a repo that allowed me to make a module (even though I initially had to insert usb id entry myself), it's been working really well and I'm surprised that it's never made it into the mainline kernel. I guess there must be good reasons for that. The only real issue I've had is that the most up to date repo changes every so often. The first one I found went stale after a while (wouldn't build with kernel of that time) so I found another repo whose code worked and eventually another - I think I'm on my third repo at the moment. This SlackBuild introduces yet another. I wish there were a stable source that is updated reliably or, better, it would finally make it to mainline.
The git repo used is the one used by Arch Linux so i expect it to be updated if needed,it's also forked of realtek v4.3.20.
I did find some forked from earlier releases but they didn't work with my "Comfast" 600Mbps 11AC adapter 0bda:a811, but this git repo works.
I did put some time into this adapter, first finding the last source release that i could find (v4.3.20) and then poking in the source myself until i found this git repo.
Last edited by Nille_kungen; 05-19-2017 at 04:48 AM.
Updated the script since kernelversion wasn't passed to make.
This is needed to be able to build the package for a new kernel before reboot.
Code:
#!/bin/sh
# Slackware build script for rtl8812au
# Copyright 2017 Niklas 'Nille' Åkerström <nille.kungen [at] gmail.com>
# 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=rtl8812au
BRANCH=${BRANCH:-master} #for original source use 4.3.20
BUILD=${BUILD:-1}
KERNELVERSION=${KERNELVERSION:-`uname -r`}
TAG=${TAG:-_Nille}
# Automatically determine the architecture we're building on:
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
i?86) ARCH=i586 ;;
arm*) ARCH=arm ;;
# Unless $ARCH is already set, use uname -m for all other archs:
*) ARCH=$( uname -m ) ;;
esac
fi
CWD=$(pwd)
TMP=${TMP:-/tmp/builds}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
set -e # Exit on most errors
rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf rtl8812au_rtl8821au
git clone git://github.com/Grawp/rtl8812au_rtl8821au.git
cd rtl8812au_rtl8821au
HEADISAT="$(cat .git/packed-refs | grep "refs/remotes/origin/${BRANCH}$" | cut -b1-7)"
set +e
find . -name ".git*" -exec rm -rf "{}" \;
set -e
chown -R root:root .
make KVER=${KERNELVERSION}
mkdir -p $PKG/lib/modules/${KERNELVERSION}/drivers/net/wireless
install -m 644 *.ko $PKG/lib/modules/${KERNELVERSION}/drivers/net/wireless/
mkdir -p $PKG/install
# Create the slack-desc file
cat << 'EOF' > $PKG/install/slack-desc
# 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 ':'.
|-----handy-ruler------------------------------------------------------|
rtl8812au:
rtl8812au: RealTek RTL8812AU and RTL8821AU driver
rtl8812au:
rtl8812au: This driver package is built with an fork of RealTek driver v4.3.20
rtl8812au:
rtl8812au: https://github.com/Grawp/rtl8812au_rtl8821au
rtl8812au:
rtl8812au:
rtl8812au:
rtl8812au:
rtl8812au:
EOF
#create doinst.sh that runs depmod with kernelversion
cat << 'EOF' > $PKG/install/doinst.sh
if [ -x sbin/depmod ]; then
chroot . /sbin/depmod -ae @KERNEL@ 1> /dev/null 2> /dev/null
fi
EOF
sed -i "s%@KERNEL@%${KERNELVERSION}%" $PKG/install/doinst.sh
cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$HEADISAT\_${KERNELVERSION}-${ARCH}-${BUILD}${TAG}.${PKGTYPE:-tgz}
Updated the script since kernelversion wasn't passed to make.
This is needed to be able to build the package for a new kernel before reboot.
Code:
...
The issue of having to make a new package before rebooting with a new kernel is the reason I've not used a SlackBuild for this module (also nvidia module). Instead I hand them over to dkms (I have my own build of it but it's also available at SBo) which detects a new kernel at boot time and builds any out of date modules that it knows about.
Further to the earlier comment about the most up to date upstream changing from time to time, I see Arch Linux has now changed theirs to: https://github.com/zebulon2/rtl8812au-driver-5.2.9
which I've been using for about 15mins so far. No problems yet.
I spent yesterday on a 8814au build, eventually settling on zebulon2 - I too found it looked like the most current. Has patch for 4.11 which was missing from other repos.
Not Slack in my case, just adding corroboration.
Looks like a lot of. Nice equipment. What do you want to do? I was skypeing with a buddy overseas and while he was doing that he was actually broadcasting voice and music to other people. I find this amazing but I am not going to resurrect a old dead box to do it? Laptop? Internet? Throw these things in a blender and I guarantee you will have something.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.