sys.stderr.write('File too large.\n')
return 3
+ # The bootloader only accepts chunks whose size is word-aligned:
+ num_extra = len(chunks[-1]) & 3
+
+ if num_extra != 0:
+ num_pad = 4 - extra
+ chunks[-1] += b'\xff' * num_pad
+
# Defaulting to zero seems too dangerous:
if self._offset is None:
sector0 = None