remove ia64 keywords
[gentoo-zh.git] / sys-boot / ventoy-bin / files / sanitize.patch
blobed98be7aa78f4f07bf07e496b11b505c436be1d8
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() {
14 vtdebug() {
15 - echo "$*" >> ./log.txt
16 + echo "$*" >>/var/log/ventoy.log
19 vtoy_gen_uuid() {
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 ..."
26 - else
27 - vtdebug "hexdump test fail ..."
28 - ventoy_false
29 - return
30 - fi
32 - if mkexfatfs -V > /dev/null; then
33 - vtdebug "mkexfatfs test ok ..."
34 - else
35 - vtdebug "mkexfatfs test fail ..."
36 - ventoy_false
37 - return
38 - fi
40 - if vtoycli fat -T; then
41 - vtdebug "vtoycli fat test ok ..."
42 - else
43 - vtdebug "vtoycli fat test fail ..."
44 - ventoy_false
45 - return
46 - fi
48 vtdebug "tool check success ..."
49 ventoy_true
51 @@ -311,7 +287,7 @@ format_ventoy_disk_mbr() {
52 else
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"
66 else
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."
69 exit 1
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 '**********************************************'
77 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."
83 - else
84 - echo "Please run under the correct directory!"
85 - fi
86 - exit 1
87 -fi
89 -echo "############# Ventoy2Disk $* [$TOOLDIR] ################" >> ./log.txt
90 -date >> ./log.txt
92 -#decompress tool
93 -echo "decompress tools" >> ./log.txt
94 -cd ./tool/$TOOLDIR
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
105 - done
108 -cd ../../
109 -chmod +x -R ./tool/$TOOLDIR
112 -if [ -f /bin/bash ]; then
113 - /bin/bash ./tool/VentoyWorker.sh $*
114 -else
115 - ash ./tool/VentoyWorker.sh $*
118 -if [ -n "$OLDDIR" ]; then
119 - CURDIR=$(pwd)
120 - if [ "$CURDIR" != "$OLDDIR" ]; then
121 - cd "$OLDDIR"
122 - fi
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
129 TOOLDIR=aarch64
130 elif echo $machine | grep -E -q 'x86_64|amd64'; then
131 TOOLDIR=x86_64
132 -elif echo $machine | grep -E -q 'mips64'; then
133 - TOOLDIR=mips64el
134 elif echo $machine | grep -E -q 'i[3-6]86'; then
135 TOOLDIR=i386
136 else
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() {
141 echo ""
144 -uid=$(id -u)
145 -if [ $uid -ne 0 ]; then
146 - print_err "Please use sudo or run the script as root."
147 - exit 1
150 OLDDIR=$(pwd)
152 if uname -m | egrep -q 'aarch64|arm64'; then
153 @@ -85,8 +79,8 @@ if ps -ef | grep "V2DServer.*$HOST.*$POR
154 exit 1
157 -LOGFILE=log.txt
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