Do not try to read raw disk data as unicode

Fixes regression in commit 9f8fa2853a:
utils.execute returns unicode by default, but this data is binary.

Change-Id: I5b54c1f6cfac5fff672245c523b9fb647478edbd
(cherry picked from commit 1d12505fa0)
This commit is contained in:
Dmitry Tantsur
2019-11-11 16:03:59 +01:00
committed by Steve Baker
parent 10059c535f
commit 045bcfef32

View File

@@ -159,7 +159,7 @@ def _is_bootloader_loaded(dev):
if 'boot sector' in stdout:
# Now lets check the signature
ddout, dderr = utils.execute(
'dd', 'if=%s' % device, 'bs=218', 'count=1')
'dd', 'if=%s' % device, 'bs=218', 'count=1', binary=True)
stdout, stderr = utils.execute('file', '-', process_input=ddout)
# The bytes recovered by dd show as a "dos executable" when
# examined with file. In other words, the bootloader is present.