Merge pull request #158365 from k4leg/ventoy-update

This commit is contained in:
Sandro 2022-03-31 09:40:00 +02:00 committed by GitHub
commit 36436ac2fe
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 72 additions and 107 deletions

View file

@ -0,0 +1,5 @@
--- VentoyPlugson.sh
+++ VentoyPlugson.sh
@@ -27,0 +28,2 @@ elif echo $machine | egrep -q 'x86_64|am
+elif echo $machine | egrep -q 'mips64'; then
+ TOOLDIR=mips64el

View file

@ -1,40 +1,55 @@
{ lib, stdenv, fetchurl, fetchpatch { lib, stdenv, fetchurl, fetchpatch
, autoPatchelfHook, makeWrapper , autoPatchelfHook, makeWrapper
, hexdump, exfat, dosfstools, e2fsprogs, xz, util-linux, bash, parted , bash, coreutils, dosfstools, exfat, gawk, gnugrep, gnused, hexdump, parted
, withGtk3 ? true, gtk3 , procps, util-linux, which, xz
, withCryptsetup ? false, cryptsetup
, withXfs ? false, xfsprogs
, withExt4 ? false, e2fsprogs
, withNtfs ? false, ntfs3g
, withGtk3 ? false, gtk3
, withQt5 ? false, qt5 , withQt5 ? false, qt5
, defaultGuiType ? ""
}: }:
let arch = { assert lib.elem defaultGuiType ["" "gtk3" "qt5"];
x86_64-linux = "x86_64"; assert defaultGuiType == "gtk3" -> withGtk3;
i686-linux = "i386"; assert defaultGuiType == "qt5" -> withQt5;
aarch64-linux = "aarch64";
mipsel-linux = "mips64el"; let
}.${stdenv.hostPlatform.system} or (throw "Unsupported platform ${stdenv.hostPlatform.system}"); arch = {
defaultGuiType = if withGtk3 then "gtk3" x86_64-linux = "x86_64";
else if withQt5 then "qt5" i686-linux = "i386";
else ""; aarch64-linux = "aarch64";
mipsel-linux = "mips64el";
}.${stdenv.hostPlatform.system} or (throw "Unsupported platform ${stdenv.hostPlatform.system}");
in stdenv.mkDerivation rec { in stdenv.mkDerivation rec {
pname = "ventoy-bin"; pname = "ventoy-bin";
version = "1.0.56"; version = "1.0.72";
nativeBuildInputs = [ autoPatchelfHook makeWrapper ] nativeBuildInputs = [ autoPatchelfHook makeWrapper ]
++ lib.optional withQt5 qt5.wrapQtAppsHook; ++ lib.optional withQt5 qt5.wrapQtAppsHook;
buildInputs = [ hexdump exfat dosfstools e2fsprogs xz util-linux bash parted ] buildInputs = [
bash coreutils dosfstools exfat gawk gnugrep gnused hexdump parted procps
util-linux which xz
] ++ lib.optional withCryptsetup cryptsetup
++ lib.optional withXfs xfsprogs
++ lib.optional withExt4 e2fsprogs
++ lib.optional withNtfs ntfs3g
++ lib.optional withGtk3 gtk3 ++ lib.optional withGtk3 gtk3
++ lib.optional withQt5 qt5.qtbase; ++ lib.optional withQt5 qt5.qtbase;
src = fetchurl { src = fetchurl {
url = "https://github.com/ventoy/Ventoy/releases/download/v${version}/ventoy-${version}-linux.tar.gz"; url = "https://github.com/ventoy/Ventoy/releases/download/v${version}/ventoy-${version}-linux.tar.gz";
sha256 = "da53d51e653092a170c11dd560e0ad6fb27c497dd77ad0ba483c32935c069dea"; sha256 = "sha256-1mfe6ZnqkeBNGNjI7Qx7jG5FLgfn6rVwr0VQvSOG7Ow=";
}; };
patches = [ patches = [
(fetchpatch { (fetchpatch {
name = "sanitize.patch"; name = "sanitize.patch";
url = "https://aur.archlinux.org/cgit/aur.git/plain/sanitize.patch?h=ventoy-bin&id=ce4c26c67a1de4b761f9448bf92e94ffae1c8148"; url = "https://aur.archlinux.org/cgit/aur.git/plain/sanitize.patch?h=19f8922b3d96c5ff55eeefc269ae43369a0748e8";
sha256 = "c00f9f9cd5b4f81c566267b7b2480fa94d28dda43a71b1e47d6fa86f764e7038"; sha256 = "sha256-RDdxPCmrfNMwXNuJwQW48fAiJPbMjdHiBmF03fKqm2o=";
}) })
./fix-for-read-only-file-system.patch ./fix-for-read-only-file-system.patch
./add-mips64.patch
]; ];
patchFlags = [ "-p0" ]; patchFlags = [ "-p0" ];
postPatch = '' postPatch = ''
@ -42,7 +57,8 @@ in stdenv.mkDerivation rec {
find -type f -name \*.sh -exec chmod a+x '{}' \; find -type f -name \*.sh -exec chmod a+x '{}' \;
# Fix path to log. # Fix path to log.
sed -i 's:[lL]og\.txt:/var/log/ventoy\.log:g' WebUI/static/js/languages.js sed -i 's:log\.txt:/var/log/ventoy\.log:g' \
WebUI/static/js/languages.js tool/languages.json
''; '';
installPhase = '' installPhase = ''
# Setup variables. # Setup variables.
@ -66,8 +82,8 @@ in stdenv.mkDerivation rec {
aarch64) rm -r {tool/,VentoyGUI.}{x86_64,i386,mips64el};; aarch64) rm -r {tool/,VentoyGUI.}{x86_64,i386,mips64el};;
mips64el) rm -r {tool/,VentoyGUI.}{x86_64,i386,aarch64};; mips64el) rm -r {tool/,VentoyGUI.}{x86_64,i386,aarch64};;
esac esac
rm README rm README tool/VentoyWorker.sh.orig
rm tool/"$ARCH"/Ventoy2Disk.gtk2 rm tool/"$ARCH"/Ventoy2Disk.gtk2 || true # For aarch64 and mips64el.
# Copy from "$src" to "$out". # Copy from "$src" to "$out".
mkdir -p "$out"/bin "$VENTOY_PATH" mkdir -p "$out"/bin "$VENTOY_PATH"
@ -76,20 +92,24 @@ in stdenv.mkDerivation rec {
# Fill bin dir. # Fill bin dir.
for f in Ventoy2Disk.sh_ventoy VentoyWeb.sh_ventoy-web \ for f in Ventoy2Disk.sh_ventoy VentoyWeb.sh_ventoy-web \
CreatePersistentImg.sh_ventoy-persistent \ CreatePersistentImg.sh_ventoy-persistent \
ExtendPersistentImg.sh_ventoy-extend-persistent; do ExtendPersistentImg.sh_ventoy-extend-persistent \
makeWrapper "$VENTOY_PATH/''${f%_*}" "$out/bin/''${f#*_}" \ VentoyPlugson.sh_ventoy-plugson; do
local bin="''${f%_*}" wrapper="''${f#*_}"
makeWrapper "$VENTOY_PATH/$bin" "$out/bin/$wrapper" \
--prefix PATH : "${lib.makeBinPath buildInputs}" \ --prefix PATH : "${lib.makeBinPath buildInputs}" \
--run "cd '$VENTOY_PATH' || exit 1" --run "cd '$VENTOY_PATH' || exit 1"
done done
'' + lib.optionalString (withGtk3 || withQt5) '' '' + lib.optionalString (withGtk3 || withQt5) ''
# VentoGUI uses the `ventoy_gui_type` file to determine the type of GUI.
# See <https://github.com/ventoy/Ventoy/blob/471432fc50ffad80bde5de0b22e4c30fa3aac41b/LinuxGUI/Ventoy2Disk/ventoy_gui.c#L1044>.
echo "${defaultGuiType}" > "$VENTOY_PATH/ventoy_gui_type" echo "${defaultGuiType}" > "$VENTOY_PATH/ventoy_gui_type"
makeWrapper "$VENTOY_PATH/VentoyGUI.$ARCH" "$out/bin/ventoy-gui" \ makeWrapper "$VENTOY_PATH/VentoyGUI.$ARCH" "$out/bin/ventoy-gui" \
--prefix PATH : "${lib.makeBinPath buildInputs}" \ --prefix PATH : "${lib.makeBinPath buildInputs}" \
--run "cd '$VENTOY_PATH' || exit 1" --run "cd '$VENTOY_PATH' || exit 1"
'' + lib.optionalString (!withGtk3) '' '' + lib.optionalString (!withGtk3) ''
rm "$out"/share/ventoy/tool/"$ARCH"/Ventoy2Disk.gtk3 rm "$VENTOY_PATH/tool/$ARCH/Ventoy2Disk.gtk3"
'' + lib.optionalString (!withQt5) '' '' + lib.optionalString (!withQt5) ''
rm "$out"/share/ventoy/tool/"$ARCH"/Ventoy2Disk.qt5 rm "$VENTOY_PATH/tool/$ARCH/Ventoy2Disk.qt5"
''; '';
meta = with lib; { meta = with lib; {
@ -99,10 +119,14 @@ in stdenv.mkDerivation rec {
ISO/WIM/IMG/VHD(x)/EFI files. With ventoy, you don't need to format the ISO/WIM/IMG/VHD(x)/EFI files. With ventoy, you don't need to format the
disk over and over, you just need to copy the ISO/WIM/IMG/VHD(x)/EFI disk over and over, you just need to copy the ISO/WIM/IMG/VHD(x)/EFI
files to the USB drive and boot them directly. You can copy many files files to the USB drive and boot them directly. You can copy many files
at a time and ventoy will give you a boot menu to select them at a time and ventoy will give you a boot menu to select them. You can
(screenshot). x86 Legacy BIOS, IA32 UEFI, x86_64 UEFI, ARM64 UEFI and also browse ISO/WIM/IMG/VHD(x)/EFI files in local disk and boot them.
MIPS64EL UEFI are supported in the same way. Most type of OS supported x86 Legacy BIOS, IA32 UEFI, x86_64 UEFI, ARM64 UEFI and MIPS64EL UEFI are
(Windows/WinPE/Linux/Unix/VMware/Xen...). supported in the same way. Most type of OS supported
(Windows/WinPE/Linux/ChromeOS/Unix/VMware/Xen...). With ventoy you can
also browse ISO/WIM/IMG/VHD(x)/EFI files in local disk and boot them.
800+ image files are tested. 90%+ distros in <distrowatch.com>
supported.
''; '';
homepage = "https://www.ventoy.net"; homepage = "https://www.ventoy.net";
changelog = "https://www.ventoy.net/doc_news.html"; changelog = "https://www.ventoy.net/doc_news.html";

View file

@ -1,7 +1,6 @@
diff -Naurp0 old/CreatePersistentImg.sh new/CreatePersistentImg.sh --- CreatePersistentImg.sh
--- CreatePersistentImg.sh 2021-07-17 13:13:51.000000000 +0300 +++ CreatePersistentImg.sh
+++ CreatePersistentImg.sh 2021-07-20 17:37:53.605911754 +0300 @@ -110,7 +110,3 @@ if [ -n "$config" ]; then
@@ -94,7 +94,3 @@ if [ -n "$config" ]; then
- if [ -d ./persist_tmp_mnt ]; then - if [ -d ./persist_tmp_mnt ]; then
- rm -rf ./persist_tmp_mnt - rm -rf ./persist_tmp_mnt
- fi - fi
@ -9,110 +8,47 @@ diff -Naurp0 old/CreatePersistentImg.sh new/CreatePersistentImg.sh
- mkdir ./persist_tmp_mnt - mkdir ./persist_tmp_mnt
- if mount $freeloop ./persist_tmp_mnt; then - if mount $freeloop ./persist_tmp_mnt; then
- echo '/ union' > ./persist_tmp_mnt/$config - echo '/ union' > ./persist_tmp_mnt/$config
+ path_to_persist_mnt="$(mktemp -d)" + path_to_persist_mnt="`mktemp -d`"
+ if mount $freeloop "$path_to_persist_mnt"; then + if mount $freeloop "$path_to_persist_mnt"; then
+ echo '/ union' > "$path_to_persist_mnt"/$config + echo '/ union' > "$path_to_persist_mnt"/$config
@@ -102 +98 @@ if [ -n "$config" ]; then @@ -118 +114 @@ if [ -n "$config" ]; then
- umount ./persist_tmp_mnt - umount ./persist_tmp_mnt
+ umount "$path_to_persist_mnt" + umount "$path_to_persist_mnt"
@@ -104 +100 @@ if [ -n "$config" ]; then @@ -120 +116 @@ if [ -n "$config" ]; then
- rm -rf ./persist_tmp_mnt - rm -rf ./persist_tmp_mnt
+ rm -rf "$path_to_persist_mnt" + rm -rf "$path_to_persist_mnt"
diff -Naurp0 old/tool/VentoyWorker.sh new/tool/VentoyWorker.sh --- tool/VentoyWorker.sh
--- tool/VentoyWorker.sh 2021-07-17 13:13:51.000000000 +0300 +++ tool/VentoyWorker.sh
+++ tool/VentoyWorker.sh 2021-07-20 17:27:10.885452119 +0300 @@ -162,12 +161,0 @@ fi
@@ -153,12 +152,0 @@ fi
-#check tmp_mnt directory -#check tmp_mnt directory
-if [ -d ./tmp_mnt ]; then -if [ -d ./tmp_mnt ]; then
- vtdebug "There is a tmp_mnt directory, now delete it." - vtdebug "There is a tmp_mnt directory, now delete it."
- umount ./tmp_mnt >/dev/null 2>&1 - umount ./tmp_mnt >/dev/null 2>&1
- rm -rf ./tmp_mnt - rm -rf ./tmp_mnt
- if [ -d ./tmp_mnt ]; then - if [ -d ./tmp_mnt ]; then
- vterr "tmp_mnt directory exits, please delete it first." - vterr "tmp_mnt directory exists, please delete it first."
- exit 1 - exit 1
- fi - fi
-fi -fi
- -
- -
@@ -322 +310 @@ if [ "$MODE" = "install" ]; then @@ -569,2 +557,2 @@ else
- mkdir ./tmp_mnt
+ path_to_mnt="$(mktemp -d)"
@@ -326 +314 @@ if [ "$MODE" = "install" ]; then
- if mount ${PART2} ./tmp_mnt > /dev/null 2>&1; then
+ if mount ${PART2} "$path_to_mnt" > /dev/null 2>&1; then
@@ -335,9 +323,9 @@ if [ "$MODE" = "install" ]; then
- rm -f ./tmp_mnt/EFI/BOOT/BOOTX64.EFI
- rm -f ./tmp_mnt/EFI/BOOT/grubx64.efi
- rm -f ./tmp_mnt/EFI/BOOT/BOOTIA32.EFI
- rm -f ./tmp_mnt/EFI/BOOT/grubia32.efi
- rm -f ./tmp_mnt/EFI/BOOT/MokManager.efi
- rm -f ./tmp_mnt/EFI/BOOT/mmia32.efi
- rm -f ./tmp_mnt/ENROLL_THIS_KEY_IN_MOKMANAGER.cer
- mv ./tmp_mnt/EFI/BOOT/grubx64_real.efi ./tmp_mnt/EFI/BOOT/BOOTX64.EFI
- mv ./tmp_mnt/EFI/BOOT/grubia32_real.efi ./tmp_mnt/EFI/BOOT/BOOTIA32.EFI
+ rm -f "$path_to_mnt"/EFI/BOOT/BOOTX64.EFI
+ rm -f "$path_to_mnt"/EFI/BOOT/grubx64.efi
+ rm -f "$path_to_mnt"/EFI/BOOT/BOOTIA32.EFI
+ rm -f "$path_to_mnt"/EFI/BOOT/grubia32.efi
+ rm -f "$path_to_mnt"/EFI/BOOT/MokManager.efi
+ rm -f "$path_to_mnt"/EFI/BOOT/mmia32.efi
+ rm -f "$path_to_mnt"/ENROLL_THIS_KEY_IN_MOKMANAGER.cer
+ mv "$path_to_mnt"/EFI/BOOT/grubx64_real.efi "$path_to_mnt"/EFI/BOOT/BOOTX64.EFI
+ mv "$path_to_mnt"/EFI/BOOT/grubia32_real.efi "$path_to_mnt"/EFI/BOOT/BOOTIA32.EFI
@@ -348 +336 @@ if [ "$MODE" = "install" ]; then
- if umount ./tmp_mnt; then
+ if umount "$path_to_mnt"; then
@@ -350 +338 @@ if [ "$MODE" = "install" ]; then
- rm -rf ./tmp_mnt
+ rm -rf "$path_to_mnt"
@@ -407,2 +395,2 @@ else
- rm -f ./diskuuid.bin - rm -f ./diskuuid.bin
- dd status=none conv=fsync if=${DISK} skip=384 bs=1 count=16 of=./diskuuid.bin - dd status=none conv=fsync if=${DISK} skip=384 bs=1 count=16 of=./diskuuid.bin
+ path_to_diskuuid="$(mktemp)" + path_to_diskuuid="`mktemp`"
+ dd status=none conv=fsync if=${DISK} skip=384 bs=1 count=16 of="$path_to_diskuuid" + dd status=none conv=fsync if=${DISK} skip=384 bs=1 count=16 of="$path_to_diskuuid"
@@ -411,2 +399,2 @@ else @@ -573,2 +561,2 @@ else
- dd status=none conv=fsync if=./diskuuid.bin of=$DISK bs=1 count=16 seek=384 - dd status=none conv=fsync if=./diskuuid.bin of=$DISK bs=1 count=16 seek=384
- rm -f ./diskuuid.bin - rm -f ./diskuuid.bin
+ dd status=none conv=fsync if="$path_to_diskuuid" of=$DISK bs=1 count=16 seek=384 + dd status=none conv=fsync if="$path_to_diskuuid" of=$DISK bs=1 count=16 seek=384
+ rm -f "$path_to_diskuuid" + rm -f "$path_to_diskuuid"
@@ -415,2 +403,2 @@ else @@ -577,2 +565,2 @@ else
- rm -f ./rsvdata.bin - rm -f ./rsvdata.bin
- dd status=none conv=fsync if=${DISK} skip=2040 bs=512 count=8 of=./rsvdata.bin - dd status=none conv=fsync if=${DISK} skip=2040 bs=512 count=8 of=./rsvdata.bin
+ path_to_rsvdata="$(mktemp)" + path_to_rsvdata="`mktemp`"
+ dd status=none conv=fsync if=${DISK} skip=2040 bs=512 count=8 of="$path_to_rsvdata" + dd status=none conv=fsync if=${DISK} skip=2040 bs=512 count=8 of="$path_to_rsvdata"
@@ -438,2 +426,2 @@ else @@ -600,2 +588,2 @@ else
- dd status=none conv=fsync if=./rsvdata.bin seek=2040 bs=512 count=8 of=${DISK} - dd status=none conv=fsync if=./rsvdata.bin seek=2040 bs=512 count=8 of=${DISK}
- rm -f ./rsvdata.bin - rm -f ./rsvdata.bin
+ dd status=none conv=fsync if="$path_to_rsvdata" seek=2040 bs=512 count=8 of=${DISK} + dd status=none conv=fsync if="$path_to_rsvdata" seek=2040 bs=512 count=8 of=${DISK}
+ rm -f "$path_to_rsvdata" + rm -f "$path_to_rsvdata"
@@ -448 +436 @@ else
- mkdir ./tmp_mnt
+ path_to_mnt="$(mktemp -d)"
@@ -454 +442 @@ else
- if mount ${PART2} ./tmp_mnt > /dev/null 2>&1; then
+ if mount ${PART2} "$path_to_mnt" > /dev/null 2>&1; then
@@ -463,9 +451,9 @@ else
- rm -f ./tmp_mnt/EFI/BOOT/BOOTX64.EFI
- rm -f ./tmp_mnt/EFI/BOOT/grubx64.efi
- rm -f ./tmp_mnt/EFI/BOOT/BOOTIA32.EFI
- rm -f ./tmp_mnt/EFI/BOOT/grubia32.efi
- rm -f ./tmp_mnt/EFI/BOOT/MokManager.efi
- rm -f ./tmp_mnt/EFI/BOOT/mmia32.efi
- rm -f ./tmp_mnt/ENROLL_THIS_KEY_IN_MOKMANAGER.cer
- mv ./tmp_mnt/EFI/BOOT/grubx64_real.efi ./tmp_mnt/EFI/BOOT/BOOTX64.EFI
- mv ./tmp_mnt/EFI/BOOT/grubia32_real.efi ./tmp_mnt/EFI/BOOT/BOOTIA32.EFI
+ rm -f "$path_to_mnt"/EFI/BOOT/BOOTX64.EFI
+ rm -f "$path_to_mnt"/EFI/BOOT/grubx64.efi
+ rm -f "$path_to_mnt"/EFI/BOOT/BOOTIA32.EFI
+ rm -f "$path_to_mnt"/EFI/BOOT/grubia32.efi
+ rm -f "$path_to_mnt"/EFI/BOOT/MokManager.efi
+ rm -f "$path_to_mnt"/EFI/BOOT/mmia32.efi
+ rm -f "$path_to_mnt"/ENROLL_THIS_KEY_IN_MOKMANAGER.cer
+ mv "$path_to_mnt"/EFI/BOOT/grubx64_real.efi "$path_to_mnt"/EFI/BOOT/BOOTX64.EFI
+ mv "$path_to_mnt"/EFI/BOOT/grubia32_real.efi "$path_to_mnt"/EFI/BOOT/BOOTIA32.EFI
@@ -476 +464 @@ else
- if umount ./tmp_mnt > /dev/null 2>&1; then
+ if umount "$path_to_mnt" > /dev/null 2>&1; then
@@ -478 +466 @@ else
- rm -rf ./tmp_mnt
+ rm -rf "$path_to_mnt"