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