mirror of
https://github.com/fosslinux/live-bootstrap.git
synced 2026-03-02 01:18:08 +01:00
Merge pull request #567 from klpn/cursize-fix
Check image size and pad after closing first with statement
This commit is contained in:
commit
8b832a1e58
1 changed files with 3 additions and 0 deletions
|
|
@ -246,6 +246,9 @@ class Generator():
|
||||||
with open(os.path.join('builder-hex0', 'builder-hex0-x86-stage2.hex0'),
|
with open(os.path.join('builder-hex0', 'builder-hex0-x86-stage2.hex0'),
|
||||||
encoding="utf-8") as infile:
|
encoding="utf-8") as infile:
|
||||||
image_file.write(infile.read().encode())
|
image_file.write(infile.read().encode())
|
||||||
|
|
||||||
|
# Close first with statement before getting file size.
|
||||||
|
with open(image_file_name, 'ab') as image_file:
|
||||||
# Pad to next sector
|
# Pad to next sector
|
||||||
current_size = os.stat(image_file_name).st_size
|
current_size = os.stat(image_file_name).st_size
|
||||||
while current_size % 512 != 0:
|
while current_size % 512 != 0:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue