3 if [ "$1" = "CI" ]; then
9 dos2unix
-q .
/tool
/ventoy_lib.sh
10 dos2unix
-q .
/tool
/VentoyWorker.sh
11 dos2unix
-q .
/tool
/VentoyGTK.glade
12 dos2unix
-q .
/tool
/distro_gui_type.json
14 . .
/tool
/ventoy_lib.sh
16 GRUB_DIR
=..
/GRUB
2/INSTALL
19 if ! [ -d $GRUB_DIR ]; then
20 echo "$GRUB_DIR not exist"
35 sh language.sh
|| exit 1
53 dd if=/dev
/zero of
=img.bin bs
=1M count
=256 status
=none
55 losetup
-P $LOOP img.bin
57 while ! grep -q 524288 /sys
/block
/${LOOP#/dev/}/size
2>/dev
/null
; do
62 format_ventoy_disk_mbr
0 $LOOP fdisk
64 $GRUB_DIR/sbin
/grub
-bios-setup --skip-fs-probe --directory="./grub/i386-pc" $LOOP
66 curver
=$(get_ventoy_version_from_cfg ./grub/grub.cfg)
68 tmpmnt
=.
/ventoy
-${curver}-mnt
69 tmpdir
=.
/ventoy
-${curver}
74 mount
${LOOP}p2
$tmpmnt
78 # First copy grub.cfg file, to make it locate at front of the part2
79 cp $OPT .
/grub
/grub.cfg
$tmpmnt/grub
/
81 ls -1 .
/grub
/ | grep -v 'grub\.cfg' | while read line
; do
82 cp $OPT .
/grub
/$line $tmpmnt/grub
/
87 tar czf
help.
tar.gz .
/help
/
91 #tar menu txt & update menulang.cfg
94 vtlangtitle
=$(grep VTLANG_LANGUAGE_NAME menu/zh_CN.json | awk -F\" '{print $4}')
95 echo "menuentry \"zh_CN - $vtlangtitle\" --class=menu_lang_item --class=debug_menu_lang --class=F5tool {" >> menulang.cfg
96 echo " vt_load_menu_lang zh_CN" >> menulang.cfg
97 echo "}" >> menulang.cfg
99 ls -1 menu
/ | grep -v 'zh_CN' | sort | while read vtlang
; do
100 vtlangname
=${vtlang%.*}
101 vtlangtitle
=$(grep VTLANG_LANGUAGE_NAME menu/$vtlang | awk -F\" '{print $4}')
102 echo "menuentry \"$vtlangname - $vtlangtitle\" --class=menu_lang_item --class=debug_menu_lang --class=F5tool {" >> menulang.cfg
103 echo " vt_load_menu_lang $vtlangname" >> menulang.cfg
104 echo "}" >> menulang.cfg
106 echo "menuentry \"$VTLANG_RETURN_PREVIOUS\" --class=vtoyret VTOY_RET {" >> menulang.cfg
107 echo " echo \"Return ...\"" >> menulang.cfg
108 echo "}" >> menulang.cfg
110 tar czf menu.
tar.gz .
/menu
/
116 cp $OPT .
/ventoy
$tmpmnt/
117 cp $OPT .
/EFI
$tmpmnt/
118 cp $OPT .
/tool
/ENROLL_THIS_KEY_IN_MOKMANAGER.cer
$tmpmnt/
121 mkdir -p $tmpmnt/tool
122 # cp $OPT ./tool/i386/mount.exfat-fuse $tmpmnt/tool/mount.exfat-fuse_i386
123 # cp $OPT ./tool/x86_64/mount.exfat-fuse $tmpmnt/tool/mount.exfat-fuse_x86_64
124 # cp $OPT ./tool/aarch64/mount.exfat-fuse $tmpmnt/tool/mount.exfat-fuse_aarch64
126 dd status
=none bs
=1024 count
=16 if=.
/tool
/i
386/vtoycli of
=$tmpmnt/tool
/mount.exfat
-fuse_i386
127 dd status
=none bs
=1024 count
=16 if=.
/tool
/x
86_
64/vtoycli of
=$tmpmnt/tool
/mount.exfat
-fuse_x86_64
128 dd status
=none bs
=1024 count
=16 if=.
/tool
/aarch
64/vtoycli of
=$tmpmnt/tool
/mount.exfat
-fuse_aarch64
131 rm -f $tmpmnt/grub
/i386
-pc/*.img
134 umount
$tmpmnt && rm -rf $tmpmnt
138 mkdir -p $tmpdir/boot
139 mkdir -p $tmpdir/ventoy
140 echo $curver > $tmpdir/ventoy
/version
141 dd if=$LOOP of
=$tmpdir/boot
/boot.img bs
=1 count
=512 status
=none
142 dd if=$LOOP of
=$tmpdir/boot
/core.img bs
=512 count
=2047 skip
=1 status
=none
143 xz
--check=crc32
$tmpdir/boot
/core.img
145 cp $OPT .
/tool
$tmpdir/
146 rm -f $tmpdir/ENROLL_THIS_KEY_IN_MOKMANAGER.cer
147 cp $OPT Ventoy2Disk.sh
$tmpdir/
148 cp $OPT VentoyWeb.sh
$tmpdir/
149 cp $OPT VentoyPlugson.sh
$tmpdir/
150 cp $OPT VentoyVlnk.sh
$tmpdir/
151 cp $OPT VentoyGUI
* $tmpdir/
154 cp $OPT README
$tmpdir/
155 cp $OPT plugin
$tmpdir/
156 cp $OPT CreatePersistentImg.sh
$tmpdir/
157 cp $OPT ExtendPersistentImg.sh
$tmpdir/
158 dos2unix
-q $tmpdir/Ventoy2Disk.sh
159 dos2unix
-q $tmpdir/VentoyWeb.sh
160 dos2unix
-q $tmpdir/VentoyPlugson.sh
161 dos2unix
-q $tmpdir/VentoyVlnk.sh
164 dos2unix
-q $tmpdir/CreatePersistentImg.sh
165 dos2unix
-q $tmpdir/ExtendPersistentImg.sh
167 cp $OPT ..
/LinuxGUI
/WebUI
$tmpdir/
168 sed 's/.*SCRIPT_DEL_THIS \(.*\)/\1/g' -i $tmpdir/WebUI
/index.html
171 dd status
=none
if=$LOOP of
=$tmpdir/ventoy
/ventoy.disk.img bs
=512 count
=$VENTOY_SECTOR_NUM skip
=$part2_start_sector
172 xz
--check=crc32
$tmpdir/ventoy
/ventoy.disk.img
174 losetup
-d $LOOP && rm -f img.bin
176 rm -f ventoy
-${curver}-linux.
tar.gz
181 for d
in i386 x86_64 aarch64 mips64el
; do
183 for file in $(ls); do
184 if [ "$file" != "xzcat" ]; then
185 if echo "$file" | grep -q '^Ventoy2Disk'; then
188 xz
--check=crc32
$file
196 find $tmpdir/ -type d
-exec chmod 755 "{}" +
197 find $tmpdir/ -type f
-exec chmod 644 "{}" +
198 chmod +x
$tmpdir/Ventoy2Disk.sh
199 chmod +x
$tmpdir/VentoyWeb.sh
200 chmod +x
$tmpdir/VentoyPlugson.sh
201 chmod +x
$tmpdir/VentoyVlnk.sh
202 chmod +x
$tmpdir/VentoyGUI
*
203 chmod +x
$tmpdir/tool
/*.sh
205 for d
in i386 x86_64 aarch64 mips64el
; do
206 chmod +x
$tmpdir/tool
/$d/xzcat
207 chmod +x
$tmpdir/tool
/$d/Ventoy2Disk.
*
211 cp $OPT $LANG_DIR/languages.json
$tmpdir/tool
/
214 chmod +x
$tmpdir/CreatePersistentImg.sh
215 chmod +x
$tmpdir/ExtendPersistentImg.sh
217 tar -czvf ventoy
-${curver}-linux.
tar.gz
$tmpdir
221 rm -f ventoy
-${curver}-windows.
zip
223 cp $OPT Ventoy2Disk.exe
$tmpdir/
224 cp $OPT VentoyPlugson.exe
$tmpdir/
225 cp $OPT VentoyVlnk.exe
$tmpdir/
226 cp $OPT FOR_X64_ARM.txt
$tmpdir/
227 mkdir -p $tmpdir/altexe
228 cp $OPT Ventoy2Disk_
*.exe
$tmpdir/altexe
/
229 cp $OPT VentoyPlugson_
*.exe
$tmpdir/altexe
/
233 cp $OPT $tmpdir/tool
/plugson.
tar.xz
$tmpdir/ventoy
/
234 cp $OPT $LANG_DIR/languages.json
$tmpdir/ventoy
/
237 rm -f $tmpdir/VentoyGUI.
*
242 zip -r ventoy
-${curver}-windows.
zip $tmpdir/
246 echo "=============== run livecd.sh ==============="
251 mv ..
/LiveCDGUI
/ventoy
*.iso .
/
253 if [ -e ventoy
-${curver}-windows.
zip ] && [ -e ventoy
-${curver}-linux.
tar.gz
]; then
254 echo -e "\n ============= SUCCESS =================\n"
256 echo -e "\n ============= FAILED =================\n"
262 sha256sum ventoy
-${curver}-* > sha256.txt