2
0
mirror of https://github.com/mbusb/multibootusb synced 2024-11-01 15:40:16 +00:00

Merge pull request #133 from alindt/fixes

various fixes
This commit is contained in:
multibootusb 2017-04-20 18:45:10 +05:30 committed by GitHub
commit 0a25f582ba
8 changed files with 39 additions and 39 deletions

View File

@ -162,7 +162,7 @@ def detect_iso_from_file_list(iso_link):
elif any("dban" in s.lower() for s in iso_file_list):
return "slitaz"
elif any("memtest.img" in s.lower() for s in iso_file_list):
return "mentest"
return "memtest"
elif any("mt86.png" in s.lower() for s in iso_file_list) and any("isolinux" in s.lower() for s in iso_file_list):
return 'raw_iso'
elif any("menu.lst" in s.lower() for s in iso_file_list):

View File

@ -85,7 +85,7 @@ def mbusb_update_grub_cfg():
elif config.distro == 'ReactOS':
f.write(' menuentry ' + iso.iso_basename(config.image_path) +
' {multiboot /loader/setupldr.sys}' + "\n")
elif config.distro == 'mentest':
elif config.distro == 'memtest':
f.write(' menuentry ' + iso.iso_basename(config.image_path) +
' {linux16 ' + '/multibootusb/' + iso.iso_basename(config.image_path) + '/BISOLINUX/MEMTEST}' + "\n")
elif syslinux_menu is not None:

View File

@ -101,8 +101,8 @@ def install_distro():
os.system('sync')
if config.persistence != 0:
log('Creating Persistence...')
config.status_text = 'Creating Persistence...'
log('Creating persistence...')
config.status_text = 'Creating persistence...'
persistence.create_persistence()
install_patch()

View File

@ -642,9 +642,9 @@ class ISO9660:
###########################################################################
def dump_dir_record(dirs):
""" Dump all the file dirctory records contained in desc_buf """
""" Dump all the file directory records contained in desc_buf """
gen.log("Dump file/deirectory record")
gen.log("Dump file/directory record")
gen.log("===========================", end="\n")
if dirs != None:
for f in dirs:
@ -705,7 +705,7 @@ def dump_boot_record(volume_dsc):
gen.log("boot system identifier(%s)" %bootsys_identifier)
boot_identifier = volume_dsc[39:71]
gen.log("boot identifier(%s)" %boot_identifier)
gen.log("boot identifier(%s)" %boot_identifier)
def usage():
""" Prompt user how to use """

View File

@ -277,9 +277,9 @@ Are you SURE you want to enable it?",
log("File not selected...")
def ui_update_persistence(self):
log("===== config.persistence_available = " + str(config.persistence_available))
log("===== config.persistence_max_size = " + str(config.persistence_max_size))
log("===== config.persistence = " + str(config.persistence))
# log("===== config.persistence_available = " + str(config.persistence_available))
# log("===== config.persistence_max_size = " + str(config.persistence_max_size))
# log("===== config.persistence = " + str(config.persistence))
if config.persistence_available and config.persistence_max_size:
self.ui.label_persistence_value.setVisible(True)
self.ui.label_persistence.setVisible(True)
@ -457,17 +457,17 @@ Are you SURE you want to enable it?",
# extract_cfg_file(config.image_path) # Extract files from ISO
# config.distro = distro(iso_cfg_ext_dir(), config.image_path) # Detect supported distro
usb_details = usb.details(config.usb_disk)
log("MultiBoot Install: USB Disk is " + config.usb_disk)
log("MultiBoot Install: USB Label is " + config.usb_label)
log("MultiBoot Install: USB UUID is " + config.usb_uuid)
log("MultiBoot Install: USB Mount path is " + config.usb_mount)
log("MultiBoot Install: Total size of the disk is " + str(usb.bytes2human(usb_details['size_total'])))
log("MultiBoot Install: Total used size is " + str(usb.bytes2human(usb_details['size_used'])))
log("MultiBoot Install: Total size left on the disk is " + str(usb.bytes2human(usb_details['size_free'])))
log("MultiBoot Install: FileSystem is " + usb_details['file_system'])
log("MultiBoot Install: Vendor is " + usb_details['vendor'])
log("MultiBoot Install: Model is " + usb_details['model'])
log("MultiBoot Install: Name of the ISO file is " + iso_name(config.image_path))
log("MultiBoot Install: USB Disk: " + config.usb_disk)
log("MultiBoot Install: USB Label: " + config.usb_label)
log("MultiBoot Install: USB UUID: " + config.usb_uuid)
log("MultiBoot Install: USB mount path: " + config.usb_mount)
log("MultiBoot Install: Disk total size: " + str(usb.bytes2human(usb_details['size_total'])))
log("MultiBoot Install: Disk used size: " + str(usb.bytes2human(usb_details['size_used'])))
log("MultiBoot Install: Disk free size: " + str(usb.bytes2human(usb_details['size_free'])))
log("MultiBoot Install: Filesystem: " + usb_details['file_system'])
log("MultiBoot Install: Disk vendor: " + usb_details['vendor'])
log("MultiBoot Install: Disk model: " + usb_details['model'])
log("MultiBoot Install: ISO file: " + iso_name(config.image_path))
if os.path.exists(config.image_path):
self.ui.image_path.clear()
@ -476,7 +476,7 @@ Are you SURE you want to enable it?",
copy_mbusb_dir_usb(config.usb_disk)
if not os.path.exists(os.path.join(config.usb_mount, "multibootusb", iso_basename(config.image_path))):
config.persistence = self.ui.slider_persistence.value() * 1024 * 1024
log("Persistence chosen is " + str(bytes2human(config.persistence)) + " MB")
log("Persistence chosen is " + str(bytes2human(config.persistence)))
install_size = iso_size(config.image_path) + config.persistence
if install_size >= disk_usage(config.usb_mount).free:
log("ERROR: Not enough space available on " + config.usb_disk)

View File

@ -67,23 +67,23 @@ def create_persistence():
if platform.system() == 'Linux':
mkfs = 'mkfs.ext3'
dd = 'dd'
persistence_mkfs_cmd = mkfs + ' -F ' + os.path.join(config.usb_mount, 'multibootusb',
persistence_mkfs_cmd = mkfs + ' -F ' + gen.quote(os.path.join(config.usb_mount, 'multibootusb',
iso.iso_basename(config.image_path),
fs_name)
fs_name))
elif platform.system() == 'Windows':
mkfs = gen.quote(gen.resource_path(os.path.join("data", "tools", "mkfs", "mke2fs.exe")))
dd = gen.quote(gen.resource_path(os.path.join("data", "tools", "dd", "dd.exe")))
persistence_mkfs_cmd = 'echo y|' + mkfs + ' -b 1024 -L ' + fs_name + ' ' + os.path.join(config.usb_mount, 'multibootusb',
iso.iso_basename(config.image_path), fs_name)
persistence_mkfs_cmd = 'echo y|' + mkfs + ' -b 1024 -L ' + fs_name + ' ' + gen.quote(os.path.join(config.usb_mount, 'multibootusb',
iso.iso_basename(config.image_path), fs_name))
if config.distro == 'fedora':
persistence_dd_cmd = dd + ' if=/dev/zero ' \
'of=' + os.path.join(config.usb_mount, 'multibootusb',
iso.iso_basename(config.image_path), 'LiveOS', fs_name) + \
'of=' + gen.quote(os.path.join(config.usb_mount, 'multibootusb',
iso.iso_basename(config.image_path), 'LiveOS', fs_name)) + \
' bs=1M count=' + str(int(persistence))
else:
persistence_dd_cmd = dd + ' if=/dev/zero of=' + os.path.join(config.usb_mount, 'multibootusb',
iso.iso_basename(config.image_path), fs_name) +\
persistence_dd_cmd = dd + ' if=/dev/zero of=' + gen.quote(os.path.join(config.usb_mount, 'multibootusb',
iso.iso_basename(config.image_path), fs_name)) +\
' bs=1M count=' + str(int(persistence))
gen.log('Executing ==>' + persistence_dd_cmd)

View File

@ -63,7 +63,7 @@ def syslinux_default(usb_disk, version=4):
config.status_text = 'Installing mbr...'
log ('\nExecuting ==> ' + mbr_install_cmd)
if subprocess.call(mbr_install_cmd, shell=True) == 0:
config.status_text = 'mbr install is success...'
config.status_text = 'mbr install is successful...'
log("\nmbr install is success...\n")
if set_boot_flag(usb_disk) is True:
return True
@ -158,13 +158,13 @@ def syslinux_distro_dir(usb_disk, iso_link, distro):
log ("Executing ==> " + sys_cmd)
config.status_text = 'Installing distro specific syslinux...'
if subprocess.call(sys_cmd, shell=True) == 0:
config.status_text = 'Syslinux install on distro directory is success...'
log ("\nSyslinux install on distro directory is success...\n")
config.status_text = 'Syslinux install on distro directory is successful...'
log ("\nSyslinux install on distro directory is successful...\n")
log ('Executing ==> ' + dd_cmd + '\n')
config.status_text = 'Copying boot sector...'
if subprocess.call(dd_cmd, shell=True) == 0:
config.status_text = 'Bootsector copy is success...'
log ("\nBootsector copy is success...\n")
config.status_text = 'Bootsector copy is successful...'
log ("\nBootsector copy is successful...\n")
else:
config.status_text = 'Failed to copy boot sector...'
log ("\nFailed to copy boot sector...\n")
@ -182,7 +182,7 @@ def syslinux_distro_dir(usb_disk, iso_link, distro):
log("\nExecuting ==> " + sys_cmd + '\n')
config.status_text = 'Installing distro specific syslinux...'
if subprocess.call(sys_cmd, shell=True) == 0:
config.status_text = 'Syslinux install on distro directory is success...'
config.status_text = 'Syslinux install on distro directory is successful...'
log ("\nSyslinux install was successful on distro directory...\n")
else:
config.status_text = 'Failed to install syslinux on distro directory...'
@ -197,10 +197,10 @@ def syslinux_distro_dir(usb_disk, iso_link, distro):
subprocess.call('chmod +x ' + syslinux_path, shell=True) == 0
log ("Executing ==> " + ext_cmd)
if subprocess.call(ext_cmd, shell=True) == 0:
log ("\nSyslinux install on distro directory is success...\n")
log ("\nSyslinux install on distro directory is successful...\n")
log ('Executing ==> ' + dd_cmd, '\n')
if subprocess.call(dd_cmd, shell=True) == 0:
log ("\nBootsector copy is success...\n")
log ("\nBootsector copy is successful...\n")
else:
log ("\nFailed to install syslinux on distro directory...\n")

View File

@ -327,7 +327,7 @@ def update_mbusb_cfg_file(iso_link, usb_uuid, usb_mount, distro):
"fromusb root=UUID=" + usb_uuid + " bootfromiso=/multibootusb/" +
iso_basename(iso_link) + "/" + iso_name(iso_link) + " initrd=/multibootusb/"
+ iso_basename(iso_link) + '/isolinux/initrd.gz' + "\n")
elif distro == "mentest":
elif distro == "memtest":
config_file.write("kernel " + '/multibootusb/' + iso_basename(iso_link) + '/BOOT/MEMTEST.IMG\n')
elif distro == "sgrubd2" or config.distro == 'raw_iso':