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