Skip to content

Instantly share code, notes, and snippets.

@mnalis
Last active March 21, 2024 19:13
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mnalis/2fed42a1abf8e98f45f6edf162bf609f to your computer and use it in GitHub Desktop.
Save mnalis/2fed42a1abf8e98f45f6edf162bf609f to your computer and use it in GitHub Desktop.
RaspberryPI IrToy - restore /dev/ttyACM0 interface in newer kernels
cd /lib/modules/`uname -r`/kernel/drivers && \
mv -n media/rc/ir_toy.ko media/rc/ir_toy.ko.DISABLED && \
mv -n usb/class/cdc-acm.ko usb/class/cdc-acm.ko.DISABLED && \
env -i sed -e 's/\xd8\x04\x08\xfd/\xff\x04\x08\xfd/' < usb/class/cdc-acm.ko.DISABLED > usb/class/cdc-acm.ko && \
depmod -a
# reboot after doing the change.
#
# This changes blacklisting of USB ID `04d8:fd08` in cdc-acm, so IrToy gets recognized
# as it was in previous kernel versions, and `/dev/ttyACM0` gets created for it instead of `/dev/lirc0`
# For those who don't use lirc but IrToy directly and so need compatibility with that...
#
# works at least in Raspbian.org Buster raspberrypi-kernel 1:1.20211029-1~buster armhf
@mnalis
Copy link
Author

mnalis commented Nov 12, 2021

@Irdroid
Copy link

Irdroid commented Jan 20, 2022

Thanks for that.

I can confirm that it works on x86_64 Ubuntu with kernel 5.15

Cheers!

@matejdro
Copy link

For kernel with .gz compressed module, do I just need to decompress the module first, perform the sed command and then re-gz it?

@mnalis
Copy link
Author

mnalis commented Jan 24, 2022

@matejdro I've never used compressed kernel modules, but yes, I assume it should work just like you described.

@tuxflo
Copy link

tuxflo commented May 6, 2022

For kernel with .gz compressed module, do I just need to decompress the module first, perform the sed command and then re-gz it?

Did you ever try this? I'm facing this issue on Arch where the modules are packed as xz files.

@JoKr4
Copy link

JoKr4 commented Jul 11, 2022

just decompress and apply the script, no need to compress again

works fine on 5.10.92-2-rpi-legacy-ARCH

thanks for sharing!

@primalmotion
Copy link

thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment