mirror of
https://github.com/flatcar/scripts.git
synced 2025-08-08 13:36:58 +02:00
Merge pull request #148 from kinvolk/t-lo/disk-util-use-bytearray
build_library/disk_util: use byte array for conversion, not chr()
This commit is contained in:
commit
1570708e40
@ -711,9 +711,9 @@ def Tune2fsReadWrite(options, partition, disable_rw):
|
||||
# offset of ro_compat, highest order byte (le 32 bit field)
|
||||
flag_offset = 0x464 + 3
|
||||
flag_value = 0xff if disable_rw else 0x00
|
||||
with open(options.disk_image, 'r+') as image:
|
||||
with open(options.disk_image, 'br+') as image:
|
||||
image.seek(partition['first_byte'] + flag_offset)
|
||||
image.write(chr(flag_value))
|
||||
image.write(bytes([flag_value]))
|
||||
|
||||
|
||||
def IsE2fsReadWrite(options, partition):
|
||||
|
Loading…
Reference in New Issue
Block a user