]> glassweightruler.freedombox.rocks Git - Ventoy.git/blob - IMG/cpio/ventoy/init_loop
Update vtoytool
[Ventoy.git] / IMG / cpio / ventoy / init_loop
1 #!/ventoy/busybox/sh
2 #************************************************************************************
3 # Copyright (c) 2020, longpanda <admin@ventoy.net>
4 #
5 # This program is free software; you can redistribute it and/or
6 # modify it under the terms of the GNU General Public License as
7 # published by the Free Software Foundation; either version 3 of the
8 # License, or (at your option) any later version.
9 #
10 # This program is distributed in the hope that it will be useful, but
11 # WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 # General Public License for more details.
14 #
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, see <http://www.gnu.org/licenses/>.
17 #
18 #************************************************************************************
19
20
21 ####################################################################
22 # #
23 # Step 1 : Extract injection archive #
24 # #
25 ####################################################################
26 ventoy_unpack_injection() {
27 vtmagic=$(hexdump -n 2 -e '2/1 "%02X"' $VTOY_PATH/ventoy_injection)
28 echo "ventoy_unpack_injection vtmagic=$vtmagic ..."
29
30 if [ "1F8B" = "$vtmagic" ] || [ "1F9E" = "$vtmagic" ]; then
31 echo "tar.gz tar -xzvf"
32 tar -xzvf $VTOY_PATH/ventoy_injection -C /
33 elif [ "425A" = "$vtmagic" ]; then
34 echo "tar.bz2 tar -xjvf"
35 tar -xjvf $VTOY_PATH/ventoy_injection -C /
36 elif [ "FD37" = "$vtmagic" ]; then
37 echo "tar.xz tar -xJvf"
38 tar -xJvf $VTOY_PATH/ventoy_injection -C /
39 elif [ "5D00" = "$vtmagic" ]; then
40 echo "tar.lzma tar -xavf"
41 tar -xavf $VTOY_PATH/ventoy_injection -C /
42 else
43 echo "unzip -o"
44 unzip -o $VTOY_PATH/ventoy_injection -d /
45 fi
46 }
47
48 if [ -e $VTOY_PATH/ventoy_injection ]; then
49 echo "### decompress injection ... ###" >>$VTLOG
50 ventoy_unpack_injection > $VTOY_PATH/injection.log 2>&1
51 fi
52
53
54 ####################################################################
55 # #
56 # Step 3 : Hand over to ventoy_loop.sh #
57 # #
58 ####################################################################
59 echo "Now hand over to ventoy.sh" >>$VTLOG
60 . $VTOY_PATH/tool/vtoytool_install.sh
61
62 export PATH=$VTOY_ORG_PATH
63 exec $BUSYBOX_PATH/sh $VTOY_PATH/ventoy_loop.sh