]> code.ossystems Code Review - openembedded-core.git/commit
wic: make engine.py:get_partitions() resilient to parted/dmidecode stderr output
authorGeoff Parker <geoffhp@gmail.com>
Thu, 11 Oct 2018 16:31:26 +0000 (09:31 -0700)
committerArmin Kuster <akuster808@gmail.com>
Sun, 7 Apr 2019 09:36:06 +0000 (15:06 +0530)
commit6b5681533eed4e6c00e1cc7ee442c93076f1c976
tree82fb7d9fa25d3ef913da2a5cc4e1b50af12be607
parent2f2d52a958d3e9d511a2f5b8b14ed46466dd0d23
wic: make engine.py:get_partitions() resilient to parted/dmidecode stderr output

Running wic commands on Debian 10 systems fail in
scripts/lib/wic/engine.py:get_partitions() due to new stderr output captured
when trying to parse the output from /sbin/parted as a non-root user.

The parted command calls the dmidecode utility, which produces this error
as a non-root user:
    /sys/firmware/dmi/tables/smbios_entry_point: Permission denied
    /dev/mem: Permission denied

scripts/lib/wic/engine.py:get_partitions() calls misc.py:exec_cmd(),
a subprocess wrapper which returns a combined stderr and sdtdout.
These messages to stderr confuse the partition table parser in
get_partitions().

This patch has the partition table parser ignore lines before the expected
"BYT;" header string.

Running wic in Debian 9 does not have this issue.

Signed-off-by: Geoff Parker <geoffhp@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
scripts/lib/wic/engine.py