mirror of
https://github.com/mbusb/multibootusb
synced 2024-11-18 15:25:46 +00:00
Fix import error under Linux correct the gpt detection code under Linux
This commit is contained in:
parent
2394e15ff8
commit
2c91ed4c7f
@ -27,7 +27,6 @@ def gpt_part_table(usb_disk):
|
|||||||
Check if selected USB contain GPT or MBR partition table
|
Check if selected USB contain GPT or MBR partition table
|
||||||
:return: True if GPT else False
|
:return: True if GPT else False
|
||||||
"""
|
"""
|
||||||
win_usb_disk_no = str(usb.get_physical_disk_number(config.usb_disk))
|
|
||||||
if platform.system() == "Linux":
|
if platform.system() == "Linux":
|
||||||
_cmd_out = subprocess.check_output("parted " + usb_disk[:-1] + " print", shell=True)
|
_cmd_out = subprocess.check_output("parted " + usb_disk[:-1] + " print", shell=True)
|
||||||
if b'msdos' in _cmd_out:
|
if b'msdos' in _cmd_out:
|
||||||
@ -35,6 +34,7 @@ def gpt_part_table(usb_disk):
|
|||||||
elif b'gpt' in _cmd_out:
|
elif b'gpt' in _cmd_out:
|
||||||
return True
|
return True
|
||||||
elif platform.system() == 'Windows':
|
elif platform.system() == 'Windows':
|
||||||
|
win_usb_disk_no = str(usb.get_physical_disk_number(config.usb_disk))
|
||||||
if config.usb_gpt is True:
|
if config.usb_gpt is True:
|
||||||
return True
|
return True
|
||||||
elif config.usb_gpt is False:
|
elif config.usb_gpt is False:
|
||||||
|
@ -377,10 +377,17 @@ def gpt_device(dev_name):
|
|||||||
gen.log('Device ' + dev_name + ' is a GPT disk...')
|
gen.log('Device ' + dev_name + ' is a GPT disk...')
|
||||||
return False
|
return False
|
||||||
if platform.system() == "Linux":
|
if platform.system() == "Linux":
|
||||||
|
if gen.has_digit(dev_name):
|
||||||
_cmd_out = subprocess.check_output("parted " + dev_name[:-1] + " print", shell=True)
|
_cmd_out = subprocess.check_output("parted " + dev_name[:-1] + " print", shell=True)
|
||||||
|
else:
|
||||||
|
_cmd_out = subprocess.check_output("parted " + dev_name + " print", shell=True)
|
||||||
if b'msdos' in _cmd_out:
|
if b'msdos' in _cmd_out:
|
||||||
|
config.usb_gpt = False
|
||||||
|
gen.log('Device ' + dev_name + ' is a MBR disk...')
|
||||||
return False
|
return False
|
||||||
elif b'gpt' in _cmd_out:
|
elif b'gpt' in _cmd_out:
|
||||||
|
config.usb_gpt = True
|
||||||
|
gen.log('Device ' + dev_name + ' is a GPT disk...')
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user