02.05.2020 13:34, Carlos E. R. пишет:
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?
I included full example how to do it.
(4) Compile the module(s) by changing into the module source directory and typing ``make -C $(your_build_dir) M=$(pwd)''.
Fails.
This explains how to compile external module, not module that is part of kernel tree.
(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.
Once again - this is for compiling external module that is not part of kernel tree.
Of course you need to also build ax25 module that is required by mkiss, so
And you know this how?
By building mkiss and observing missing symbols?
Maybe of course you happen to know. How am I supposed to know?
I have never heard about mkiss module until this thread either.
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.
Readme presumes basic understanding of kernel build system. And once again - readme talks about building external module. "External module" is by definition module that is not part of kernel tree.
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.
Make process builds external module in place. It writes into directory where external module (source) is located.
bor@leap15:/usr/src/linux> sed -ie 's/\(obj-\)$(CONFIG_AX25)/\1m/' /tmp/ax25/Makefile
I have no idea what this is doing, sorry.
This is end result of configuring kernel to include AX25 as module. This config variable is undefined because this module is disabled in configuration, so in kernel tree Makefile does nothing. This sed invocation simply replaces variable by its value. If you do not like editing makefile, you could also simply set this variable when calling make, this is indeed more simple.
bor@leap15:/usr/src/linux> make -C /usr/src/linux-obj/x86_64/default M=/tmp/ax25
Which becomes then make -C /usr/src/linux-obj/x86_64/default M=/tmp/ax25 CONFIG_AX25=m
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.
You could also prepare directory containing both modules and compile them in one invocation. This is even described in kbuild documentation. In this particular case it's not worth the troubles unless you are going to repeat it often.