mirror of
https://github.com/mbusb/multibootusb
synced 2024-11-18 15:25:46 +00:00
Merge branch 'master' into devel
This commit is contained in:
commit
b3f83e08f0
3
.gitignore
vendored
3
.gitignore
vendored
@ -106,3 +106,6 @@ multibootusb*.exe
|
||||
mbusb_te*py
|
||||
text.txt
|
||||
text.py
|
||||
|
||||
# Temp files
|
||||
*~
|
75
README.md
75
README.md
@ -1,36 +1,59 @@
|
||||
#### User guide is located here http://multibootusb.org/page_guide/
|
||||
|
||||
|
||||
### Only limited instructions are provided here. For detailed instruction please refer [User guide ](http://multibootusb.org/page_guide/)
|
||||
|
||||
What is multibootusb?
|
||||
---------------------
|
||||
|
||||
MultiBootUSB is a cross platform* software/utility to create multi boot live Linux on a removable media i.e USB disk.
|
||||
It is similar to unetbootin but many distros can be installed, provided you have enough space on the disk.
|
||||
MultiBootUSB also provides an option to uninstall distro(s) at any time, if you wish.
|
||||
|
||||
* Only works on windows and linux
|
||||
|
||||
How to install?
|
||||
---------------
|
||||
## What does multibootusb do?
|
||||
|
||||
The install.py script provided with multibootusb should take care of all dependency and install multibootusb.
|
||||
Assume that you have downloaded the package named "multibootusb.tar.gz" in to your home directory.
|
||||
Issue the following commands to install multibootusb:-
|
||||
MultiBootUSB allows you to do the following:-
|
||||
|
||||
```
|
||||
tar -xf ./multibootusb.tar.gz
|
||||
cd multibootusb
|
||||
chmod +x ./install.py
|
||||
sudo ./install.py
|
||||
1. Install multiple live Linux and other Operating Systems in to a USB disk and make it bootable without erasing existing data.
|
||||
2. Ability to uninstall installed OS later.
|
||||
3. Write ISO image directly to a USB disk (you can think of GUI for Linux `dd` command).
|
||||
4. Boot ISO images directly without rebooting your system using QEMU option.
|
||||
5. Boot bootable USBs without rebooting your system using QEMU option.
|
||||
6. Boot USB on UEFI/EFI system through GRUB2 bootloader support (limited support).
|
||||
|
||||
|
||||
## Installation:
|
||||
|
||||
* On Windows:-
|
||||
* The windows version of multbootusb is not a standalone program. You need to install it on windows after download. Download the latest
|
||||
precompiled setup binary (.exe) file from
|
||||
[here](http://multibootusb.org/page_download/)
|
||||
* The installation is farley simple. Double click on the executable and follow the onscreen instruction.
|
||||
|
||||
* On Linux:-
|
||||
|
||||
**Using binary method:-**
|
||||
|
||||
* Download the installation and source files for various distros from
|
||||
[here](http://multibootusb.org/page_download/)
|
||||
* Use your favourite package manager to install multibootusb.
|
||||
|
||||
**Using source code method `Linux`:-**
|
||||
|
||||
* The install.py script provided with multibootusb should take care of all dependencies and install multibootusb.
|
||||
Assume that you have downloaded the package named **multibootusb.tar.gz** in to your home directory.
|
||||
Issue the following commands to install multibootusb:-
|
||||
|
||||
```sh
|
||||
tar -xf ./multibootusb.tar.gz
|
||||
cd multibootusb
|
||||
chmod +x ./install.py
|
||||
sudo ./install.py
|
||||
```
|
||||
|
||||
That is it. You can find multibootusb under system menu or simply launch from terminal by typing "multibootusb".
|
||||
If "install.py" script fails to install multibootusb successfully then manually install following packages and rerun the install.py script:-
|
||||
---
|
||||
|
||||
* mtools util-linux parted python3-qt5 python-dbus pkexec
|
||||
|
||||
NOTE: install.py currently supports only distros based on apt-get, yum, zypper, pacman.
|
||||
You can add more if you use other package manager system and email to me for adding into upstream.
|
||||
The above how to is only for linux. Windows users may download pre compiled standalone binaries/ .exe from
|
||||
https://sourceforge.net/projects/multibootusb/files/
|
||||
|
||||
How to uninstall?
|
||||
-----------------
|
||||
@ -42,22 +65,30 @@ chmod +x ./uninstall.py
|
||||
sudo ./uninstall.py
|
||||
```
|
||||
|
||||
For the rest of operations you can refer [Guide](http://multibootusb.org/page_guide/) section of [http://multibootusb.org](http://multibootusb.org)
|
||||
|
||||
Website:
|
||||
--------
|
||||
www.multibootusb.org
|
||||
|
||||
http://multibootusb.org
|
||||
|
||||
|
||||
Development:
|
||||
-----------
|
||||
|
||||
https://github.com/mbusb/multibootusb
|
||||
|
||||
Help:
|
||||
-----
|
||||
Mail me at feedback.multibootusb@gmail.com for query, help, bug report or feature request.
|
||||
|
||||
Use Github issue service at [https://github.com/mbusb/multibootusb/issues](https://github.com/mbusb/multibootusb/issues)
|
||||
for help and issues.
|
||||
|
||||
Contributor(s)
|
||||
--------------
|
||||
LiQiong Lee
|
||||
Ian Bruce
|
||||
LiQiong Lee
|
||||
Alin Trăistaru (alindt)
|
||||
and many others who have given their valuable bug report/ feedback.
|
||||
|
||||
Author(s)
|
||||
|
30
build_pkg
30
build_pkg
@ -20,6 +20,7 @@ import shutil
|
||||
import subprocess
|
||||
import sys
|
||||
import platform
|
||||
import re
|
||||
|
||||
|
||||
####################################################################################################
|
||||
@ -34,6 +35,9 @@ else:
|
||||
# pyinstaller_path = "/home/sundar/Documents/pyInstaller/pyinstaller.py"
|
||||
pyinstaller_path = "/media/sundar/Data/multibootusb/pyinstaller/pyinstaller.py"
|
||||
release_dir = "/media/sundar/Data/multibootusb/release"
|
||||
debian_bin_path = '/usr/bin/multibootusb'
|
||||
rpm_bin_path = '/usr/local/bin/multibootusb'
|
||||
|
||||
sourceforge_release_path = "multibootusb@frs.sourceforge.net:/home/frs/project/multibootusb/"
|
||||
####################################################################################################
|
||||
|
||||
@ -47,6 +51,27 @@ class bcolors:
|
||||
ENDC = '\033[0m'
|
||||
|
||||
|
||||
def coorect_bin_path(_file_path, search_bin_path, replace_bin_path):
|
||||
import shutil
|
||||
|
||||
# shutil.move(_file_path, _file_path + "~")
|
||||
# destination = open(_file_path, "w")
|
||||
# source = open(_file_path + "~", "r").read()
|
||||
|
||||
with open(_file_path + "~", 'r') as _infile:
|
||||
data = _infile.read()
|
||||
|
||||
if re.search(search_bin_path, data, re.I):
|
||||
_data = re.search(search_bin_path, data, re.I).group()
|
||||
_mod_text = re.sub(search_bin_path, replace_bin_path, data)
|
||||
print('_mod_text', _mod_text)
|
||||
with open(_file_path, 'w') as _out_file:
|
||||
_out_file.write(_mod_text)
|
||||
else:
|
||||
with open(_file_path, 'w') as _out_file:
|
||||
_out_file.write(data)
|
||||
|
||||
|
||||
class pkg():
|
||||
def __init__(self, name):
|
||||
self.pkg_name = name
|
||||
@ -64,6 +89,8 @@ class pkg():
|
||||
if not os.path.exists(os.path.join(self.release_upload_dir, "Source")):
|
||||
os.mkdir(os.path.join(self.release_upload_dir, "Source"))
|
||||
if self.pkg_name == "deb":
|
||||
print('Modifying policy file...')
|
||||
coorect_bin_path('org.debian.pkexec.run-multibootusb.policy', rpm_bin_path, debian_bin_path)
|
||||
print("Ensure thta you have python-stdeb package installed!")
|
||||
stdcfg = """[DEFAULT]
|
||||
Package: multibootusb
|
||||
@ -89,6 +116,8 @@ class pkg():
|
||||
print((os.path.join("deb_dist", "python3-multibootusb_" + self.version + "-1_all.deb\n\n\n")))
|
||||
result = True
|
||||
elif self.pkg_name == 'rpm' or self.pkg_name == 'suse' or self.pkg_name == 'mageia':
|
||||
print('Modifying policy file for rpm packages...')
|
||||
coorect_bin_path('org.debian.pkexec.run-multibootusb.policy', debian_bin_path, rpm_bin_path)
|
||||
if self.pkg_name == 'suse' or self.pkg_name == 'mageia':
|
||||
require = "python3-qt5, parted, util-linux, mtools, python3-dbus, python3-pyudev, p7zip, python3-six"
|
||||
else:
|
||||
@ -282,6 +311,7 @@ if __name__ == '__main__':
|
||||
if platform.system() == 'Linux':
|
||||
print('Converting line ending to Linux for proper functioning.')
|
||||
os.system('dos2unix multibootusb')
|
||||
|
||||
argv = sys.argv
|
||||
if not os.path.exists(release_dir):
|
||||
print("Release directory does not exist.\nPlease mount and rerun the script.")
|
||||
|
@ -1,6 +1,22 @@
|
||||
#!/bin/bash
|
||||
# Generic wrapper for locating multibootusb file and execute pkexec accordingly
|
||||
# Bin pat of this file and policy file have to match
|
||||
|
||||
if [ $(which pkexec) ]; then
|
||||
if [ -f /usr/bin/multibootusb ]; then
|
||||
pkexec --disable-internal-agent "/usr/bin/multibootusb" "$@"
|
||||
fi
|
||||
|
||||
if [ -f /usr/local/bin/multibootusb ]; then
|
||||
pkexec --disable-internal-agent "/usr/local/bin/multibootusb" "$@"
|
||||
fi
|
||||
else
|
||||
if [ -f /usr/bin/multibootusb ]; then
|
||||
/usr/bin/multibootusb "$@"
|
||||
fi
|
||||
|
||||
if [ -f /usr/local/bin/multibootusb ]; then
|
||||
/usr/local/bin/multibootusb "$@"
|
||||
fi
|
||||
|
||||
fi
|
@ -12,7 +12,7 @@
|
||||
<allow_inactive>auth_admin</allow_inactive>
|
||||
<allow_active>auth_admin</allow_active>
|
||||
</defaults>
|
||||
<annotate key="org.freedesktop.policykit.exec.path">/usr/bin/multibootusb</annotate>
|
||||
<annotate key="org.freedesktop.policykit.exec.path">/usr/local/bin/multibootusb</annotate>
|
||||
<annotate key="org.freedesktop.policykit.exec.allow_gui">true</annotate>
|
||||
</action>
|
||||
|
||||
|
@ -216,12 +216,15 @@ def copy_mbusb_dir_usb(usb_disk):
|
||||
log('multibootusb directory already exists. Not copying.')
|
||||
|
||||
if not os.path.exists(os.path.join(usb_mount_path, 'EFI', 'BOOT', 'multibootusb_grub2.txt')):
|
||||
if not os.path.exists(os.path.join(usb_mount_path, 'EFI', 'BOOT')):
|
||||
log('EFI directory does not exist. Creating new.')
|
||||
os.makedirs(os.path.join(usb_mount_path, 'EFI', 'BOOT'), exist_ok=True)
|
||||
try:
|
||||
log('Copying EFI directory to ' + usb_mount_path)
|
||||
shutil.copytree(resource_path(os.path.join("data", "EFI")), os.path.join(usb_mount_path, "EFI"))
|
||||
result = True
|
||||
except:
|
||||
log('multibootusb directory could not be copied to ' + usb_mount_path)
|
||||
log('EFI directory could not be copied to ' + usb_mount_path)
|
||||
result = False
|
||||
else:
|
||||
log('EFI directory already exist. Not copying.')
|
||||
|
@ -346,14 +346,20 @@ Are you SURE you want to enable it?",
|
||||
"""
|
||||
|
||||
self.ui_disable_controls()
|
||||
|
||||
if platform.system() == "Linux" or platform.system() == "Windows":
|
||||
if self.ui.check_install_sys_all.isChecked() or self.ui.check_install_sys_only.isChecked():
|
||||
if platform.system() == 'Linux' and config.usb_disk[-1].isdigit() is False:
|
||||
gen.log('Selected USB is a disk. Please select a disk partition from the drop down list')
|
||||
QtWidgets.QMessageBox.information(self, 'No Partition...!',
|
||||
'USB disk selected doesn\'t contain a partition.\n'
|
||||
'Please select the partition (ending '
|
||||
'with a digit eg. /dev/sdb1)\nfrom the drop down list.')
|
||||
|
||||
if self.ui.install_sys_all.isChecked() or self.ui.install_sys_only.isChecked():
|
||||
log("Installing default syslinux on ", config.usb_disk)
|
||||
else:
|
||||
log("Installing default syslinux on " + config.usb_disk)
|
||||
ret = syslinux_default(config.usb_disk)
|
||||
if ret is True:
|
||||
if self.ui.install_sys_all.isChecked():
|
||||
if self.ui.check_install_sys_all.isChecked():
|
||||
log("Copying multibootusb directory to " + config.usb_mount)
|
||||
for dirpath, dirnames, filenames in os.walk(resource_path(os.path.join("tools", "multibootusb"))):
|
||||
for f in filenames:
|
||||
|
@ -269,6 +269,8 @@ def update_mbusb_cfg_file(iso_link, usb_uuid, usb_mount, distro):
|
||||
Update main multibootusb suslinux.cfg file after distro is installed.
|
||||
:return:
|
||||
"""
|
||||
if platform.system() == 'Linux':
|
||||
os.system('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))
|
||||
|
2
setup.py
2
setup.py
@ -46,7 +46,7 @@ setup(
|
||||
('/usr/share/multibootusb/data/tools/dd', ["data/tools/dd/dd.exe"]),
|
||||
('/usr/share/multibootusb/data/tools/dd', ["data/tools/dd/diskio.dll"]),
|
||||
('/usr/share/multibootusb/data/tools/mkfs', ["data/tools/mkfs/mke2fs.exe"]),
|
||||
('/usr/share/multibootusb/data/EFI', get_data('data/EFI')),
|
||||
('/usr/share/multibootusb/data/EFI/BOOT', get_data('data/EFI')),
|
||||
('/usr/share/multibootusb/data/multibootusb', ["data/multibootusb/chain.c32"]),
|
||||
('/usr/share/multibootusb/data/multibootusb', ["data/multibootusb/bg.png"]),
|
||||
('/usr/share/multibootusb/data/multibootusb', ["data/multibootusb/extlinux.cfg"]),
|
||||
|
Loading…
Reference in New Issue
Block a user