I am trying to build a kernel module out of the kernel source tree. I am trying this on leap 15.6 I am pretty sure that the module in question supports this. I am guessing that I am missing some additional package. The complaint is as follows: *** *** Making pcan driver in netdev mode *** *** Host OS Release=openSUSE Leap v15.6 *** Host machine kernel version=6.4.12-1-default *** Driver kernel version=6.4.12-1-default (6.4.12) *** Path to kernel sources=/usr/src/linux *** use KBUILD=yes *** use DKMS= *** gcc version=7 *** make -C /usr/src/linux EXTRA_CFLAGS="-I/home/rst/source.18.00/peak-linux-driver-8.18.0/driver -DNO_DEBUG -DMODVERSIONS -DNO_PARPORT_SUBSYSTEM -DUSB_SUPPORT -DPCI_SUPPORT -DPCIEC_SUPPORT -DISA_SUPPORT -DNO_DONGLE_SUPPORT -DNO_PCCARD_SUPPORT -DNETDEV_ SUPPORT -DNO_RT -Wno-date-time" V=0 modules M=/home/rst/source.18.00/peak-linux-driver-8.18.0/driver make[3]: Entering directory '/usr/src/linux-6.4.0-150600.23.14' ERROR: Kernel configuration is invalid. include/generated/autoconf.h or include/config/auto.conf are missing. Run 'make oldconfig && make prepare' on kernel src to fix it. Makefile:740: include/config/auto.conf: No such file or directory make[3]: *** [Makefile:805: include/config/auto.conf] Error 1 make[3]: Leaving directory '/usr/src/linux-6.4.0-150600.23.14' I have these related RPMs installed: patterns-devel-base-devel_kernel-20170319-lp156.3.2.x86_64 kernel-default-devel-6.4.0-150600.23.14.2.x86_64 purge-kernels-service-0-150200.8.6.1.noarch kernel-macros-6.4.0-150600.23.14.2.noarch kernel-source-6.4.0-150600.23.14.2.noarch kernel-devel-6.4.0-150600.23.14.2.noarch kernel-syms-6.4.0-150600.23.14.2.x86_64 kernel-install-tools-0.3.0-150400.1.4.x86_64 Do I need anything else? I thought that kernel-devel had all the required header files. But I guess it's looking for how the kernel was configured. Is that info in a package I have missed? The module I am after is a Peak systems CANbus driver. It is supposed to be part of the kernel. I don't recall having to do this with earlier Leap releases. The driver seems not to be enabled anymore. Odd as it is a commonly used CANBus interface. -- Roger Oberholtzer
On Jul 22, 2024, at 9:51 AM, Roger Oberholtzer <roger.oberholtzer@gmail.com> wrote:
I am trying to build a kernel module out of the kernel source tree. I am trying this on leap 15.6
I am pretty sure that the module in question supports this. I am guessing that I am missing some additional package.
The complaint is as follows:
ERROR: Kernel configuration is invalid. include/generated/autoconf.h or include/config/auto.conf are missing.
Have you tried this!
Run 'make oldconfig && make prepare' on kernel src to fix it.
Ken
I am not compiling this with the target kernel being the active kernel. I think that the make oldconfig step uses /proc/config.gz to get the current running kernel's config applies that to the source tree. That is not my setup. IIRC SUSE supplied the config used to build the kernel in an RPM. Maybe I am remembering incorrectly. On Mon, Jul 22, 2024 at 5:06 PM kschneider bout-tyme.net <kschneider@bout-tyme.net> wrote:
On Jul 22, 2024, at 9:51 AM, Roger Oberholtzer <roger.oberholtzer@gmail.com> wrote:
I am trying to build a kernel module out of the kernel source tree. I am trying this on leap 15.6
I am pretty sure that the module in question supports this. I am guessing that I am missing some additional package.
The complaint is as follows:
ERROR: Kernel configuration is invalid. include/generated/autoconf.h or include/config/auto.conf are missing.
Have you tried this!
Run 'make oldconfig && make prepare' on kernel src to fix it.
Ken
-- Roger Oberholtzer
On 22.07.2024 16:50, Roger Oberholtzer wrote:
I am trying to build a kernel module out of the kernel source tree. I am trying this on leap 15.6
I am pretty sure that the module in question supports this. I am guessing that I am missing some additional package.
The complaint is as follows:
*** *** Making pcan driver in netdev mode *** *** Host OS Release=openSUSE Leap v15.6 *** Host machine kernel version=6.4.12-1-default ...
I have these related RPMs installed:
patterns-devel-base-devel_kernel-20170319-lp156.3.2.x86_64 kernel-default-devel-6.4.0-150600.23.14.2.x86_64
Either install kernel-default-devel matching your running kernel or install and reboot into kernel-default matching your kernel-default-devel or tell Makefile the kernel version/build directory location manually (whatever this Makefile accepts). It finally depends on for which kernel you are trying to build this driver.
I can tell it the kernel to compile for. And it does go to the kernel source directory I expect. But it is not happy with what it finds there. I am building on tumbleweed (6.4.12-1-default), with Leap 15.6 (6.4.0-150600.23.14) as the target. This can be seen in what the attempted build prints (below). If it is looking in the installed target source tree (/usr/src/linux-6.4.0-150600.23.14), and I have all the expected kernel-related RPMs for that kernel version installed, why should the kernel build config information be missing? *** *** Making pcan driver in netdev mode *** *** Host OS Release=openSUSE Leap v15.6 *** Host machine kernel version=6.4.12-1-default *** Driver kernel version=6.4.0-150600.23.14 (6.4.0) *** Path to kernel sources=/usr/src/linux *** use KBUILD=yes *** use DKMS= *** gcc version=7 *** make -C /usr/src/linux EXTRA_CFLAGS="-I/home/rst/source.18.00/peak-linux-driver-8.18.0/driver -DNO_DEBUG -DMODVERSIONS -DNO_PARPORT_SUBSYSTEM -DUSB_SUPPORT -DPCI_SUPPORT -DPCIEC_SUPPORT -DISA_SUPPORT -DNO_DONGLE_SUPPORT -DNO_PCCARD_SUPPORT -DNETDEV_ SUPPORT -DNO_RT -Wno-date-time" V=0 modules M=/home/rst/source.18.00/peak-linux-driver-8.18.0/driver make[3]: Entering directory '/usr/src/linux-6.4.0-150600.23.14' ERROR: Kernel configuration is invalid. include/generated/autoconf.h or include/config/auto.conf are missing. Run 'make oldconfig && make prepare' on kernel src to fix it. Makefile:740: include/config/auto.conf: No such file or directory make[3]: *** [Makefile:805: include/config/auto.conf] Error 1 make[3]: Leaving directory '/usr/src/linux-6.4.0-150600.23.14' make[2]: *** [Makefile:526: all] Error 2 make[2]: Leaving directory '/home/rst/source.18.00/peak-linux-driver-8.18.0/driver' make[1]: *** [Makefile:819: netdev] Error 2 make[1]: Leaving directory '/home/rst/source.18.00/peak-linux-driver-8.18.0/driver' make: *** [Makefile:91: netdev] Error 2 On Mon, Jul 22, 2024 at 7:43 PM Andrei Borzenkov <arvidjaar@gmail.com> wrote:
On 22.07.2024 16:50, Roger Oberholtzer wrote:
I am trying to build a kernel module out of the kernel source tree. I am trying this on leap 15.6
I am pretty sure that the module in question supports this. I am guessing that I am missing some additional package.
The complaint is as follows:
*** *** Making pcan driver in netdev mode *** *** Host OS Release=openSUSE Leap v15.6 *** Host machine kernel version=6.4.12-1-default ...
I have these related RPMs installed:
patterns-devel-base-devel_kernel-20170319-lp156.3.2.x86_64 kernel-default-devel-6.4.0-150600.23.14.2.x86_64
Either install kernel-default-devel matching your running kernel or install and reboot into kernel-default matching your kernel-default-devel or tell Makefile the kernel version/build directory location manually (whatever this Makefile accepts).
It finally depends on for which kernel you are trying to build this driver.
-- Roger Oberholtzer
On Tue, Jul 23, 2024 at 10:45 AM Roger Oberholtzer <roger.oberholtzer@gmail.com> wrote:
I can tell it the kernel to compile for. And it does go to the kernel source directory I expect. But it is not happy with what it finds there. I am building on tumbleweed (6.4.12-1-default), with Leap 15.6 (6.4.0-150600.23.14) as the target. This can be seen in what the attempted build prints (below). If it is looking in the installed target source tree (/usr/src/linux-6.4.0-150600.23.14), and I have all the expected kernel-related RPMs for that kernel version installed, why should the kernel build config information be missing?
*** *** Making pcan driver in netdev mode *** *** Host OS Release=openSUSE Leap v15.6 *** Host machine kernel version=6.4.12-1-default *** Driver kernel version=6.4.0-150600.23.14 (6.4.0)
This version is wrong, the correct version should be 6.4.0-150600.23.14-default.
*** Path to kernel sources=/usr/src/linux *** use KBUILD=yes *** use DKMS= *** gcc version=7 *** make -C /usr/src/linux EXTRA_CFLAGS="-I/home/rst/source.18.00/peak-linux-driver-8.18.0/driver -DNO_DEBUG -DMODVERSIONS -DNO_PARPORT_SUBSYSTEM -DUSB_SUPPORT -DPCI_SUPPORT -DPCIEC_SUPPORT -DISA_SUPPORT -DNO_DONGLE_SUPPORT -DNO_PCCARD_SUPPORT -DNETDEV_ SUPPORT -DNO_RT -Wno-date-time" V=0 modules M=/home/rst/source.18.00/peak-linux-driver-8.18.0/driver make[3]: Entering directory '/usr/src/linux-6.4.0-150600.23.14'
ERROR: Kernel configuration is invalid. include/generated/autoconf.h or include/config/auto.conf are missing. Run 'make oldconfig && make prepare' on kernel src to fix it.
Makefile:740: include/config/auto.conf: No such file or directory make[3]: *** [Makefile:805: include/config/auto.conf] Error 1 make[3]: Leaving directory '/usr/src/linux-6.4.0-150600.23.14' make[2]: *** [Makefile:526: all] Error 2 make[2]: Leaving directory '/home/rst/source.18.00/peak-linux-driver-8.18.0/driver' make[1]: *** [Makefile:819: netdev] Error 2 make[1]: Leaving directory '/home/rst/source.18.00/peak-linux-driver-8.18.0/driver' make: *** [Makefile:91: netdev] Error 2
On Mon, Jul 22, 2024 at 7:43 PM Andrei Borzenkov <arvidjaar@gmail.com> wrote:
On 22.07.2024 16:50, Roger Oberholtzer wrote:
I am trying to build a kernel module out of the kernel source tree. I am trying this on leap 15.6
I am pretty sure that the module in question supports this. I am guessing that I am missing some additional package.
The complaint is as follows:
*** *** Making pcan driver in netdev mode *** *** Host OS Release=openSUSE Leap v15.6 *** Host machine kernel version=6.4.12-1-default ...
I have these related RPMs installed:
patterns-devel-base-devel_kernel-20170319-lp156.3.2.x86_64 kernel-default-devel-6.4.0-150600.23.14.2.x86_64
Either install kernel-default-devel matching your running kernel or install and reboot into kernel-default matching your kernel-default-devel or tell Makefile the kernel version/build directory location manually (whatever this Makefile accepts).
It finally depends on for which kernel you are trying to build this driver.
-- Roger Oberholtzer
On Tue, Jul 23, 2024 at 10:07 AM Andrei Borzenkov <arvidjaar@gmail.com> wrote:
*** Driver kernel version=6.4.0-150600.23.14 (6.4.0)
This version is wrong, the correct version should be 6.4.0-150600.23.14-default
Seems not to make a difference: *** *** Making pcan driver in netdev mode *** *** Host OS Release=openSUSE Leap v15.6 *** Host machine kernel version=6.4.12-1-default *** Driver kernel version=6.4.0-150600.23.14-default (6.4.0) *** Path to kernel sources=/usr/src/linux *** use KBUILD=yes *** use DKMS= *** gcc version=7 *** make -C /usr/src/linux EXTRA_CFLAGS="-I/home/rst/source.18.00/peak-linux-driver-8.18.0/driver -DNO_DEBUG -DMODVERSIONS -DNO_PARPORT_SUBSYSTEM -DUSB_SUPPORT -DPCI_SUPPORT -DPCIEC_SUPPORT -DISA_SUPPORT -DNO_DONGLE_SUPPORT -DNO_PCCARD_SUPPORT -DNETDEV_ SUPPORT -DNO_RT -Wno-date-time" V=0 modules M=/home/rst/source.18.00/peak-linux-driver-8.18.0/driver make[3]: Entering directory '/usr/src/linux-6.4.0-150600.23.14' ERROR: Kernel configuration is invalid. include/generated/autoconf.h or include/config/auto.conf are missing. Run 'make oldconfig && make prepare' on kernel src to fix it. Makefile:740: include/config/auto.conf: No such file or directory make[3]: *** [Makefile:805: include/config/auto.conf] Error 1 make[3]: Leaving directory '/usr/src/linux-6.4.0-150600.23.14' make[2]: *** [Makefile:526: all] Error 2 make[2]: Leaving directory '/home/rst/source.18.00/peak-linux-driver-8.18.0/driver' make[1]: *** [Makefile:819: netdev] Error 2 make[1]: Leaving directory '/home/rst/source.18.00/peak-linux-driver-8.18.0/driver' make: *** [Makefile:91: netdev] Error 2 -- Roger Oberholtzer
On Tue, Jul 23, 2024 at 11:14 AM Roger Oberholtzer <roger.oberholtzer@gmail.com> wrote:
On Tue, Jul 23, 2024 at 10:07 AM Andrei Borzenkov <arvidjaar@gmail.com> wrote:
*** Driver kernel version=6.4.0-150600.23.14 (6.4.0)
This version is wrong, the correct version should be 6.4.0-150600.23.14-default
Seems not to make a difference:
*** *** Making pcan driver in netdev mode *** *** Host OS Release=openSUSE Leap v15.6 *** Host machine kernel version=6.4.12-1-default *** Driver kernel version=6.4.0-150600.23.14-default (6.4.0) *** Path to kernel sources=/usr/src/linux
Where does it come from? It is wrong, it must be /lib/modules/6.4.0-150600.23.14-default/build (or equivalent target for this link). Something does not work correctly in auto-detection of the kernel build directory. Check what your Makefile does. As a general rule - you must be using the kernel **build** directory, not kernel **source** directory. You can build multiple kernels with different configurations from the same sources and building external modules needs files from both locations starting from the build.
On Tue, Jul 23, 2024 at 11:21 AM Andrei Borzenkov <arvidjaar@gmail.com> wrote:
On Tue, Jul 23, 2024 at 11:14 AM Roger Oberholtzer <roger.oberholtzer@gmail.com> wrote:
On Tue, Jul 23, 2024 at 10:07 AM Andrei Borzenkov <arvidjaar@gmail.com> wrote:
*** Driver kernel version=6.4.0-150600.23.14 (6.4.0)
This version is wrong, the correct version should be 6.4.0-150600.23.14-default
Seems not to make a difference:
*** *** Making pcan driver in netdev mode *** *** Host OS Release=openSUSE Leap v15.6 *** Host machine kernel version=6.4.12-1-default *** Driver kernel version=6.4.0-150600.23.14-default (6.4.0) *** Path to kernel sources=/usr/src/linux
Where does it come from? It is wrong, it must be
/lib/modules/6.4.0-150600.23.14-default/build
(or equivalent target for this link).
Something does not work correctly in auto-detection of the kernel build directory. Check what your Makefile does.
As a general rule - you must be using the kernel **build** directory, not kernel **source** directory. You can build multiple kernels with different configurations from the same sources and building external modules needs files from both locations starting from the build.
I do not know the amount of magic your Makefile does before starting the actual module build, but for a single external module with the standard Kbuild conformant Makefile it is make -C /lib/modules/6.4.0-150600.23.14-default/build M=$PWD
Hello, In the Message; Subject : Re: Leap 15.6 Building kernel module Message-ID : <CANkOqwM8E8B1wMixq6uPMtE10+mB5UeVs6EK4tHvEZJZSeG77w@mail.gmail.com> Date & Time: Tue, 23 Jul 2024 10:13:48 +0200 [RO] == Roger Oberholtzer <roger.oberholtzer@gmail.com> has written: [...] RO> *** RO> *** Making pcan driver in netdev mode RO> *** RO> *** Host OS Release=openSUSE Leap v15.6 RO> *** Host machine kernel version=6.4.12-1-default RO> *** Driver kernel version=6.4.0-150600.23.14-default (6.4.0) RO> *** Path to kernel sources=/usr/src/linux RO> *** use KBUILD=yes RO> *** use DKMS= RO> *** gcc version=7 RO> *** RO> make -C /usr/src/linux [...] This is may case; $ make -j16 make[1]: Entering directory '/usr/local/tmp/project/peak-linux-driver-8.18.0/driver' *** *** Making pcan driver in chardev mode *** *** Host OS Release=openSUSE Tumbleweed v20240716 *** Host machine kernel version=6.9.9-1-default *** Driver kernel version=6.9.9-1-default (6.9.9) *** Path to kernel sources=/lib/modules/6.9.9-1-default/build *** use KBUILD=yes *** use DKMS= *** gcc version=14 *** make -C /lib/modules/6.9.9-1-default/build EXTRA_CFLAGS="-I/usr/local/tmp/project/peak-linux-driver-8.18.0/driver -DNO_DEBUG -DMODVERSIONS -DNO_PARPORT_SUBSYSTEM -DUSB_SUPPORT -DPCI_SUPPORT -DPCIEC_SUPPORT -DISA_SUPPORT -DNO_DONGLE_SUPPORT -DNO_PCCARD_SUPPORT -DNO_NETDEV_SUPPORT -DNO_RT -Wno-date-time" V=0 modules M=/usr/local/tmp/project/peak-linux-driver-8.18.0/driver make[2]: Entering directory '/usr/src/linux-6.9.9-1-obj/x86_64/default' warning: the compiler differs from the one used to build the kernel [...] As you can see, in my case, I can build with no problem with these; *** Path to kernel sources=/lib/modules/6.9.9-1-default/build and make -C /lib/modules/6.9.9-1-default/build ..... I understand that sources=/usr/src/linux and make -C /usr/src/linux don't build, but I don't understand why this is the case. Best Regards. --- ┏━━┓彡 Masaru Nomiya mail-to: nomiya @ lake.dti.ne.jp ┃\/彡 ┗━━┛ "To hire for skills, firms will need to implement robust and intentional changes in their hiring practices ― and change is hard." -- Employers don’t practice what they preach on skills-based hiring --
On Tue, Jul 23, 2024 at 10:33 AM Masaru Nomiya <nomiya@lake.dti.ne.jp> wrote:
As you can see, in my case, I can build with no problem with these;
*** Path to kernel sources=/lib/modules/6.9.9-1-default/build
I just came across that as well. I was getting frustrated and so I decided to build it in OBS, and I see that is where it points to.
and make -C /lib/modules/6.9.9-1-default/build .....
I understand that sources=/usr/src/linux and make -C /usr/src/linux don't build, but I don't understand why this is the case.
Seems openSUSE/SUSE have moved things into a build subdirectory: ll /lib/modules/6.4.0-150600.23.14-default/ total 8 lrwxrwxrwx 1 root root 52 Jul 7 21:13 build -> /usr/src/linux-6.4.0-150600.23.14-obj/x86_64/default lrwxrwxrwx 1 root root 33 Jul 7 21:13 source -> /usr/src/linux-6.4.0-150600.23.14 So one source tree for all builds targets, and a symlink in /lib/modules for the one of interest.. Makes sense. I guess this is all documented somewhere... -- Roger Oberholtzer
Hello, In the Message; Subject : Re: Leap 15.6 Building kernel module Message-ID : <CANkOqwMuk07wd3CSyEsz2Faeb+5VTu5ifQTp_iUgNQELbsztYQ@mail.gmail.com> Date & Time: Tue, 23 Jul 2024 11:17:51 +0200 [RO] == Roger Oberholtzer <roger.oberholtzer@gmail.com> has written: [...] RO> Seems openSUSE/SUSE have moved things into a build subdirectory: RO> ll /lib/modules/6.4.0-150600.23.14-default/ RO> total 8 RO> lrwxrwxrwx 1 root root 52 Jul 7 21:13 build -> RO> /usr/src/linux-6.4.0-150600.23.14-obj/x86_64/default RO> lrwxrwxrwx 1 root root 33 Jul 7 21:13 source -> RO> /usr/src/linux-6.4.0-150600.23.14 RO> So one source tree for all builds targets, and a symlink in RO> /lib/modules for the one of interest.. Makes sense. I guess this is RO> all documented somewhere... In my tumbleweed; $ ll /lib/modules/6.9.9-1-default/ build -> ../../../src/linux-6.9.9-1-obj/x86_64/default source -> ../../../src/linux-6.9.9-1 Best Regards & Good Night. --- ┏━━┓彡 Masaru Nomiya mail-to: nomiya @ lake.dti.ne.jp ┃\/彡 ┗━━┛ "Companies have come to view generative AI as a kind of monster that must be fed at all costs―even if it isn’t always clear what exactly that data is needed for or what those future AI systems might end up doing." -- Generative AI Is Making Companies Even More Thirsty for Your Data --
participants (4)
-
Andrei Borzenkov
-
kschneider bout-tyme.net
-
Masaru Nomiya
-
Roger Oberholtzer