Do you have one of those PS4 models that just doesn’t seem to support WiFi, Ethernet or Bluetooth? Well, you are in luck today because, in this article I will show you how you can add new device drivers to PS4 Linux kernel. This new device could be a USB WiFi adaptor or even a USB Ethernet adaptor that you bought hoping to somehow get internet working on PS4 Linux distro. Well, it is difficult to identify the networking chip on many PS4 models. So, it is a safer bet to use a USB WiFi or Ethernet adaptor on these PS4 models.
Some people do ask me, how they can install new device drivers on PS4 Linux. Most of these people are trying to figure out why their new WiFi adaptor won’t work on any PS4 Linux distro they try. Well, there are some things you should know about USB device drivers on PS4 Linux. First of all, device drivers on Linux don’t work like Windows. In most cases, you can’t just install drivers in the traditional way. The Linux kernel you use needs to have the driver or module for the specific device built-in. To be precise, on PS4 Linux, kernel modules aren’t supported. These will have to built as drivers, into a monolithic kernel.
All of this would seem gibberish to you. Believe, a few months ago, I was dumbfounded too. But, on my journey, I have learned a few new things. And, this is one of them that I would like to share. By the way, if you are interested, you should also check out my detailed article on making your own PS4 Linux distro from scratch.
Anyways, let us jump into the process. The first few preliminary steps of this tutorial have already been covered in the tutorial on compiling PS4 Linux kernel from source. So, if you have already done those steps, you could safely skip those steps. Else, keep reading.
If you prefer a video guide, then, here it is.
Video Guide: Add or install drivers for new devices to PS4 Linux kernel
On the other hand, for those who prefer textual tutorials, follow the steps below.
You could either dual boot a Linux distro or install it on a Virtual machine. If you are unsure, check out the tutorial on installing Linux onto a virtual machine. You can use any Ubuntu (based), Fedora (based) or Arch (based) distro for this tutorial.
Linux Kernel source
Most developers provide the source code for their kernels, mostly on Github. You may find them in our Downloads section.
Before we build kernel, we need to make sure that the distro has all the necessary software and dependencies to build a kernel from source. I will cover this in the very first step. So, let’s begin!
Add new device drivers to PS4 Linux kernel: Detailed Tutorial
Step 1. Setup build essentials
- Open a terminal.
- On Fedora and Fedora-based distros, type
sudo dnf install gcc git flex make bison openssl-devel elfutils-libelf-develand press Enter.
- On Ubuntu and Ubuntu-based distros, type
sudo apt-get install git fakeroot build-essential ncurses-dev xz-utils libssl-dev bc flex libelf-dev bisonand press Enter.
- On Arch and Arch-based distros, type
sudo pacman -S base-devel bc pythonand press Enter.
These are the bare minimum you need to build a kernel. In some cases, you might face an error while building the kernel due to an apparent lack of a few dependencies. In this case, leave a comment and I will help you out.
Step 2. Download kernel source
In this tutorial, I am going to show you how you could build whitehax0r’s kernel (5.4.213) for PS4 Baikal. But, the steps for every other kernel is the same.
- Go to the Github page of the kernel source.
- On the top right, click on Code and under Clone, making sure HTTPS is selected, copy the address, for example, https://github.com/whitehax0r/ps4-linux-baikal.git.
- Make a folder to contain the kernel in a suitable location on your system, say, a folder named kernel.
- Open a terminal within that folder.
git clone https://github.com/whitehax0r/ps4-linux-baikal.gitand press Enter.
- This will create a folder within the kernel folder, we created earlier and download the kernel source within that folder.
Step 3. Identify the USB device
Before we install the device driver on PS4 Linux kernel, we need to identify the device. For that, follow these instructions.
- Plug the device into your Linux PC or virtual machine. Open a terminal and type
lsusb. Then, press Enter. It will output something similar to this:-
- In the list, my USB Ethernet adaptor is identified as ASIX Electronics Corp. AX88772B. Make a note of this. If there a multiple devices in the list and you’re unsure which one pertains to your device, unplug the device, run
lsusb. After that, plug your USB device in and run
lsusbagain. The device that gets newly added, is your device.
- Now, we need to find if the driver is available for installation in the kernel source. To do that, we need to Google using the following syntax:
site:https://cateee.net AX88772B. As you can see, this query searches for AX88772B in the kernel device database available on the website, https://cateee.net. You will have to replace AX88772B with your device’s identifier from the earlier step, for example, RTL8153.
- Go to the first search result, which in my case is this page. As you can see, the title reads
CONFIG_USB_NET_AX8817X: ASIX AX88xxx Based USB 2.0 Ethernet Adapters. This is what we need, or rather, the string,
AX8817Xis all we need.
Step 4. Add device driver to PS4 Linux Kernel
Now, we will change the config file of the kernel to add/install new device drivers to PS4 Linux kernel.
- Make sure there is a .config file in the kernel folder (in this case, in the folder – ps4-linux-baikal). You will have to enable the option to show hidden files. In the case of this specific kernel, we see that there is a file by the name – config. Rename config to .config. If there is no config at all, you will have to get a .config file from some other kernel source and adapt it to this kernel. I will help if you leave a comment.
- Now, open a terminal in the source folder and type
make menuconfig. Then press Enter.
- Press on the forward slash on your keyboard. This will bring up a search bar. On it type, AX8817X (from the earlier step) and press Enter. It will display something like this:-
- As you can see, this is our driver, clear from the Prompt section of the output which is the same as what the webpage showed (from step 3.3). On this window, note the number in brackets, as encircled in red in the image above. In my case, it is 1. Press on 1 or the number you get on your keyboard.
- This, as you can see doesn’t take you to the specific driver’s option. Instead, it takes you a step back to USB Network Adapters as you can see in the image below. This is because the driver doesn’t have any drivers for USB Network Adapters enabled. To enable it, while USB Network Adapters is highlighted, press y on the keyboard. Now, there should be an asterisk in the box preceding USB Network Adapters.
- Repeat sub-steps 3-4. Now, it should highlight Multi-purpose USB Networking Framework. Press y to enable it. That should expand a list of devices.
- Repeat sub-steps 3-4 . Make sure the option, ASIX AX88xxx Based USB 2.0 Ethernet Adapters has an asterisk in the box preceding it. If not, press y to enable it. Optionally, you may disable the other devices that have been enabled in the list by going to them and pressing on n.
- Once done, use right arrow key to browse to Save and press Enter. In the popup, make sure the filename is .config and then press Enter. Again, press Enter to Exit. Finally, choose the option to Exit. You should be out of menuconfig.
Step 5. Compile PS4 Linux Kernel with new device drivers
- On the terminal, make sure you are on the kernel’s root folder, in my case, ps4-linux-baikal.
- Now, check how many cores your PC has. Assuming you are doing it on a quad core (4 cores) CPU, on the terminal we already had open, type
make -j5and press Enter. The general rule of thumb is in the command, j should be followed by the number cores plus 1. So, if you were to compile on a PS4 Linux distro, you would type
make -j9as PS4 has an octa core (8 cores) APU.
- Once the process is complete, you will find the compiled kernel (bzImage) in the folder – arch/x86/boot.
That’s it! Once the bzImage is ready, all you have to do is replace the kernel on your PS4 Linux USB drive and your new device should be running, as expected!
While these are the steps you need to follow in order to enable existing drivers on the PS4 Linux kernel, there could be some devices that require additional steps. This detailed tutorial should help you get started with kernel tweaking. Anyways, if you need any help, leave a comment below, or you could reply to this forum post.