Here is a story about how to buy trouble when you dont really need it.
A new Gentoo kernel (6.2.10) was released. I decided to build it. The build process ended with a message that it could not read the file /etc/modules.d
and in /boot it had vmlinuz-6.2.10-gentoo-x86_64
but no initramfs-6.2.10-gentoo-x86_64.img
. Of course it would not boot.
So what is differernt from last time I built a kernel? I looked back thru my logbook, and yes one thing… I had installed a driver module called 88x2bu.ko for a WiFi dongle. But that was in kernel 6.2.7… how could that affect the new kernel?
Well, I used a an install script downloaded from the manufacturers website called install-driver.sh
.
I took a close look at the script, and yes it contains just one line that might be causing trouble
# sets module parameters (driver options) and blacklisted modules
echo ": ---------------------------"
echo
echo "Starting installation."
echo "Installing ${OPTIONS_FILE} to /etc/modprobe.d"
cp -f ${OPTIONS_FILE} /etc/modprobe.d
It copies something to /etc/modprobe.d
.
I had a look at what was there and it simply blacklists some other module.
Trouble is… Gentoo does not have a file /etc/modprobe.d
, it has a directory /etc/modprobe.d/
which contains various files such as blacklist.conf
.
So there is the problem … the kernel build process went looking for a directory/etc/modprobe.d/
and it found a file there instead.
So the fix was
rm /etc/modprobe.d
mkdir /etc/modrobe.d
and inside the directory /etc/modprobe.d make the file blacklist.conf
containig one line
blacklist rtw88_8822bu
Then rebuild kernel 6.2.10… and it works. Reboot, do update-grub , and it appears ion the grub menu and boots
Solved? Well not so easy.
When I reboot with 6.2.10 kernel the module (called 88x2bu") for the new wifi card is not loaded ?
But if I boot 6.2.7 it is loaded?
So I look where the module is supposed to be
/lib/modules/6.2.10-gentoo-x86_64/kernel/drivers/net/wireless
and sure enough the file 88x2bu.ko is not there
but it is there in
/lib/modules/6.2.7-gentoo-x86_64/kernel/drivers/net/wireless
So when the new kernel was compiled it did not copy the module over from the previous kernel?
So I will put it in by hand
cp /lib/modules/6.2.7-gentoo-x86_64/kernel/drivers/net/wireless/bbx2bu.ko /lib/modules/6.2.10-gentoo-x86_64/kernel/drivers/net/wireless
depmod -a 6.2.10-gentoo-x86_64
Then modinfo 88x2bu works. (Depmod is needed to install it properly)
nevj@mary ~ $ modinfo 88x2bu
filename: /lib/modules/6.2.10-gentoo-x86_64/kernel/drivers/net/wireless/88x2bu.ko
version: v5.13.1-20-gbd7c7eb9d.20210702_COEX20210316-18317b7b
author: Realtek Semiconductor Corp.
description: Realtek Wireless Lan Driver
...
but ip addr
does not list the inteface
So I reboot
then ip sees it
evj@mary ~ $ ip link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eno1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000
link/ether 98:90:96:d2:35:50 brd ff:ff:ff:ff:ff:ff
altname enp0s25
3: wlp0s20u9: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DORMANT group default qlen 1000
link/ether d0:37:45:8b:36:68 brd ff:ff:ff:ff:ff:ff
4: wlp0s20u3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000
link/ether 44:01:bb:9f:0f:10 brd ff:ff:ff:ff:ff:ff
It is No4 wlp0s20u3
The other one at No 3 wlp0s20u9 is the internet link.
So it looks like every time one compiles a kernel, one has to reinstall any modules from outside the portage system.
That is much the same as Debian - with a new release one has to add in any externally sourced drivers all over again.
Basically, the modules are part of the kernel and have to be redone if the kernel is changed.
Solved… but there is a lesson to the story
Be careful with install scripts that you may download from external sources. Read the script first to check what it does. It may do something that does not suit your version of Linux
Cheers
Neville