Upgrade to version 8.9.0

* Improved the GPT detecttion under Windows
* Support for GPT based USB disks. BIOS and UEFI mode works only under USB created under Linux.
* Added command line option to install sysinux on multibootusb director (use -s or --syslinux)
* Added command line option to direct ISO writing to USB disk (use -r or --raw)
* Boot ISO and IMG directly using memdisk
* Added feature for selecting ISO, IMG, Zip and all files options in file chooser dialog
* Corrected path to menu.lst file for distrs based on grub4dos
* Fix for crash when multicard reader is inserted on the system without a SD card
* Correctly detect USB disk information using udisk2-dbus without crash under Linux
* Fixed an issue where using a path with spaces would cause a qemu boot error
* If distro is not supported, ISO is automatically added using memdisk. You can uninstall later if it does not work
* Added Nano Linux
pull/252/head
mbusb 7 years ago
parent ea2e3ce9ed
commit ed820167e6

@ -1,3 +1,17 @@
Version - 8.9.0
---------------
* Support for GPT based USB disks. BIOS mode works only under USB created under Linux. UEFI for on Windows and Linux
* Added command line option to install sysinux on multibootusb director (use -s or --syslinux)
* Added command line option to direct ISO writing to USB disk (use -r or --raw)
* Boot ISO and IMG directly using memdisk
* Added feature for selecting ISO, IMG, Zip and all files options in file chooser dialog
* Corrected path to menu.lst file for distrs based on grub4dos
* Fix for crash when multicard reader is inserted on the system without a SD card
* Correctly detect USB disk information using udisk2-dbus without crash under Linux
* Fixed an issue where using a path with spaces would cause a qemu boot error
* If distro is not supported, ISO is automatically added using memdisk. You can uninstall later if it does not work
* Added Nano Linux
Version - 8.8.0
---------------
* Fix for crash when listing fixed partition

@ -1 +1 @@
8.8.0
8.9.0

@ -75,7 +75,8 @@ def list_iso(iso_link, suppress_out=True):
file_list = []
_cmd = _7zip + ' l ' + gen.quote(iso_link) + suppress_out
try:
_cmd_out = subprocess.check_output(_cmd, stderr=subprocess.PIPE, shell=True).decode('utf-8', 'ignore').splitlines()
_cmd_out = subprocess.check_output(_cmd, stderr=subprocess.PIPE, stdin=subprocess.DEVNULL,
shell=True).decode('utf-8', 'ignore').splitlines()
except Exception as e:
gen.log(e)
_cmd_out = ''
@ -84,18 +85,6 @@ def list_iso(iso_link, suppress_out=True):
line = line.split()
_path = line[-1]
file_list.append(_path)
'''
for line in _cmd_out:
line = line.split()
if '.....' in line:
if gen.has_digit(line[2]) or gen.has_digit(line[4]):
if len(line) > 6:
f_path = " ".join(line[5:])
file_list.append(f_path)
else:
f_path = line[-1]
file_list.append(f_path)
'''
return file_list

@ -28,6 +28,7 @@ process_exist = None
yes = False
cli_dd = False
cli_syslinux = False
usb_gpt = ''
imager_iso_link = ""
imager_usb_disk_selected = ""

@ -157,6 +157,9 @@ Are you SURE you want to enable it?",
self.ui.usb_type.setText(config.usb_details.get('devtype', ""))
self.ui.usb_fs.setText(config.usb_details.get('file_system', ""))
# Get the GPT status of the disk and store it on a variable
usb.gpt_device(config.usb_disk)
self.update_list_box(config.usb_disk)
self.ui_update_persistence()
else:

@ -35,32 +35,10 @@ def gpt_part_table(usb_disk):
elif b'gpt' in _cmd_out:
return True
elif platform.system() == 'Windows':
gdisk_command = win_gdisk + ' -l //./physicaldrive' + win_usb_disk_no
#_cmd_out = subprocess.check_output(win_gdisk + ' -l //./physicaldrive' + win_usb_disk_no, shell=True)
p = subprocess.Popen(gdisk_command, shell=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE,
universal_newlines=True)
for line in p.stdout:
if 'Found valid MBR and GPT' in line:
# gdisks wait for user input. Probably this is a MBR disk.
p.stdin.write('1\n')
return False
elif 'using GPT' in line:
# Probably GPT disk.
return True
elif 'Found invalid GPT and valid MBR' in line:
return False
elif 'MBR only' in line:
return False
if p.poll() is None:
p.terminate()
'''
if b'using GPT' in _cmd_out:
if config.usb_gpt is True:
return True
elif b'MBR only' in _cmd_out:
elif config.usb_gpt is False:
return False
'''
def get_mbr_bin_path(usb_disk):
@ -69,10 +47,10 @@ def get_mbr_bin_path(usb_disk):
:param usb_disk: path to whole USB disk '/dev/sdb'
:return: Path to mbr.bin for use
"""
if gpt_part_table(usb_disk) is False:
if config.usb_gpt is False:
log('Using mbr.bin msdos mbr install.')
return resource_path(os.path.join("data", "tools", "mbr.bin"))
if gpt_part_table(usb_disk) is True:
elif config.usb_gpt is True:
log('Using gptmbr.bin for mbr install.')
return resource_path(os.path.join("data", "tools", "gptmbr.bin"))
@ -171,9 +149,13 @@ def syslinux_default(usb_disk):
elif platform.system() == "Windows":
syslinux = resource_path(os.path.join(multibootusb_host_dir(), "syslinux", "bin", "syslinux4.exe"))
log('Executing ==>' + syslinux + ' -maf -d multibootusb ' + usb_disk)
config.status_text = 'Installing default syslinux version 4...'
syslinux_cmd = syslinux + ' -maf -d multibootusb ' + usb_disk
# syslinux_cmd = syslinux + ' -maf -d multibootusb ' + usb_disk
if config.usb_gpt is False:
syslinux_cmd = syslinux + ' -maf -d multibootusb ' + usb_disk
else:
syslinux_cmd = syslinux + ' -af -d multibootusb ' + usb_disk
log('Executing ==> ' + syslinux_cmd)
'''
if gpt_part_table(config.usb_disk) is False:
syslinux_cmd = syslinux + ' -maf -d multibootusb ' + usb_disk
@ -183,15 +165,19 @@ def syslinux_default(usb_disk):
if subprocess.call(syslinux_cmd, shell=True) == 0:
config.status_text = 'Default syslinux successfully installed...'
log("\nDefault syslinux install is success...\n")
'''
# We will need to flash gptmbr.bin only for GPT disk. As of version 8.9.0 this corrupts the gpt disk.
# Therefore not included for BIOS booting. GPT disk may work on UEFI system.
if gpt_part_table(config.usb_disk) is True:
# if gpt_part_table(config.usb_disk) is True:
'''
if config.usb_gpt is False:
log('\nExecuting ==> ' + mbr_install_cmd)
if subprocess.call(mbr_install_cmd, shell=True) == 0:
log("\ngptmbr install is success...\n")
log("\nmbr install is success...\n")
return True
else:
log('Disk uses GPT and mbr install is not required...')
'''
else:
log("\nFailed to install default syslinux...\n")
config.status_text = 'Failed to install default syslinux...'
@ -331,7 +317,8 @@ def replace_grub_binary():
else:
log('Replacing efi binary with msdos compatible one...')
try:
shutil.copy(core_img_bin_gpt_path, core_img_bin_path)
# shutil.copy(core_img_bin_gpt_path, core_img_bin_path)
shutil.copy(grub_efi_bin_msdos_path, grub_efi_bin_path)
except Exception as e:
log(e)
log('Failed to replace efi binary...')

@ -13,6 +13,7 @@ import shutil
import collections
import ctypes
import subprocess
from . import config
from . import gen
if platform.system() == 'Linux':
from . import udisks
@ -349,6 +350,36 @@ def bytes2human(n):
return "%sB" % n
def gpt_device(dev_name):
"""
Find if the device inserted is GPT or not. We will just change the variable parameter in config file for later use
:param dev_name:
:return: True if GPT else False
"""
if platform.system() == 'Windows':
diskpart_cmd = 'diskpart.exe /s ' + os.path.join('data', 'tools', 'gdisk', 'list-disk.txt')
dev_no = get_physical_disk_number(dev_name)
cmd_out = subprocess.check_output(diskpart_cmd)
cmd_spt = cmd_out.split(b'\r')
for line in cmd_spt:
line = line.decode('utf-8')
if 'Disk ' + dev_no in line:
if '*' not in line.split()[-1]:
config.usb_gpt = False
gen.log('Device ' + dev_name + ' is a MBR disk...')
return False
else:
config.usb_gpt = True
gen.log('Device ' + dev_name + ' is a GPT disk...')
return False
if platform.system() == "Linux":
_cmd_out = subprocess.check_output("parted " + dev_name[:-1] + " print", shell=True)
if b'msdos' in _cmd_out:
return False
elif b'gpt' in _cmd_out:
return True
def win_disk_details(disk_drive):
"""
Populate and get details of an USB disk under windows. Minimum required windows version is Vista.
@ -421,6 +452,7 @@ def details(usb_disk_part):
details = details_udisks2(usb_disk_part)
elif platform.system() == 'Windows':
details = win_disk_details(usb_disk_part)
return details

Loading…
Cancel
Save