diff --git a/anda/tools/ventoy/anda.hcl b/anda/tools/ventoy/anda.hcl new file mode 100644 index 00000000000..ddba136d655 --- /dev/null +++ b/anda/tools/ventoy/anda.hcl @@ -0,0 +1,5 @@ +project pkg { + rpm { + spec = "ventoy.spec" + } +} diff --git a/anda/tools/ventoy/sanitize.patch b/anda/tools/ventoy/sanitize.patch new file mode 100644 index 00000000000..7c19f906e69 --- /dev/null +++ b/anda/tools/ventoy/sanitize.patch @@ -0,0 +1,81 @@ +Author: DuckSoft + +I just cannot stand such a dirty package. +Let me do some optimisations. + +If you are interested to improve this patch, welcome to mail me. + +diff -Npur a/tool/ventoy_lib.sh b/tool/ventoy_lib.sh +--- a/tool/ventoy_lib.sh 2026-04-05 09:27:04.000000000 -0600 ++++ b/tool/ventoy_lib.sh 2026-04-06 10:03:00.691008472 -0600 +@@ -51,31 +51,6 @@ vtoy_gen_uuid() { + } + + check_tool_work_ok() { +- +- if echo 1 | hexdump > /dev/null; then +- vtdebug "hexdump test ok ..." +- else +- vtdebug "hexdump test fail ..." +- ventoy_false +- return +- fi +- +- if mkexfatfs -V > /dev/null; then +- vtdebug "mkexfatfs test ok ..." +- else +- vtdebug "mkexfatfs test fail ..." +- ventoy_false +- return +- fi +- +- if vtoycli fat -T; then +- vtdebug "vtoycli fat test ok ..." +- else +- vtdebug "vtoycli fat test fail ..." +- ventoy_false +- return +- fi +- + vtdebug "tool check success ..." + ventoy_true + } +diff -Npur a/VentoyPlugson.sh b/VentoyPlugson.sh +--- a/VentoyPlugson.sh 2026-04-05 09:27:04.000000000 -0600 ++++ b/VentoyPlugson.sh 2026-04-06 10:03:00.692415370 -0600 +@@ -34,8 +34,6 @@ if echo $machine | grep -E -q 'aarch64|a + TOOLDIR=aarch64 + elif echo $machine | grep -E -q 'x86_64|amd64'; then + TOOLDIR=x86_64 +-elif echo $machine | grep -E -q 'mips64'; then +- TOOLDIR=mips64el + elif echo $machine | grep -E -q 'i[3-6]86'; then + TOOLDIR=i386 + else +diff -Npur a/VentoyWeb.sh b/VentoyWeb.sh +--- a/VentoyWeb.sh 2026-04-05 09:27:04.000000000 -0600 ++++ b/VentoyWeb.sh 2026-04-06 10:03:00.692673550 -0600 +@@ -15,12 +15,6 @@ print_err() { + echo "" + } + +-uid=$(id -u) +-if [ $uid -ne 0 ]; then +- print_err "Please use sudo or run the script as root." +- exit 1 +-fi +- + OLDDIR=$(pwd) + + if uname -m | grep -E -q 'aarch64|arm64'; then +@@ -85,8 +79,8 @@ if ps -ef | grep "V2DServer.*$HOST.*$POR + exit 1 + fi + +-LOGFILE=log.txt +-#delete the log.txt if it's more than 8MB ++LOGFILE=/var/log/ventoy.log ++#delete the ventoy.log if it's more than 8MB + if [ -f $LOGFILE ]; then + logsize=$(stat -c '%s' $LOGFILE) + if [ $logsize -gt 8388608 ]; then diff --git a/anda/tools/ventoy/update.rhai b/anda/tools/ventoy/update.rhai new file mode 100644 index 00000000000..3d03ec76f49 --- /dev/null +++ b/anda/tools/ventoy/update.rhai @@ -0,0 +1 @@ +rpm.version(gh("ventoy/Ventoy")); diff --git a/anda/tools/ventoy/ventoy b/anda/tools/ventoy/ventoy new file mode 100755 index 00000000000..b6feeaa81b1 --- /dev/null +++ b/anda/tools/ventoy/ventoy @@ -0,0 +1,4 @@ +#!/bin/sh + +cd /opt/ventoy || exit 1 +exec ./Ventoy2Disk.sh "$@" diff --git a/anda/tools/ventoy/ventoy-extend-persistent b/anda/tools/ventoy/ventoy-extend-persistent new file mode 100755 index 00000000000..9616aa3a3d1 --- /dev/null +++ b/anda/tools/ventoy/ventoy-extend-persistent @@ -0,0 +1,3 @@ +#!/bin/sh + +exec /opt/ventoy/ExtendPersistentImg.sh "$@" diff --git a/anda/tools/ventoy/ventoy-persistent b/anda/tools/ventoy/ventoy-persistent new file mode 100755 index 00000000000..c955fb6f158 --- /dev/null +++ b/anda/tools/ventoy/ventoy-persistent @@ -0,0 +1,3 @@ +#!/bin/sh + +exec /opt/ventoy/CreatePersistentImg.sh "$@" diff --git a/anda/tools/ventoy/ventoy.desktop b/anda/tools/ventoy/ventoy.desktop new file mode 100644 index 00000000000..ee550072286 --- /dev/null +++ b/anda/tools/ventoy/ventoy.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Type=Application +Icon=ventoy +Name=Ventoy +Exec=ventoygui +Terminal=false +Hidden=false +Categories=Utility +Comment=Ventoy2Disk GUI +StartupWMClass=Ventoy2Disk.gtk3 diff --git a/anda/tools/ventoy/ventoy.spec b/anda/tools/ventoy/ventoy.spec new file mode 100644 index 00000000000..b7a9fe4411e --- /dev/null +++ b/anda/tools/ventoy/ventoy.spec @@ -0,0 +1,105 @@ +%define debug_package %{nil} +%global __strip /bin/true + +Name: ventoy +Version: 1.1.17 +Release: 1%{?dist} +Summary: A new bootable USB solution for ISO/WIM/IMG/VHD(x)/EFI files + +License: GPL-3.0-or-later +URL: https://www.ventoy.net +Source0: https://github.com/ventoy/Ventoy/releases/download/v%{version}/%{name}-%{version}-linux.tar.gz +Source1: %{name}.desktop +Source2: %{name} +Source3: %{name}gui +Source4: %{name}web +Source5: %{name}plugson +Source6: %{name}-persistent +Source7: %{name}-extend-persistent +Source8: https://raw.githubusercontent.com/ventoy/Ventoy/v%{version}/COPYING +Patch0: sanitize.patch +Packager: Caio Bruno + +ExclusiveArch: x86_64 aarch64 + +BuildRequires: xz +Requires: bash dosfstools util-linux which xz +Recommends: e2fsprogs gtk3 polkit +Recommends: ntfs-3g parted xfsprogs + +%description +Ventoy is an open source tool to create bootable USB drive for ISO/WIM/IMG/VHD(x)/EFI files. With Ventoy you don't need to format the disk over and over, just copy the image files to the USB drive and boot them. + +%prep +%autosetup -n ventoy-%{version} -p1 +cp %{SOURCE8} COPYING + +# Decompress bundled tool binaries +pushd tool/%{_arch} +for f in *.xz; do + xzcat "$f" > "${f%.xz}" + chmod +x "${f%.xz}" +done +rm -f *.xz +popd + +# Log location +sed -i 's|log\.txt|/var/log/ventoy.log|g' WebUI/static/js/languages.js tool/languages.json +sed -i 's|\./log\.txt|/var/log/ventoy.log|g' Ventoy2Disk.sh tool/ventoy_lib.sh tool/VentoyWorker.sh + +# Use bash for non-POSIX scripts +sed -i 's|bin/sh|usr/bin/env bash|g' Ventoy2Disk.sh VentoyVlnk.sh tool/create_ventoy_iso_part_dm.sh tool/ventoy_lib.sh tool/VentoyWorker.sh + +# Drop bundled tools we replace with system ones +rm -f tool/%{_arch}/{xzcat,hexdump} + +%build +# Prebuilt binaries, nothing to compile. + +%install +DEST=%{buildroot}/opt/ventoy +install -d -m0755 "$DEST"/{boot,ventoy,tool/%{_arch}} + +install -Dm0644 -t "$DEST"/boot/ boot/* +install -Dm0644 -t "$DEST"/ventoy/ ventoy/* +install -Dm0644 -t "$DEST"/tool/ tool/*.{cer,glade,json,sh,xz} +install -Dm0755 -t "$DEST"/tool/%{_arch}/ tool/%{_arch}/* +install -Dm0755 -t "$DEST"/ *.sh +cp -a plugin WebUI "$DEST"/ + +install -Dm0755 VentoyGUI.%{_arch} "$DEST"/ +install -Dm0644 WebUI/static/img/VentoyLogo.png %{buildroot}%{_datadir}/pixmaps/%{name}.png +install -Dm0644 %{SOURCE1} %{buildroot}%{_appsdir}/%{name}.desktop + +install -Dm0755 %{SOURCE2} %{buildroot}%{_bindir}/%{name} +install -Dm0755 %{SOURCE3} %{buildroot}%{_bindir}/%{name}gui +install -Dm0755 %{SOURCE4} %{buildroot}%{_bindir}/%{name}web +install -Dm0755 %{SOURCE5} %{buildroot}%{_bindir}/%{name}plugson +install -Dm0755 %{SOURCE6} %{buildroot}%{_bindir}/%{name}-persistent +install -Dm0755 %{SOURCE7} %{buildroot}%{_bindir}/%{name}-extend-persistent + +# Use system xzcat/hexdump instead of the bundled ones +ln -s %{_bindir}/xzcat "$DEST"/tool/%{_arch}/xzcat +ln -s %{_bindir}/hexdump "$DEST"/tool/%{_arch}/hexdump + +# Drop the gtk2 variant on x86_64 (we ship gtk3/qt5) +%ifarch x86_64 +rm -f "$DEST"/tool/%{_arch}/Ventoy2Disk.gtk2 +%endif + +%files +%license COPYING +%doc README +%{_bindir}/%{name} +%{_bindir}/%{name}gui +%{_bindir}/%{name}web +%{_bindir}/%{name}plugson +%{_bindir}/%{name}-persistent +%{_bindir}/%{name}-extend-persistent +/opt/ventoy/ +%{_appsdir}/%{name}.desktop +%{_datadir}/pixmaps/%{name}.png + +%changelog +* Thu Jul 30 2026 Caio Bruno +- Initial package diff --git a/anda/tools/ventoy/ventoygui b/anda/tools/ventoy/ventoygui new file mode 100755 index 00000000000..887535f72f7 --- /dev/null +++ b/anda/tools/ventoy/ventoygui @@ -0,0 +1,9 @@ +#!/bin/sh + +cd /opt/ventoy || exit 1 + +if [ "$(uname -m)" = "x86_64" ]; then + ./VentoyGUI.x86_64 "$@" +elif [ "$(uname -m)" = "aarch64" ]; then + ./VentoyGUI.aarch64 "$@" +fi diff --git a/anda/tools/ventoy/ventoyplugson b/anda/tools/ventoy/ventoyplugson new file mode 100755 index 00000000000..f1e7b2d362b --- /dev/null +++ b/anda/tools/ventoy/ventoyplugson @@ -0,0 +1,4 @@ +#!/bin/sh + +cd /opt/ventoy || exit 1 +exec ./VentoyPlugson.sh "$@" diff --git a/anda/tools/ventoy/ventoyweb b/anda/tools/ventoy/ventoyweb new file mode 100755 index 00000000000..fefe649136c --- /dev/null +++ b/anda/tools/ventoy/ventoyweb @@ -0,0 +1,4 @@ +#!/bin/sh + +cd /opt/ventoy || exit 1 +exec ./VentoyWeb.sh "$@"