Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 5077

Advanced users • keyboard device name in initramfs

$
0
0
I'm working on a little sh script that runs in initramfs, and I need to know whether there is a keyboard attached or not.

I thought I could use the existence of /dev/input/by-id if a keyboard is attached, but this doesn't seem to be populated in initramfs, so this test always fails, even with a keyboard attached.

Code:

if [ -e /dev/input/by-id ]; then  echo "there is a keyboard"fi
I didn't see anything obvious in the initramfs /dev, and searching was moderately futile.

PS yes, this is pi-related :lol:

Statistics: Posted by bls — Fri May 03, 2024 12:01 am



Viewing all articles
Browse latest Browse all 5077

Trending Articles