Edit: I turned Cristians answer into a script which does everything automatically: https://github.com/frans-fuerst/magic/blob/master/fedora-activate-can.sh
I need some kernel modules which are available in the Linux source but deactivated on Fedora 20 and I wonder what's the easiest and most forward way to do make them available. (namely then net/CAN suport resulting in some can_* modules)
- are there fedora-repos/rpms which make deactivated modules available?
- or do I have to compile these modules manually?
- in this case - is there some mechanism to automate this in case of a kernel update or do i have to compile them over and over again?
I've already followed this HowTo (and there are many more very similar out there) but the "build a module only" section seems to work only for modules which haven't been disabled because in that case even the module sources are missing.
Here is what I tried following the mentioned HowTo:
First I tried to follow the Out Of Tree Modules section but in that damn source tree shipped with kernel-devel
even the sources for CAN support are missing.
So I try to build the modules from the src.rpm:
$ yumdownloader --source kernel
$ sudo yum-builddep kernel-3.14.8-200.fc20.src.rpm
$ rpm -Uvh kernel-3.14.8-200.fc20.src.rpm
$ cd ~/rpmbuild/SPECS
$ rpmbuild -bp --target=$(uname -m) kernel.special
$ cd ~/rpmbuild/BUILD/<kerneldir>/<linuxdir>
$ <configure the kernel using menuconfig>
$ make prepare
Then I build and get some warnings:
$ make -C /lib/modules/`uname -r`/build M=`pwd`/net/can modules
make: Entering directory `<rpmbuild-BUILD-kernel-linux-dir>'
WARNING: Symbol version dump <rpmbuild-BUILD-kernel-linux-dir>/Module.symvers
is missing; modules will have no dependencies and modversions.
CC [M] <rpmbuild-BUILD-kernel-linux-dir>/net/can/bcm.o
CC [M] <rpmbuild-BUILD-kernel-linux-dir>/net/can/gw.o
CC [M] <rpmbuild-BUILD-kernel-linux-dir>/net/can/raw.o
CC [M] <rpmbuild-BUILD-kernel-linux-dir>/net/can/af_can.o
CC [M] <rpmbuild-BUILD-kernel-linux-dir>/net/can/proc.o
LD [M] <rpmbuild-BUILD-kernel-linux-dir>/net/can/can.o
LD [M] <rpmbuild-BUILD-kernel-linux-dir>/net/can/can-raw.o
LD [M] <rpmbuild-BUILD-kernel-linux-dir>/net/can/can-bcm.o
LD [M] <rpmbuild-BUILD-kernel-linux-dir>/net/can/can-gw.o
Building modules, stage 2.
MODPOST 4 modules
CC <rpmbuild-BUILD-kernel-linux-dir>/net/can/can-bcm.mod.o
LD [M] <rpmbuild-BUILD-kernel-linux-dir>/net/can/can-bcm.ko
CC <rpmbuild-BUILD-kernel-linux-dir>/net/can/can-gw.mod.o
LD [M] <rpmbuild-BUILD-kernel-linux-dir>/net/can/can-gw.ko
CC <rpmbuild-BUILD-kernel-linux-dir>/net/can/can-raw.mod.o
LD [M] <rpmbuild-BUILD-kernel-linux-dir>/net/can/can-raw.ko
CC <rpmbuild-BUILD-kernel-linux-dir>/net/can/can.mod.o
LD [M] <rpmbuild-BUILD-kernel-linux-dir>/net/can/can.ko
make: Leaving directory `<rpmbuild-BUILD-kernel-linux-dir>'
$ sudo make -C /lib/modules/`uname -r`/build M=`pwd`/net/can modules_install
make: Entering directory `<rpmbuild-BUILD-kernel-linux-dir>'
INSTALL <rpmbuild-BUILD-kernel-linux-dir>/net/can/can-bcm.ko
Can't read private key
INSTALL <rpmbuild-BUILD-kernel-linux-dir>/net/can/can-gw.ko
Can't read private key
INSTALL <rpmbuild-BUILD-kernel-linux-dir>/net/can/can-raw.ko
Can't read private key
INSTALL <rpmbuild-BUILD-kernel-linux-dir>/net/can/can.ko
Can't read private key
DEPMOD 3.14.8
make: Leaving directory `<rpmbuild-BUILD-kernel-linux-dir>'
I don't get the first warning when I just run make modules
but this costs me about an hour.
However after installing, the .ko
files are located in the wrong directory
(/usr/lib/modules/3.14.8
rather than /usr/lib/modules/3.14.8-200.fc20.x86_64
) and after depmod -a
and modprobe can
I get
modprobe: ERROR: could not insert 'can': Exec format error
What am I doing wrong?