The messaging FIFO is UTF-8, so decode the command as UTF-8 as well as the value
as otherwise "bberror" != b("bberror") and none of the messages from shell
functions are ever displayed.
Also add an else to the command parser so unhandled commands are noticed.
[ YOCTO #9947 ]
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
def readfifo(data):
lines = data.split(b'\0')
for line in lines:
+ # Just skip empty commands
+ if not line:
+ continue
splitval = line.split(b' ', 1)
- cmd = splitval[0]
+ cmd = splitval[0].decode("utf-8")
if len(splitval) > 1:
value = splitval[1].decode("utf-8")
else:
level = int(splitval[0])
value = splitval[1]
bb.debug(level, value)
-
+ else:
+ bb.warn("Unrecognised command '%s' on FIFO" % cmd)
tempdir = d.getVar('T', True)
fifopath = os.path.join(tempdir, 'fifo.%s' % os.getpid())
if os.path.exists(fifopath):