Do not try to read raw disk data as unicode

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

Change-Id: I5b54c1f6cfac5fff672245c523b9fb647478edbd
This commit is contained in:
Dmitry Tantsur 2019-11-11 16:03:59 +01:00
parent 11862ccae9
commit 1d12505fa0
1 changed files with 1 additions and 1 deletions

View File

@ -149,7 +149,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.