Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux? |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
08-29-2022, 06:48 AM
|
#1
|
LQ Guru
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,740
|
Loading a custom driver automatically at boot time
I have a hardware driver which I must build by hand from the vendor's Git repository. That part works fine, though I would prefer an official, generic APT package. The module loads manually no problem, but what do I change and where in order to have the module loaded at boot time?
Code:
$ sudo insmod /usr/lib/modules/5.18.0-4-amd64/kernel/drivers/vendor/vendor.ko
$ uname -a
Linux laptop 5.18.0-4-amd64 #1 SMP PREEMPT_DYNAMIC Debian 5.18.16-1 (2022-08-10) x86_64 GNU/Linux
$ lsb_release -rd
Description: Devuan GNU/Linux 5 (daedalus/ceres)
Release: 5
And does it matter that the following don't match up?
Code:
$ uname -r -v
5.18.0-4-amd64 #1 SMP PREEMPT_DYNAMIC Debian 5.18.16-1 (2022-08-10)
PS. Some of the above is blocked by clownflare, specifically the utility which starts with "u".
|
|
|
08-29-2022, 01:00 PM
|
#2
|
Member
Registered: Jan 2022
Location: Hanover, Germany
Distribution: Slackware
Posts: 312
Rep: 
|
If you won't call a spade a spade it will be nearly impossible to help you.
|
|
|
08-29-2022, 01:30 PM
|
#3
|
LQ Guru
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 17,524
|
why not build it into the initrd or specify it's loading in grub? It saves you farting about with insmod.
|
|
|
08-29-2022, 01:33 PM
|
#4
|
LQ Guru
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,740
Original Poster
|
Quote:
Originally Posted by business_kid
... or specify it's loading in grub?
|
Because I find GRUB2 terribly confusing, difficult, risky, and overly complex. I can see the GRUB2 route working if I can figure it out after a lot of experimental reboots. But I'd like to postpone that approach if possible.
I was hoping that there would simply be a file somewhere in /etc/ where I could list the module, perhaps with full path if necessary, and it would be loaded upon boot.
|
|
|
08-30-2022, 04:21 AM
|
#5
|
LQ Guru
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 17,524
|
Then the initrd is the way to go. Just rebuild the initrd, or add your module to /boot-initrd-tree and rebuild it without clearing the tree. Being honest, with uefi I use elilo.
What I found was that on the EFI partition, in the EFI directory, there's a directory for each boot option like this
Code:
tree /boot/efi
/boot/efi
└── EFI
├── Boot
│** └── bootx64.efi
├── Microsoft
[SNIP VAST REAMS OF PURE M$ WASTE OF SPACE]
└── Slackware
├── elilo.conf
├── elilo.efi
├── initrd-5.15.27.gz
└── vmlinuz-generic-5.15.27
The efi is the executable, the kernel & initrd are there, & elilo.conf. There'll be something similar for all the other boot options
EDIT: You don't appear to have boot options in elilo.
Last edited by business_kid; 08-30-2022 at 04:28 AM.
|
|
|
08-30-2022, 04:47 AM
|
#6
|
Member
Registered: Aug 2008
Location: Yorkshire
Distribution: openSUSE(Leap and Tumbleweed) and a (not so) regularly changing third and fourth
Posts: 629
Rep: 
|
Put the module in /etc/modules-load.d.
|
|
|
08-30-2022, 07:26 AM
|
#7
|
LQ Guru
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,740
Original Poster
|
Quote:
Originally Posted by petelq
Put the module in /etc/modules-load.d.
|
Thanks. I tried putting the name in a .conf file there, both just the module.ko and the full path. Neither caused the module to load on boot. So I am missing something in the process.
I'll look at GRUB2 next when I can plan some reboots.
|
|
|
08-30-2022, 08:10 AM
|
#8
|
LQ Guru
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 8,253
|
There used to be a modprobe file or a modprobe.d directory to put that kind of thing in. But I'm pretty sure it didn't use the .ko suffix in module names.
Last edited by hazel; 08-30-2022 at 08:15 AM.
|
|
|
08-30-2022, 10:23 AM
|
#9
|
LQ Guru
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 17,524
|
Yeah, etc/modprobe.d/ is it, but / isn't even mounted ro yet.
The initrd is the place - if he has one.
|
|
|
All times are GMT -5. The time now is 03:24 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|