0

I have a fully working (for this part) embedded system based on a rather ancient, vendor-modified, Linux v3.18.29.

To solve other problems I am in the process of upgrading everything to current u-boot/kernel/Buildroot.

Everything seems to work, but I have problems with hot-plugging devices.

I remember I had some problems setting up input handling on the old system, but I can't remember exactly what they were (after several years).

I have full sources and I can successfully rebuild both old and new system, but I could not spot relevant differences (_defconfig's changed enough a simple diff won't give understandable results).

Old system was relying solely on devtmpfs, I tried that and also mdev on new, but apparently mdev is never called (at least it does not log in /dev/mdev.log)

I have UEVENT_HELPER=y, UEVENT_HELPER_PATH=/sbin/hotplug, EVENTFD=y, HAVE_PERF_EVENTS=y, INPUT=y, INPUT_EVDEV=y.

Primary usage of this would be to connect a USB barcode scanner in "keyboard emulation" to system.

In particular I need creation of character device /dev/input/event0

Can someone suggest what I should check/enable/whatever?

Update: A bit of details:

  • Hardware is based on a tiny SoM "Vocore2" sporting :
    • mips32 cpu (MT7628)
    • 128M RAM
    • Integrated WiFi b/g/n
    • 100baseT Ethernet MAC
    • Integrated 5 Port Ethernet
    • 16M SPI NOR
    • SD card (currently 8G)
    • USB2 master
    • 3 x Serial (3wire)
  • Software is:
    • U-Boot (mips-next from git)
    • Linux v5.5 (just one patch to have fully working SD)
    • Buldroot 2020.02 (plus a few custom packages)
    • Application (written in python3)
    • Most of basic Unix utilities are provided by Busybox, in particular:
      • There is no udevd, substitute is Busybox mdev
ZioByte
  • 246
  • 3
  • 15
  • /dev is an odd place for mdev.log, but so be it. Any movement in the logs when you connect the scanner? Its driver gets loaded? – Gerard H. Pille Mar 09 '20 at 16:41
  • @GerardH.Pille: not my choice; that is the place where mdev (Busybox) will write *iff* the file already exists (at least that is what I understood from docs). No output whatsoever. I'm doing a full recompile and I'll retest ASAP. – ZioByte Mar 09 '20 at 18:20
  • What if you modprobe the scanner's driver, when it's connected? – Gerard H. Pille Mar 09 '20 at 18:46
  • @GerardH.Pille: Scanner driver is built-in (as almost everything in this embedded; I have a few modules because wifi driver *cannot* be compiled in). Actually that's the normal keyboard driver anyways (as said scanner is in "keyboard emulation mode" which means it appear as a kbd and just sends the scanned string (plus header and trailer) "as if" typed in; Linux should not be able to se the difference. – ZioByte Mar 09 '20 at 19:52
  • Does a USB keyboard work? – Gerard H. Pille Mar 09 '20 at 19:57
  • @GerardH.Pille: That is exactly how I'm testing (plugging in a keyboard), but I don't know how to test since this embedded has no real console (I'm working either with a serial line or through ssh). Actually THAT could be the problem. I'll have to check if I have all keyboard input drivers in place... – ZioByte Mar 09 '20 at 21:38
  • What hardware are we talking about? udevd is running? – Gerard H. Pille Mar 09 '20 at 22:00
  • @GerardH.Pille: I edited question to add a few details. – ZioByte Mar 09 '20 at 23:17
  • You did start your kernel config from arch/mips/configs/vocore2_defconfig, you do have CONFIG_USB_EHCI_HCD=y and CONFIG_USB_EHCI_HCD_PLATFORM=y ? Shouldn't UEVENT_HELPER_PATH=/sbin/hotplug point to /sbin/mdev? – Gerard H. Pille Mar 10 '20 at 15:11
  • @GerardH.Pille: VERY good catch Gerard, unfortunately You come second. I did not change that, but I added a "echo /sbin/mdev > /proc/sys/kernel/hotplug" following advice [here](https://git.busybox.net/busybox/tree/docs/mdev.txt?h=1_18_stable) – ZioByte Mar 10 '20 at 22:47
  • Yeah, but you put me on the wrong foot, thought you abandoned mdev completely. ;-) Now, everything OK? – Gerard H. Pille Mar 11 '20 at 11:43

0 Answers0