1 Author: DuckSoft <realducksoft@gmail.com>
3 I just cannot stand such a dirty package.
4 Let me do some optimisations.
6 If you are interested to improve this patch, welcome to mail me.
8 diff -rup old/tool/ventoy_lib.sh new/tool/ventoy_lib.sh
9 --- tool/ventoy_lib.sh 2021-12-02 16:59:42.148650182 +0100
10 +++ tool/ventoy_lib.sh 2021-12-02 17:01:17.214720518 +0100
11 @@ -29,7 +29,7 @@ vterr() {
15 - echo "$*" >> ./log.txt
16 + echo "$*" >>/var/log/ventoy.log
20 @@ -52,30 +52,6 @@ vtoy_gen_uuid() {
22 check_tool_work_ok() {
24 - if echo 1 | hexdump > /dev/null; then
25 - vtdebug "hexdump test ok ..."
27 - vtdebug "hexdump test fail ..."
32 - if mkexfatfs -V > /dev/null; then
33 - vtdebug "mkexfatfs test ok ..."
35 - vtdebug "mkexfatfs test fail ..."
40 - if vtoycli fat -T; then
41 - vtdebug "vtoycli fat test ok ..."
43 - vtdebug "vtoycli fat test fail ..."
48 vtdebug "tool check success ..."
51 @@ -311,7 +287,7 @@ format_ventoy_disk_mbr() {
53 vtdebug "format disk by fdisk ..."
55 -fdisk $DISK >>./log.txt 2>&1 <<EOF
56 +fdisk $DISK >>/var/log/ventoy.log 2>&1 <<EOF
60 diff -rup old/tool/VentoyWorker.sh new/tool/VentoyWorker.sh
61 --- tool/VentoyWorker.sh 2021-12-02 16:59:31.485642239 +0100
62 +++ tool/VentoyWorker.sh 2021-12-02 17:02:00.326752183 +0100
63 @@ -105,7 +105,7 @@ vtdebug "MODE=$MODE FORCE=$FORCE RESERVE
64 if check_tool_work_ok; then
65 vtdebug "check tool work ok"
67 - vterr "Some tools can not run on current system. Please check log.txt for details."
68 + vterr "Some tools can not run on current system. Please check /var/log/ventoy.log for details."
72 diff -rup old/Ventoy2Disk.sh new/Ventoy2Disk.sh
73 --- Ventoy2Disk.sh 2021-12-02 16:59:05.205622608 +0100
74 +++ Ventoy2Disk.sh 2021-12-02 17:03:29.037816991 +0100
75 @@ -32,48 +32,4 @@ echo " https://www.ventoy.net"
76 echo '**********************************************'
80 -if ! [ -f ./boot/boot.img ]; then
81 - if [ -d ./grub ]; then
82 - echo "Don't run Ventoy2Disk.sh here, please download the released install package, and run the script in it."
84 - echo "Please run under the correct directory!"
89 -echo "############# Ventoy2Disk $* [$TOOLDIR] ################" >> ./log.txt
93 -echo "decompress tools" >> ./log.txt
96 -ls *.xz > /dev/null 2>&1
97 -if [ $? -eq 0 ]; then
98 - [ -f ./xzcat ] && chmod +x ./xzcat
100 - for file in $(ls *.xz); do
101 - echo "decompress $file" >> ./log.txt
102 - xzcat $file > ${file%.xz}
103 - [ -f ./${file%.xz} ] && chmod +x ./${file%.xz}
104 - [ -f ./$file ] && rm -f ./$file
109 -chmod +x -R ./tool/$TOOLDIR
112 -if [ -f /bin/bash ]; then
113 - /bin/bash ./tool/VentoyWorker.sh $*
115 - ash ./tool/VentoyWorker.sh $*
118 -if [ -n "$OLDDIR" ]; then
120 - if [ "$CURDIR" != "$OLDDIR" ]; then
124 +./tool/VentoyWorker.sh $*
125 diff -rup old/VentoyPlugson.sh new/VentoyPlugson.sh
126 --- VentoyPlugson.sh 2022-12-24 06:00:51.000000000 -0700
127 +++ VentoyPlugson.sh 2022-12-24 08:18:59.154268575 -0700
128 @@ -34,8 +34,6 @@ if echo $machine | grep -E -q 'aarch64|a
130 elif echo $machine | grep -E -q 'x86_64|amd64'; then
132 -elif echo $machine | grep -E -q 'mips64'; then
134 elif echo $machine | grep -E -q 'i[3-6]86'; then
137 diff -rup old/VentoyWeb.sh new/VentoyWeb.sh
138 --- VentoyWeb.sh 2021-12-02 16:58:51.885612627 +0100
139 +++ VentoyWeb.sh 2021-12-02 17:04:43.437871014 +0100
140 @@ -15,12 +15,6 @@ print_err() {
145 -if [ $uid -ne 0 ]; then
146 - print_err "Please use sudo or run the script as root."
152 if uname -m | egrep -q 'aarch64|arm64'; then
153 @@ -85,8 +79,8 @@ if ps -ef | grep "V2DServer.*$HOST.*$POR
158 -#delete the log.txt if it's more than 8MB
159 +LOGFILE=/var/log/ventoy.log
160 +#delete the ventoy.log if it's more than 8MB
161 if [ -f $LOGFILE ]; then
162 logsize=$(stat -c '%s' $LOGFILE)
163 if [ $logsize -gt 8388608 ]; then