summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
aff3fa9)
A device like /dev/sdX1 won't have a bootflag enabled, so instead
look for the bootflag on the corresponding /dev/sdX device instead.
Tested-by: Markus Rekkenbeil
def check_boot_flag(device):
def check_boot_flag(device):
- with open(device, 'r') as image:
+ if device[-1:].isdigit():
+ boot_dev = re.match(r'(.*?)\d*$', device).group(1)
+ else:
+ boot_dev = device
+
+ with open(boot_dev, 'r') as image:
data = image.read(512)
bootcode = data[440:]
if bootcode[6] == '\x80':
data = image.read(512)
bootcode = data[440:]
if bootcode[6] == '\x80':
else:
logging.debug("bootflag is NOT enabled")
raise VerifyException("Device %s does not have the bootflag set. "
else:
logging.debug("bootflag is NOT enabled")
raise VerifyException("Device %s does not have the bootflag set. "
- "Please enable it to be able to boot." % device)
+ "Please enable it to be able to boot." % boot_dev)