Discussion:
[gentoo-user] problem compiling Kernel 6.1.27-gentoo-r1
(too old to reply)
Philip Webb
2023-05-20 07:10:01 UTC
Permalink
I'm trying to install Gentoo in my new machine
& have got to the step of compiling a kernel.
I used the config file from my present machine, did 'make oldconfig'
& have then done 'make menuconfig' to include drivers etc.

The 'make' stage goes on for a long time, then crashes doing
'UPD drivers/base/firmware_loader/builtin/rtl_nic/rtl8168g-2.fw.gen.S'
with message "make [5] *** No rule to make target
'lib/firmware/rtl_nic/rtl8168g-2.fw' needed by 'drivers/base/firmware_loader/
builtin/rtl_nic/rtl8168g-2.fw.gen.o' Stop".

The relevant line in Menuconfig is 'DeviceDrivers > NetworkDeviceSupport >
EthernetDriverSupport' under 'Realtek devices'.
I've tried it with 'Realtek8169/8168/...' 'Y' or 'M' or 'N'
& also with 'Realtek devices' as 'N'. I also tried a 'make clean'.
The same error goes on happening.

Since I don't have anything by Realtek for networking
-- sound uses Realtek -- , I can't understand the behaviour above.

Can anyone offer any advice ?
--
========================,,============================================
SUPPORT ___________//___, Philip Webb
ELECTRIC /] [] [] [] [] []| Cities Centre, University of Toronto
TRANSIT `-O----------O---' purslowatchassdotutorontodotca
Michael
2023-05-20 08:00:01 UTC
Permalink
Post by Philip Webb
I'm trying to install Gentoo in my new machine
& have got to the step of compiling a kernel.
I used the config file from my present machine, did 'make oldconfig'
& have then done 'make menuconfig' to include drivers etc.
The 'make' stage goes on for a long time, then crashes doing
'UPD drivers/base/firmware_loader/builtin/rtl_nic/rtl8168g-2.fw.gen.S'
with message "make [5] *** No rule to make target
'lib/firmware/rtl_nic/rtl8168g-2.fw' needed by
'drivers/base/firmware_loader/ builtin/rtl_nic/rtl8168g-2.fw.gen.o' Stop".
The relevant line in Menuconfig is 'DeviceDrivers > NetworkDeviceSupport >
EthernetDriverSupport' under 'Realtek devices'.
I've tried it with 'Realtek8169/8168/...' 'Y' or 'M' or 'N'
& also with 'Realtek devices' as 'N'. I also tried a 'make clean'.
The same error goes on happening.
Since I don't have anything by Realtek for networking
-- sound uses Realtek -- , I can't understand the behaviour above.
Can anyone offer any advice ?
The compilation complains it is missing the firmware required by a realtek
NIC, probably a setting inherited from the config settings of the old kernel?
You eventually compiled it with "N". I suspect the order in which you
configured/compiled it plays a role in this error.

Since you do not have this hardware, set it to "N", then run:

make clean && make && make install modules_install .... <whatever options you
normally use here>.

Meanwhile, check if you have the firmware file it asks for, which would have
been installed as part of 'sys-kernel/linux-firmware':

$ ls -la /lib/firmware/rtl_nic/rtl8168g-2.fw
-rw-r--r-- 1 root root 4896 May 18 16:15 /lib/firmware/rtl_nic/rtl8168g-2.fw

$ qfile /lib/firmware/rtl_nic/rtl8168g-2.fw
sys-kernel/linux-firmware: /lib/firmware/rtl_nic/rtl8168g-2.fw

When you update world after you have compiled your new kernel, linux-firmware
will be installed and the missing file will be available anyway - although no
longer needed or used by the kernel.
Nuno Silva
2023-05-20 10:00:01 UTC
Permalink
Post by Michael
Post by Philip Webb
I'm trying to install Gentoo in my new machine
& have got to the step of compiling a kernel.
I used the config file from my present machine, did 'make oldconfig'
& have then done 'make menuconfig' to include drivers etc.
The 'make' stage goes on for a long time, then crashes doing
'UPD drivers/base/firmware_loader/builtin/rtl_nic/rtl8168g-2.fw.gen.S'
with message "make [5] *** No rule to make target
'lib/firmware/rtl_nic/rtl8168g-2.fw' needed by
'drivers/base/firmware_loader/ builtin/rtl_nic/rtl8168g-2.fw.gen.o' Stop".
The relevant line in Menuconfig is 'DeviceDrivers > NetworkDeviceSupport >
EthernetDriverSupport' under 'Realtek devices'.
I've tried it with 'Realtek8169/8168/...' 'Y' or 'M' or 'N'
& also with 'Realtek devices' as 'N'. I also tried a 'make clean'.
The same error goes on happening.
Since I don't have anything by Realtek for networking
-- sound uses Realtek -- , I can't understand the behaviour above.
Can anyone offer any advice ?
The compilation complains it is missing the firmware required by a realtek
NIC, probably a setting inherited from the config settings of the old kernel?
You eventually compiled it with "N". I suspect the order in which you
configured/compiled it plays a role in this error.
Could this be the manually defined list of firmware blobs to include in
the kernel image, and not something automatically pulled in by a driver?

I'm not sure what's the quickest way to check, perhaps this works?:

grep CONFIG_EXTRA_FIRMWARE /usr/src/linux/.config
--
Nuno Silva
Michael
2023-05-20 11:00:01 UTC
Permalink
Post by Nuno Silva
Post by Michael
Post by Philip Webb
I'm trying to install Gentoo in my new machine
& have got to the step of compiling a kernel.
I used the config file from my present machine, did 'make oldconfig'
& have then done 'make menuconfig' to include drivers etc.
The 'make' stage goes on for a long time, then crashes doing
'UPD drivers/base/firmware_loader/builtin/rtl_nic/rtl8168g-2.fw.gen.S'
with message "make [5] *** No rule to make target
'lib/firmware/rtl_nic/rtl8168g-2.fw' needed by
'drivers/base/firmware_loader/ builtin/rtl_nic/rtl8168g-2.fw.gen.o' Stop".
The relevant line in Menuconfig is 'DeviceDrivers > NetworkDeviceSupport
EthernetDriverSupport' under 'Realtek devices'.
I've tried it with 'Realtek8169/8168/...' 'Y' or 'M' or 'N'
& also with 'Realtek devices' as 'N'. I also tried a 'make clean'.
The same error goes on happening.
Since I don't have anything by Realtek for networking
-- sound uses Realtek -- , I can't understand the behaviour above.
Can anyone offer any advice ?
The compilation complains it is missing the firmware required by a realtek
NIC, probably a setting inherited from the config settings of the old
kernel? You eventually compiled it with "N". I suspect the order in
which you configured/compiled it plays a role in this error.
Could this be the manually defined list of firmware blobs to include in
the kernel image, and not something automatically pulled in by a driver?
grep CONFIG_EXTRA_FIRMWARE /usr/src/linux/.config
This will not resolve the problem of a missing firmware file. It is missing
in the filesystem.
Philip Webb
2023-05-21 08:20:01 UTC
Permalink
Post by Michael
Post by Nuno Silva
Post by Michael
Post by Philip Webb
I'm trying to install Gentoo in my new machine
& have got to the step of compiling a kernel.
I used the config file from my present machine, did 'make oldconfig'
& have then done 'make menuconfig' to include drivers etc.
The 'make' stage goes on for a long time, then crashes doing
'UPD drivers/base/firmware_loader/builtin/rtl_nic/rtl8168g-2.fw.gen.S'
with message "make [5] *** No rule to make target
'lib/firmware/rtl_nic/rtl8168g-2.fw' needed by
'drivers/base/firmware_loader/ builtin/rtl_nic/rtl8168g-2.fw.gen.o' Stop".
The relevant line in Menuconfig is 'DeviceDrivers > NetworkDeviceSupport
EthernetDriverSupport' under 'Realtek devices'.
I've tried it with 'Realtek8169/8168/...' 'Y' or 'M' or 'N'
& also with 'Realtek devices' as 'N'. I also tried a 'make clean'.
The same error goes on happening.
Since I don't have anything by Realtek for networking
-- sound uses Realtek -- , I can't understand the behaviour above.
The compilation complains it is missing the firmware required by a realtek
NIC, probably a setting inherited from the config settings of the old
kernel? You eventually compiled it with "N". I suspect the order in
which you configured/compiled it plays a role in this error.
Could this be the manually defined list of firmware blobs to include in
the kernel image, and not something automatically pulled in by a driver?
grep CONFIG_EXTRA_FIRMWARE /usr/src/linux/.config
This will not resolve the problem of a missing firmware file.
It is missing in the filesystem.
The problem was 'make oldconfig', which used a 5 year-old .config .
For some reason, the resulting .config insisted on installing
the Realtek driver, which wasn't available.

I cut the Gordian knot by moving the other .config's out of the way
& doing a raw 'make menuconfig'. Then the kernel compiled.
If it needs further tweaking, esp for missing drivers, I can do it later.

It's too late to do further steps today,
so we'll see what happens when I try booting from the new kernel.

Thanks for the various pieces of help.
--
========================,,============================================
SUPPORT ___________//___, Philip Webb
ELECTRIC /] [] [] [] [] []| Cities Centre, University of Toronto
TRANSIT `-O----------O---' purslowatchassdotutorontodotca
Loading...