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
48 dd if=/dev
/zero of
=img.bin bs
=1M count
=256 status
=none
50 losetup
-P $LOOP img.bin
52 while ! grep -q 524288 /sys
/block
/${LOOP#/dev/}/size
2>/dev
/null
; do
57 format_ventoy_disk_mbr
0 $LOOP fdisk
59 $GRUB_DIR/sbin
/grub
-bios-setup --skip-fs-probe --directory="./grub/i386-pc" $LOOP
61 curver
=$(get_ventoy_version_from_cfg ./grub/grub.cfg)
63 tmpmnt
=.
/ventoy
-${curver}-mnt
64 tmpdir
=.
/ventoy
-${curver}
69 mount
${LOOP}p2
$tmpmnt
73 # First copy grub.cfg file, to make it locate at front of the part2
74 cp $OPT .
/grub
/grub.cfg
$tmpmnt/grub
/
76 ls -1 .
/grub
/ | grep -v 'grub\.cfg' | while read line
; do
77 cp $OPT .
/grub
/$line $tmpmnt/grub
/
82 tar czf
help.
tar.gz .
/help
/
87 cp $OPT .
/ventoy
$tmpmnt/
88 cp $OPT .
/EFI
$tmpmnt/
89 cp $OPT .
/tool
/ENROLL_THIS_KEY_IN_MOKMANAGER.cer
$tmpmnt/
93 # cp $OPT ./tool/i386/mount.exfat-fuse $tmpmnt/tool/mount.exfat-fuse_i386
94 # cp $OPT ./tool/x86_64/mount.exfat-fuse $tmpmnt/tool/mount.exfat-fuse_x86_64
95 # cp $OPT ./tool/aarch64/mount.exfat-fuse $tmpmnt/tool/mount.exfat-fuse_aarch64
97 dd status
=none bs
=1024 count
=16 if=.
/tool
/i
386/vtoycli of
=$tmpmnt/tool
/mount.exfat
-fuse_i386
98 dd status
=none bs
=1024 count
=16 if=.
/tool
/x
86_
64/vtoycli of
=$tmpmnt/tool
/mount.exfat
-fuse_x86_64
99 dd status
=none bs
=1024 count
=16 if=.
/tool
/aarch
64/vtoycli of
=$tmpmnt/tool
/mount.exfat
-fuse_aarch64
102 rm -f $tmpmnt/grub
/i386
-pc/*.img
105 umount
$tmpmnt && rm -rf $tmpmnt
109 mkdir -p $tmpdir/boot
110 mkdir -p $tmpdir/ventoy
111 echo $curver > $tmpdir/ventoy
/version
112 dd if=$LOOP of
=$tmpdir/boot
/boot.img bs
=1 count
=512 status
=none
113 dd if=$LOOP of
=$tmpdir/boot
/core.img bs
=512 count
=2047 skip
=1 status
=none
114 xz
--check=crc32
$tmpdir/boot
/core.img
116 cp $OPT .
/tool
$tmpdir/
117 rm -f $tmpdir/ENROLL_THIS_KEY_IN_MOKMANAGER.cer
118 cp $OPT Ventoy2Disk.sh
$tmpdir/
119 cp $OPT VentoyWeb.sh
$tmpdir/
120 cp $OPT VentoyPlugson.sh
$tmpdir/
121 cp $OPT VentoyGUI
* $tmpdir/
124 cp $OPT README
$tmpdir/
125 cp $OPT plugin
$tmpdir/
126 cp $OPT CreatePersistentImg.sh
$tmpdir/
127 cp $OPT ExtendPersistentImg.sh
$tmpdir/
128 dos2unix
-q $tmpdir/Ventoy2Disk.sh
129 dos2unix
-q $tmpdir/VentoyWeb.sh
130 dos2unix
-q $tmpdir/VentoyPlugson.sh
133 dos2unix
-q $tmpdir/CreatePersistentImg.sh
134 dos2unix
-q $tmpdir/ExtendPersistentImg.sh
136 cp $OPT ..
/LinuxGUI
/WebUI
$tmpdir/
137 sed 's/.*SCRIPT_DEL_THIS \(.*\)/\1/g' -i $tmpdir/WebUI
/index.html
140 dd status
=none
if=$LOOP of
=$tmpdir/ventoy
/ventoy.disk.img bs
=512 count
=$VENTOY_SECTOR_NUM skip
=$part2_start_sector
141 xz
--check=crc32
$tmpdir/ventoy
/ventoy.disk.img
143 losetup
-d $LOOP && rm -f img.bin
145 rm -f ventoy
-${curver}-linux.
tar.gz
150 for d
in i386 x86_64 aarch64 mips64el
; do
152 for file in $(ls); do
153 if [ "$file" != "xzcat" ]; then
154 if echo "$file" | grep -q '^Ventoy2Disk'; then
157 xz
--check=crc32
$file
165 find $tmpdir/ -type d
-exec chmod 755 "{}" +
166 find $tmpdir/ -type f
-exec chmod 644 "{}" +
167 chmod +x
$tmpdir/Ventoy2Disk.sh
168 chmod +x
$tmpdir/VentoyWeb.sh
169 chmod +x
$tmpdir/VentoyPlugson.sh
170 chmod +x
$tmpdir/VentoyGUI
*
172 cp $OPT $LANG_DIR/languages.json
$tmpdir/tool
/
175 chmod +x
$tmpdir/CreatePersistentImg.sh
176 chmod +x
$tmpdir/ExtendPersistentImg.sh
178 tar -czvf ventoy
-${curver}-linux.
tar.gz
$tmpdir
182 rm -f ventoy
-${curver}-windows.
zip
184 cp $OPT Ventoy2Disk.exe
$tmpdir/
185 cp $OPT VentoyPlugson.exe
$tmpdir/
186 cp $OPT FOR_X64_ARM.txt
$tmpdir/
187 mkdir -p $tmpdir/altexe
188 cp $OPT Ventoy2Disk_
*.exe
$tmpdir/altexe
/
192 cp $OPT $tmpdir/tool
/plugson.
tar.xz
$tmpdir/ventoy
/
193 cp $OPT $LANG_DIR/languages.json
$tmpdir/ventoy
/
196 rm -f $tmpdir/VentoyGUI.
*
201 zip -r ventoy
-${curver}-windows.
zip $tmpdir/
205 echo "=============== run livecd.sh ==============="
210 mv ..
/LiveCDGUI
/ventoy
*.iso .
/
212 if [ -e ventoy
-${curver}-windows.
zip ] && [ -e ventoy
-${curver}-linux.
tar.gz
]; then
213 echo -e "\n ============= SUCCESS =================\n"
215 echo -e "\n ============= FAILED =================\n"