openbmc / obmc-console

OpenBMC host console infrastructure
Apache License 2.0
17 stars 25 forks source link

obmc-console-server cannot be ran used with udev rules. #5

Closed williamspatrick closed 7 years ago

williamspatrick commented 8 years ago

In openbmc/openbmc#528 it was proposed to use a udev rule to populate a device entry like /dev/ttyVUART0, which is symlink to /dev/ttyS0 (or similar). This allows userspace applications, like obmc-console-server, to in theory be started with a logical name rather than a dynamically allocated device name.

Unfortunately, the current obmc-console-server code expects a sysfs name rather than a dev name: https://github.com/openbmc/obmc-console/blob/master/console-server.c#L95

There is also a 'todo' in the code along these lines: https://github.com/openbmc/obmc-console/blob/master/console-server.c#L114

In order to get console server to work with a dev entry I had to do a fairly hacky systemd unit file change: ExecStart=/bin/sh -c 'realpath /dev/ttyVUART0 | xargs basename | xargs {sbindir}/obmc-console-server'

Would like obmc-console-server enhanced to support simply 'obmc-console-server ttyVUART0' or similar.

jk-ozlabs commented 8 years ago

Yep, I agree we want the dev name available there; we'll need to do a bit of a lookup to turn the (possibly renamed or linked) device node name into a kernel name (ie, as used in sysfs).

Would this make the ttyVUART0 symlink unnecessary?

williamspatrick commented 8 years ago

I don't think it makes the symlink unnecessary. We still have an "unknown" as to which /dev/ttyS* is the VUART without the symlink.

adamliyi commented 7 years ago

A patch committed to: https://gerrit.openbmc-project.xyz/#/c/826/ @jk-ozlabs , please have a look.

geissonator commented 7 years ago

Looks like still needs another +1 and a merge, moving to next sprint.