🌕 Linux 硬體熱插拔事件:深入底層的技術細節
➤ 從核心廣播到使用者空間監聽的底層剖析
https://arcanenibble.github.io/hardware-hotplug-events-on-linux-the-gory-details.html
當開發者需要偵測 Linux 系統中的 USB 熱插拔事件時,通常會首選 `libusb`。然而,若受限於特定應用場景無法使用該函式庫,開發者便需深入探討核心與使用者空間(userspace)之間的通訊機制。本文揭示了 `udev` 如何透過 `Netlink` 協議接收來自核心的硬體事件,並處理後續的廣播機制。作者通過剖析 `libudev` 的封包格式與 `Netlink` 運作原理,示範瞭如何直接在使用者空間監聽並解析這些底層訊息,從而繞過對高階函式庫的依賴。
+ 這篇文章真是及時雨!我之前一直以為監聽熱插拔必須依賴 libudev,沒想到透過 Netlink 處理 udev 廣播封包是完全可行的。
+ 雖然這確實提供了深入理解系統底層的機會
#Linux #系統程式設計 #USB #Netlink #udev
Hardware hotplug events on Linux, the gory details

Maybe the code shouldn't be the only documentation?

ArcaneNibble's site

Ubuntu 24.04 - HID works only with sudo despite udev rule #permissions #python #udev

https://askubuntu.com/q/1564556/612

Ubuntu 24.04 - HID works only with sudo despite udev rule

INFO: Linux Ubuntu 24.04.4 LTS Python - lib: hid SteelSeries Nova 5 I made a program that communicates with my headphones through HID, but I can only run it with sudo. I tried changing the device

Ask Ubuntu
MAC Address Spoofing Setup Steps | Drowr

Learn how to enhance your privacy by setting up MAC address spoofing on Linux using macchanger and udev rules

Would you like to contribute something easy to a little project?

My game-devices-udev is missing out some udev-rules already in steam-devices. This would be a good chance to kill some time and do some MR :D (and even learn git, markdown, udev in the process!)

https://codeberg.org/fabiscafe/game-devices-udev/issues/73

#gaming #udev #Linux #LinuxGaming #LazyMe

Sync with steam-devices

https://github.com/ValveSoftware/steam-devices/blob/master/60-steam-input.rules - [x] Valve USB devices; 28de; * - [x] Steam Controller udev write access; *; * - [x] Valve HID devices over USB hidraw; 28de; * - [x] Valve HID devices over bluetooth hidraw; 28de; * - [x] DualShock 3 over USB...

Codeberg.org

Any ideas how to get a #Wine app to pick up a USB peripheral? I created a #Udev rule but beyond that I'm stumped. For the record, I've read all about how USB isn't a core Wine function and that if Wine does control the device the host won't be able to. I'm good with all of that, I think it's fine for my use case.

My use case being: I have a #Roland #TR-6s and I want to try to use the TR Editor via Wine. I was able to get it installed and running finally and now this new roadblock has appeared.

If this doesn't pan out I'll look into setting up a stripped down VM.

#arch #linux #bottles #bottles61 #usebottles

#HIVEMIND: What would be the best way to give a #Linux user with no admin rights (i.e. no access to sudo) have full access to external block devices?

These users need to be able to repartition and put images on USB sticks, but not internal drives.

I'm thinking #udev should be able to do the job, but I don't know if there's a way to specify "all USB block devices." I guess an alternative would be to say "anything but NVMe drives" or "only /dev/sdx drives," but that feels too imprecise.

If there's a better way then I'm all ears.

#AskFedi #LazyWeb

First time renaming something at the #udev level (NAME=) instead of adding an alternative name (SYMLINK+=).

That was fun… regardless of the relative order of the TAG+=, ENV{}=, and NAME= directives, I couldn't do more than renaming…

Turns out this isn't an all-or-nothing thing, you might get the new name, without the rest (environment variables)… until you figure out your KERNEL== filter needs to accept the new name as well. Otherwise, you're out of luck.

That was fun…

Flipper Zero unter Arch Linux – wichtiger Hinweis

Falls der Flipper Zero unter Arch nicht erkannt wird und ihr „/dev/ttyACM0: Permission denied“ bekommt:

Die Udev-Regeln der Flipper-App erwarten die Gruppe „dialout“. Arch nutzt dafür aber die Gruppe „uucp“.

Fix:
1. Udev-Regel anpassen: dialout → uucp
2. User hinzufügen: sudo usermod -aG uucp $USER
3. reboot

Danach läuft der Flipper Zero unter Arch auch ohne sudo.

#flipperzero #archlinux #linux #udev #opensource #debugging #foss #archusers