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

Merge pull request #153 from alindt/fixes

re-enable GUI controls
uninstall: don't treat ldlinux.* files differently
grub.py: display human readable size
copy_mbusb_dir_usb() only after user agrees
rework imager tab
use os.sync()
code cleanup
remove old GUI files
This commit is contained in:
multibootusb 2017-05-03 19:54:32 +05:30 committed by GitHub
commit 323e75832e
17 changed files with 148 additions and 1789 deletions

View File

@ -80,7 +80,7 @@ def list_iso(iso_link, suppress_out=True):
if '.....' in line:
if gen.has_digit(line[2]) or gen.has_digit(line[4]):
if len(line) > 6:
f_path = " ".join(line[5:len(line)])
f_path = " ".join(line[5:])
file_list.append(f_path)
else:
f_path = line[-1]
@ -115,10 +115,7 @@ def test_iso(iso_link, suppress_out=True):
rc = subprocess.call(_cmd, shell=True)
if rc == 0 or rc == 1:
return True
else:
return False
return bool(rc in [0, 1])
if __name__ == '__main__':

View File

@ -86,7 +86,10 @@ def runAsAdmin(cmdLine=None, wait=True):
# raise RuntimeError, "This function is only implemented on Windows."
if platform.system() == "Windows":
import win32api, win32con, win32event, win32process
import win32api
import win32con
import win32event
import win32process
from win32com.shell.shell import ShellExecuteEx
from win32com.shell import shellcon

View File

@ -112,10 +112,7 @@ def is_quoted(text):
:param text: Any word or sentence with or without quote.
:return: True if text is quoted else False.
"""
if text.startswith("\"") and text.endswith("\""):
return True
else:
return False
return bool(text.startswith("\"") and text.endswith("\""))
def has_digit(word):
@ -266,10 +263,8 @@ def size_not_enough(iso_link, usb_disk):
isoSize = iso_size(iso_link)
usb_details = details(usb_disk)
usb_size = usb_details['size_free']
if isoSize > usb_size:
return True
else:
return False
return bool(isoSize > usb_size)
def mbusb_version():
@ -339,12 +334,12 @@ def prepare_mbusb_host_dir():
log("Removing junk files...")
for files in os.listdir(os.path.join(home, "iso_cfg_ext_dir")):
if os.path.isdir(os.path.join(os.path.join(home, "iso_cfg_ext_dir", files))):
log (os.path.join(os.path.join(home, "iso_cfg_ext_dir", files)))
log(os.path.join(os.path.join(home, "iso_cfg_ext_dir", files)))
os.chmod(os.path.join(os.path.join(home, "iso_cfg_ext_dir", files)), 0o777)
shutil.rmtree(os.path.join(os.path.join(home, "iso_cfg_ext_dir", files)))
else:
try:
log (os.path.join(os.path.join(home, "iso_cfg_ext_dir", files)))
log(os.path.join(os.path.join(home, "iso_cfg_ext_dir", files)))
os.chmod(os.path.join(os.path.join(home, "iso_cfg_ext_dir", files)), 0o777)
os.unlink(os.path.join(os.path.join(home, "iso_cfg_ext_dir", files)))
os.remove(os.path.join(os.path.join(home, "iso_cfg_ext_dir", files)))

View File

@ -11,6 +11,7 @@ from . import config
from . import iso
from . import _7zip
from . import gen
from .usb import bytes2human
def mbusb_update_grub_cfg():
@ -141,9 +142,9 @@ def get_grub_cfg(iso_link, efi=True):
def grub_custom_menu(mbus_grub_cfg_path, distro):
iso_size_mb = iso.iso_size(config.image_path) / (1024.0 * 1024.0)
iso_size_mb = bytes2human(iso.iso_size(config.image_path))
gen.log('size of the ISO is ' + str(iso_size_mb))
if distro == 'sgrubd2' or distro == 'raw_iso':
if distro in ['sgrubd2', 'raw_iso']:
grub_raw_iso(mbus_grub_cfg_path)
'''

View File

@ -308,7 +308,7 @@
<bool>false</bool>
</property>
<property name="currentIndex">
<number>0</number>
<number>1</number>
</property>
<widget class="QWidget" name="tab_multibootusb">
<property name="enabled">
@ -351,7 +351,7 @@
</property>
<property name="icon">
<iconset>
<normaloff>:/icon_uninstall</normaloff>:/icon_uninstall</iconset>
<normaloff>:/icon_uninstall</normaloff>:/icon_uninstall</iconset>
</property>
<property name="iconSize">
<size>
@ -374,7 +374,7 @@
</property>
<property name="icon">
<iconset>
<normaloff>:/icon_install</normaloff>:/icon_install</iconset>
<normaloff>:/icon_install</normaloff>:/icon_install</iconset>
</property>
<property name="iconSize">
<size>
@ -483,7 +483,7 @@
<property name="bottomMargin">
<number>5</number>
</property>
<item row="1" column="2">
<item row="3" column="2">
<spacer name="horizontalSpacer_7">
<property name="orientation">
<enum>Qt::Horizontal</enum>
@ -496,14 +496,14 @@
</property>
</spacer>
</item>
<item row="1" column="1">
<item row="3" column="1">
<widget class="QPushButton" name="button_write_image_to_disk">
<property name="text">
<string>Write image to USB</string>
</property>
</widget>
</item>
<item row="1" column="3" colspan="2">
<item row="3" column="3" colspan="2">
<widget class="QWidget" name="widget_7" native="true">
<layout class="QVBoxLayout" name="verticalLayout_6">
<property name="leftMargin">
@ -521,7 +521,7 @@
</layout>
</widget>
</item>
<item row="1" column="0">
<item row="3" column="0">
<spacer name="horizontalSpacer_5">
<property name="orientation">
<enum>Qt::Horizontal</enum>
@ -534,8 +534,28 @@
</property>
</spacer>
</item>
<item row="4" column="1">
<spacer name="verticalSpacer_3">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="1">
<widget class="QLabel" name="label_6">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;center&quot;&gt;&lt;span style=&quot; font-size:14pt; font-weight:600; color:#ff0000;&quot;&gt;WARNING!&lt;/span&gt;&lt;/p&gt;&lt;p align=&quot;center&quot;&gt;&lt;span style=&quot; color:#000000;&quot;&gt;This operation destroys &lt;/span&gt;&lt;span style=&quot; font-weight:600; color:#000000;&quot;&gt;ALL&lt;/span&gt;&lt;span style=&quot; color:#000000;&quot;&gt; data on the selected disk.&lt;/span&gt;&lt;/p&gt;&lt;p align=&quot;center&quot;&gt;&lt;span style=&quot; color:#000000;&quot;&gt;Please select the destination disk carefully.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item row="0" column="1">
<spacer name="verticalSpacer_4">
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
@ -548,7 +568,7 @@
</spacer>
</item>
<item row="2" column="1">
<spacer name="verticalSpacer_5">
<spacer name="verticalSpacer_4">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>

File diff suppressed because it is too large Load Diff

View File

@ -1,519 +0,0 @@
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'gui/multibootusb.ui'
#
# Created by: PyQt5 UI code generator 5.5.1
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_Dialog(object):
def setupUi(self, Dialog):
Dialog.setObjectName("Dialog")
Dialog.resize(717, 516)
self.horizontalLayout = QtWidgets.QHBoxLayout(Dialog)
self.horizontalLayout.setObjectName("horizontalLayout")
self.tabWidget = QtWidgets.QTabWidget(Dialog)
self.tabWidget.setEnabled(True)
self.tabWidget.setObjectName("tabWidget")
self.tab_3 = QtWidgets.QWidget()
self.tab_3.setEnabled(True)
self.tab_3.setObjectName("tab_3")
self.horizontalLayout_2 = QtWidgets.QHBoxLayout(self.tab_3)
self.horizontalLayout_2.setContentsMargins(0, 0, 0, 0)
self.horizontalLayout_2.setObjectName("horizontalLayout_2")
self.gridLayout = QtWidgets.QGridLayout()
self.gridLayout.setContentsMargins(5, 5, 5, 5)
self.gridLayout.setObjectName("gridLayout")
self.groupBox_6 = QtWidgets.QGroupBox(self.tab_3)
self.groupBox_6.setAlignment(QtCore.Qt.AlignBottom|QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing)
self.groupBox_6.setFlat(False)
self.groupBox_6.setCheckable(False)
self.groupBox_6.setObjectName("groupBox_6")
self.formLayout = QtWidgets.QFormLayout(self.groupBox_6)
self.formLayout.setLabelAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
self.formLayout.setObjectName("formLayout")
self.label_usb_dev = QtWidgets.QLabel(self.groupBox_6)
self.label_usb_dev.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
self.label_usb_dev.setObjectName("label_usb_dev")
self.formLayout.setWidget(0, QtWidgets.QFormLayout.LabelRole, self.label_usb_dev)
self.usb_dev = QtWidgets.QLabel(self.groupBox_6)
self.usb_dev.setText("")
self.usb_dev.setObjectName("usb_dev")
self.formLayout.setWidget(0, QtWidgets.QFormLayout.FieldRole, self.usb_dev)
self.label_usb_vendor = QtWidgets.QLabel(self.groupBox_6)
self.label_usb_vendor.setObjectName("label_usb_vendor")
self.formLayout.setWidget(1, QtWidgets.QFormLayout.LabelRole, self.label_usb_vendor)
self.usb_vendor = QtWidgets.QLabel(self.groupBox_6)
self.usb_vendor.setText("")
self.usb_vendor.setObjectName("usb_vendor")
self.formLayout.setWidget(1, QtWidgets.QFormLayout.FieldRole, self.usb_vendor)
self.label_usb_model = QtWidgets.QLabel(self.groupBox_6)
self.label_usb_model.setObjectName("label_usb_model")
self.formLayout.setWidget(2, QtWidgets.QFormLayout.LabelRole, self.label_usb_model)
self.label_usb_size = QtWidgets.QLabel(self.groupBox_6)
self.label_usb_size.setFrameShape(QtWidgets.QFrame.NoFrame)
self.label_usb_size.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
self.label_usb_size.setObjectName("label_usb_size")
self.formLayout.setWidget(3, QtWidgets.QFormLayout.LabelRole, self.label_usb_size)
self.label_usb_mount = QtWidgets.QLabel(self.groupBox_6)
self.label_usb_mount.setObjectName("label_usb_mount")
self.formLayout.setWidget(4, QtWidgets.QFormLayout.LabelRole, self.label_usb_mount)
self.usb_model = QtWidgets.QLabel(self.groupBox_6)
self.usb_model.setText("")
self.usb_model.setObjectName("usb_model")
self.formLayout.setWidget(2, QtWidgets.QFormLayout.FieldRole, self.usb_model)
self.usb_size = QtWidgets.QLabel(self.groupBox_6)
self.usb_size.setText("")
self.usb_size.setObjectName("usb_size")
self.formLayout.setWidget(3, QtWidgets.QFormLayout.FieldRole, self.usb_size)
self.usb_mount = QtWidgets.QLabel(self.groupBox_6)
self.usb_mount.setText("")
self.usb_mount.setObjectName("usb_mount")
self.formLayout.setWidget(4, QtWidgets.QFormLayout.FieldRole, self.usb_mount)
self.gridLayout.addWidget(self.groupBox_6, 2, 0, 1, 5)
self.close = QtWidgets.QPushButton(self.tab_3)
self.close.setObjectName("close")
self.gridLayout.addWidget(self.close, 9, 6, 1, 1)
spacerItem = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
self.gridLayout.addItem(spacerItem, 8, 0, 1, 1)
self.browse_iso = QtWidgets.QPushButton(self.tab_3)
self.browse_iso.setCheckable(False)
self.browse_iso.setFlat(False)
self.browse_iso.setObjectName("browse_iso")
self.gridLayout.addWidget(self.browse_iso, 4, 4, 1, 1)
self.listWidget = QtWidgets.QListWidget(self.tab_3)
self.listWidget.setFrameShape(QtWidgets.QFrame.StyledPanel)
self.listWidget.setFrameShadow(QtWidgets.QFrame.Sunken)
self.listWidget.setResizeMode(QtWidgets.QListView.Fixed)
self.listWidget.setObjectName("listWidget")
self.gridLayout.addWidget(self.listWidget, 1, 5, 8, 2)
self.label_persistence = QtWidgets.QLabel(self.tab_3)
self.label_persistence.setEnabled(False)
self.label_persistence.setMouseTracking(True)
self.label_persistence.setStyleSheet("font-weight: 600")
self.label_persistence.setObjectName("label_persistence")
self.gridLayout.addWidget(self.label_persistence, 6, 0, 1, 1)
self.lineEdit = QtWidgets.QLineEdit(self.tab_3)
self.lineEdit.setObjectName("lineEdit")
self.gridLayout.addWidget(self.lineEdit, 4, 0, 1, 4)
self.detect_usb = QtWidgets.QPushButton(self.tab_3)
self.detect_usb.setObjectName("detect_usb")
self.gridLayout.addWidget(self.detect_usb, 1, 2, 1, 2)
self.uninstall = QtWidgets.QPushButton(self.tab_3)
self.uninstall.setObjectName("uninstall")
self.gridLayout.addWidget(self.uninstall, 0, 5, 1, 2)
self.comboBox = QtWidgets.QComboBox(self.tab_3)
self.comboBox.setObjectName("comboBox")
self.gridLayout.addWidget(self.comboBox, 1, 0, 1, 2)
self.slider_persistence = QtWidgets.QSlider(self.tab_3)
self.slider_persistence.setEnabled(False)
self.slider_persistence.setAutoFillBackground(False)
self.slider_persistence.setOrientation(QtCore.Qt.Horizontal)
self.slider_persistence.setTickPosition(QtWidgets.QSlider.TicksBothSides)
self.slider_persistence.setObjectName("slider_persistence")
self.gridLayout.addWidget(self.slider_persistence, 6, 1, 1, 3)
spacerItem1 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
self.gridLayout.addItem(spacerItem1, 8, 2, 1, 2)
self.checkBox_all_drives = QtWidgets.QCheckBox(self.tab_3)
self.checkBox_all_drives.setObjectName("checkBox_all_drives")
self.gridLayout.addWidget(self.checkBox_all_drives, 1, 4, 1, 1)
self.label_persistence_value = QtWidgets.QLabel(self.tab_3)
self.label_persistence_value.setEnabled(False)
self.label_persistence_value.setObjectName("label_persistence_value")
self.gridLayout.addWidget(self.label_persistence_value, 6, 4, 1, 1)
spacerItem2 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
self.gridLayout.addItem(spacerItem2, 8, 1, 1, 1)
self.create = QtWidgets.QPushButton(self.tab_3)
self.create.setObjectName("create")
self.gridLayout.addWidget(self.create, 7, 4, 1, 1)
self.progressBar = QtWidgets.QProgressBar(self.tab_3)
self.progressBar.setProperty("value", 0)
self.progressBar.setInvertedAppearance(False)
self.progressBar.setObjectName("progressBar")
self.gridLayout.addWidget(self.progressBar, 7, 0, 1, 4)
self.status = QtWidgets.QLabel(self.tab_3)
self.status.setMinimumSize(QtCore.QSize(0, 0))
self.status.setAcceptDrops(False)
self.status.setAutoFillBackground(False)
self.status.setFrameShadow(QtWidgets.QFrame.Plain)
self.status.setTextFormat(QtCore.Qt.AutoText)
self.status.setScaledContents(False)
self.status.setObjectName("status")
self.gridLayout.addWidget(self.status, 9, 0, 1, 6)
self.labelstep1 = QtWidgets.QLabel(self.tab_3)
self.labelstep1.setStyleSheet("font-weight: 600; margin-top:15")
self.labelstep1.setObjectName("labelstep1")
self.gridLayout.addWidget(self.labelstep1, 0, 0, 1, 5)
self.labelstep2 = QtWidgets.QLabel(self.tab_3)
self.labelstep2.setStyleSheet("font-weight: 600; margin-top:15")
self.labelstep2.setObjectName("labelstep2")
self.gridLayout.addWidget(self.labelstep2, 3, 0, 1, 5)
self.labelstep3 = QtWidgets.QLabel(self.tab_3)
self.labelstep3.setStyleSheet("font-weight: 600; margin-top:15")
self.labelstep3.setObjectName("labelstep3")
self.gridLayout.addWidget(self.labelstep3, 5, 0, 1, 5)
self.horizontalLayout_2.addLayout(self.gridLayout)
self.tabWidget.addTab(self.tab_3, "")
self.imager = QtWidgets.QWidget()
self.imager.setEnabled(True)
self.imager.setObjectName("imager")
self.horizontalLayout_7 = QtWidgets.QHBoxLayout(self.imager)
self.horizontalLayout_7.setContentsMargins(0, 0, 0, 0)
self.horizontalLayout_7.setObjectName("horizontalLayout_7")
self.gridLayout_9 = QtWidgets.QGridLayout()
self.gridLayout_9.setContentsMargins(5, 5, 5, 5)
self.gridLayout_9.setObjectName("gridLayout_9")
self.widget_7 = QtWidgets.QWidget(self.imager)
self.widget_7.setObjectName("widget_7")
self.verticalLayout_6 = QtWidgets.QVBoxLayout(self.widget_7)
self.verticalLayout_6.setContentsMargins(5, 5, 5, 5)
self.verticalLayout_6.setObjectName("verticalLayout_6")
self.gridLayout_11 = QtWidgets.QGridLayout()
self.gridLayout_11.setObjectName("gridLayout_11")
self.groupBox_10 = QtWidgets.QGroupBox(self.widget_7)
self.groupBox_10.setObjectName("groupBox_10")
self.verticalLayout_9 = QtWidgets.QVBoxLayout(self.groupBox_10)
self.verticalLayout_9.setObjectName("verticalLayout_9")
self.pushButton = QtWidgets.QPushButton(self.groupBox_10)
self.pushButton.setObjectName("pushButton")
self.verticalLayout_9.addWidget(self.pushButton)
self.lineEdit_3 = QtWidgets.QLineEdit(self.groupBox_10)
self.lineEdit_3.setObjectName("lineEdit_3")
self.verticalLayout_9.addWidget(self.lineEdit_3)
self.imager_bootable = QtWidgets.QLabel(self.groupBox_10)
self.imager_bootable.setObjectName("imager_bootable")
self.verticalLayout_9.addWidget(self.imager_bootable)
self.imager_iso_size = QtWidgets.QLabel(self.groupBox_10)
self.imager_iso_size.setObjectName("imager_iso_size")
self.verticalLayout_9.addWidget(self.imager_iso_size)
spacerItem3 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
self.verticalLayout_9.addItem(spacerItem3)
self.gridLayout_11.addWidget(self.groupBox_10, 0, 1, 1, 1)
spacerItem4 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
self.gridLayout_11.addItem(spacerItem4, 1, 0, 1, 1)
self.groupBox_9 = QtWidgets.QGroupBox(self.widget_7)
self.groupBox_9.setStyleSheet("")
self.groupBox_9.setObjectName("groupBox_9")
self.verticalLayout_8 = QtWidgets.QVBoxLayout(self.groupBox_9)
self.verticalLayout_8.setObjectName("verticalLayout_8")
self.comboBox_2 = QtWidgets.QComboBox(self.groupBox_9)
self.comboBox_2.setObjectName("comboBox_2")
self.verticalLayout_8.addWidget(self.comboBox_2)
self.pushbtn_imager_refreshusb = QtWidgets.QPushButton(self.groupBox_9)
self.pushbtn_imager_refreshusb.setObjectName("pushbtn_imager_refreshusb")
self.verticalLayout_8.addWidget(self.pushbtn_imager_refreshusb)
self.formLayout_3 = QtWidgets.QFormLayout()
self.formLayout_3.setLabelAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
self.formLayout_3.setObjectName("formLayout_3")
self.label_imager_disk_label = QtWidgets.QLabel(self.groupBox_9)
self.label_imager_disk_label.setObjectName("label_imager_disk_label")
self.formLayout_3.setWidget(0, QtWidgets.QFormLayout.LabelRole, self.label_imager_disk_label)
self.label_imager_total_size = QtWidgets.QLabel(self.groupBox_9)
self.label_imager_total_size.setObjectName("label_imager_total_size")
self.formLayout_3.setWidget(1, QtWidgets.QFormLayout.LabelRole, self.label_imager_total_size)
self.label_imager_uuid = QtWidgets.QLabel(self.groupBox_9)
self.label_imager_uuid.setObjectName("label_imager_uuid")
self.formLayout_3.setWidget(2, QtWidgets.QFormLayout.LabelRole, self.label_imager_uuid)
self.imager_disk_label = QtWidgets.QLabel(self.groupBox_9)
self.imager_disk_label.setText("")
self.imager_disk_label.setObjectName("imager_disk_label")
self.formLayout_3.setWidget(0, QtWidgets.QFormLayout.FieldRole, self.imager_disk_label)
self.imager_total_size = QtWidgets.QLabel(self.groupBox_9)
self.imager_total_size.setText("")
self.imager_total_size.setObjectName("imager_total_size")
self.formLayout_3.setWidget(1, QtWidgets.QFormLayout.FieldRole, self.imager_total_size)
self.imager_uuid = QtWidgets.QLabel(self.groupBox_9)
self.imager_uuid.setText("")
self.imager_uuid.setObjectName("imager_uuid")
self.formLayout_3.setWidget(2, QtWidgets.QFormLayout.FieldRole, self.imager_uuid)
self.verticalLayout_8.addLayout(self.formLayout_3)
spacerItem5 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
self.verticalLayout_8.addItem(spacerItem5)
self.gridLayout_11.addWidget(self.groupBox_9, 0, 0, 1, 1)
self.verticalLayout_6.addLayout(self.gridLayout_11)
self.imager_label_status = QtWidgets.QLabel(self.widget_7)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.imager_label_status.sizePolicy().hasHeightForWidth())
self.imager_label_status.setSizePolicy(sizePolicy)
self.imager_label_status.setObjectName("imager_label_status")
self.verticalLayout_6.addWidget(self.imager_label_status)
self.gridLayout_12 = QtWidgets.QGridLayout()
self.gridLayout_12.setObjectName("gridLayout_12")
self.label_10 = QtWidgets.QLabel(self.widget_7)
self.label_10.setObjectName("label_10")
self.gridLayout_12.addWidget(self.label_10, 1, 0, 1, 3)
self.imager_progressbar = QtWidgets.QProgressBar(self.widget_7)
self.imager_progressbar.setProperty("value", 0)
self.imager_progressbar.setObjectName("imager_progressbar")
self.gridLayout_12.addWidget(self.imager_progressbar, 0, 0, 1, 3)
self.imager_write = QtWidgets.QPushButton(self.widget_7)
self.imager_write.setObjectName("imager_write")
self.gridLayout_12.addWidget(self.imager_write, 2, 2, 1, 1)
self.verticalLayout_6.addLayout(self.gridLayout_12)
self.gridLayout_9.addWidget(self.widget_7, 0, 0, 1, 2)
self.imager_close = QtWidgets.QPushButton(self.imager)
self.imager_close.setObjectName("imager_close")
self.gridLayout_9.addWidget(self.imager_close, 1, 1, 1, 1)
spacerItem6 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
self.gridLayout_9.addItem(spacerItem6, 1, 0, 1, 1)
self.horizontalLayout_7.addLayout(self.gridLayout_9)
self.tabWidget.addTab(self.imager, "")
self.syslinux_ab = QtWidgets.QWidget()
self.syslinux_ab.setObjectName("syslinux_ab")
self.horizontalLayout_3 = QtWidgets.QHBoxLayout(self.syslinux_ab)
self.horizontalLayout_3.setObjectName("horizontalLayout_3")
self.gridLayout_2 = QtWidgets.QGridLayout()
self.gridLayout_2.setObjectName("gridLayout_2")
self.groupBox_2 = QtWidgets.QGroupBox(self.syslinux_ab)
self.groupBox_2.setAutoFillBackground(False)
self.groupBox_2.setObjectName("groupBox_2")
self.horizontalLayout_4 = QtWidgets.QHBoxLayout(self.groupBox_2)
self.horizontalLayout_4.setObjectName("horizontalLayout_4")
self.gridLayout_3 = QtWidgets.QGridLayout()
self.gridLayout_3.setObjectName("gridLayout_3")
self.install_sys_only = QtWidgets.QRadioButton(self.groupBox_2)
self.install_sys_only.setObjectName("install_sys_only")
self.gridLayout_3.addWidget(self.install_sys_only, 0, 0, 1, 1)
self.install_sys_all = QtWidgets.QRadioButton(self.groupBox_2)
self.install_sys_all.setObjectName("install_sys_all")
self.gridLayout_3.addWidget(self.install_sys_all, 1, 0, 1, 1)
self.install_syslinux = QtWidgets.QPushButton(self.groupBox_2)
self.install_syslinux.setObjectName("install_syslinux")
self.gridLayout_3.addWidget(self.install_syslinux, 0, 2, 2, 1)
spacerItem7 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
self.gridLayout_3.addItem(spacerItem7, 0, 1, 2, 1)
self.horizontalLayout_4.addLayout(self.gridLayout_3)
self.gridLayout_2.addWidget(self.groupBox_2, 0, 0, 1, 1)
spacerItem8 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
self.gridLayout_2.addItem(spacerItem8, 3, 0, 1, 1)
self.groupBox_3 = QtWidgets.QGroupBox(self.syslinux_ab)
self.groupBox_3.setObjectName("groupBox_3")
self.horizontalLayout_5 = QtWidgets.QHBoxLayout(self.groupBox_3)
self.horizontalLayout_5.setObjectName("horizontalLayout_5")
self.gridLayout_4 = QtWidgets.QGridLayout()
self.gridLayout_4.setObjectName("gridLayout_4")
self.edit_syslinux = QtWidgets.QPushButton(self.groupBox_3)
self.edit_syslinux.setObjectName("edit_syslinux")
self.gridLayout_4.addWidget(self.edit_syslinux, 0, 2, 1, 1)
self.label_2 = QtWidgets.QLabel(self.groupBox_3)
self.label_2.setObjectName("label_2")
self.gridLayout_4.addWidget(self.label_2, 0, 0, 1, 1)
spacerItem9 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
self.gridLayout_4.addItem(spacerItem9, 0, 1, 1, 1)
self.horizontalLayout_5.addLayout(self.gridLayout_4)
self.gridLayout_2.addWidget(self.groupBox_3, 2, 0, 1, 1)
spacerItem10 = QtWidgets.QSpacerItem(20, 20, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Fixed)
self.gridLayout_2.addItem(spacerItem10, 1, 0, 1, 1)
self.horizontalLayout_3.addLayout(self.gridLayout_2)
self.tabWidget.addTab(self.syslinux_ab, "")
self.tab = QtWidgets.QWidget()
self.tab.setObjectName("tab")
self.verticalLayout_2 = QtWidgets.QVBoxLayout(self.tab)
self.verticalLayout_2.setObjectName("verticalLayout_2")
self.groupBox_5 = QtWidgets.QGroupBox(self.tab)
self.groupBox_5.setObjectName("groupBox_5")
self.verticalLayout_3 = QtWidgets.QVBoxLayout(self.groupBox_5)
self.verticalLayout_3.setObjectName("verticalLayout_3")
self.gridLayout_7 = QtWidgets.QGridLayout()
self.gridLayout_7.setObjectName("gridLayout_7")
spacerItem11 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
self.gridLayout_7.addItem(spacerItem11, 3, 0, 1, 1)
spacerItem12 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
self.gridLayout_7.addItem(spacerItem12, 1, 6, 1, 1)
self.boot_iso_qemu = QtWidgets.QPushButton(self.groupBox_5)
self.boot_iso_qemu.setObjectName("boot_iso_qemu")
self.gridLayout_7.addWidget(self.boot_iso_qemu, 3, 6, 1, 1)
self.browse_iso_qemu = QtWidgets.QPushButton(self.groupBox_5)
self.browse_iso_qemu.setObjectName("browse_iso_qemu")
self.gridLayout_7.addWidget(self.browse_iso_qemu, 0, 6, 1, 1)
self.lineEdit_2 = QtWidgets.QLineEdit(self.groupBox_5)
self.lineEdit_2.setObjectName("lineEdit_2")
self.gridLayout_7.addWidget(self.lineEdit_2, 0, 0, 1, 6)
spacerItem13 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
self.gridLayout_7.addItem(spacerItem13, 2, 6, 1, 1)
self.label_3 = QtWidgets.QLabel(self.groupBox_5)
self.label_3.setObjectName("label_3")
self.gridLayout_7.addWidget(self.label_3, 2, 0, 1, 1)
self.ram_iso_256 = QtWidgets.QRadioButton(self.groupBox_5)
self.ram_iso_256.setObjectName("ram_iso_256")
self.gridLayout_7.addWidget(self.ram_iso_256, 2, 1, 1, 1)
self.ram_iso_512 = QtWidgets.QRadioButton(self.groupBox_5)
self.ram_iso_512.setObjectName("ram_iso_512")
self.gridLayout_7.addWidget(self.ram_iso_512, 2, 2, 1, 1)
self.ram_iso_768 = QtWidgets.QRadioButton(self.groupBox_5)
self.ram_iso_768.setObjectName("ram_iso_768")
self.gridLayout_7.addWidget(self.ram_iso_768, 2, 3, 1, 1)
self.ram_iso_1024 = QtWidgets.QRadioButton(self.groupBox_5)
self.ram_iso_1024.setObjectName("ram_iso_1024")
self.gridLayout_7.addWidget(self.ram_iso_1024, 2, 4, 1, 1)
self.ram_iso_2048 = QtWidgets.QRadioButton(self.groupBox_5)
self.ram_iso_2048.setObjectName("ram_iso_2048")
self.gridLayout_7.addWidget(self.ram_iso_2048, 2, 5, 1, 1)
self.verticalLayout_3.addLayout(self.gridLayout_7)
self.verticalLayout_2.addWidget(self.groupBox_5)
self.gridLayout_6 = QtWidgets.QGridLayout()
self.gridLayout_6.setObjectName("gridLayout_6")
self.groupBox_4 = QtWidgets.QGroupBox(self.tab)
self.groupBox_4.setStyleSheet("")
self.groupBox_4.setObjectName("groupBox_4")
self.verticalLayout_4 = QtWidgets.QVBoxLayout(self.groupBox_4)
self.verticalLayout_4.setObjectName("verticalLayout_4")
self.gridLayout_8 = QtWidgets.QGridLayout()
self.gridLayout_8.setObjectName("gridLayout_8")
self.ram_usb_2048 = QtWidgets.QRadioButton(self.groupBox_4)
self.ram_usb_2048.setObjectName("ram_usb_2048")
self.gridLayout_8.addWidget(self.ram_usb_2048, 0, 5, 1, 1)
spacerItem14 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
self.gridLayout_8.addItem(spacerItem14, 0, 6, 1, 1)
spacerItem15 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
self.gridLayout_8.addItem(spacerItem15, 1, 0, 1, 1)
self.boot_usb_qemu = QtWidgets.QPushButton(self.groupBox_4)
self.boot_usb_qemu.setObjectName("boot_usb_qemu")
self.gridLayout_8.addWidget(self.boot_usb_qemu, 1, 6, 1, 1)
self.ram_usb_256 = QtWidgets.QRadioButton(self.groupBox_4)
self.ram_usb_256.setObjectName("ram_usb_256")
self.gridLayout_8.addWidget(self.ram_usb_256, 0, 1, 1, 1)
self.ram_usb_768 = QtWidgets.QRadioButton(self.groupBox_4)
self.ram_usb_768.setObjectName("ram_usb_768")
self.gridLayout_8.addWidget(self.ram_usb_768, 0, 3, 1, 1)
self.label_4 = QtWidgets.QLabel(self.groupBox_4)
self.label_4.setObjectName("label_4")
self.gridLayout_8.addWidget(self.label_4, 0, 0, 1, 1)
self.ram_usb_512 = QtWidgets.QRadioButton(self.groupBox_4)
self.ram_usb_512.setObjectName("ram_usb_512")
self.gridLayout_8.addWidget(self.ram_usb_512, 0, 2, 1, 1)
self.ram_usb_1024 = QtWidgets.QRadioButton(self.groupBox_4)
self.ram_usb_1024.setObjectName("ram_usb_1024")
self.gridLayout_8.addWidget(self.ram_usb_1024, 0, 4, 1, 1)
self.verticalLayout_4.addLayout(self.gridLayout_8)
self.gridLayout_6.addWidget(self.groupBox_4, 0, 0, 1, 1)
self.verticalLayout_2.addLayout(self.gridLayout_6)
spacerItem16 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
self.verticalLayout_2.addItem(spacerItem16)
self.tabWidget.addTab(self.tab, "")
self.tab_2 = QtWidgets.QWidget()
self.tab_2.setObjectName("tab_2")
self.horizontalLayout_6 = QtWidgets.QHBoxLayout(self.tab_2)
self.horizontalLayout_6.setObjectName("horizontalLayout_6")
self.gridLayout_10 = QtWidgets.QGridLayout()
self.gridLayout_10.setObjectName("gridLayout_10")
spacerItem17 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Minimum)
self.gridLayout_10.addItem(spacerItem17, 0, 1, 1, 1)
spacerItem18 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
self.gridLayout_10.addItem(spacerItem18, 1, 0, 1, 1)
spacerItem19 = QtWidgets.QSpacerItem(20, 30, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Minimum)
self.gridLayout_10.addItem(spacerItem19, 2, 1, 1, 1)
self.label_5 = QtWidgets.QLabel(self.tab_2)
self.label_5.setObjectName("label_5")
self.gridLayout_10.addWidget(self.label_5, 1, 1, 1, 1)
spacerItem20 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
self.gridLayout_10.addItem(spacerItem20, 1, 2, 1, 1)
self.horizontalLayout_6.addLayout(self.gridLayout_10)
self.tabWidget.addTab(self.tab_2, "")
self.horizontalLayout.addWidget(self.tabWidget)
self.retranslateUi(Dialog)
self.tabWidget.setCurrentIndex(0)
QtCore.QMetaObject.connectSlotsByName(Dialog)
Dialog.setTabOrder(self.comboBox, self.detect_usb)
Dialog.setTabOrder(self.detect_usb, self.lineEdit)
Dialog.setTabOrder(self.lineEdit, self.slider_persistence)
Dialog.setTabOrder(self.slider_persistence, self.uninstall)
Dialog.setTabOrder(self.uninstall, self.listWidget)
Dialog.setTabOrder(self.listWidget, self.close)
Dialog.setTabOrder(self.close, self.comboBox_2)
Dialog.setTabOrder(self.comboBox_2, self.pushButton)
Dialog.setTabOrder(self.pushButton, self.pushbtn_imager_refreshusb)
Dialog.setTabOrder(self.pushbtn_imager_refreshusb, self.lineEdit_3)
Dialog.setTabOrder(self.lineEdit_3, self.imager_write)
Dialog.setTabOrder(self.imager_write, self.imager_close)
Dialog.setTabOrder(self.imager_close, self.install_sys_only)
Dialog.setTabOrder(self.install_sys_only, self.install_sys_all)
Dialog.setTabOrder(self.install_sys_all, self.install_syslinux)
Dialog.setTabOrder(self.install_syslinux, self.edit_syslinux)
Dialog.setTabOrder(self.edit_syslinux, self.lineEdit_2)
Dialog.setTabOrder(self.lineEdit_2, self.browse_iso_qemu)
Dialog.setTabOrder(self.browse_iso_qemu, self.ram_iso_256)
Dialog.setTabOrder(self.ram_iso_256, self.ram_iso_512)
Dialog.setTabOrder(self.ram_iso_512, self.ram_iso_768)
Dialog.setTabOrder(self.ram_iso_768, self.ram_iso_1024)
Dialog.setTabOrder(self.ram_iso_1024, self.ram_iso_2048)
Dialog.setTabOrder(self.ram_iso_2048, self.boot_iso_qemu)
Dialog.setTabOrder(self.boot_iso_qemu, self.ram_usb_256)
Dialog.setTabOrder(self.ram_usb_256, self.ram_usb_512)
Dialog.setTabOrder(self.ram_usb_512, self.ram_usb_768)
Dialog.setTabOrder(self.ram_usb_768, self.ram_usb_1024)
Dialog.setTabOrder(self.ram_usb_1024, self.ram_usb_2048)
Dialog.setTabOrder(self.ram_usb_2048, self.boot_usb_qemu)
Dialog.setTabOrder(self.boot_usb_qemu, self.tabWidget)
def retranslateUi(self, Dialog):
_translate = QtCore.QCoreApplication.translate
Dialog.setWindowTitle(_translate("Dialog", "multibootusb"))
self.groupBox_6.setTitle(_translate("Dialog", "USB Details"))
self.label_usb_dev.setText(_translate("Dialog", "Drive:"))
self.label_usb_vendor.setText(_translate("Dialog", "Vendor:"))
self.label_usb_model.setText(_translate("Dialog", "Model:"))
self.label_usb_size.setText(_translate("Dialog", "Size:"))
self.label_usb_mount.setText(_translate("Dialog", "Mount:"))
self.close.setText(_translate("Dialog", "Quit"))
self.browse_iso.setText(_translate("Dialog", "Browse ISO"))
self.label_persistence.setText(_translate("Dialog", "Persistence"))
self.detect_usb.setText(_translate("Dialog", "Detect Drives"))
self.uninstall.setText(_translate("Dialog", "Uninstall Distro"))
self.slider_persistence.setToolTip(_translate("Dialog", "Choose Persistence size. Not all distros supports persistence..."))
self.checkBox_all_drives.setText(_translate("Dialog", "All Drives"))
self.label_persistence_value.setText(_translate("Dialog", "0 MB"))
self.create.setText(_translate("Dialog", "Install"))
self.status.setText(_translate("Dialog", "Status: Idle"))
self.labelstep1.setText(_translate("Dialog", "Step 1 :: Select drive"))
self.labelstep2.setText(_translate("Dialog", "Step 2 :: Select ISO"))
self.labelstep3.setText(_translate("Dialog", "Step 3 :: Install distro"))
self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_3), _translate("Dialog", "MultiBootUSB"))
self.groupBox_10.setTitle(_translate("Dialog", "Select image"))
self.pushButton.setText(_translate("Dialog", "Browse image..."))
self.imager_bootable.setText(_translate("Dialog", "Bootable ISO"))
self.imager_iso_size.setText(_translate("Dialog", "Image Size"))
self.groupBox_9.setTitle(_translate("Dialog", "Select USB Drive"))
self.pushbtn_imager_refreshusb.setText(_translate("Dialog", "Refresh USB"))
self.label_imager_disk_label.setText(_translate("Dialog", "Disk Type:"))
self.label_imager_total_size.setText(_translate("Dialog", "Disk Size:"))
self.label_imager_uuid.setText(_translate("Dialog", "Disk Label:"))
self.imager_label_status.setText(_translate("Dialog", "Status: Idle"))
self.label_10.setText(_translate("Dialog", "<html><head/><body><p><span style=\" font-weight:600; color:#ff0000;\">WARNING</span> : Any bootable USB made using<span style=\" font-weight:600;\"> ISO Imager will destroy all data </span>on the selected USB disk. </p><p>Use it at your own risk. Developers are not responsile for loss of any data.</p></body></html>"))
self.imager_write.setText(_translate("Dialog", "Write Image"))
self.imager_close.setText(_translate("Dialog", "Quit"))
self.tabWidget.setTabText(self.tabWidget.indexOf(self.imager), _translate("Dialog", "Write Image to USB"))
self.groupBox_2.setTitle(_translate("Dialog", "Install Syslinux"))
self.install_sys_only.setText(_translate("Dialog", "Install only syslinu&x (existing configurations will not be altered)."))
self.install_sys_all.setText(_translate("Dialog", "Install syslinux and copy all re&quired files."))
self.install_syslinux.setText(_translate("Dialog", "Install"))
self.groupBox_3.setTitle(_translate("Dialog", "Edit syslinux.cfg"))
self.edit_syslinux.setText(_translate("Dialog", "Edit"))
self.label_2.setText(_translate("Dialog", "<html><head/><body><p align=\"justify\">Edit syslinux.cfg file directly using the default editor of your system. </p><p align=\"justify\">Be <span style=\" font-weight:600; color:#ff0000;\">CAREFUL</span> while editing syslinux.cfg!</p></body></html>"))
self.tabWidget.setTabText(self.tabWidget.indexOf(self.syslinux_ab), _translate("Dialog", "Install Syslinux"))
self.groupBox_5.setTitle(_translate("Dialog", "Boot ISO :: Test bootable ISOs without reboot"))
self.boot_iso_qemu.setText(_translate("Dialog", "Boot ISO"))
self.browse_iso_qemu.setText(_translate("Dialog", "Browse ISO"))
self.label_3.setText(_translate("Dialog", "Choose RAM size:"))
self.ram_iso_256.setText(_translate("Dialog", "&256 MB"))
self.ram_iso_512.setText(_translate("Dialog", "&512 MB"))
self.ram_iso_768.setText(_translate("Dialog", "&768 MB"))
self.ram_iso_1024.setText(_translate("Dialog", "&1024 MB"))
self.ram_iso_2048.setText(_translate("Dialog", "204&8 MB"))
self.groupBox_4.setTitle(_translate("Dialog", "Boot USB :: Test bootable USB drive without reboot"))
self.ram_usb_2048.setText(_translate("Dialog", "20&48 MB"))
self.boot_usb_qemu.setText(_translate("Dialog", "Boot USB"))
self.ram_usb_256.setText(_translate("Dialog", "25&6 MB"))
self.ram_usb_768.setText(_translate("Dialog", "7&68 MB"))
self.label_4.setText(_translate("Dialog", "Choose RAM size:"))
self.ram_usb_512.setText(_translate("Dialog", "5&12 MB"))
self.ram_usb_1024.setText(_translate("Dialog", "1&024 MB"))
self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab), _translate("Dialog", "Boot ISO/USB"))
self.label_5.setText(_translate("Dialog", "<html><head/><body><p align=\"center\">An advanced bootable usb creator with option to install/uninstall multiple distros.</p><p align=\"center\">This software is written in python and pyqt. </p><p align=\"center\">Copyright 2010-2016 Sundar</p><p align=\"center\"><span style=\" font-weight:600;\">Author(s)</span>: Sundar, Ian Bruce, Lee</p><p align=\"center\"><span style=\" font-weight:600;\">Licence</span>: GPL version 2 or later</p><p align=\"center\"><span style=\" font-weight:600;\">Home page</span>: <a href=\" http://multibootusb.org\"><span style=\" text-decoration: underline; color:#0000ff;\">http://multibootusb.org</span></a></p><p align=\"center\"><span style=\" font-weight:600;\">Help/Email</span>: feedback.multibootusb@gmail.com</p><p align=\"center\"><span style=\" font-weight:600;\">Source Code</span>: <a href=\"https://github.com/mbusb/multibootusb\"><span style=\" text-decoration: underline; color:#0000ff;\">https://github.com/mbusb/multibootusb</span></a></p><p><br/></p></body></html>"))
self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_2), _translate("Dialog", "About"))

View File

@ -217,22 +217,27 @@ class Ui_MainWindow(object):
self.gridLayout_9.setContentsMargins(5, 5, 5, 5)
self.gridLayout_9.setObjectName("gridLayout_9")
spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
self.gridLayout_9.addItem(spacerItem, 1, 2, 1, 1)
self.gridLayout_9.addItem(spacerItem, 3, 2, 1, 1)
self.button_write_image_to_disk = QtWidgets.QPushButton(self.tab_imager)
self.button_write_image_to_disk.setObjectName("button_write_image_to_disk")
self.gridLayout_9.addWidget(self.button_write_image_to_disk, 1, 1, 1, 1)
self.gridLayout_9.addWidget(self.button_write_image_to_disk, 3, 1, 1, 1)
self.widget_7 = QtWidgets.QWidget(self.tab_imager)
self.widget_7.setObjectName("widget_7")
self.verticalLayout_6 = QtWidgets.QVBoxLayout(self.widget_7)
self.verticalLayout_6.setContentsMargins(5, 5, 5, 5)
self.verticalLayout_6.setObjectName("verticalLayout_6")
self.gridLayout_9.addWidget(self.widget_7, 1, 3, 1, 2)
self.gridLayout_9.addWidget(self.widget_7, 3, 3, 1, 2)
spacerItem1 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
self.gridLayout_9.addItem(spacerItem1, 1, 0, 1, 1)
self.gridLayout_9.addItem(spacerItem1, 3, 0, 1, 1)
spacerItem2 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
self.gridLayout_9.addItem(spacerItem2, 0, 1, 1, 1)
self.gridLayout_9.addItem(spacerItem2, 4, 1, 1, 1)
self.label_6 = QtWidgets.QLabel(self.tab_imager)
self.label_6.setObjectName("label_6")
self.gridLayout_9.addWidget(self.label_6, 1, 1, 1, 1)
spacerItem3 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
self.gridLayout_9.addItem(spacerItem3, 2, 1, 1, 1)
self.gridLayout_9.addItem(spacerItem3, 0, 1, 1, 1)
spacerItem4 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
self.gridLayout_9.addItem(spacerItem4, 2, 1, 1, 1)
self.horizontalLayout_7.addLayout(self.gridLayout_9)
self.tabWidget.addTab(self.tab_imager, "")
self.tab_syslinux = QtWidgets.QWidget()
@ -257,12 +262,12 @@ class Ui_MainWindow(object):
self.button_install_syslinux = QtWidgets.QPushButton(self.groupBox_2)
self.button_install_syslinux.setObjectName("button_install_syslinux")
self.gridLayout_3.addWidget(self.button_install_syslinux, 0, 2, 2, 1)
spacerItem4 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
self.gridLayout_3.addItem(spacerItem4, 0, 1, 2, 1)
spacerItem5 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
self.gridLayout_3.addItem(spacerItem5, 0, 1, 2, 1)
self.horizontalLayout_4.addLayout(self.gridLayout_3)
self.gridLayout_2.addWidget(self.groupBox_2, 0, 0, 1, 1)
spacerItem5 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
self.gridLayout_2.addItem(spacerItem5, 3, 0, 1, 1)
spacerItem6 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
self.gridLayout_2.addItem(spacerItem6, 3, 0, 1, 1)
self.groupBox_3 = QtWidgets.QGroupBox(self.tab_syslinux)
self.groupBox_3.setObjectName("groupBox_3")
self.horizontalLayout_5 = QtWidgets.QHBoxLayout(self.groupBox_3)
@ -275,12 +280,12 @@ class Ui_MainWindow(object):
self.label_2 = QtWidgets.QLabel(self.groupBox_3)
self.label_2.setObjectName("label_2")
self.gridLayout_4.addWidget(self.label_2, 0, 0, 1, 1)
spacerItem6 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
self.gridLayout_4.addItem(spacerItem6, 0, 1, 1, 1)
spacerItem7 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
self.gridLayout_4.addItem(spacerItem7, 0, 1, 1, 1)
self.horizontalLayout_5.addLayout(self.gridLayout_4)
self.gridLayout_2.addWidget(self.groupBox_3, 2, 0, 1, 1)
spacerItem7 = QtWidgets.QSpacerItem(20, 20, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Fixed)
self.gridLayout_2.addItem(spacerItem7, 1, 0, 1, 1)
spacerItem8 = QtWidgets.QSpacerItem(20, 20, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Fixed)
self.gridLayout_2.addItem(spacerItem8, 1, 0, 1, 1)
self.horizontalLayout_3.addLayout(self.gridLayout_2)
self.tabWidget.addTab(self.tab_syslinux, "")
self.tab_testboot = QtWidgets.QWidget()
@ -310,13 +315,13 @@ class Ui_MainWindow(object):
self.label_4 = QtWidgets.QLabel(self.groupBox_4)
self.label_4.setObjectName("label_4")
self.gridLayout_8.addWidget(self.label_4, 0, 0, 1, 1)
spacerItem8 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
self.gridLayout_8.addItem(spacerItem8, 0, 5, 1, 1)
spacerItem9 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
self.gridLayout_8.addItem(spacerItem9, 0, 5, 1, 1)
self.boot_usb_qemu = QtWidgets.QPushButton(self.groupBox_4)
self.boot_usb_qemu.setObjectName("boot_usb_qemu")
self.gridLayout_8.addWidget(self.boot_usb_qemu, 0, 4, 1, 1)
spacerItem9 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
self.gridLayout_8.addItem(spacerItem9, 0, 3, 1, 1)
spacerItem10 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
self.gridLayout_8.addItem(spacerItem10, 0, 3, 1, 1)
self.label_5 = QtWidgets.QLabel(self.groupBox_4)
self.label_5.setObjectName("label_5")
self.gridLayout_8.addWidget(self.label_5, 0, 2, 1, 1)
@ -334,8 +339,8 @@ class Ui_MainWindow(object):
self.boot_iso_qemu = QtWidgets.QPushButton(self.groupBox_5)
self.boot_iso_qemu.setObjectName("boot_iso_qemu")
self.gridLayout_7.addWidget(self.boot_iso_qemu, 0, 4, 1, 1)
spacerItem10 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
self.gridLayout_7.addItem(spacerItem10, 0, 3, 1, 1)
spacerItem11 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
self.gridLayout_7.addItem(spacerItem11, 0, 3, 1, 1)
self.combo_iso_boot_ram = QtWidgets.QComboBox(self.groupBox_5)
self.combo_iso_boot_ram.setObjectName("combo_iso_boot_ram")
self.combo_iso_boot_ram.addItem("")
@ -345,16 +350,16 @@ class Ui_MainWindow(object):
self.combo_iso_boot_ram.addItem("")
self.combo_iso_boot_ram.addItem("")
self.gridLayout_7.addWidget(self.combo_iso_boot_ram, 0, 1, 1, 1)
spacerItem11 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
self.gridLayout_7.addItem(spacerItem11, 0, 5, 1, 1)
spacerItem12 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
self.gridLayout_7.addItem(spacerItem12, 0, 5, 1, 1)
self.label = QtWidgets.QLabel(self.groupBox_5)
self.label.setObjectName("label")
self.gridLayout_7.addWidget(self.label, 0, 2, 1, 1)
self.verticalLayout_3.addLayout(self.gridLayout_7)
self.gridLayout_6.addWidget(self.groupBox_5, 0, 0, 1, 1)
self.verticalLayout_2.addLayout(self.gridLayout_6)
spacerItem12 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
self.verticalLayout_2.addItem(spacerItem12)
spacerItem13 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
self.verticalLayout_2.addItem(spacerItem13)
self.tabWidget.addTab(self.tab_testboot, "")
self.verticalLayout_7.addWidget(self.tabWidget)
self.progressbar = QtWidgets.QProgressBar(self.centralwidget)
@ -385,7 +390,7 @@ class Ui_MainWindow(object):
self.menubar.addAction(self.menu_Help.menuAction())
self.retranslateUi(MainWindow)
self.tabWidget.setCurrentIndex(0)
self.tabWidget.setCurrentIndex(1)
QtCore.QMetaObject.connectSlotsByName(MainWindow)
def retranslateUi(self, MainWindow):
@ -415,6 +420,7 @@ class Ui_MainWindow(object):
self.label_persistence_value.setText(_translate("MainWindow", "0 MB"))
self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_multibootusb), _translate("MainWindow", "MultiBootUSB"))
self.button_write_image_to_disk.setText(_translate("MainWindow", "Write image to USB"))
self.label_6.setText(_translate("MainWindow", "<html><head/><body><p align=\"center\"><span style=\" font-size:14pt; font-weight:600; color:#ff0000;\">WARNING!</span></p><p align=\"center\"><span style=\" color:#000000;\">This operation destroys </span><span style=\" font-weight:600; color:#000000;\">ALL</span><span style=\" color:#000000;\"> data on the selected disk.</span></p><p align=\"center\"><span style=\" color:#000000;\">Please select the destination disk carefully.</span></p></body></html>"))
self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_imager), _translate("MainWindow", "Write Image to disk"))
self.groupBox_2.setTitle(_translate("MainWindow", "Install Syslinux"))
self.check_install_sys_only.setText(_translate("MainWindow", "Install only syslinu&x (existing configurations will not be altered)."))

View File

@ -63,7 +63,7 @@ def dd_linux():
if dd_process.poll() is not None:
log("\nExecuting ==> sync")
os.system("sync")
os.sync()
log("ISO has been written to USB disk...")
return

View File

@ -100,7 +100,7 @@ def install_distro():
if platform.system() == 'Linux':
log('ISO extracted successfully. Sync is in progress...')
os.system('sync')
os.sync()
if config.persistence != 0:
log('Creating persistence...')
@ -159,7 +159,7 @@ def install_patch():
"""
if config.distro == 'debian':
if platform.system() == 'Linux': # Need to syn under Linux. Otherwise, USB disk becomes random read only.
os.system('sync')
os.sync()
iso_cfg_ext_dir = os.path.join(multibootusb_host_dir(), "iso_cfg_ext_dir")
isolinux_path = os.path.join(iso_cfg_ext_dir, isolinux_bin_path(config.image_path))
iso_linux_bin_dir = isolinux_bin_dir(config.image_path)

View File

@ -152,15 +152,15 @@ class ISO9660:
BLOCK_SIZE = priVol.blockSize
# Check RRIP
#gen.log ("loc extent(%d)"%(dirRec.locExtent))
#gen.log("loc extent(%d)"%(dirRec.locExtent))
self.priVol = priVol # readDirItems will use self.priVol
root_dir = self.readDirItems(dirRec.locExtent, priVol.rootTotal)[0]
rripNode = self.__rripLoop__(root_dir.suspBuf, root_dir.lenDr-root_dir.sysUseStar)
if rripNode.offset != -1:
self.rripOffset = rripNode.offset
#gen.log ("RRIP: rrip_offset %d"%(self.rripOffset))
#gen.log("RRIP: rrip_offset %d"%(self.rripOffset))
else:
gen.log ("This ISO doesn't support RRIP")
gen.log("This ISO doesn't support RRIP")
self.rootDir = root_dir
# Rrip extension
@ -168,7 +168,7 @@ class ISO9660:
if self.rripOffset > 0:
entry_buf = desc_buf[self.rripOffset:]
gen.log ("__rripLoop__ offset:%d"%(self.rripOffset))
gen.log("__rripLoop__ offset:%d"%(self.rripOffset))
else:
entry_buf = desc_buf
@ -181,7 +181,7 @@ class ISO9660:
len_entry = 0
while True:
#gen.log (("\n%d, %d\n")%(len_buf, head))
#gen.log(("\n%d, %d\n")%(len_buf, head))
head += len_entry
if len_buf - head < 4: # less than one entry
break
@ -322,7 +322,7 @@ class ISO9660:
else:
return item
else:
gen.log ("can't find " + dircomps[i_dircomp])
gen.log("can't find " + dircomps[i_dircomp])
return None
def readDirrecord(self, desc_buf):
@ -628,7 +628,7 @@ class ISO9660:
lastfile_end = BLOCK_SIZE * dr2.locExtent + dr2.lenData
self.isoFile.seek(0, os.SEEK_END)
iso_end = self.isoFile.tell()
#gen.log ("%d-->%d")%(lastfile_end, iso_end)
#gen.log("%d-->%d")%(lastfile_end, iso_end)
if iso_end >= lastfile_end:
return True
else:

View File

@ -331,7 +331,7 @@ Are you SURE you want to enable it?",
self.update_list_box(config.usb_disk)
if sys.platform.startswith("linux"):
self.ui.statusbar.showMessage("Status: Sync is in progress...")
os.system('sync')
os.sync()
self.ui.statusbar.showMessage("Status: Idle")
self.ui_disable_persistence()
log(iso_name(config.image_path) + ' has been successfully installed.')
@ -434,7 +434,6 @@ Are you SURE you want to enable it?",
QtWidgets.QMessageBox.Yes|QtWidgets.QMessageBox.No, QtWidgets.QMessageBox.No)
if reply == QtWidgets.QMessageBox.Yes:
if not os.path.exists(os.path.join(config.usb_mount, 'multibootusb', config.uninstall_distro_dir_name)):
log("Distro install directory not found. Just updating syslinux.cfg file.")
update_sys_cfg_file()
@ -442,6 +441,8 @@ Are you SURE you want to enable it?",
self.ui_enable_controls()
else:
self.progress_thread_uninstall.start()
else:
self.ui_enable_controls()
def uninstall_sys_file_update(self):
"""
@ -452,7 +453,7 @@ Are you SURE you want to enable it?",
self.update_list_box(config.usb_mount)
if sys.platform.startswith("linux"):
self.ui.statusbar.showMessage("Status: Sync in progress...")
os.system('sync')
os.sync()
self.ui.statusbar.showMessage("Status: Idle")
QtWidgets.QMessageBox.information(self, 'Uninstall Complete...',
config.uninstall_distro_dir_name + ' has been successfully removed.')
@ -509,7 +510,6 @@ Are you SURE you want to enable it?",
# self.ui.image_path.clear()
if config.distro:
log("MultiBoot Install: Distro type detected: " + config.distro)
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)))
@ -528,6 +528,7 @@ Are you SURE you want to enable it?",
if reply == QtWidgets.QMessageBox.Yes:
self.ui.slider_persistence.setEnabled(False)
copy_mbusb_dir_usb(config.usb_disk)
config.process_exist = True
self.progress_thread_install.start()
elif reply == QtWidgets.QMessageBox.No:
@ -590,18 +591,18 @@ Are you SURE you want to enable it?",
self.ui_disable_controls()
if not config.usb_disk:
QtWidgets.QMessageBox.information(self, 'No USB...', 'Please Insert USB disk and rerun multibootusb.')
QtWidgets.QMessageBox.information(self, 'No USB disk selected', 'Please insert USB disk and click "Detect Drives".')
self.ui_enable_controls()
elif not config.image_path:
QtWidgets.QMessageBox.information(self, 'No ISO...', 'Please select an ISO.')
QtWidgets.QMessageBox.information(self, 'No ISO selected', 'Please select an ISO.')
self.ui_enable_controls()
else:
imager = Imager()
if platform.system() == 'Linux' and config.usb_disk[-1].isdigit() is True:
gen.log('Selected disk is a partitions. Please select a disk from the drop down list')
QtWidgets.QMessageBox.information(self, 'Wrong Disk...!', 'Disk selected is a partition.\nISO is to '
'be written to whole disk for proper functioning'
'.\n\nPlease select the disk from the drop down list.')
if platform.system() == 'Linux' and config.usb_details['devtype'] == "partition":
gen.log('Selected device is a partition. Please select a disk from the drop down list')
QtWidgets.QMessageBox.information(self, 'Incompatible device', 'Selected device (%s) is a partition!\n'
'ISO must be written to a whole disk.'
'\n\nPlease select a disk from the drop down list.' % config.usb_disk)
self.ui_enable_controls()
else:
usb_disk_size = int(imager.imager_usb_detail(config.usb_disk, partition=0).total_size)

View File

@ -27,27 +27,6 @@ class Qemu(QtWidgets.QMainWindow, Ui_MainWindow):
QtWidgets.QMainWindow.__init__(self)
self.ui = Ui_MainWindow()
self.ui.setupUi(self)
# def on_Qemu_Browse_iso_Click(self):
# """
# Browse and choose an ISO.
# :return:
# """
# self.ui.lineEdit_2.clear()
#
# qemu = self.check_qemu_exist()
#
# if not qemu is None:
# qemu_iso_link = QtWidgets.QFileDialog.getOpenFileName(self, 'Select an iso...', "", "ISO Files (*.iso)")[0]
# else:
# log("QEMU does not exist.\nPlease install qemu package to avail this feature.")
# QtWidgets.QMessageBox.information(self, 'No QEMU...', 'Please install qemu package to avail this feature.')
# qemu_iso_link = None
#
# if not qemu_iso_link is None:
# self.ui.lineEdit_2.insert(qemu_iso_link)
# else:
# log ("File not selected.")
def on_Qemu_Boot_iso_Click(self):
"""

View File

@ -24,18 +24,18 @@ mbr_bin = resource_path(os.path.join("data", "tools", "mbr.bin"))
def set_boot_flag(usb_disk):
if platform.system() == "Linux":
log ("\nChecking boot flag on " + usb_disk[:-1], '\n')
log("\nChecking boot flag on " + usb_disk[:-1], '\n')
cmd_out = subprocess.check_output("parted -m -s " + usb_disk[:-1] + " print", shell=True)
if b'boot' in cmd_out:
log ("\nDisk " + usb_disk[:-1] + " already has boot flag.\n")
log("\nDisk " + usb_disk[:-1] + " already has boot flag.\n")
return True
else:
log ("\nExecuting ==> parted " + usb_disk[:-1] + " set 1 boot on", '\n')
log("\nExecuting ==> parted " + usb_disk[:-1] + " set 1 boot on", '\n')
if subprocess.call("parted " + usb_disk[:-1] + " set 1 boot on", shell=True) == 0:
log ("\nBoot flag set to bootable " + usb_disk[:-1], '\n')
log("\nBoot flag set to bootable " + usb_disk[:-1], '\n')
return True
else:
log ("\nUnable to set boot flag on " + usb_disk[:-1], '\n')
log("\nUnable to set boot flag on " + usb_disk[:-1], '\n')
return False
@ -50,18 +50,18 @@ def syslinux_default(usb_disk, version=4):
usb_fs = usb_details['file_system']
usb_mount = usb_details['mount_point']
mbr_install_cmd = 'dd bs=440 count=1 conv=notrunc if=' + mbr_bin + ' of=' + usb_disk[:-1]
# log (usb_fs)
# log(usb_fs)
if usb_fs in extlinux_fs:
extlinu_cmd = extlinux_path + ' --install ' + os.path.join(usb_mount, 'multibootusb')
if os.access(extlinux_path, os.X_OK) is False:
subprocess.call('chmod +x ' + extlinux_path, shell=True)
log ("\nExecuting ==> " + extlinu_cmd)
log("\nExecuting ==> " + extlinu_cmd)
config.status_text = 'Installing default extlinux version 4...'
if subprocess.call(extlinu_cmd, shell=True) == 0:
log ("\nDefault Extlinux install is success...\n")
log("\nDefault Extlinux install is success...\n")
config.status_text = 'Default extlinux install is success...'
config.status_text = 'Installing mbr...'
log ('\nExecuting ==> ' + mbr_install_cmd)
log('\nExecuting ==> ' + mbr_install_cmd)
if subprocess.call(mbr_install_cmd, shell=True) == 0:
config.status_text = 'mbr install is successful...'
log("\nmbr install is success...\n")
@ -74,31 +74,31 @@ def syslinux_default(usb_disk, version=4):
syslinux_cmd = syslinux_path + ' -i -d multibootusb ' + usb_disk
if os.access(syslinux_path, os.X_OK) is False:
subprocess.call('chmod +x ' + syslinux_path, shell=True)
log ("\nExecuting ==> " + syslinux_cmd + "\n")
log("\nExecuting ==> " + syslinux_cmd + "\n")
config.status_text = 'Installing default syslinux version 4...'
if subprocess.call(syslinux_cmd, shell=True) == 0:
log ("\nDefault syslinux install is success...\n")
log("\nDefault syslinux install is success...\n")
config.status_text = 'Default syslinux successfully installed...'
if subprocess.call(mbr_install_cmd, shell=True) == 0:
config.status_text = 'mbr install is success...'
log ("\nmbr install is success...\n")
log("\nmbr install is success...\n")
if set_boot_flag(usb_disk) is True:
return True
else:
log ("\nFailed to install default syslinux...\n")
log("\nFailed to install default syslinux...\n")
config.status_text = 'Failed to install default syslinux...'
return False
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)
log('Executing ==>' + syslinux + ' -maf -d multibootusb ' + usb_disk)
config.status_text = 'Installing default syslinux version 4...'
if subprocess.call(syslinux + ' -maf -d multibootusb ' + usb_disk, shell=True) == 0:
config.status_text = 'Default syslinux successfully installed...'
log ("\nDefault syslinux install is success...\n")
log("\nDefault syslinux install is success...\n")
return True
else:
log ("\nFailed to install default syslinux...\n")
log("\nFailed to install default syslinux...\n")
config.status_text = 'Failed to install default syslinux...'
return False
@ -115,7 +115,7 @@ def syslinux_distro_dir(usb_disk, iso_link, distro):
usb_mount = usb_details['mount_point']
isolinux_bin_dir(iso_link)
if isolinux_bin_exist(iso_link) is False:
log ('Distro does not use isolinux for booting ISO.')
log('Distro does not use isolinux for booting ISO.')
else:
# iso_cfg_ext_dir = os.path.join(multibootusb_host_dir(), "iso_cfg_ext_dir")
_iso_cfg_ext_dir = iso_cfg_ext_dir()
@ -126,7 +126,7 @@ def syslinux_distro_dir(usb_disk, iso_link, distro):
log('Distro uses really old isolinux. Installing version 3 instead of 2.')
config.syslinux_version = '3'
if distro == "generic" or distro == "alpine":
if distro in ["generic", "alpine"]:
install_dir = usb_mount
distro_syslinux_install_dir = os.path.join(usb_mount, iso_linux_bin_dir.strip("/")).replace(usb_mount, "")
distro_sys_install_bs = os.path.join(install_dir, iso_linux_bin_dir.strip("/"), distro + '.bs')
@ -134,8 +134,8 @@ def syslinux_distro_dir(usb_disk, iso_link, distro):
install_dir = os.path.join(usb_mount, "multibootusb", iso_basename(iso_link))
distro_syslinux_install_dir = os.path.join(install_dir, iso_linux_bin_dir.strip("/")).replace(usb_mount, "")
distro_sys_install_bs = os.path.join(install_dir, iso_linux_bin_dir.strip("/"), distro + '.bs')
# log (distro_sys_install_bs)
# log (distro_syslinux_install_dir)
# log(distro_sys_install_bs)
# log(distro_syslinux_install_dir)
if usb_fs in syslinux_fs:
if config.syslinux_version == str(3):
@ -155,22 +155,22 @@ def syslinux_distro_dir(usb_disk, iso_link, distro):
subprocess.call('chmod +x ' + syslinux_path, shell=True) == 0
sys_cmd = syslinux_path + option + quote(distro_syslinux_install_dir) + ' ' + usb_disk
dd_cmd = 'dd if=' + usb_disk + ' ' + 'of=' + quote(distro_sys_install_bs) + ' count=1'
log ("Executing ==> " + sys_cmd)
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 successful...'
log ("\nSyslinux install on distro directory is successful...\n")
log ('Executing ==> ' + dd_cmd + '\n')
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 successful...'
log ("\nBootsector copy is successful...\n")
log("\nBootsector copy is successful...\n")
else:
config.status_text = 'Failed to copy boot sector...'
log ("\nFailed to copy boot sector...\n")
log("\nFailed to copy boot sector...\n")
else:
config.status_text = 'Failed to install syslinux on distro directory...'
log ("\nFailed to install syslinux on distro directory...\n")
log("\nFailed to install syslinux on distro directory...\n")
elif platform.system() == "Windows":
syslinux_path = resource_path(os.path.join(multibootusb_host_dir(), "syslinux", "bin")) + \
@ -183,10 +183,10 @@ def syslinux_distro_dir(usb_disk, iso_link, distro):
config.status_text = 'Installing distro specific syslinux...'
if subprocess.call(sys_cmd, shell=True) == 0:
config.status_text = 'Syslinux install on distro directory is successful...'
log ("\nSyslinux install was successful on distro directory...\n")
log("\nSyslinux install was successful on distro directory...\n")
else:
config.status_text = 'Failed to install syslinux on distro directory...'
log ("\nFailed to install syslinux on distro directory...\n")
log("\nFailed to install syslinux on distro directory...\n")
elif usb_fs in extlinux_fs:
if platform.system() == "Linux":
distro_syslinux_install_dir = os.path.join(install_dir, iso_linux_bin_dir.strip("/"))
@ -195,18 +195,18 @@ def syslinux_distro_dir(usb_disk, iso_link, distro):
dd_cmd = 'dd if=' + usb_disk + ' ' + 'of=' + quote(distro_sys_install_bs) + ' count=1'
if os.access(syslinux_path, os.X_OK) is False:
subprocess.call('chmod +x ' + syslinux_path, shell=True) == 0
log ("Executing ==> " + ext_cmd)
log("Executing ==> " + ext_cmd)
if subprocess.call(ext_cmd, shell=True) == 0:
log ("\nSyslinux install on distro directory is successful...\n")
log ('Executing ==> ' + dd_cmd, '\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 successful...\n")
log("\nBootsector copy is successful...\n")
else:
log ("\nFailed to install syslinux on distro directory...\n")
log("\nFailed to install syslinux on distro directory...\n")
if __name__ == '__main__':
if os.geteuid() != 0:
log ('Please running this script with sudo/root/admin privilage.')
log('Please running this script with sudo/root/admin privilage.')
exit(1)
else:
syslinux_distro_dir('/dev/sdb1', '../../../DISTROS/2016/debian-live-8.3.0-amd64-lxde-desktop.iso', 'debian')

View File

@ -90,7 +90,7 @@ def delete_frm_file_list():
if platform.system() == 'Linux':
gen.log('Removed files from ' + config.uninstall_distro_dir_name)
gen.log('Syncing....')
os.system('sync')
os.sync()
@ -107,7 +107,7 @@ def uninstall_distro():
usb_mount = usb_details['mount_point']
if platform.system() == 'Linux':
os.system('sync')
os.sync()
# remove 'immutable' from files on ext2/3/4 fs
if usb_mount:
subprocess.call("chattr -i -R %s/* 2>/dev/null" % usb_mount, shell=True)
@ -115,13 +115,7 @@ def uninstall_distro():
if os.path.exists(os.path.join(usb_mount, "multibootusb", config.uninstall_distro_dir_name, "iso_file_list.cfg")):
with open(os.path.join(usb_mount, "multibootusb", config.uninstall_distro_dir_name, "iso_file_list.cfg"), "r") as f:
config.iso_file_list = f.readlines()
# gen.log iso_file_list
for path, subdirs, files in os.walk(os.path.join(usb_mount, "multibootusb", config.uninstall_distro_dir_name)):
for name in files:
if name.endswith('ldlinux.sys') or name.endswith('ldlinux.c32'):
os.chmod(os.path.join(path, name), 0o777)
os.unlink(os.path.join(path, name))
if config.distro == "opensuse":
if os.path.exists(os.path.join(usb_mount, config.uninstall_distro_dir_name + ".iso")):
os.remove(os.path.join(usb_mount, config.uninstall_distro_dir_name + ".iso"))
@ -139,7 +133,7 @@ def uninstall_distro():
if os.path.exists(os.path.join(usb_mount, "multibootusb", config.uninstall_distro_dir_name)):
if platform.system() == 'Linux':
os.system('sync')
os.sync()
shutil.rmtree(os.path.join(usb_mount, "multibootusb", config.uninstall_distro_dir_name))
delete_frm_file_list()
@ -167,7 +161,7 @@ def update_sys_cfg_file():
:return:
"""
if platform.system() == 'Linux':
os.system('sync')
os.sync()
sys_cfg_file = os.path.join(config.usb_mount, "multibootusb", "syslinux.cfg")
if not os.path.exists(sys_cfg_file):
@ -187,7 +181,7 @@ def update_grub_cfg_file():
:return:
"""
if platform.system() == 'Linux':
os.system('sync')
os.sync()
grub_cfg_file = os.path.join(config.usb_mount, "multibootusb", "grub", "grub.cfg")
if not os.path.exists(grub_cfg_file):
@ -210,7 +204,7 @@ def uninstall_progress():
usb_details = details(config.usb_disk)
usb_mount = usb_details['mount_point']
if platform.system() == 'Linux':
os.system('sync')
os.sync()
if os.path.exists(os.path.join(usb_mount, "multibootusb", config.uninstall_distro_dir_name, "multibootusb.cfg")):
with open(os.path.join(usb_mount, "multibootusb", config.uninstall_distro_dir_name, "multibootusb.cfg"),

View File

@ -53,14 +53,14 @@ def update_distro_cfg_files(iso_link, usb_disk, distro, persistence=0):
'ignore_bootid root=UUID=' + usb_uuid + ' live-media-path=/multibootusb/'
+ iso_basename(iso_link) + '/casper', string)
string = re.sub(r'ui gfxboot', '#ui gfxboot', string)
if not persistence == 0:
if persistence != 0:
string = re.sub(r'boot=casper', 'boot=casper persistent persistent-path=/multibootusb/' +
iso_basename(iso_link) + "/", string)
elif distro == "debian" or distro == "debian-install":
elif distro in ["debian", "debian-install"]:
string = re.sub(r'boot=live', 'boot=live ignore_bootid live-media-path=/multibootusb/' +
iso_basename(iso_link) + '/live', string)
if not persistence == 0:
if persistence != 0:
string = re.sub(r'boot=live', 'boot=live persistent persistent-path=/multibootusb/' +
iso_basename(iso_link) + "/", string)
elif distro == 'grml':
@ -81,7 +81,7 @@ def update_distro_cfg_files(iso_link, usb_disk, distro, persistence=0):
string = re.sub(r'initrd=', 'rd.live.dir=/multibootusb/' + iso_basename(iso_link) +
'/LiveOS initrd=', string)
if not persistence == 0:
if persistence != 0:
if re.search(r'liveimg', string, re.I):
string = re.sub(r'liveimg', 'liveimg overlay=UUID=' + usb_uuid, string)
elif re.search(r'rd.live.image', string, re.I):
@ -152,7 +152,7 @@ def update_distro_cfg_files(iso_link, usb_disk, distro, persistence=0):
rows.append(line)
string = ''.join(rows)
elif distro == "arch" or distro == "chakra":
elif distro in ["arch", "chakra"]:
string = re.sub(r'isolabel=\S*',
'isodevice=/dev/disk/by-uuid/' + usb_uuid, string, flags=re.I)
string = re.sub(r'isobasedir=',
@ -168,7 +168,7 @@ def update_distro_cfg_files(iso_link, usb_disk, distro, persistence=0):
string = re.sub(r'append',
'append kdeosisobasedir=/multibootusb/' + iso_basename(iso_link) + '/kdeos/', string, flags=re.I)
string = re.sub(r'ui gfxboot', '# ui gfxboot', string) # Bug in the isolinux package
elif distro == "suse" or distro == "opensuse":
elif distro in ["suse", "opensuse"]:
if re.search(r'opensuse_12', string, re.I):
string = re.sub(r'append',
'append loader=syslinux isofrom_system=/dev/disk/by-uuid/' + usb_uuid + ":/" +
@ -256,7 +256,7 @@ def update_distro_cfg_files(iso_link, usb_disk, distro, persistence=0):
gen.log('EFI image does not exist. Copying now...')
shutil.copy2(resource_path(os.path.join("data", "EFI", "BOOT", "bootx64.efi")),
os.path.join(config.usb_mount, 'EFI', 'BOOT'))
elif not gen.grub_efi_exist(efi_grub_img) is True:
elif gen.grub_efi_exist(efi_grub_img) is False:
gen.log('EFI image overwritten by distro install. Replacing it now...')
shutil.copy2(resource_path(os.path.join("data", "EFI", "BOOT", "bootx64.efi")),
os.path.join(config.usb_mount, 'EFI', 'BOOT'))
@ -270,7 +270,7 @@ def update_mbusb_cfg_file(iso_link, usb_uuid, usb_mount, distro):
:return:
"""
if platform.system() == 'Linux':
os.system('sync')
os.sync()
log('Updating multibootusb config file...')
sys_cfg_file = os.path.join(usb_mount, "multibootusb", "syslinux.cfg")
install_dir = os.path.join(usb_mount, "multibootusb", iso_basename(iso_link))
@ -279,7 +279,7 @@ def update_mbusb_cfg_file(iso_link, usb_uuid, usb_mount, distro):
if distro == "hbcd":
if os.path.exists(os.path.join(usb_mount, "multibootusb", "menu.lst")):
_config_file = os.path.join(usb_mount, "multibootusb", "menu.lst")
config_file = open(_config_file,"w")
config_file = open(_config_file, "w")
string = re.sub(r'/HBCD', '/multibootusb/' + iso_basename(iso_link) + '/HBCD', _config_file)
config_file.write(string)
config_file.close()
@ -360,7 +360,7 @@ def update_mbusb_cfg_file(iso_link, usb_uuid, usb_mount, distro):
if isolinux_bin_exist(config.image_path) is True:
if distro == "generic":
distro_syslinux_install_dir = isolinux_bin_dir(iso_link)
if not isolinux_bin_dir(iso_link) == "/":
if isolinux_bin_dir(iso_link) != "/":
distro_sys_install_bs = os.path.join(usb_mount, isolinux_bin_dir(iso_link)) + '/' + distro + '.bs'
else:
distro_sys_install_bs = '/' + distro + '.bs'

View File

@ -353,9 +353,9 @@ def win_disk_details(disk_drive):
oFS = win32com.client.Dispatch("Scripting.FileSystemObject")
d = oFS.GetDrive(oFS.GetDriveName(oFS.GetAbsolutePathName(selected_usb_part)))
selected_usb_device = d.DriveLetter
if d.DriveType is 1:
if d.DriveType == 1:
devtype = "Removable Disk"
elif d.DriveType is 2:
elif d.DriveType == 2:
devtype = "Fixed Disk"
label = (d.VolumeName).strip()
if not label.strip():