0

I configured a debian kernel 5.10.57 to add the HSR/PRP module. I enabled it as built-in <*>. Then i compiled and installed the kernel using make deb-pkg and dpkg -i *.deb respectively.

The new kernel is running.

debian@debian:~$ uname -r
5.10.57

The HSR/PRP module path is in the builtin.modules file :

debian@debian:~$ cat /lib/modules/5.10.57/modules.builtin |grep hsr
kernel/net/hsr/hsr.ko

But the hsr directory (and the .ko file) does not exist.

debian@debian:~$ ls /lib/modules/5.10.57/kernel/net/ |grep hsr
debian@debian:~$

So the module is not loaded.

debian@debian:~$ lsmod |grep hsr
debian@debian:~$

In the /usr/src/linux-5.10.57/ folder, containing the kernel I compiled, the hsr configuration files are all here.


debian@debian:~$ ls /usr/src/linux-5.10.57/net/hsr/
hsr_debugfs.c  hsr_forward.c   hsr_framereg.h  hsr_netlink.c  hsr_slave.h
hsr_device.c   hsr_forward.h   hsr_main.c      hsr_netlink.h  Kconfig
hsr_device.h   hsr_framereg.c  hsr_main.h      hsr_slave.c    Makefile
debian@debian:~$

I tried a few commands to build the .ko file but nothing worked.

debian@debian:/usr/src/linux-5.10.57/net/hsr$ make
make: *** No targets.  Stop.
debian@debian:/usr/src/linux-5.10.57/net/hsr$
debian@debian:/usr/src/linux-5.10.57/net/hsr$ make install
make: *** No rule to make target 'install'.  Stop.
debian@debian:/usr/src/linux-5.10.57/net/hsr$
debian@debian:/usr/src/linux-5.10.57/net/hsr$ make modules
make: *** No rule to make target 'modules'.  Stop.
debian@debian:/usr/src/linux-5.10.57/net/hsr$
debian@debian:/usr/src/linux-5.10.57/net/hsr$ make modules_install
make: *** No rule to make target 'modules_install'.  Stop.

If you want to know what is in the Makefile :

debian@debian:/usr/src/linux-5.10.57/net/hsr$ cat Makefile
# SPDX-License-Identifier: GPL-2.0-only
#
# Makefile for HSR
#

obj-$(CONFIG_HSR)       += hsr.o

hsr-y                   := hsr_main.o hsr_framereg.o hsr_device.o \
                           hsr_netlink.o hsr_slave.o hsr_forward.o
hsr-$(CONFIG_DEBUG_FS) += hsr_debugfs.o
debian@debian:/usr/src/linux-5.10.57/net/hsr$

Here are my questions :

  • Does a builtin module need a .ko file to be in the path required by the /lib/modules/5.10.57/modules.builtin file to be loaded ?

  • If yes, how can I generate or find the hsr.ko file I need ?

0

1 Answer 1

3

Since you configured the driver as built-in, rather than a module (<M> in the kernel configuration), it is part of the kernel binary (bzImage etc.). It will always be “loaded” whenever that particular kernel binary is booted.

You won’t see it as a separate .ko file, nor will you be able to force the .ko file to be built.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .