We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b0bbe08 commit 6686cd0Copy full SHA for 6686cd0
lib/inputstreamhelper/__init__.py
@@ -265,11 +265,12 @@ def _chromeos_offset(self, bin_path):
265
266
output = self._run_cmd(cmd, sudo=False)
267
if output['success']:
268
+ import re
269
for line in output['output'].splitlines():
- partition_data = line.split()
270
+ partition_data = re.match(r'^\s?(3|.+bin3)\s+(\d+)s?\s+\d+', line)
271
if partition_data:
- if partition_data[0] == '3' or '.bin3' in partition_data[0]:
272
- offset = int(partition_data[1].replace('s', ''))
+ if partition_data.group(1) == '3' or partition_data.group(1).endswith('.bin3'):
273
+ offset = int(partition_data.group(2))
274
return str(offset * config.CHROMEOS_BLOCK_SIZE)
275
276
log('Failed to calculate losetup offset.')
0 commit comments