3 if [ "$1" = "CI" ]; then
9 dos2unix
-q .
/tool
/ventoy_lib.sh
10 dos2unix
-q .
/tool
/VentoyWorker.sh
12 . .
/tool
/ventoy_lib.sh
14 GRUB_DIR
=..
/GRUB
2/INSTALL
17 if ! [ -d $GRUB_DIR ]; then
18 echo "$GRUB_DIR not exist"
32 dd if=/dev
/zero of
=img.bin bs
=1M count
=256 status
=none
34 losetup
-P $LOOP img.bin
36 while ! grep -q 524288 /sys
/block
/${LOOP#/dev/}/size
2>/dev
/null
; do
41 format_ventoy_disk_mbr
0 $LOOP fdisk
43 $GRUB_DIR/sbin
/grub
-bios-setup --skip-fs-probe --directory="./grub/i386-pc" $LOOP
45 curver
=$(get_ventoy_version_from_cfg ./grub/grub.cfg)
47 tmpmnt
=.
/ventoy
-${curver}-mnt
48 tmpdir
=.
/ventoy
-${curver}
53 mount
${LOOP}p2
$tmpmnt
57 # First copy grub.cfg file, to make it locate at front of the part2
58 cp $OPT .
/grub
/grub.cfg
$tmpmnt/grub
/
60 ls -1 .
/grub
/ | grep -v 'grub\.cfg' | while read line
; do
61 cp $OPT .
/grub
/$line $tmpmnt/grub
/
64 cp $OPT .
/ventoy
$tmpmnt/
65 cp $OPT .
/EFI
$tmpmnt/
66 cp $OPT .
/tool
/ENROLL_THIS_KEY_IN_MOKMANAGER.cer
$tmpmnt/
70 cp $OPT .
/tool
/i
386/mount.exfat
-fuse $tmpmnt/tool
/mount.exfat
-fuse_i386
71 cp $OPT .
/tool
/x
86_
64/mount.exfat
-fuse $tmpmnt/tool
/mount.exfat
-fuse_x86_64
72 cp $OPT .
/tool
/aarch
64/mount.exfat
-fuse $tmpmnt/tool
/mount.exfat
-fuse_aarch64
74 rm -f $tmpmnt/grub
/i386
-pc/*.img
77 umount
$tmpmnt && rm -rf $tmpmnt
82 mkdir -p $tmpdir/ventoy
83 echo $curver > $tmpdir/ventoy
/version
84 dd if=$LOOP of
=$tmpdir/boot
/boot.img bs
=1 count
=512 status
=none
85 dd if=$LOOP of
=$tmpdir/boot
/core.img bs
=512 count
=2047 skip
=1 status
=none
86 xz
--check=crc32
$tmpdir/boot
/core.img
88 cp $OPT .
/tool
$tmpdir/
89 rm -f $tmpdir/ENROLL_THIS_KEY_IN_MOKMANAGER.cer
90 cp $OPT Ventoy2Disk.sh
$tmpdir/
91 cp $OPT README
$tmpdir/
92 cp $OPT plugin
$tmpdir/
93 cp $OPT CreatePersistentImg.sh
$tmpdir/
94 dos2unix
-q $tmpdir/Ventoy2Disk.sh
95 dos2unix
-q $tmpdir/CreatePersistentImg.sh
98 dd status
=none
if=$LOOP of
=$tmpdir/ventoy
/ventoy.disk.img bs
=512 count
=$VENTOY_SECTOR_NUM skip
=$part2_start_sector
99 xz
--check=crc32
$tmpdir/ventoy
/ventoy.disk.img
101 losetup
-d $LOOP && rm -f img.bin
103 rm -f ventoy
-${curver}-linux.
tar.gz
108 for d
in i386 x86_64 aarch64
; do
110 for file in $(ls); do
111 if [ "$file" != "xzcat" ]; then
112 xz
--check=crc32
$file
119 find $tmpdir/ -type d
-exec chmod 755 "{}" +
120 find $tmpdir/ -type f
-exec chmod 644 "{}" +
121 chmod +x
$tmpdir/Ventoy2Disk.sh
122 chmod +x
$tmpdir/CreatePersistentImg.sh
124 tar -czvf ventoy
-${curver}-linux.
tar.gz
$tmpdir
128 rm -f ventoy
-${curver}-windows.
zip
129 cp $OPT Ventoy2Disk
*.exe
$tmpdir/
130 cp $OPT $LANG_DIR/languages.ini
$tmpdir/ventoy
/
136 zip -r ventoy
-${curver}-windows.
zip $tmpdir/
140 echo "=============== run livecd.sh ==============="
145 mv ..
/LiveCD
/ventoy
*.iso .
/
147 if [ -e ventoy
-${curver}-windows.
zip ] && [ -e ventoy
-${curver}-linux.
tar.gz
]; then
148 echo -e "\n ============= SUCCESS =================\n"
150 echo -e "\n ============= FAILED =================\n"