Vanfanel
Posts: 439
Joined: Sat Aug 18, 2012 5:58 pm

USB keyboard in "single-process" mode

Thu Jun 22, 2017 11:29 am

Hi,

For a particular project, I need the Pi to run in single-process mode ("init=/bin/bash" in config,txt, for example, in this case it's our own program).
The thing is, UDEV isn't running obviously, so USB keyboard is not working in this mode.
In theory, it should be possible to have USB devices working in single-process mode with initramfs hooks, as initramfs is used for these early tasks that need to be done before giving the control to init.
However, this is not documented anywhere so I am totally lost here.
So, what initramfs hooks should I add, and where should I add them? I can't find a /boot/initramfs file or similar, either.
I know I should run update-initramfs after adding them, but that's all I can find.

Thanks

Martin Frezman
Posts: 1009
Joined: Mon Oct 31, 2016 10:05 am

Re: USB keyboard in "single-process" mode

Thu Jun 22, 2017 12:43 pm

My USB keyboard works fine with init=/bin/bash. That mode would be pretty useless if it didn't (I think you'd have to hook up a serial port in order to do anything - and even that wouldn't work unless you could get a getty running on the serial port).
If this post appears in the wrong forums category, my apologies.

Vanfanel
Posts: 439
Joined: Sat Aug 18, 2012 5:58 pm

Re: USB keyboard in "single-process" mode

Thu Jun 22, 2017 1:54 pm

Then, the problem must be I'm using a cordless keyboard!
It's identified as:

Code: Select all

Bus 001 Device 004: ID 046d:c52b Logitech, Inc. Unifying Receiver
According to lsusb.
It uses a couple of modules, according to lsmod:

Code: Select all

hid_logitech_hiddpp
hid_logitech_dj
So, how can I have these modules loaded in "init=/bin/bash" mode?

Return to “Advanced users”