Loading a kernel module at boot
I have an Intel NUC, and I've compiled a kernel extension to control the LED. It has created a .ko
file at /lib/modules/4.15.0-38-generic/updates/dkms/nuc_led.ko
(which matches uname -r
). Manually loading the extension works great:
sudo modprobe wmi
sudo insmod /lib/modules/4.15.0-38-generic/updates/dkms/nuc_led.ko
echo 'ring,80,blink_medium,green' | sudo tee /proc/acpi/nuc_led > /dev/null
This works.
However the extension is not currently loaded at boot. I would like to put commands to turn the LED on and off in rc.local
and rc6.d/
but these are not working, I have to run the modprobe
commands manually, and even then my file in rc6.d/
(shown below) is not working - the LED remains on.
What am I doing wrong?
$ cat /etc/rc6.d/zz_led_off.sh
#! /bin/bash
echo 'ring,0,none,off' | sudo tee /proc/acpi/nuc_led > /dev/null
$ ls -la /etc/rc6.d/zz_led_off.sh | grep zz
-rwxr-xr-x 1 root root 79 Nov 9 10:07 zz_led_off.sh
kernel
add a comment |
I have an Intel NUC, and I've compiled a kernel extension to control the LED. It has created a .ko
file at /lib/modules/4.15.0-38-generic/updates/dkms/nuc_led.ko
(which matches uname -r
). Manually loading the extension works great:
sudo modprobe wmi
sudo insmod /lib/modules/4.15.0-38-generic/updates/dkms/nuc_led.ko
echo 'ring,80,blink_medium,green' | sudo tee /proc/acpi/nuc_led > /dev/null
This works.
However the extension is not currently loaded at boot. I would like to put commands to turn the LED on and off in rc.local
and rc6.d/
but these are not working, I have to run the modprobe
commands manually, and even then my file in rc6.d/
(shown below) is not working - the LED remains on.
What am I doing wrong?
$ cat /etc/rc6.d/zz_led_off.sh
#! /bin/bash
echo 'ring,0,none,off' | sudo tee /proc/acpi/nuc_led > /dev/null
$ ls -la /etc/rc6.d/zz_led_off.sh | grep zz
-rwxr-xr-x 1 root root 79 Nov 9 10:07 zz_led_off.sh
kernel
why not compile directly into the kernel, instead of being a module?
– Doug Smythies
Nov 9 '18 at 16:18
@DougSmythies I'm not sure what that means, how would I compile it directly into the kernel?
– user31415629
Nov 12 '18 at 15:32
Sorry, I think I was wrong. If I understand correctly, because it isn't part of the kernel code, but rather an extension to it, I don't think direct compile into the kernel is an option.
– Doug Smythies
Nov 12 '18 at 15:51
add a comment |
I have an Intel NUC, and I've compiled a kernel extension to control the LED. It has created a .ko
file at /lib/modules/4.15.0-38-generic/updates/dkms/nuc_led.ko
(which matches uname -r
). Manually loading the extension works great:
sudo modprobe wmi
sudo insmod /lib/modules/4.15.0-38-generic/updates/dkms/nuc_led.ko
echo 'ring,80,blink_medium,green' | sudo tee /proc/acpi/nuc_led > /dev/null
This works.
However the extension is not currently loaded at boot. I would like to put commands to turn the LED on and off in rc.local
and rc6.d/
but these are not working, I have to run the modprobe
commands manually, and even then my file in rc6.d/
(shown below) is not working - the LED remains on.
What am I doing wrong?
$ cat /etc/rc6.d/zz_led_off.sh
#! /bin/bash
echo 'ring,0,none,off' | sudo tee /proc/acpi/nuc_led > /dev/null
$ ls -la /etc/rc6.d/zz_led_off.sh | grep zz
-rwxr-xr-x 1 root root 79 Nov 9 10:07 zz_led_off.sh
kernel
I have an Intel NUC, and I've compiled a kernel extension to control the LED. It has created a .ko
file at /lib/modules/4.15.0-38-generic/updates/dkms/nuc_led.ko
(which matches uname -r
). Manually loading the extension works great:
sudo modprobe wmi
sudo insmod /lib/modules/4.15.0-38-generic/updates/dkms/nuc_led.ko
echo 'ring,80,blink_medium,green' | sudo tee /proc/acpi/nuc_led > /dev/null
This works.
However the extension is not currently loaded at boot. I would like to put commands to turn the LED on and off in rc.local
and rc6.d/
but these are not working, I have to run the modprobe
commands manually, and even then my file in rc6.d/
(shown below) is not working - the LED remains on.
What am I doing wrong?
$ cat /etc/rc6.d/zz_led_off.sh
#! /bin/bash
echo 'ring,0,none,off' | sudo tee /proc/acpi/nuc_led > /dev/null
$ ls -la /etc/rc6.d/zz_led_off.sh | grep zz
-rwxr-xr-x 1 root root 79 Nov 9 10:07 zz_led_off.sh
kernel
kernel
asked Nov 9 '18 at 10:21
user31415629user31415629
1012
1012
why not compile directly into the kernel, instead of being a module?
– Doug Smythies
Nov 9 '18 at 16:18
@DougSmythies I'm not sure what that means, how would I compile it directly into the kernel?
– user31415629
Nov 12 '18 at 15:32
Sorry, I think I was wrong. If I understand correctly, because it isn't part of the kernel code, but rather an extension to it, I don't think direct compile into the kernel is an option.
– Doug Smythies
Nov 12 '18 at 15:51
add a comment |
why not compile directly into the kernel, instead of being a module?
– Doug Smythies
Nov 9 '18 at 16:18
@DougSmythies I'm not sure what that means, how would I compile it directly into the kernel?
– user31415629
Nov 12 '18 at 15:32
Sorry, I think I was wrong. If I understand correctly, because it isn't part of the kernel code, but rather an extension to it, I don't think direct compile into the kernel is an option.
– Doug Smythies
Nov 12 '18 at 15:51
why not compile directly into the kernel, instead of being a module?
– Doug Smythies
Nov 9 '18 at 16:18
why not compile directly into the kernel, instead of being a module?
– Doug Smythies
Nov 9 '18 at 16:18
@DougSmythies I'm not sure what that means, how would I compile it directly into the kernel?
– user31415629
Nov 12 '18 at 15:32
@DougSmythies I'm not sure what that means, how would I compile it directly into the kernel?
– user31415629
Nov 12 '18 at 15:32
Sorry, I think I was wrong. If I understand correctly, because it isn't part of the kernel code, but rather an extension to it, I don't think direct compile into the kernel is an option.
– Doug Smythies
Nov 12 '18 at 15:51
Sorry, I think I was wrong. If I understand correctly, because it isn't part of the kernel code, but rather an extension to it, I don't think direct compile into the kernel is an option.
– Doug Smythies
Nov 12 '18 at 15:51
add a comment |
1 Answer
1
active
oldest
votes
Add the module to /etc/modules
, in this case, add the following two lines:
wmi
nuc_led
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "89"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
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%2faskubuntu.com%2fquestions%2f1091379%2floading-a-kernel-module-at-boot%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Add the module to /etc/modules
, in this case, add the following two lines:
wmi
nuc_led
add a comment |
Add the module to /etc/modules
, in this case, add the following two lines:
wmi
nuc_led
add a comment |
Add the module to /etc/modules
, in this case, add the following two lines:
wmi
nuc_led
Add the module to /etc/modules
, in this case, add the following two lines:
wmi
nuc_led
answered Jan 3 at 16:34
user31415629user31415629
1012
1012
add a comment |
add a comment |
Thanks for contributing an answer to Ask Ubuntu!
- 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%2faskubuntu.com%2fquestions%2f1091379%2floading-a-kernel-module-at-boot%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
why not compile directly into the kernel, instead of being a module?
– Doug Smythies
Nov 9 '18 at 16:18
@DougSmythies I'm not sure what that means, how would I compile it directly into the kernel?
– user31415629
Nov 12 '18 at 15:32
Sorry, I think I was wrong. If I understand correctly, because it isn't part of the kernel code, but rather an extension to it, I don't think direct compile into the kernel is an option.
– Doug Smythies
Nov 12 '18 at 15:51