]> glassweightruler.freedombox.rocks Git - Ventoy.git/blob - INSTALL/Ventoy2Disk.sh
1.0.23 release
[Ventoy.git] / INSTALL / Ventoy2Disk.sh
1 #!/bin/sh
2
3 if ! [ -f ./tool/ventoy_lib.sh ]; then
4 if [ -f ${0%Ventoy2Disk.sh}/tool/ventoy_lib.sh ]; then
5 cd ${0%Ventoy2Disk.sh}
6 fi
7 fi
8
9 if [ -f ./ventoy/version ]; then
10 curver=$(cat ./ventoy/version)
11 fi
12
13 echo ''
14 echo '**********************************************'
15 echo " Ventoy: $curver"
16 echo " longpanda admin@ventoy.net"
17 echo " https://www.ventoy.net"
18 echo '**********************************************'
19 echo ''
20
21 OLDDIR=$(pwd)
22 PATH=./tool:$PATH
23
24 if ! [ -f ./boot/boot.img ]; then
25 if [ -d ./grub ]; then
26 echo "Don't run Ventoy2Disk.sh here, please download the released install package, and run the script in it."
27 else
28 echo "Please run under the correct directory!"
29 fi
30 exit 1
31 fi
32
33 echo "############# Ventoy2Disk $* ################" >> ./log.txt
34 date >> ./log.txt
35
36 #decompress tool
37 if [ -f ./tool/VentoyWorker.sh ]; then
38 echo "no need to decompress tools" >> ./log.txt
39 else
40 cd tool
41
42 if [ -f ./xzcat ]; then
43 chmod +x ./xzcat
44 fi
45
46 for file in $(ls *.xz); do
47 xzcat $file > ${file%.xz}
48 chmod +x ${file%.xz}
49 done
50 cd ../
51 fi
52
53 if [ -f /bin/bash ]; then
54 bash ./tool/VentoyWorker.sh $*
55 else
56 ./tool/ash ./tool/VentoyWorker.sh $*
57 fi
58
59 if [ -n "$OLDDIR" ]; then
60 cd $OLDDIR
61 fi
62
63