Skip to content

Commit e63a7db

Browse files
committed
Released mkusb 11.0.1
1 parent d06b214 commit e63a7db

File tree

6 files changed

+143
-59
lines changed

6 files changed

+143
-59
lines changed

mkusb

Lines changed: 133 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -306,8 +306,14 @@
306306
# 2016-05-24 sudodus mkusb version 10.6.5
307307
# 2016-05-24 sudodus improved logic to invoke gpt_fix
308308
# 2016-05-24 sudodus mkusb version 10.6.6
309+
# 2016-07-21 sudodus enabled alternative without usb-pack_efi.tar.gz
310+
# advantage: free software
311+
# disadvantage: 32-bit version do not boot in UEFI mode
312+
# 2016-07-21 sudodus mkusb version 11.0.0
313+
# 2016-07-26 sudodus function get_usb_pack_efi
314+
# 2016-07-26 sudodus mkusb version 11.0.1
309315

310-
version="mkusb 10.6.6"
316+
version="mkusb 11.0.1"
311317

312318
prgnam="${version% *}"
313319
#echo "$prgnam"
@@ -594,7 +600,7 @@ errout=$(mktemp)
594600
zerrlog=$(mktemp)
595601

596602
(echo "$htmlbody") | zenity --text-info --html --filename=/dev/stdin \
597-
--height=$(($hadd+120)) --title "" --timeout 2 2>> "$errout"
603+
--height=$(($hadd+120)) --title "" --timeout 1 2>> "$errout"
598604

599605
exitnr=$?
600606
grep 'The owner of' "$errout"
@@ -1555,7 +1561,7 @@ sed_mtab
15551561

15561562
if test -s "$zerrlog"
15571563
then
1558-
zenity --question --timeout 3 --text "Check zenity error log?" \
1564+
zenity --question --timeout 1 --text "Check zenity error log?" \
15591565
--ok-label "No" --cancel-label="Yes" 2>> "$zerrlog"
15601566
if [ $? -eq 1 ]
15611567
then
@@ -3302,7 +3308,7 @@ function grub_n_iso {
33023308
inst=0
33033309
bpsiz=128
33043310

3305-
select_boot_system
3311+
#select_boot_system
33063312
select_partition_table
33073313
echo "selected target partition table: '$part_type'"
33083314
get_grub_pc
@@ -3335,10 +3341,10 @@ fi
33353341
# check if running an installed system in UEFI mode, and
33363342
# in that case 'upefi' (usb-pack_efi.tar.gz) cannot be used
33373343

3338-
if ! $biosbl
3344+
if ! $biosbl || ! test -f "$mkusb_sdir"/usb-pack_efi.tar.gz
33393345
then
33403346
upefi=false
3341-
mess0="The boot system must be fetched from the ISO file"
3347+
mess0="The boot system for UEFI must be fetched from the ISO file"
33423348
echo "$separator"
33433349
echo "$mess0"
33443350
echo "$separator"
@@ -3353,7 +3359,9 @@ srclocal="${srcorig##*/}"
33533359

33543360
mount -o loop "$srclocal" "$looper" 2>&1
33553361

3356-
if ! test -f "$looper"/boot/grub/grub.cfg && ! $upefi
3362+
select_boot_system "$looper"
3363+
3364+
if ! test -f "$looper"/boot/grub/grub.cfg && ! $upefi && ! $biosbl
33573365
then
33583366
ng1="'.../boot/grub/grub.cfg': file not found"
33593367
ng2="In an installed system in UEFI mode, mkusb needs
@@ -3367,6 +3375,9 @@ Try with an Ubuntu family *amd64* iso file."
33673375
rm -r "$looper" "$targ1" "$tailfile" "$usbdata"
33683376
warner "$ng1" "$ng2"
33693377
exit
3378+
elif ! test -f "$looper"/boot/grub/grub.cfg
3379+
then
3380+
get_usb_pack_efi
33703381
fi
33713382

33723383
# general grub_n_iso progress window
@@ -3428,12 +3439,12 @@ then
34283439
exit
34293440
fi
34303441

3431-
is_file "$mkusb_sdir"/usb-pack_efi.tar.gz
3432-
if [ $? -ne 0 ]
3433-
then
3434-
clear_grn "$pid" "$looper" "$targ1" "$tailfile" "$usbdata"
3435-
exit
3436-
fi
3442+
#is_file "$mkusb_sdir"/usb-pack_efi.tar.gz
3443+
#if [ $? -ne 0 ]
3444+
#then
3445+
# clear_grn "$pid" "$looper" "$targ1" "$tailfile" "$usbdata"
3446+
# exit
3447+
#fi
34373448

34383449
source="$srcorig"
34393450

@@ -3522,7 +3533,7 @@ fi
35223533
get_percent
35233534

35243535
echo "$separator"
3525-
echo "Selected percentage of remaining space for persistence = $perc"
3536+
echo -e "$inversvid Selected percentage of remaining space for persistence = $perc $resetvid"
35263537
echo "$separator"
35273538
persize=$(( $perc * $freesize/100 ))
35283539
if [ $persize -lt 300 ]
@@ -3797,13 +3808,25 @@ echo "70
37973808

37983809
if $biosbl
37993810
then
3800-
if $upefi
3811+
if $upefi && test -f "$mkusb_sdir"/usb-pack_efi.tar.gz
38013812
then
3802-
/bin/echo -n "UEFI Bootloader: "
3813+
/bin/echo -ne "$inversvid UEFI Bootloader: $resetvid "
38033814
grub-install --force --removable --no-floppy --boot-directory="$targ1"/boot \
38043815
--efi-directory="$targ1"/EFI/BOOT "$2" 2>&1
3816+
elif ! test -f "$looper"/boot/grub/grub.cfg
3817+
then
3818+
/bin/echo -e "$inversvid No UEFI Bootloader available $resetvid
3819+
mkusb needs the package 'usb-pack-efi' with the file
3820+
'usb-pack_efi.tar.gz' from 'ppa:mkusb/ppa' to make a
3821+
persistent live system with this iso file boot in UEFI mode.
3822+
You can use the following command lines in a terminal window.
3823+
3824+
sudo add-apt-repository ppa:mkusb/ppa
3825+
sudo apt-get update
3826+
sudo apt-get install usb-pack-efi
3827+
$separator"
38053828
fi
3806-
/bin/echo -n "BIOS Bootloader: "
3829+
/bin/echo -ne "$inversvid BIOS Bootloader: $resetvid "
38073830
grub-install --force --removable --no-floppy --boot-directory="$targ1"/boot "$2" 2>&1
38083831
fi
38093832

@@ -3812,17 +3835,20 @@ echo "80
38123835

38133836
error=""
38143837

3815-
if ! $upefi # start copy/extract boot files ---------------------------
3838+
# start copy/extract boot files (not upefi) ----------------------------
3839+
3840+
if ! $upefi && test -f "$looper"/boot/grub/grub.cfg
38163841
then
38173842

38183843
# copy the boot files from the iso file
38193844

3820-
echo "copy the boot files from the iso file"
3845+
/bin/echo -e "$inversvid 64-bit bootloader: copy the boot files from the iso file $resetvid"
38213846
echo "looper=$looper"
38223847
echo "targ1=$targ1"
38233848

38243849
sudo rsync -Ha --exclude=filesystem.squashfs "$looper/" "$targ1"
3825-
echo "rsync: symlink errors are *expected* because of the target file system"
3850+
/bin/echo -e "rsync:$inversvid don't worry, $resetvid symlink errors are *expected*
3851+
because of the target file system."
38263852

38273853
is_file "$targ1"/boot/grub/grub.cfg
38283854
if [ $? -ne 0 ]
@@ -3849,15 +3875,18 @@ then
38493875
fi
38503876
rm "$targ1"/boot/grub/grub.cfg0
38513877

3852-
else # ... copy/extract boot files -----------------------------------
3878+
else # ... copy/extract boot files (upefi) ----------------------------
38533879

38543880
# extract files originally from Andre's zip-file (except grub.cfg grub4dos/ ini/)
38553881

3856-
echo "using usb-pack_efi.tar.gz"
3857-
tar -xvzf "$mkusb_sdir"/usb-pack_efi.tar.gz --directory "$targ1"
3858-
if [ $? -ne 0 ]
3882+
if test -f "$mkusb_sdir"/usb-pack_efi.tar.gz
38593883
then
3860-
error="- tar: extracting usb-pack_efi"
3884+
echo "using usb-pack_efi.tar.gz"
3885+
tar -xvzf "$mkusb_sdir"/usb-pack_efi.tar.gz --directory "$targ1"
3886+
if [ $? -ne 0 ]
3887+
then
3888+
error="- tar: extracting usb-pack_efi"
3889+
fi
38613890
fi
38623891

38633892
# tweak grub.cfg
@@ -3895,7 +3924,7 @@ then
38953924
error="$error - sed: appending grub.cfg"
38963925
fi
38973926

3898-
fi # end copy/extract boot files -------------------------------------
3927+
fi # end copy/extract boot files --------------------------------------
38993928

39003929
# copy the script files 'backup' and 'restore'
39013930

@@ -4128,8 +4157,8 @@ then
41284157
echo "$separator"
41294158
mess1="\Z4$0\Zn\n
41304159
\n
4131-
might not make all systems bootable in UEFI mode using 'usb-pack_efi'
4132-
from this version. You should \Z4work in version $minrel or newer\Zn of
4160+
might not make all systems bootable in UEFI mode from this version.
4161+
You should \Z4work in version $minrel or newer\Zn of
41334162
Ubuntu or an Ubuntu flavour (Kubuntu, Lubuntu, ... Xubuntu.)"
41344163
echo "$mess1"|sed -e 's/\\Z.//g' -e 's/\\n//g'
41354164
message="$mess1\n
@@ -4704,6 +4733,39 @@ fi
47044733
########################################################################
47054734
########################################################################
47064735

4736+
function get_usb_pack_efi {
4737+
4738+
if ! test -f /usr/share/mkusb/usb-pack_efi.tar.gz && test -f /usr/bin/apt-get
4739+
then
4740+
upinst=$(apt-cache policy usb-pack-efi|grep -m1 Installed)
4741+
if [ "${upinst/(none)}" != "$upinst" ]
4742+
then
4743+
menu_package_installer wants usb-pack-efi "useful in order to install 'persistent live'."
4744+
elif [ "${upinst/Installed}" != "$upinst" ]
4745+
then
4746+
echo "usb-pack-efi: $upinst"
4747+
echo "trying to reinstall usb-pack-efi ..."
4748+
sudo apt-get install --reinstall usb-pack-efi
4749+
echo "$separator"
4750+
else
4751+
echo "$separator"
4752+
message="mkusb will be able to create persistent live drives that work in UEFI mode
4753+
also from 32-bit iso files, if you add ppa:mkusb/ppa and install usb-pack-efi.
4754+
You can copy and paste the following three command lines to a terminal window.
4755+
4756+
sudo add-apt-repository ppa:mkusb/ppa
4757+
sudo apt-get update
4758+
sudo apt-get install usb-pack-efi"
4759+
echo "$message"
4760+
echo "$separator"
4761+
warner "Install 'usb-pack-efi' manually" "$message"
4762+
fi
4763+
fi
4764+
}
4765+
4766+
########################################################################
4767+
########################################################################
4768+
47074769
function menu_entry_1 {
47084770

47094771
# Usage: menu_entry_1 <input file> <output file>
@@ -4753,42 +4815,65 @@ IFS=$old_IFS # restore default field separator
47534815

47544816
function select_boot_system {
47554817

4756-
while [ "$ans" != "u" ] && [ "$ans" != "i" ] && [ "$ans" != "q" ]
4757-
do
4818+
# parameter looper
47584819

4759-
ans=$(zenity --list --width=$(($wadd+540)) --height=$(($hadd+240)) \
4820+
ans=
4821+
#find "$looper" -name "*amd64*" | grep -a grub
4822+
find "$looper" -name "*amd64*" | grep -a grub > /dev/null 2> /dev/null
4823+
#ans=$?
4824+
#echo "find "$looper" -name *amd64* | grep -a grub 2>&1 /dev/null"
4825+
#echo "select_boot_system: ans=dollarfråga=$ans"
4826+
#if [ $ans -eq 0 ] && test -f "$mkusb_sdir"/usb-pack_efi.tar.gz
4827+
if [ $? -eq 0 ] && test -f "$mkusb_sdir"/usb-pack_efi.tar.gz
4828+
then
4829+
while [ "$ans" != "u" ] && [ "$ans" != "i" ] && [ "$ans" != "q" ]
4830+
do
4831+
4832+
ans=$(zenity --list --width=$(($wadd+540)) --height=$(($hadd+240)) \
47604833
--title="$version - select boot system" --cancel-label="Quit" \
47614834
--window-icon="/usr/share/icons/hicolor/48x48/apps/mkusb.png" \
47624835
--text="Select preferred boot system from 'usb-pack_efi' or from 'ISO file'
47634836
'usb-pack_efi': does not work with secure boot
47644837
'ISO file': does not work with i386 iso files (32-bit systems)" \
47654838
--column="Hotkey" --column="Selection" \
4766-
u "usb-pack_efi" \
47674839
i "ISO file" \
4768-
q "Quit from this menu (default 'usb-pack_efi' if possible)" \
4840+
u "usb-pack_efi" \
4841+
q "Quit from this menu (default 'ISO file' if possible)" \
47694842
2>> "$zerrlog")
47704843

4771-
retval=$?
4772-
if [ $retval -eq 1 ]
4773-
then
4774-
ans=$retval
4775-
fi
4776-
ans=${ans:0:1} # fix for buggy(?) zenity --list in trusty
4844+
retval=$?
4845+
if [ $retval -eq 1 ]
4846+
then
4847+
ans=$retval
4848+
fi
4849+
ans=${ans:0:1} # fix for buggy(?) zenity --list in trusty
47774850

47784851
# echo "ans=xxx${ans}xxx"
47794852

4780-
if [ "$ans" == "1" ]
4781-
then
4782-
ans="q"
4783-
elif [ "$ans" == "u" ]
4784-
then
4785-
upefi=true
4786-
elif [ "$ans" == "i" ]
4853+
upefi=false
4854+
if [ "$ans" == "1" ]
4855+
then
4856+
ans="q"
4857+
elif [ "$ans" == "u" ]
4858+
then
4859+
upefi=true
4860+
elif [ "$ans" == "i" ]
4861+
then
4862+
upefi=false
4863+
fi
4864+
done
4865+
ans=0
4866+
4867+
else
4868+
find "$looper" -name "*amd64*" | grep grub > /dev/null 2> /dev/null
4869+
if [ $? -eq 0 ]
47874870
then
47884871
upefi=false
4872+
else
4873+
upefi=true
47894874
fi
4790-
done
4791-
ans=0
4875+
fi
4876+
echo "select_boot_system: [if installed, use] usb-pack_efi=$upefi"
47924877
}
47934878

47944879
########################################################################

mkusb_sdir/maybe-problems.txt

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,10 @@ Boot alternatives in the grub menu:\n
1515
\Z7-------------------------------------------------------------------\Zn\n
1616
\Z4The following Ubuntu [based] distros are tested and work\Zn\n
1717
\Z7-------------------------------------------------------------------\Zn\n
18-
ubuntu-12.04.x-desktop-i386.iso "precise"\n
19-
ubuntu-14.04.x-desktop-amd64.iso "trusty"\n
20-
xenial-desktop-amd64.iso ...\n
18+
ubuntu-12.04.x-desktop-{amd64,i386}.iso "precise"\n
19+
ubuntu-14.04.x-desktop-{amd64,i386}.iso "trusty"\n
20+
ubuntu-16.04.x-desktop-{amd64,i386}.iso "xenial"\n
21+
yakkety-desktop-amd64.iso ...\n
2122
the whole Ubuntu family's desktop iso files\n
2223
Kubuntu, Lubuntu, standard Ubuntu, Xubuntu, ...\n
2324
\n
@@ -26,13 +27,14 @@ bodhi-2.4.0-64.iso\n
2627
extix-14.2-64bit-isoh-persistent-836mb-141024.iso\n
2728
linuxmint-17.2-cinnamon-64bit.iso\n
2829
lxle-12044-32.iso (not isohybrid)\n
29-
ToriOS-beta.iso (based on Ubuntu 12.04 i386)\n
30+
ToriOS-daily.iso (based on Ubuntu 12.04 i386)\n
3031

3132
\Z7-------------------------------------------------------------------\Zn\n
3233
\Z4The following Debian [based] distros are tested and work\Zn\n
3334
\Z7-------------------------------------------------------------------\Zn\n
3435
debian-live-8.0.0-i386-gnome-desktop.iso "Debian Jessie 32-bit"\n
3536
debian-live-8.2.0-amd64-gnome-desktop.iso "Debian Jessie 64-bit"\n
37+
ToriOS-Debian-daily.iso\n
3638

3739
\Z7---------------------------------------------------------\Zn\n
3840
\Z4The following distros boot but persistence fails\Zn\n

q.txt

Lines changed: 0 additions & 6 deletions
This file was deleted.

show-q

Lines changed: 0 additions & 1 deletion
This file was deleted.

usb-pack-efi

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/bash
2+
3+
echo "usb-pack_efi - a help package for mkusb"
4+
echo "installs /usr/share/mkusb/usb-pack_efi.tar.gz"
File renamed without changes.

0 commit comments

Comments
 (0)