Closed marc0777 closed 2 years ago
After looking into it further I also noticed that find_module
has been unexported too since kernel 5.12, as in commit https://github.com/torvalds/linux/commit/089049f6c9956c5cf1fc89fe10229c76e99f4bef, so solving the module_mutex
problem would't be enough to compile this in more recent kernels.
Yup. I ran into this when I looked at what it would take to migrate my N5550 to something later than CentOS 7 a few months ago. As you discovered, the approach that I took with my n5550_ahci_leds
module (which was always a rather horrible hack) is no longer viable.
The good news is that this provided the impetus for me to write a more generic block device LED trigger that actually does things the "right way." I've since been trying to get someone who works on the Linux LEDs subsystem to actually review the darn thing, so that it can actually be included in the kernel. Unfortunately, I've had no luck with this.
The module does, however, work just fine as an out-of-tree driver, and it does away with the requirement that the ahci
driver be built as a module; it works just fine with a built-in AHCI driver. I've added a copy of the relevant files to this repo here, including documentation of the various sysfs
attributes and a short overview of how the trigger works.
You'll still need the n5550_board
module to actually tell the kernel about the N5550's LEDs and GPIOs, and you'll need to create udev
rules or something to configure the blkdev
LED trigger at boot. Once that's done, however, the disk activity LEDs should just work, and the other LEDs and GPIOs should all be configured, so that you can use them with freecusd
or anything else.
Let me know how it goes.
I managed to compile and enable the n5550_board
together with the ledtrig-blkdev
module and it works very well, thanks!
I'm having problems compiling freecusd
too, but I'll open a separate issue for that.
I managed to compile and enable the
n5550_board
together with theledtrig-blkdev
module and it works very well, thanks!
@marc0777 Would you be so kind to include a short step-by-step for what you did to make this work? I'm still struggling with what to do after compiling both these modules.
I was trying to get this on my N5550 currently running OpenMediaVault. However I noticed that, even after applying the patch mentioned in #17 the modules still can't compile. The error I get is this:
After some investigation I found torvalds/linux@922f2a7c822bf76dffb218331bd95b1eea3cf637 this commit affecting linux since version 5.12 that removed the export of
module_mutex
in module.h, making it not accessible for us.How could this be made into working again without directly using that export?