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.

BUG=b:184559695
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`
BRANCH=none

Change-Id: Ia82ed7966ea66274f72fe21eca5241633ffbdb5c
Signed-off-by: Nicolas Boichat <[email protected]>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2812630
Reviewed-by: Mike Frysinger <[email protected]>
Reviewed-by: Jack Rosenthal <[email protected]>
Commit-Queue: Jack Rosenthal <[email protected]>
1 file changed