Skip to content

Commit d5d0da9

Browse files
committed
Merge branch 'devel' of https://github.com/mbusb/multibootusb.git into devel
2 parents 0ba7dc0 + 2691bab commit d5d0da9

21 files changed

+184
-1807
lines changed

CHANGELOG

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
Version - 8.7.1
2+
---------------
3+
* Warning text under 'Write image to disk' tab
4+
* Fix for rpm based distro which did not run due to import error
5+
* Fix for suse package and it now checks for correct package dependencies
6+
* Copy only multibootusb directory to USB if user accept installation choice
7+
* Display human readable size for an ISO in terminal
8+
* New command line option to skip confirmation message 'try multibootusb -c -h' for more details
9+
* New command line option to install multiple distros at a time (Windows user should be able to run only under source code)
10+
* Fix for crash when installing under Install syslinux tab
11+
* Prevent read only filesystem under Linux
12+
* Corrected setup file copy location preventing crash
13+
* Improved multibootusb-pkexec script for working under rpm and deb based distros
14+
* Create correct policy file during build time for various packages
15+
* Improved user guide at http://multibootusb.org/page_guide/
16+
* Various code cleanups
17+
118
Version - 8.7.0
219
---------------
320
* Welcome "Alin Trăistaru (alindt)". He is one of the major contributor for the project

build_pkg

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,9 @@ class pkg():
118118
elif self.pkg_name == 'rpm' or self.pkg_name == 'suse' or self.pkg_name == 'mageia':
119119
print('Modifying policy file for rpm packages...')
120120
coorect_bin_path('org.debian.pkexec.run-multibootusb.policy', debian_bin_path, rpm_bin_path)
121-
if self.pkg_name == 'suse' or self.pkg_name == 'mageia':
121+
if self.pkg_name == 'suse':
122+
require = "python3-qt5, parted, util-linux, mtools, dbus-1-python3, python3-pyudev, p7zip, python3-six"
123+
elif self.pkg_name == 'mageia':
122124
require = "python3-qt5, parted, util-linux, mtools, python3-dbus, python3-pyudev, p7zip, python3-six"
123125
else:
124126
require = "python3-PyQt5, parted, util-linux, mtools, python3-dbus, python3-pyudev, p7zip, p7zip-plugins, python3-six"

data/version.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
8.7.0
1+
8.7.1

multibootusb

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ import sys
1212
import os
1313
import platform
1414

15+
# The following line is required for distros based on rpm so as to avoid import errors when running from installed system
16+
sys.path.append('/usr/local/lib/python3.4/dist-packages')
17+
# print(sys.path)
18+
1519
# Had trouble in importing scripts directory. Had to add few lines below to ensure it works on source as well as
1620
# post install
1721
try:
@@ -32,6 +36,16 @@ gui = True
3236
uninstall = False
3337

3438

39+
def running_from():
40+
"""
41+
Print version and path location (installed or source code) info for debugging later.
42+
"""
43+
if os.path.exists('scripts'):
44+
gen.log('Running multibootusb version ' + gen.mbusb_version() + ' from source...')
45+
else:
46+
gen.log('Running multibootusb version ' + gen.mbusb_version() + ' from installed system...')
47+
48+
3549
def usage():
3650
print('\n An advanced multiboot live usb creator using command line.')
3751
print('\n Usage: python3 multibootusb [option(s)]\n')
@@ -67,6 +81,7 @@ def start_gui():
6781

6882

6983
if __name__ == '__main__':
84+
running_from()
7085
if platform.system() == 'Windows':
7186
if not admin.isUserAdmin():
7287
admin.runAsAdmin()

scripts/_7zip.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def list_iso(iso_link, suppress_out=True):
8080
if '.....' in line:
8181
if gen.has_digit(line[2]) or gen.has_digit(line[4]):
8282
if len(line) > 6:
83-
f_path = " ".join(line[5:len(line)])
83+
f_path = " ".join(line[5:])
8484
file_list.append(f_path)
8585
else:
8686
f_path = line[-1]
@@ -115,10 +115,7 @@ def test_iso(iso_link, suppress_out=True):
115115

116116
rc = subprocess.call(_cmd, shell=True)
117117

118-
if rc == 0 or rc == 1:
119-
return True
120-
else:
121-
return False
118+
return bool(rc in [0, 1])
122119

123120

124121
if __name__ == '__main__':

scripts/admin.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,10 @@ def runAsAdmin(cmdLine=None, wait=True):
8686
# raise RuntimeError, "This function is only implemented on Windows."
8787
if platform.system() == "Windows":
8888

89-
import win32api, win32con, win32event, win32process
89+
import win32api
90+
import win32con
91+
import win32event
92+
import win32process
9093
from win32com.shell.shell import ShellExecuteEx
9194
from win32com.shell import shellcon
9295

scripts/gen.py

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,7 @@ def is_quoted(text):
112112
:param text: Any word or sentence with or without quote.
113113
:return: True if text is quoted else False.
114114
"""
115-
if text.startswith("\"") and text.endswith("\""):
116-
return True
117-
else:
118-
return False
115+
return bool(text.startswith("\"") and text.endswith("\""))
119116

120117

121118
def has_digit(word):
@@ -266,10 +263,8 @@ def size_not_enough(iso_link, usb_disk):
266263
isoSize = iso_size(iso_link)
267264
usb_details = details(usb_disk)
268265
usb_size = usb_details['size_free']
269-
if isoSize > usb_size:
270-
return True
271-
else:
272-
return False
266+
267+
return bool(isoSize > usb_size)
273268

274269

275270
def mbusb_version():
@@ -339,12 +334,12 @@ def prepare_mbusb_host_dir():
339334
log("Removing junk files...")
340335
for files in os.listdir(os.path.join(home, "iso_cfg_ext_dir")):
341336
if os.path.isdir(os.path.join(os.path.join(home, "iso_cfg_ext_dir", files))):
342-
log (os.path.join(os.path.join(home, "iso_cfg_ext_dir", files)))
337+
log(os.path.join(os.path.join(home, "iso_cfg_ext_dir", files)))
343338
os.chmod(os.path.join(os.path.join(home, "iso_cfg_ext_dir", files)), 0o777)
344339
shutil.rmtree(os.path.join(os.path.join(home, "iso_cfg_ext_dir", files)))
345340
else:
346341
try:
347-
log (os.path.join(os.path.join(home, "iso_cfg_ext_dir", files)))
342+
log(os.path.join(os.path.join(home, "iso_cfg_ext_dir", files)))
348343
os.chmod(os.path.join(os.path.join(home, "iso_cfg_ext_dir", files)), 0o777)
349344
os.unlink(os.path.join(os.path.join(home, "iso_cfg_ext_dir", files)))
350345
os.remove(os.path.join(os.path.join(home, "iso_cfg_ext_dir", files)))

scripts/grub.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
from . import iso
1212
from . import _7zip
1313
from . import gen
14+
from .usb import bytes2human
1415

1516

1617
def mbusb_update_grub_cfg():
@@ -141,9 +142,9 @@ def get_grub_cfg(iso_link, efi=True):
141142

142143

143144
def grub_custom_menu(mbus_grub_cfg_path, distro):
144-
iso_size_mb = iso.iso_size(config.image_path) / (1024.0 * 1024.0)
145+
iso_size_mb = bytes2human(iso.iso_size(config.image_path))
145146
gen.log('size of the ISO is ' + str(iso_size_mb))
146-
if distro == 'sgrubd2' or distro == 'raw_iso':
147+
if distro in ['sgrubd2', 'raw_iso']:
147148
grub_raw_iso(mbus_grub_cfg_path)
148149

149150
'''

scripts/gui/multibootusb.ui

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@
308308
<bool>false</bool>
309309
</property>
310310
<property name="currentIndex">
311-
<number>0</number>
311+
<number>1</number>
312312
</property>
313313
<widget class="QWidget" name="tab_multibootusb">
314314
<property name="enabled">
@@ -483,7 +483,7 @@
483483
<property name="bottomMargin">
484484
<number>5</number>
485485
</property>
486-
<item row="1" column="2">
486+
<item row="3" column="2">
487487
<spacer name="horizontalSpacer_7">
488488
<property name="orientation">
489489
<enum>Qt::Horizontal</enum>
@@ -496,14 +496,14 @@
496496
</property>
497497
</spacer>
498498
</item>
499-
<item row="1" column="1">
499+
<item row="3" column="1">
500500
<widget class="QPushButton" name="button_write_image_to_disk">
501501
<property name="text">
502502
<string>Write image to USB</string>
503503
</property>
504504
</widget>
505505
</item>
506-
<item row="1" column="3" colspan="2">
506+
<item row="3" column="3" colspan="2">
507507
<widget class="QWidget" name="widget_7" native="true">
508508
<layout class="QVBoxLayout" name="verticalLayout_6">
509509
<property name="leftMargin">
@@ -521,7 +521,7 @@
521521
</layout>
522522
</widget>
523523
</item>
524-
<item row="1" column="0">
524+
<item row="3" column="0">
525525
<spacer name="horizontalSpacer_5">
526526
<property name="orientation">
527527
<enum>Qt::Horizontal</enum>
@@ -534,8 +534,28 @@
534534
</property>
535535
</spacer>
536536
</item>
537+
<item row="4" column="1">
538+
<spacer name="verticalSpacer_3">
539+
<property name="orientation">
540+
<enum>Qt::Vertical</enum>
541+
</property>
542+
<property name="sizeHint" stdset="0">
543+
<size>
544+
<width>20</width>
545+
<height>40</height>
546+
</size>
547+
</property>
548+
</spacer>
549+
</item>
550+
<item row="1" column="1">
551+
<widget class="QLabel" name="label_6">
552+
<property name="text">
553+
<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>
554+
</property>
555+
</widget>
556+
</item>
537557
<item row="0" column="1">
538-
<spacer name="verticalSpacer_4">
558+
<spacer name="verticalSpacer_2">
539559
<property name="orientation">
540560
<enum>Qt::Vertical</enum>
541561
</property>
@@ -548,7 +568,7 @@
548568
</spacer>
549569
</item>
550570
<item row="2" column="1">
551-
<spacer name="verticalSpacer_2">
571+
<spacer name="verticalSpacer_4">
552572
<property name="orientation">
553573
<enum>Qt::Vertical</enum>
554574
</property>

0 commit comments

Comments
 (0)