cgpt: Use subprocess_run to call flashrom with 1>/dev/null

Closing fd=1 is a bad idea, as flashrom will then reuse fd=1 for
the MTD device and directly write to it.

Luckily, we have a subprocess_run function in vboot that does
what we need. There will be some cleanup required after this,
but hopefully this is enough to clear the P0 on hand.

TEST=`cgpt find -t kernel` (fails?!), but at least does not
 corrupt flash:
 `flashrom -r /usr/local/x.bin && hexdump -C /usr/local/x.bin | head`

Change-Id: Ia82ed7966ea66274f72fe21eca5241633ffbdb5c
Signed-off-by: Nicolas Boichat <>
Reviewed-by: Mike Frysinger <>
Reviewed-by: Jack Rosenthal <>
Commit-Queue: Jack Rosenthal <>
1 file changed