|
|
|
@ -185,20 +185,22 @@ class Install(MethodsInterface):
|
|
|
|
|
pipe = Popen([fdisk_cmd, device_name],
|
|
|
|
|
stdin=PIPE, stdout=PIPE, stderr=PIPE)
|
|
|
|
|
for part_num in change_active:
|
|
|
|
|
pipe.stdin.write("a\n%s\n" % part_num)
|
|
|
|
|
pipe.stdin.write("w\n")
|
|
|
|
|
write_str = "a\n%s\n" % part_num
|
|
|
|
|
pipe.stdin.write(write_str.encode("UTF-8"))
|
|
|
|
|
pipe.stdin.write(b"w\n")
|
|
|
|
|
pipe.stdin.close()
|
|
|
|
|
pipe.wait()
|
|
|
|
|
elif partition_table == "gpt":
|
|
|
|
|
pipe = Popen([gdisk_cmd, device_name],
|
|
|
|
|
stdin=PIPE, stdout=PIPE, stderr=PIPE)
|
|
|
|
|
if device_partition_count > 1:
|
|
|
|
|
pipe.stdin.write("x\n")
|
|
|
|
|
pipe.stdin.write(b"x\n")
|
|
|
|
|
for part_num in change_active:
|
|
|
|
|
pipe.stdin.write("a\n%s\n2\n\n" % part_num)
|
|
|
|
|
pipe.stdin.write("w\nY\n")
|
|
|
|
|
write_str = "a\n%s\n2\n\n" % part_num
|
|
|
|
|
pipe.stdin.write(write_str.encode("UTF-8"))
|
|
|
|
|
pipe.stdin.write(b"w\nY\n")
|
|
|
|
|
else:
|
|
|
|
|
pipe.stdin.write("x\na\n2\n\nw\nY\n")
|
|
|
|
|
pipe.stdin.write(b"x\na\n2\n\nw\nY\n")
|
|
|
|
|
pipe.stdin.close()
|
|
|
|
|
pipe.wait()
|
|
|
|
|
for wait_time in (0.1, 0.2, 0.5, 1, 2, 4):
|
|
|
|
|