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
/
92 cp $OPT .
/ventoy
$tmpmnt/
93 cp $OPT .
/EFI
$tmpmnt/
94 cp $OPT .
/tool
/ENROLL_THIS_KEY_IN_MOKMANAGER.cer
$tmpmnt/
98 # cp $OPT ./tool/i386/mount.exfat-fuse $tmpmnt/tool/mount.exfat-fuse_i386
99 # cp $OPT ./tool/x86_64/mount.exfat-fuse $tmpmnt/tool/mount.exfat-fuse_x86_64
100 # cp $OPT ./tool/aarch64/mount.exfat-fuse $tmpmnt/tool/mount.exfat-fuse_aarch64
102 dd status
=none bs
=1024 count
=16 if=.
/tool
/i
386/vtoycli of
=$tmpmnt/tool
/mount.exfat
-fuse_i386
103 dd status
=none bs
=1024 count
=16 if=.
/tool
/x
86_
64/vtoycli of
=$tmpmnt/tool
/mount.exfat
-fuse_x86_64
104 dd status
=none bs
=1024 count
=16 if=.
/tool
/aarch
64/vtoycli of
=$tmpmnt/tool
/mount.exfat
-fuse_aarch64
107 rm -f $tmpmnt/grub
/i386
-pc/*.img
110 umount
$tmpmnt && rm -rf $tmpmnt
114 mkdir -p $tmpdir/boot
115 mkdir -p $tmpdir/ventoy
116 echo $curver > $tmpdir/ventoy
/version
117 dd if=$LOOP of
=$tmpdir/boot
/boot.img bs
=1 count
=512 status
=none
118 dd if=$LOOP of
=$tmpdir/boot
/core.img bs
=512 count
=2047 skip
=1 status
=none
119 xz
--check=crc32
$tmpdir/boot
/core.img
121 cp $OPT .
/tool
$tmpdir/
122 rm -f $tmpdir/ENROLL_THIS_KEY_IN_MOKMANAGER.cer
123 cp $OPT Ventoy2Disk.sh
$tmpdir/
124 cp $OPT VentoyWeb.sh
$tmpdir/
125 cp $OPT VentoyPlugson.sh
$tmpdir/
126 cp $OPT VentoyVlnk.sh
$tmpdir/
127 cp $OPT VentoyGUI
* $tmpdir/
130 cp $OPT README
$tmpdir/
131 cp $OPT plugin
$tmpdir/
132 cp $OPT CreatePersistentImg.sh
$tmpdir/
133 cp $OPT ExtendPersistentImg.sh
$tmpdir/
134 dos2unix
-q $tmpdir/Ventoy2Disk.sh
135 dos2unix
-q $tmpdir/VentoyWeb.sh
136 dos2unix
-q $tmpdir/VentoyPlugson.sh
137 dos2unix
-q $tmpdir/VentoyVlnk.sh
140 dos2unix
-q $tmpdir/CreatePersistentImg.sh
141 dos2unix
-q $tmpdir/ExtendPersistentImg.sh
143 cp $OPT ..
/LinuxGUI
/WebUI
$tmpdir/
144 sed 's/.*SCRIPT_DEL_THIS \(.*\)/\1/g' -i $tmpdir/WebUI
/index.html
147 dd status
=none
if=$LOOP of
=$tmpdir/ventoy
/ventoy.disk.img bs
=512 count
=$VENTOY_SECTOR_NUM skip
=$part2_start_sector
148 xz
--check=crc32
$tmpdir/ventoy
/ventoy.disk.img
150 losetup
-d $LOOP && rm -f img.bin
152 rm -f ventoy
-${curver}-linux.
tar.gz
157 for d
in i386 x86_64 aarch64 mips64el
; do
159 for file in $(ls); do
160 if [ "$file" != "xzcat" ]; then
161 if echo "$file" | grep -q '^Ventoy2Disk'; then
164 xz
--check=crc32
$file
172 find $tmpdir/ -type d
-exec chmod 755 "{}" +
173 find $tmpdir/ -type f
-exec chmod 644 "{}" +
174 chmod +x
$tmpdir/Ventoy2Disk.sh
175 chmod +x
$tmpdir/VentoyWeb.sh
176 chmod +x
$tmpdir/VentoyPlugson.sh
177 chmod +x
$tmpdir/VentoyVlnk.sh
178 chmod +x
$tmpdir/VentoyGUI
*
179 chmod +x
$tmpdir/tool
/*.sh
181 for d
in i386 x86_64 aarch64 mips64el
; do
182 chmod +x
$tmpdir/tool
/$d/xzcat
183 chmod +x
$tmpdir/tool
/$d/Ventoy2Disk.
*
187 cp $OPT $LANG_DIR/languages.json
$tmpdir/tool
/
190 chmod +x
$tmpdir/CreatePersistentImg.sh
191 chmod +x
$tmpdir/ExtendPersistentImg.sh
193 tar -czvf ventoy
-${curver}-linux.
tar.gz
$tmpdir
197 rm -f ventoy
-${curver}-windows.
zip
199 cp $OPT Ventoy2Disk.exe
$tmpdir/
200 cp $OPT VentoyPlugson.exe
$tmpdir/
201 cp $OPT VentoyVlnk.exe
$tmpdir/
202 cp $OPT FOR_X64_ARM.txt
$tmpdir/
203 mkdir -p $tmpdir/altexe
204 cp $OPT Ventoy2Disk_
*.exe
$tmpdir/altexe
/
208 cp $OPT $tmpdir/tool
/plugson.
tar.xz
$tmpdir/ventoy
/
209 cp $OPT $LANG_DIR/languages.json
$tmpdir/ventoy
/
212 rm -f $tmpdir/VentoyGUI.
*
217 zip -r ventoy
-${curver}-windows.
zip $tmpdir/
221 echo "=============== run livecd.sh ==============="
226 mv ..
/LiveCDGUI
/ventoy
*.iso .
/
228 if [ -e ventoy
-${curver}-windows.
zip ] && [ -e ventoy
-${curver}-linux.
tar.gz
]; then
229 echo -e "\n ============= SUCCESS =================\n"
231 echo -e "\n ============= FAILED =================\n"
237 sha256sum ventoy
-${curver}-* > sha256.txt