On 02/05/2020 11.02, Andrei Borzenkov wrote:
01.05.2020 23:11, Carlos E. R. пишет:
Content-ID: <alpine.LSU.2.21.2005012150360.16357@Telcontar.valinor>
On Friday, 2020-05-01 at 22:33 +0300, Andrei Borzenkov wrote:
Отправлено с iPhone
1 мая 2020 г., в 21:18, Carlos E. R. <robin.listas@telefonica.net> написал(а):
No, I did not look. I know that the source file is present:
/usr/src/linux-4.12.14-lp151.28.44/drivers/net/hamradio/mkiss.c
So I assumed the entry would be in the config file. I can confirm that it is not present here :-((
You need to enable HAMRADIO before you can enable individual drivers.
Ah, of course, makes sense.
..
Still, does not build:
Telcontar:/usr/src/linux # grep -i mkiss .config CONFIG_MKISS=m Telcontar:/usr/src/linux #
You must not compile anything inside /usr/src/linux. README.SUSE makes it pretty clear.
I explained why I don't: ]> Notes: ]> ]> a) Purists will say that it is wrong to do this as root. Well, it happens that none of the above runs as user, because of the ownership of the files. Doing as user is more complicated, so I will not. Can you explain how to do it? How to do it as user in another directory? I don't understand what the readme says - and I have been reading the file for years and never noticed that it was supposed to explain how to do it as user in another directory, till today you said it is there: (2) Create a build directory for use in configuring and building the kernel. Using /usr/src/linux directly requires root priviledges and will cause problems if you need to build kernel modules for other installed kernels. (3) Configure the kernel (for example, ``make -C /usr/src/linux O=$(pwd) oldconfig'', see HOW TO CONFIGURE THE KERNEL SOURCES).
Telcontar:/usr/src/linux # make M=drivers/net/hamradio Building modules, stage 2. MODPOST 0 modules Telcontar:/usr/src/linux # l drivers/net/hamradio/mkiss* -rw-r--r-- 1 root root 24307 Apr 17 07:38 drivers/net/hamradio/mkiss.c Telcontar:/usr/src/linux #
Your /usr/src/linux state is already broken, so I have no idea what happens here. You seem to execute random commands without any understanding what they are supposed to do.
You are making wrong assumptions. All I have done in there has been posted in this thread. The kernel tree was installed clean.
As I said, I know how to build the entire kernel, but not a single module as Masaru Nomiya does on his script:
This script is for vanilla upstream kernel, not for SUSE distributed kernel sources. How is this script relevant (unless you actually understand what script does and can adapt it to your specific case)?
Then how about you kindly explain how to do it instead of remonstrating to me? I know he is using the vanilla kernel, and I told him that this was not correct. I'm using the openSUSE sources instead, and trying to use only part of what he does, but does not work. And no, of course I do not understand what he is doing, I said so. I have never tried to build a single module, this is is a first for me and trying to learn how to do it.
... make mrproper (I don't)
cp /lib/modules/`uname -r`/build/.config ./ (I use /proc/config)
cp /usr/lib/modules/`uname -r`/build/Module.symvers ./ (it is not there)
So much about executing some random script you found somewhere on Internet.
Not on internet. Not random. You have not been reading this thread. It was posted *HERE* on this thread by Masaru Nomiya, yesterday: Date: Fri, 01 May 2020 21:45:31 +0900 Message-ID: <87mu6rx1qs.wl-nomiya@galaxy.dti.ne.jp> From: Masaru Nomiya <nomiya@...> To: opensuse@opensuse.org Subject: Re: [opensuse] mkiss kernel module missing In-Reply-To: <40cbad1a-6c9e-dba5-541d-3ed1bacde0bb@gmx.es> I assumed he knew.
make oldconfig
make prepare && make scripts
make M=drivers/net/hamradio
xz -z drivers/net/hamradio/mkiss.ko
...
I will check "/usr/src/linux/README.SUSE".
The first method involves the following steps:
(1) Install the kernel-source package.
(2) Configure the kernel, see HOW TO CONFIGURE THE KERNEL SOURCES.
(3) Create files required for compiling external modules: ``make prepare'' and ``make scripts''.
(4) Compile the module(s) by changing into the module source directory and typing ``make -C $(your_build_dir) M=$(pwd)''.
(5) Install the module(s) by typing ``make -C $(your_build_dir) M=$(pwd) modules_install''.
Still no go...
Telcontar:/usr/src/linux # cd drivers/net/hamradio/ Telcontar:/usr/src/linux/drivers/net/hamradio # make make: *** No targets. Stop. Telcontar:/usr/src/linux/drivers/net/hamradio # make -C . make: Entering directory '/usr/src/linux-4.12.14-lp151.28.48/drivers/net/hamradio' make: *** No targets. Stop. make: Leaving directory '/usr/src/linux-4.12.14-lp151.28.48/drivers/net/hamradio' Telcontar:/usr/src/linux/drivers/net/hamradio #
Telcontar:/usr/src/linux/drivers/net/hamradio # make M=$(pwd) make: *** No targets. Stop. Telcontar:/usr/src/linux/drivers/net/hamradio # make -C . M=$(pwd) make: Entering directory '/usr/src/linux-4.12.14-lp151.28.48/drivers/net/hamradio' make: *** No targets. Stop. make: Leaving directory '/usr/src/linux-4.12.14-lp151.28.48/drivers/net/hamradio' Telcontar:/usr/src/linux/drivers/net/hamradio #
I do not know where even to start commenting this.
Anyway - you cannot compile additional module that is part of kernel source tree and that is disabled in SUSE kernel config as part of SUSE kernel. You must either
But I enabled it. cer@Telcontar:/usr/src/linux> grep -i mkiss .config CONFIG_MKISS=m
a) force this module to be built as external module. That is BUILDING ADDITIONAL EXTERNAL MODULES in README.SUSE and most simple is (2).
"BUILDING ADDITIONAL (EXTERNAL) MODULES" (1) by configuring the kernel sources in a separate build directory (see HOW TO CONFIGURE THE KERNEL SOURCES), or (2) by using one of the standard configurations in /usr/src/linux-obj/$ARCH/$FLAVOR, or cer@Telcontar:~> ls /usr/src/linux-obj/x86_64/default Makefile Module.supported Module.symvers arch include scripts tools cer@Telcontar:~> Clear as mud, sorry. The first method involves the following steps: (1) Install the kernel-source package. Done. (2) Configure the kernel, see HOW TO CONFIGURE THE KERNEL SOURCES. Done. (3) Create files required for compiling external modules: ``make prepare'' and ``make scripts''. Done (4) Compile the module(s) by changing into the module source directory and typing ``make -C $(your_build_dir) M=$(pwd)''. Fails. (5) Install the module(s) by typing ``make -C $(your_build_dir) M=$(pwd) modules_install''. Let's see the other method in the readme, which you say you use. The second method involves the following steps: (1) Install the kernel-devel package. Happens to be installed: cer@Telcontar:~> rpm -q kernel-devel kernel-devel-4.12.14-lp151.28.44.1.noarch kernel-devel-4.12.14-lp151.28.48.1.noarch cer@Telcontar:~> (2) Install the kernel-$FLAVOR-devel package. This is necessary for symbol version information (CONFIG_MODVERSIONS). Happens to be installed: cer@Telcontar:~> rpm -q kernel-default-devel kernel-default-devel-4.12.14-lp151.28.44.1.x86_64 kernel-default-devel-4.12.14-lp151.28.48.1.x86_64 cer@Telcontar:~> (3) Compile the module(s) by changing into the module source directory and typing ``make -C /usr/src/linux-obj/$ARCH/$FLAVOR M=$(pwd)''. Substitute $ARCH and $FLAVOR with the architecture and flavor for which to build the module(s). Seems to me that it is doing the operation directly on the /usr/src/linux directory as root. It doesn't explain how to do it in another directory. Anyway, it is using linux-obj as you, so one part explained. If the installed kernel sources match the running kernel, you can build modules for the running kernel by using the path /lib/modules/$(uname -r)/build as the -C option in the above command. (build is a symlink to /usr/src/linux-obj/$ARCH/$FLAVOR). They do. cer@Telcontar:~> l /lib/modules/$(uname -r)/build lrwxrwxrwx 1 root root 53 Apr 17 18:00 /lib/modules/4.12.14-lp151.28.48-default/build -> /usr/src/linux-4.12.14-lp151.28.48-obj/x86_64/default/ cer@Telcontar:~> (4) Install the module(s) with ``make -C /usr/src/linux-obj/$ARCH/$FLAVOR M=$(pwd) modules_install''.
Of course you need to also build ax25 module that is required by mkiss, so
And you know this how? Maybe of course you happen to know. How am I supposed to know? Anyway: cer@Telcontar:/usr/src/linux> grep -i ax25 .config CONFIG_AX25=y CONFIG_AX25_DAMA_SLAVE=y cer@Telcontar:/usr/src/linux>
bor@leap15:/usr/src/linux> cp -a net/ax25 /tmp
Ah, you copy a part of the source directory to a temporary directory outside. Well, the readme fails to explain this. I don't see why the original sources can not be used and we need a copy, the make process is not supposed to write to the source files.
bor@leap15:/usr/src/linux> sed -ie 's/\(obj-\)$(CONFIG_AX25)/\1m/' /tmp/ax25/Makefile
I have no idea what this is doing, sorry.
bor@leap15:/usr/src/linux> make -C /usr/src/linux-obj/x86_64/default M=/tmp/ax25
Mmm.
make: Entering directory '/usr/src/linux-4.12.14-lp151.28.48-obj/x86_64/default' LD /tmp/ax25/built-in.o CC [M] /tmp/ax25/ax25_addr.o CC [M] /tmp/ax25/ax25_dev.o CC [M] /tmp/ax25/ax25_iface.o CC [M] /tmp/ax25/ax25_in.o CC [M] /tmp/ax25/ax25_ip.o CC [M] /tmp/ax25/ax25_out.o CC [M] /tmp/ax25/ax25_route.o CC [M] /tmp/ax25/ax25_std_in.o CC [M] /tmp/ax25/ax25_std_subr.o CC [M] /tmp/ax25/ax25_std_timer.o CC [M] /tmp/ax25/ax25_subr.o CC [M] /tmp/ax25/ax25_timer.o CC [M] /tmp/ax25/ax25_uid.o CC [M] /tmp/ax25/af_ax25.o CC [M] /tmp/ax25/sysctl_net_ax25.o LD [M] /tmp/ax25/ax25.o Building modules, stage 2. MODPOST 1 modules CC /tmp/ax25/ax25.mod.o LD [M] /tmp/ax25/ax25.ko make: Leaving directory '/usr/src/linux-4.12.14-lp151.28.48-obj/x86_64/default' bor@leap15:/usr/src/linux> cp -a drivers/net/hamradio/ /tmp
And now you copy another directory.
bor@leap15:/usr/src/linux> sed -ie 's/\(obj-\)$(CONFIG_MKISS)/\1m/' /tmp/hamradio/Makefile
I don't understand what that does, sorry.
bor@leap15:/usr/src/linux> make -C /usr/src/linux-obj/x86_64/default M=/tmp/hamradio KBUILD_EXTRA_SYMBOLS=/tmp/ax25/Module.symvers make: Entering directory '/usr/src/linux-4.12.14-lp151.28.48-obj/x86_64/default' LD /tmp/hamradio/built-in.o CC [M] /tmp/hamradio/mkiss.o Building modules, stage 2. MODPOST 1 modules CC /tmp/hamradio/mkiss.mod.o LD [M] /tmp/hamradio/mkiss.ko make: Leaving directory '/usr/src/linux-4.12.14-lp151.28.48-obj/x86_64/default' bor@leap15:/usr/src/linux> find /tmp/ax25 /tmp/hamradio -name \*.ko /tmp/ax25/ax25.ko /tmp/hamradio/mkiss.ko
Ok
bor@leap15:/usr/src/linux> sudo insmod /tmp/ax25/ax25.ko bor@leap15:/usr/src/linux> sudo insmod /tmp/hamradio/mkiss.ko bor@leap15:/usr/src/linux> dmesg | tail [12667.358420] NET: Registered protocol family 3 [12675.514306] mkiss: AX.25 Multikiss, Hans Albas PE1AYX bor@leap15:/usr/src/linux>
Ok.
b) compile your own kernel with the same configuration as SUSE kernel with addition of your module.
That is what I was going to do till Masaru Nomiya posted another method that seemed simpler.
That is variant COMPILING YOUR OWN KERNEL in README.SUSE.
-- Cheers / Saludos, Carlos E. R. (from 15.1 x86_64 at Telcontar)