Load unsigned module

Hi,

I’ve compiled a driver for my device and I’m trying to load it via insmod:

insmod ax88179_178a.ko 
insmod: error inserting 'ax88179_178a.ko': -1 Unknown symbol in module

somewhere I’ve read that this might be the case when the kernel does not allow loading unsigned modules. How can I figure out whether this is the case for my kernel and how can I change this behavior?

thanks!

P.S: I’m running opensuse 13.1 with


uname -a
Linux laptop.site 3.11.10-21-desktop #1 SMP PREEMPT Mon Jul 21 15:28:46 UTC 2014 (9a9565d) x86_64 x86_64 x86_64 GNU/Linux

Why did you compile the Driver?
The Driver exists:

modinfo ax88179_178a
filename:       /lib/modules/3.11.10-21-desktop/kernel/drivers/net/usb/ax88179_178a.ko
license:        GPL
description:    ASIX AX88179/178A based USB 3.0/2.0 Gigabit Ethernet Devices
srcversion:     EFC95C503DEFA5D6B2A8853
alias:          usb:v0DF6p0072d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0B95p178Ad*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0B95p1790d*dc*dsc*dp*ic*isc*ip*in*
depends:        usbnet,mii
intree:         Y
vermagic:       3.11.10-21-desktop SMP preempt mod_unload modversions

Because of USB, post:

lsusb

I bought the USB adapter for my ARM-Board and I compiled there the same driver, but it is not working: there ethtool always says that there is no link (physically) so i wanted to test this specific driver on my laptop. The built-in driver is working properly on opensuse, but maybe not the sources I used for the ARM-board.


lsusb
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 004: ID 0b95:1790 ASIX Electronics Corp. 
Bus 001 Device 003: ID 04f2:b221 Chicony Electronics Co., Ltd integrated camera
 

I forgot to say, that I blacklisted the ax88179_178a from the kernel.

Bus 001 Device 004: ID 0b95:1790 ASIX Electronics Corp.

This one is in the Kernel:

alias: usb:v0B95p1790ddcdscdpiciscipin

No need to compile and blacklist anything.

See on the arm-board, if there exists a Driver for that Device?

Sorry, but I don’t understand. How can I test whether its driver-related ( so that there is problem with the driver source provided by the vendor) ?

On the ARM-Board there is no driver for this device. This is why I compiled it.

At my Computer:

make
make -C /lib/modules/3.11.10-21-desktop/build SUBDIRS=/xxx/Downloads/AX88179_178A_LINUX_DRIVER_v1.10.0_SOURCE modules
make[1]: Entering directory `/usr/src/linux-3.11.10-21-obj/x86_64/desktop'
  CC [M]  /xxx/Downloads/AX88179_178A_LINUX_DRIVER_v1.10.0_SOURCE/ax88179_178a.o
  Building modules, stage 2.
  MODPOST 1 modules
  CC      /xxx/Downloads/AX88179_178A_LINUX_DRIVER_v1.10.0_SOURCE/ax88179_178a.mod.o
  LD [M]  /xxx/Downloads/AX88179_178A_LINUX_DRIVER_v1.10.0_SOURCE/ax88179_178a.ko
make[1]: Leaving directory `/usr/src/linux-3.11.10-21-obj/x86_64/desktop'
make install
su -c "cp -v ax88179_178a.ko /lib/modules/3.11.10-21-desktop/kernel/drivers/net/usb && /sbin/depmod -a"
„ax88179_178a.ko“ -> „/lib/modules/3.11.10-21-desktop/kernel/drivers/net/usb/ax88179_178a.ko“

New modinfo:

modinfo ax88179_178a
filename:       /lib/modules/3.11.10-21-desktop/kernel/drivers/net/usb/ax88179_178a.ko
license:        GPL
description:    ASIX AX88179_178A based USB 2.0/3.0 Gigabit Ethernet Devices
author:         David Hollis
srcversion:     ED1D3D33ED9142B3388F964
alias:          usb:v04E8pA100d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0930p0A13d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v17EFp304Bd*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0DF6p0072d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0B95p178Ad*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0B95p1790d*dc*dsc*dp*ic*isc*ip*in*
depends:        usbnet,mii
vermagic:       3.11.10-21-desktop SMP preempt mod_unload modversions 
parm:           msg_enable:usbnet msg_enable (int)
parm:           bsize:RX Bulk IN Queue Size (int)
parm:           ifg:RX Bulk IN Inter Frame Gap (int)

Nothing blacklisted and modprobe -i:

modprobe -i ax88179_178a

Above without any Errors.

lsmod | grep ax
ax88179_178a           23294  0 
usbnet                 43621  1 ax88179_178a
mii                    13934  3 ax88179_178a,usbnet,r8169

kernel and kernel-desktop-devel and kernel-source are in the same Version:

zypper se -si kernel

That weird. Now, when trying to compile it once again i get:


make
make -C /lib/modules/3.11.10-21-desktop/build SUBDIRS=/home/blub/Downloads/AX88179_178A_LINUX_DRIVER_v1.10.0_SOURCE modules
make[1]: Entering directory `/usr/src/linux-3.11.10-21-obj/i386/desktop'
  CC [M]  /home/blub/Downloads/AX88179_178A_LINUX_DRIVER_v1.10.0_SOURCE/ax88179_178a.o
In file included from /usr/src/linux-3.11.10-21/include/linux/elf.h:4:0,
                 from /usr/src/linux-3.11.10-21/include/linux/module.h:14,
                 from /home/blub/Downloads/AX88179_178A_LINUX_DRIVER_v1.10.0_SOURCE/ax88179_178a.c:30:
/usr/src/linux-3.11.10-21/arch/x86/include/asm/elf.h: In function ‘elf_common_init’:
/usr/src/linux-3.11.10-21/arch/x86/include/asm/elf.h:170:6: error: ‘struct pt_regs’ has no member named ‘r8’
  regs->r8 = regs->r9 = regs->r10 = regs->r11 = 0;
      ^
/usr/src/linux-3.11.10-21/arch/x86/include/asm/elf.h:170:17: error: ‘struct pt_regs’ has no member named ‘r9’
  regs->r8 = regs->r9 = regs->r10 = regs->r11 = 0;
                 ^
/usr/src/linux-3.11.10-21/arch/x86/include/asm/elf.h:170:28: error: ‘struct pt_regs’ has no member named ‘r10’
  regs->r8 = regs->r9 = regs->r10 = regs->r11 = 0;
                            ^
/usr/src/linux-3.11.10-21/arch/x86/include/asm/elf.h:170:40: error: ‘struct pt_regs’ has no member named ‘r11’
  regs->r8 = regs->r9 = regs->r10 = regs->r11 = 0;
                                        ^
/usr/src/linux-3.11.10-21/arch/x86/include/asm/elf.h:171:6: error: ‘struct pt_regs’ has no member named ‘r12’
  regs->r12 = regs->r13 = regs->r14 = regs->r15 = 0;
      ^
/usr/src/linux-3.11.10-21/arch/x86/include/asm/elf.h:171:18: error: ‘struct pt_regs’ has no member named ‘r13’
  regs->r12 = regs->r13 = regs->r14 = regs->r15 = 0;
                  ^
/usr/src/linux-3.11.10-21/arch/x86/include/asm/elf.h:171:30: error: ‘struct pt_regs’ has no member named ‘r14’
  regs->r12 = regs->r13 = regs->r14 = regs->r15 = 0;
                              ^
/usr/src/linux-3.11.10-21/arch/x86/include/asm/elf.h:171:42: error: ‘struct pt_regs’ has no member named ‘r15’
  regs->r12 = regs->r13 = regs->r14 = regs->r15 = 0;
                                          ^
In file included from /usr/src/linux-3.11.10-21/include/uapi/linux/unistd.h:7:0,
                 from /usr/src/linux-3.11.10-21/arch/x86/include/asm/seccomp_64.h:4,
                 from /usr/src/linux-3.11.10-21/arch/x86/include/asm/seccomp.h:4,
                 from /usr/src/linux-3.11.10-21/include/linux/seccomp.h:9,
                 from /usr/src/linux-3.11.10-21/include/linux/sched.h:39,
                 from /home/blub/Downloads/AX88179_178A_LINUX_DRIVER_v1.10.0_SOURCE/ax88179_178a.c:32:
/usr/src/linux-3.11.10-21/arch/x86/include/asm/unistd.h: At top level:
/usr/src/linux-3.11.10-21/arch/x86/include/asm/unistd.h:24:33: fatal error: asm/unistd_64_x32.h: Datei oder Verzeichnis nicht gefunden
 #  include <asm/unistd_64_x32.h>
                                 ^
compilation terminated.
make[4]: *** [/home/blub/Downloads/AX88179_178A_LINUX_DRIVER_v1.10.0_SOURCE/ax88179_178a.o] Fehler 1
make[3]: *** [_module_/home/blub/Downloads/AX88179_178A_LINUX_DRIVER_v1.10.0_SOURCE] Fehler 2
make[2]: *** [sub-make] Fehler 2
make[1]: *** [all] Fehler 2
make[1]: Leaving directory `/usr/src/linux-3.11.10-21-obj/i386/desktop'
make: *** [default] Fehler 2



For the insmod Command:

DESCRIPTION
insmod is a trivial program to insert a module into the kernel: if the filename is a hyphen, the
module is taken from standard input. Most users will want to use modprobe(8) instead, which is
more clever and can handle module dependencies.

See man insmod.

I personal use modprobe -i instead of insmod.