How can I load a module at runtime?

stdcerr

I just compiled the qcserial module which is a driver module for a Gobi USB modem. Now I have a couple of questions.

  1. Now I have two files: drivers/usb/serial/qcserial.ko and drivers/usb/serial/qcserial.o which one is the correct driver?
  2. Also, as I understand, it will need to go into /lib/modules/3.11.6/kernel/drivers/ but how do I know which sub directories from there onwards?
  3. Should I just be able to copy the files over and then load with modprobe qcserial?

What I have tried so far:

root@ariag25:~# mkdir /lib/modules/3.11.6/kernel/drivers/usb/serial
root@ariag25:~# cp drivers/usb/serial/qcserial.ko /lib/modules/3.11.6/kernel/drivers/usb/serial/
root@ariag25:~# ls -l /lib/modules/3.11.6/kernel/drivers/usb/serial
total 20
-rw-r--r-- 1 root root 17921 Jan  1 18:30 qcserial.ko
root@ariag25:~# modprobe qcserial
FATAL: Module qcserial not found.
root@ariag25:~# 

What am I missing? Do I also need to copy the .o file?

From where I compiled it, I have:

ls -l drivers/usb/serial/qc*
-rw-r--r-- 1 reg reg  3776 Oct 18 18:24 drivers/usb/serial/qcaux.c
-rw-r--r-- 1 reg reg  3212 Dec 28 10:14 drivers/usb/serial/qcaux.o
-rw-r--r-- 1 reg reg 12577 Oct 18 18:24 drivers/usb/serial/qcserial.c
-rw-r--r-- 1 reg reg 17921 Dec 28 10:44 drivers/usb/serial/qcserial.ko
-rw-r--r-- 1 reg reg  7743 Dec 28 10:44 drivers/usb/serial/qcserial.mod.c
-rw-r--r-- 1 reg reg 11688 Dec 28 10:44 drivers/usb/serial/qcserial.mod.o
-rw-r--r-- 1 reg reg  6912 Dec 28 10:44 drivers/usb/serial/qcserial.o

edit for Answer 1

Ok, I copied my linux-3.11.6-arm.tar into the target's /tmp/. I then executed tar -C / -tvf linux-3.11.6-arm.tar to extract it onto / but after this, I still would get

# modprobe qcserial
FATAL: Module qcserial not found.

I then wondered if the driver gat even copied:

# tar -C / -tvf linux-3.11.6-arm.tar | grep qcserial
-rw-r--r-- root/root     17921 2013-12-28 13:22 lib/modules/3.11.6/kernel/drivers/usb/serial/qcserial.ko

so that looks fine, but if I want to ls it, # ls /lib/modules/3.11.6/kernel/drivers/usb/ there's no serial directory within usb/ - why not? What happened?

yegorich

You'll need to create a kernel package (make tar-pkg). Then copy it to your ARM system, for example to /tmp and extract to /. You'll get all driver modules installed into correct folders including proper modules.dep and other files needed to automatically resolve module dependencies.

modprobe qcserial should be working then.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How can I load a module into another module using Elixir language?

From Dev

How to load module not in INC in Perl during runtime?

From Dev

How can I bypass kivy module error: ImportError: DLL load failed: The specified module could not be found?

From Dev

How can I make Tycho load platform specific fragment into the test runtime for any OS?

From Dev

In Java9 how can I reflectively load a class if I don't know it's module?

From Dev

Can I change the attributes of a module at runtime in the active python shell?

From Dev

Can I change the attributes of a module at runtime in the active python shell?

From Dev

How do I load a module to PulseAudio server?

From Dev

How do I permanently load a kernel module?

From Dev

How do I load a module to PulseAudio server?

From Dev

How do I permanently load a kernel module?

From Dev

How can I load a server's specific R installation (environment module) when launching a local installation of emacs?

From Dev

How can I fix tests in Ember testem with errors such as 'could not load', 'failed', 'could not find module' or 'died'?

From Dev

How can I fix tests in Ember testem with errors such as 'could not load', 'failed', 'could not find module' or 'died'?

From Dev

How can I target a module?

From Dev

How can I simplify this module?

From Java

How can I improve this search algorithms runtime?

From Dev

how can I debug a jar at runtime?

From Dev

How can I read the metadata of a type at runtime?

From Dev

How can I serialize functions at runtime in Clojure?

From Dev

How i can request permission at runtime in Android?

From Dev

How can I instantiate an interface at runtime?

From Dev

How can I change a library declaration at runtime?

From Dev

How can I solve "Runtime Error" on OJ

From Dev

How can a runnable jar load external xml file at runtime?

From Dev

How to load Typescript module from a file known at runtime (in angular2+electron)

From Dev

How can I share the url I got at runtime?

From Dev

Load balancing server, how can I implement it?

From Dev

How can I dynamically load a foreign library?

Related Related

  1. 1

    How can I load a module into another module using Elixir language?

  2. 2

    How to load module not in INC in Perl during runtime?

  3. 3

    How can I bypass kivy module error: ImportError: DLL load failed: The specified module could not be found?

  4. 4

    How can I make Tycho load platform specific fragment into the test runtime for any OS?

  5. 5

    In Java9 how can I reflectively load a class if I don't know it's module?

  6. 6

    Can I change the attributes of a module at runtime in the active python shell?

  7. 7

    Can I change the attributes of a module at runtime in the active python shell?

  8. 8

    How do I load a module to PulseAudio server?

  9. 9

    How do I permanently load a kernel module?

  10. 10

    How do I load a module to PulseAudio server?

  11. 11

    How do I permanently load a kernel module?

  12. 12

    How can I load a server's specific R installation (environment module) when launching a local installation of emacs?

  13. 13

    How can I fix tests in Ember testem with errors such as 'could not load', 'failed', 'could not find module' or 'died'?

  14. 14

    How can I fix tests in Ember testem with errors such as 'could not load', 'failed', 'could not find module' or 'died'?

  15. 15

    How can I target a module?

  16. 16

    How can I simplify this module?

  17. 17

    How can I improve this search algorithms runtime?

  18. 18

    how can I debug a jar at runtime?

  19. 19

    How can I read the metadata of a type at runtime?

  20. 20

    How can I serialize functions at runtime in Clojure?

  21. 21

    How i can request permission at runtime in Android?

  22. 22

    How can I instantiate an interface at runtime?

  23. 23

    How can I change a library declaration at runtime?

  24. 24

    How can I solve "Runtime Error" on OJ

  25. 25

    How can a runnable jar load external xml file at runtime?

  26. 26

    How to load Typescript module from a file known at runtime (in angular2+electron)

  27. 27

    How can I share the url I got at runtime?

  28. 28

    Load balancing server, how can I implement it?

  29. 29

    How can I dynamically load a foreign library?

HotTag

Archive