Work-around: Extract led name from device path

udev rule for leds subsystem in Witherspoon launches a systemd
service file with /sys/class/leds/$name. If the path is
sys-class-leds-rear-fault, systemd service file
interprets it as /sys/class/leds/rear/fault.

However, what is really needed by the service file is
/sys/class/leds/rear-fault.

This is a limitation in current systemd with template argument
containing hyphen.

Short term solution is to extract $name from path
and convert "/" to "-".  It would then become:
/sys/class/leds/rear-fault and hence will work.

Refer: systemd/systemd#5072

Change-Id: I0acc11d039650857005ba75810e3ef6bcc4a3934
Signed-off-by: Vishwanatha Subbanna <vishwa@linux.vnet.ibm.com>
2 files changed