The inevitable Internet searching didn’t turn up any horror stories from people who had tried to install Linux on this hardware and failed, so although this seemed as though I was sailing into uncharted waters, it was actually reassuring. The next step was to download my distro of choice (the latest Ubuntu 16.04) and write it to a USB memory stick. When it came to booting and installing from the memory stick, it was textbook: even the GPU was recognised and supported. I went for a dual-boot configuration, just in case I ever needed to use Windows 10. (Shurely shome mishstake?) After rebooting to complete the installation, everything seemed fine — except that I wasn’t seeing any WiFi activity in the network menu.
Now, in a modern laptop, wireless networking is an expected norm. This was one of the main reasons for buying it. Getting Ubuntu 16.04 to use WiFi in an HP Pavilion 15-cw0980na could then be a challenge. Firing up a Terminal, I used the lspci command to identify the wireless networking chip. As far as I could tell, it was a Realtek Semiconductor Co., Ltd. RTL8821CE. Although Ubuntu does provide support for the RTL8821AE, this is a different chip unfortunately. (One nice thing about the HP Pavilion 15 laptop, and a reason why I bought it, is that it also comes with an Ethernet port. So I could connect a UTP network cable between my laptop and home router and still have an Internet connection.)
More Internet searching for the RTL8821CE and Ubuntu turned up a number of leads, including source for at least one driver on Github. (Thank you Tomas Pinho and friends.) The catch being that this was targetted for Ubuntu 18.04, not 16.04! Nevertheless, I reasoned that the driver source changes couldn't have been that drastic for 18.04, otherwise I would have heard (read) the criticism. (Even IT people are not that keen on change, especially if the benefits are questionable.)
Therefore, I installed the extra packages needed to access and compile the driver source code, and copied the driver code into a suitable directory. When I went into the driver code directory and ran the make command, predictably it chugged away for a few seconds and then stopped saying there was a problem with the file os_dep/linux/rtw_android.c: there was a mismatch of arguments in the macro access_ok. Fortunately, I was able to copy and change the file to work with Ubuntu 16.04, and to my relief the commands make and make install both ran without further errors. When I then rebooted my laptop, I was delighted to see that wireless networking had sprung to life -- and I was able to connect to my home WiFi without any problem. Excellent!
For a more detailed explanation, these are the steps I took to get wireless networking functioning:
- mkdir /usr/local/src/tomaspinho; cd /usr/local/src/tomaspinho
- apt-get install git
- git clone https://github.com/tomaspinho/rtl8821ce.git
- cd rtl8821ce
- Edit the file os_dep/linux/rtw_android.c (make a copy first) and use a text editor to change line 665 from: if (!access_ok(priv_cmd.buf, priv_cmd.total_len)) { to: if (!access_ok(VERIFY_WRITE, priv_cmd.buf, priv_cmd.total_len)) { .
- Run the make command.
- Run the make install command.
- Now reboot the laptop.
- Wireless networking should now be working.
No comments:
Post a Comment