load module via /etc/modules
up vote
5
down vote
favorite
I want to load my kernel module hello.ko
on boot in Ubuntu 12.04. I placed it in /lib/modules/3.8.0-31-generic/kernel/ubuntu/hello.ko
, ran depmod -a
, and added "hello" to /etc/modules
.
However, when I restart, there is no "hello" module in lsmod
. In /var/log/upstart/module-init-tools.log
there is a string "FATAL: Module hello not found."
If I run modprobe hello
everything is fine. What's wrong with /etc/modules
? Where is it trying to find modules?
linux kernel-modules
add a comment |
up vote
5
down vote
favorite
I want to load my kernel module hello.ko
on boot in Ubuntu 12.04. I placed it in /lib/modules/3.8.0-31-generic/kernel/ubuntu/hello.ko
, ran depmod -a
, and added "hello" to /etc/modules
.
However, when I restart, there is no "hello" module in lsmod
. In /var/log/upstart/module-init-tools.log
there is a string "FATAL: Module hello not found."
If I run modprobe hello
everything is fine. What's wrong with /etc/modules
? Where is it trying to find modules?
linux kernel-modules
add a comment |
up vote
5
down vote
favorite
up vote
5
down vote
favorite
I want to load my kernel module hello.ko
on boot in Ubuntu 12.04. I placed it in /lib/modules/3.8.0-31-generic/kernel/ubuntu/hello.ko
, ran depmod -a
, and added "hello" to /etc/modules
.
However, when I restart, there is no "hello" module in lsmod
. In /var/log/upstart/module-init-tools.log
there is a string "FATAL: Module hello not found."
If I run modprobe hello
everything is fine. What's wrong with /etc/modules
? Where is it trying to find modules?
linux kernel-modules
I want to load my kernel module hello.ko
on boot in Ubuntu 12.04. I placed it in /lib/modules/3.8.0-31-generic/kernel/ubuntu/hello.ko
, ran depmod -a
, and added "hello" to /etc/modules
.
However, when I restart, there is no "hello" module in lsmod
. In /var/log/upstart/module-init-tools.log
there is a string "FATAL: Module hello not found."
If I run modprobe hello
everything is fine. What's wrong with /etc/modules
? Where is it trying to find modules?
linux kernel-modules
linux kernel-modules
edited Aug 8 '14 at 18:13
drs
3,29352858
3,29352858
asked Aug 8 '14 at 18:00
Andrey Romanchev
2612
2612
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
Run sudo update-initramfs -u
to get your module in the initial ramdisk for the current kernel. Otherwise it will not load on init.
2
This is not necessary. Modules listed in/etc/modules
are loaded on init (from thekmod
job, which runs once udev is up).
– Gilles
Aug 9 '14 at 20:07
@Gilles It is necessary. If the module does not exist in the initrd, then init can obviously not load it when it has not yet mounted any filesystems.
– Lekensteyn
Aug 10 '14 at 11:51
2
You're confusing the/init
script in the initramfs and the init system which is Upstart. The initramfs doesn't even contain/etc/modules
, that's part of the root filesystem. There's an Upstart job (kmod
) that loads modules listed in/etc/modules
. This happens after the root filesystem is mounted, it has nothing to do with the initramfs.
– Gilles
Aug 10 '14 at 19:53
Can you doublecheck if the running kernel is the correct version with the path you placed the module withuname -r
. Please also check the output ofmodinfo /lib/modules/3.8.0-31-generic/kernel/ubuntu/hello.ko
.
– Thomas
Jun 26 '16 at 14:48
@Gilles You were right, kmod loads the module after the rootfs is mounted. Since/etc/modprobe.d/
did end up in the initramfs I supposed that it would also be the case for/etc/modules
which is apparently not true.
– Lekensteyn
Jun 27 '16 at 9:49
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
Run sudo update-initramfs -u
to get your module in the initial ramdisk for the current kernel. Otherwise it will not load on init.
2
This is not necessary. Modules listed in/etc/modules
are loaded on init (from thekmod
job, which runs once udev is up).
– Gilles
Aug 9 '14 at 20:07
@Gilles It is necessary. If the module does not exist in the initrd, then init can obviously not load it when it has not yet mounted any filesystems.
– Lekensteyn
Aug 10 '14 at 11:51
2
You're confusing the/init
script in the initramfs and the init system which is Upstart. The initramfs doesn't even contain/etc/modules
, that's part of the root filesystem. There's an Upstart job (kmod
) that loads modules listed in/etc/modules
. This happens after the root filesystem is mounted, it has nothing to do with the initramfs.
– Gilles
Aug 10 '14 at 19:53
Can you doublecheck if the running kernel is the correct version with the path you placed the module withuname -r
. Please also check the output ofmodinfo /lib/modules/3.8.0-31-generic/kernel/ubuntu/hello.ko
.
– Thomas
Jun 26 '16 at 14:48
@Gilles You were right, kmod loads the module after the rootfs is mounted. Since/etc/modprobe.d/
did end up in the initramfs I supposed that it would also be the case for/etc/modules
which is apparently not true.
– Lekensteyn
Jun 27 '16 at 9:49
add a comment |
up vote
0
down vote
Run sudo update-initramfs -u
to get your module in the initial ramdisk for the current kernel. Otherwise it will not load on init.
2
This is not necessary. Modules listed in/etc/modules
are loaded on init (from thekmod
job, which runs once udev is up).
– Gilles
Aug 9 '14 at 20:07
@Gilles It is necessary. If the module does not exist in the initrd, then init can obviously not load it when it has not yet mounted any filesystems.
– Lekensteyn
Aug 10 '14 at 11:51
2
You're confusing the/init
script in the initramfs and the init system which is Upstart. The initramfs doesn't even contain/etc/modules
, that's part of the root filesystem. There's an Upstart job (kmod
) that loads modules listed in/etc/modules
. This happens after the root filesystem is mounted, it has nothing to do with the initramfs.
– Gilles
Aug 10 '14 at 19:53
Can you doublecheck if the running kernel is the correct version with the path you placed the module withuname -r
. Please also check the output ofmodinfo /lib/modules/3.8.0-31-generic/kernel/ubuntu/hello.ko
.
– Thomas
Jun 26 '16 at 14:48
@Gilles You were right, kmod loads the module after the rootfs is mounted. Since/etc/modprobe.d/
did end up in the initramfs I supposed that it would also be the case for/etc/modules
which is apparently not true.
– Lekensteyn
Jun 27 '16 at 9:49
add a comment |
up vote
0
down vote
up vote
0
down vote
Run sudo update-initramfs -u
to get your module in the initial ramdisk for the current kernel. Otherwise it will not load on init.
Run sudo update-initramfs -u
to get your module in the initial ramdisk for the current kernel. Otherwise it will not load on init.
answered Aug 8 '14 at 18:17
Lekensteyn
9,710115086
9,710115086
2
This is not necessary. Modules listed in/etc/modules
are loaded on init (from thekmod
job, which runs once udev is up).
– Gilles
Aug 9 '14 at 20:07
@Gilles It is necessary. If the module does not exist in the initrd, then init can obviously not load it when it has not yet mounted any filesystems.
– Lekensteyn
Aug 10 '14 at 11:51
2
You're confusing the/init
script in the initramfs and the init system which is Upstart. The initramfs doesn't even contain/etc/modules
, that's part of the root filesystem. There's an Upstart job (kmod
) that loads modules listed in/etc/modules
. This happens after the root filesystem is mounted, it has nothing to do with the initramfs.
– Gilles
Aug 10 '14 at 19:53
Can you doublecheck if the running kernel is the correct version with the path you placed the module withuname -r
. Please also check the output ofmodinfo /lib/modules/3.8.0-31-generic/kernel/ubuntu/hello.ko
.
– Thomas
Jun 26 '16 at 14:48
@Gilles You were right, kmod loads the module after the rootfs is mounted. Since/etc/modprobe.d/
did end up in the initramfs I supposed that it would also be the case for/etc/modules
which is apparently not true.
– Lekensteyn
Jun 27 '16 at 9:49
add a comment |
2
This is not necessary. Modules listed in/etc/modules
are loaded on init (from thekmod
job, which runs once udev is up).
– Gilles
Aug 9 '14 at 20:07
@Gilles It is necessary. If the module does not exist in the initrd, then init can obviously not load it when it has not yet mounted any filesystems.
– Lekensteyn
Aug 10 '14 at 11:51
2
You're confusing the/init
script in the initramfs and the init system which is Upstart. The initramfs doesn't even contain/etc/modules
, that's part of the root filesystem. There's an Upstart job (kmod
) that loads modules listed in/etc/modules
. This happens after the root filesystem is mounted, it has nothing to do with the initramfs.
– Gilles
Aug 10 '14 at 19:53
Can you doublecheck if the running kernel is the correct version with the path you placed the module withuname -r
. Please also check the output ofmodinfo /lib/modules/3.8.0-31-generic/kernel/ubuntu/hello.ko
.
– Thomas
Jun 26 '16 at 14:48
@Gilles You were right, kmod loads the module after the rootfs is mounted. Since/etc/modprobe.d/
did end up in the initramfs I supposed that it would also be the case for/etc/modules
which is apparently not true.
– Lekensteyn
Jun 27 '16 at 9:49
2
2
This is not necessary. Modules listed in
/etc/modules
are loaded on init (from the kmod
job, which runs once udev is up).– Gilles
Aug 9 '14 at 20:07
This is not necessary. Modules listed in
/etc/modules
are loaded on init (from the kmod
job, which runs once udev is up).– Gilles
Aug 9 '14 at 20:07
@Gilles It is necessary. If the module does not exist in the initrd, then init can obviously not load it when it has not yet mounted any filesystems.
– Lekensteyn
Aug 10 '14 at 11:51
@Gilles It is necessary. If the module does not exist in the initrd, then init can obviously not load it when it has not yet mounted any filesystems.
– Lekensteyn
Aug 10 '14 at 11:51
2
2
You're confusing the
/init
script in the initramfs and the init system which is Upstart. The initramfs doesn't even contain /etc/modules
, that's part of the root filesystem. There's an Upstart job (kmod
) that loads modules listed in /etc/modules
. This happens after the root filesystem is mounted, it has nothing to do with the initramfs.– Gilles
Aug 10 '14 at 19:53
You're confusing the
/init
script in the initramfs and the init system which is Upstart. The initramfs doesn't even contain /etc/modules
, that's part of the root filesystem. There's an Upstart job (kmod
) that loads modules listed in /etc/modules
. This happens after the root filesystem is mounted, it has nothing to do with the initramfs.– Gilles
Aug 10 '14 at 19:53
Can you doublecheck if the running kernel is the correct version with the path you placed the module with
uname -r
. Please also check the output of modinfo /lib/modules/3.8.0-31-generic/kernel/ubuntu/hello.ko
.– Thomas
Jun 26 '16 at 14:48
Can you doublecheck if the running kernel is the correct version with the path you placed the module with
uname -r
. Please also check the output of modinfo /lib/modules/3.8.0-31-generic/kernel/ubuntu/hello.ko
.– Thomas
Jun 26 '16 at 14:48
@Gilles You were right, kmod loads the module after the rootfs is mounted. Since
/etc/modprobe.d/
did end up in the initramfs I supposed that it would also be the case for /etc/modules
which is apparently not true.– Lekensteyn
Jun 27 '16 at 9:49
@Gilles You were right, kmod loads the module after the rootfs is mounted. Since
/etc/modprobe.d/
did end up in the initramfs I supposed that it would also be the case for /etc/modules
which is apparently not true.– Lekensteyn
Jun 27 '16 at 9:49
add a comment |
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f149282%2fload-module-via-etc-modules%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown