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.
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.
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)?
... 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.
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 a) force this module to be built as external module. That is BUILDING ADDITIONAL EXTERNAL MODULES in README.SUSE and most simple is (2). Of course you need to also build ax25 module that is required by mkiss, so bor@leap15:/usr/src/linux> cp -a net/ax25 /tmp bor@leap15:/usr/src/linux> sed -ie 's/\(obj-\)$(CONFIG_AX25)/\1m/' /tmp/ax25/Makefile bor@leap15:/usr/src/linux> make -C /usr/src/linux-obj/x86_64/default M=/tmp/ax25 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 bor@leap15:/usr/src/linux> sed -ie 's/\(obj-\)$(CONFIG_MKISS)/\1m/' /tmp/hamradio/Makefile 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 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> b) compile your own kernel with the same configuration as SUSE kernel with addition of your module. That is variant COMPILING YOUR OWN KERNEL in README.SUSE.