Fix setup crash, if partition table entries are not in disk order
This commit is contained in:
parent
8afb5390c8
commit
f71df24cd3
@ -121,16 +121,22 @@ def getDiskTable(disk):
|
|||||||
length = len(results)
|
length = len(results)
|
||||||
index = length - 1
|
index = length - 1
|
||||||
while index >= 0:
|
while index >= 0:
|
||||||
if results[index] == "": break
|
if results[index] != "" and results[index][0] != "/": break
|
||||||
index -= 1
|
index -= 1
|
||||||
if index < 0: return {}
|
if index < 0: return {}
|
||||||
results = results[index + 2:]
|
results = results[index + 1:]
|
||||||
length = len(results)
|
length = len(results)
|
||||||
|
|
||||||
index = 0
|
index = 0
|
||||||
while index < length:
|
while index < length:
|
||||||
while results[index].replace(" "," ") != results[index]:
|
while results[index].replace(" "," ") != results[index]:
|
||||||
results[index] = results[index].replace(" "," ")
|
results[index] = results[index].replace(" "," ")
|
||||||
|
|
||||||
|
if results[index] == "" or results[index][0] != "/":
|
||||||
|
del results[index]
|
||||||
|
length -= 1
|
||||||
|
continue
|
||||||
|
|
||||||
results[index] = results[index].split(" ")
|
results[index] = results[index].split(" ")
|
||||||
index += 1
|
index += 1
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user