Trying to compile test kernel to disable network leds

After finding out how to disable the Pis power and SD activity leds from software I’m trying to get rid of the last bit of light pollution but I’m having trouble compiling the custom kernel.

I wanted to test the patch then if it worked request that it be added to OSMC so I could just stay stock in the future.

I have a build environment set up on a Linux machine and have previously compiled rbp2-mediacenter-osmc with it so it should be set up correctly.

I couldn’t find any good instructions so I just did a “make rbp2” in the kernel-osmc directory which ran for over four hours even getting to the point of making a deb file but the console output ends with a failure during some cleaning or something and the deb fails to install on the Pi due to missing overlays.

Here is what was in my console output

The modified patch I made to apply from your patches directory that works after other patches have broke the first hunks context lines --- a/drivers/net/usb/smsc95xx.c 2013-11-25 17:31:58.181733581 -0200+++ b/driv -

The original link to the patch and info on it (I had to use Google Translate) Patch para controlar os leds ethernet do Raspberry Pi

A tiny piece of black tape is not sufficient ? Or an opaque case ?

That would be no fun.

Obviously it’s possible with this patch and the kernel compile fails a very long time after that module is compiled so it’s not related and must be because I couldn’t find instructions and was guessing.

Plus on the pi2 the lights would be annoying and ugly to cover with tape since they’re right on the Ethernet port not the board like old versions. (A comment on that site mentions this patch still works so I don’t see that being a problem.

For a case short of a custom none really block where the lights are plus I don’t have it wasn’t a case on this pi.

I have tried a test compile that doesn’t include my patch so I know it is not the problem. I assume it has to do with xargs getting to many arguments which I am trying to figure out a way around but all the fixes online recommend using rm in a loop with find giving the arguments one at a time. But for that I have to figure out how to change the build script which I can’t figure when that command is ran at first glance.

I just tried:

sudo echo 0 > /sys/class/leds/led1/brightness

But I get permission denied. I did not mess around with OSMC.
On a RPi2.

That command doesn’t work because it does the echo as sudo but not anything after the >

Try this command to turn off that led

echo gpio | sudo tee /sys/class/leds/led1/trigger

Please note I’m still trying to figure out why I can’t compile a kernel. I have even tried without my patch on a clean git source tree and it fails at the same point.

It does make image and headers deb files just that the image deb is not installable due to missing overlays.

That works! But after a reboot it blinks again. With that info I actually found this:

so I added this to the bottom of boot/config.txt:

# Disable the ACT LED.

# Disable the PWR LED.

After a reboot, the PWR and ACT leds are off (thank god!).
I’d say this solution is much cleaner that trying to patch a kernel!

If the OSMC devs are reading: please add this as a feature/setting in MyOSMC!


  • The leds of the network port are still blinking but they are practically invisible.
  • More annoying: the blue led of my Bluetooth CSR dongle is blinking and it is very bright. There is a method described here to disable the led of dongles like this one:
    Edimax Light blinking all the time - Raspberry Pi Forums
    But I don’t have the expertise or guts to test it.

The entire point of the patch is the network leds only.

For my commands I just set them in rc.local to work after a reboot but I might switch to your commands I had never found them before and keeping configuration changes grouped in config.txt seems like a nice idea.

Please post the exact error, as well as how you’re trying to build the kernel.

I suspect you may be building too ‘deep’ a directory. Try clone to /root/git and building from there.

Here is the end of the console output install -p -o root -g root -m 644 README.Debian / -

My procedure for compiling is to
make rbp2

I’ll move the osmc directory from /home/htpc to / and try again but that is a five hour test on that system so it will be a bit until I find if it works.

I hate my luck after all these hours and just before it gets to the point it usually fails, I run out of disk space. It really frustrates me that I forgot that / was a different partition and to small for something like this.

I can’t easily work around that so I’m trying to recompile the host systems kernel with a fix to allow bigger xargs lists and move the osmc directory back to /home/htpc

if you have another Linux system, just build on that. A VM will do too.

Add deb jessie main to a Debian 8 or Ubuntu 14.04 or later 64-bit /etc/apt/sources.list, clone the repo and make rbp2 in kernel-osmc.


No other system, my laptop (over 6 years old) if compiling will overheat and literally burn the power cord tip until I have to buy a new one and even a couple times hurt my finger when I went to use the touch pad.

So that system is the only one.

You are not having much luck…


Well there is always black tape… :slight_smile: