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
44 ls -lah .
/grub
/i386
-pc/
45 $GRUB_DIR/sbin
/grub
-bios-setup --verbose --skip-fs-probe --directory="./grub/i386-pc" $LOOP
47 curver
=$(get_ventoy_version_from_cfg ./grub/grub.cfg)
49 tmpmnt
=.
/ventoy
-${curver}-mnt
50 tmpdir
=.
/ventoy
-${curver}
55 mount
${LOOP}p2
$tmpmnt
59 # First copy grub.cfg file, to make it locate at front of the part2
60 cp $OPT .
/grub
/grub.cfg
$tmpmnt/grub
/
62 ls -1 .
/grub
/ | grep -v 'grub\.cfg' | while read line
; do
63 cp $OPT .
/grub
/$line $tmpmnt/grub
/
66 cp $OPT .
/ventoy
$tmpmnt/
67 cp $OPT .
/EFI
$tmpmnt/
68 cp $OPT .
/tool
/ENROLL_THIS_KEY_IN_MOKMANAGER.cer
$tmpmnt/
72 cp $OPT .
/tool
/i
386/mount.exfat
-fuse $tmpmnt/tool
/mount.exfat
-fuse_i386
73 cp $OPT .
/tool
/x
86_
64/mount.exfat
-fuse $tmpmnt/tool
/mount.exfat
-fuse_x86_64
74 cp $OPT .
/tool
/aarch
64/mount.exfat
-fuse $tmpmnt/tool
/mount.exfat
-fuse_aarch64
76 rm -f $tmpmnt/grub
/i386
-pc/*.img
79 umount
$tmpmnt && rm -rf $tmpmnt
84 mkdir -p $tmpdir/ventoy
85 echo $curver > $tmpdir/ventoy
/version
86 dd if=$LOOP of
=$tmpdir/boot
/boot.img bs
=1 count
=512 status
=none
87 dd if=$LOOP of
=$tmpdir/boot
/core.img bs
=512 count
=2047 skip
=1 status
=none
88 xz
--check=crc32
$tmpdir/boot
/core.img
90 cp $OPT .
/tool
$tmpdir/
91 rm -f $tmpdir/ENROLL_THIS_KEY_IN_MOKMANAGER.cer
92 cp $OPT Ventoy2Disk.sh
$tmpdir/
93 cp $OPT README
$tmpdir/
94 cp $OPT plugin
$tmpdir/
95 cp $OPT CreatePersistentImg.sh
$tmpdir/
96 dos2unix
-q $tmpdir/Ventoy2Disk.sh
97 dos2unix
-q $tmpdir/CreatePersistentImg.sh
100 dd status
=none
if=$LOOP of
=$tmpdir/ventoy
/ventoy.disk.img bs
=512 count
=$VENTOY_SECTOR_NUM skip
=$part2_start_sector
101 xz
--check=crc32
$tmpdir/ventoy
/ventoy.disk.img
103 losetup
-d $LOOP && rm -f img.bin
105 rm -f ventoy
-${curver}-linux.
tar.gz
110 for d
in i386 x86_64 aarch64
; do
112 for file in $(ls); do
113 if [ "$file" != "xzcat" ]; then
114 xz
--check=crc32
$file
121 find $tmpdir/ -type d
-exec chmod 755 "{}" +
122 find $tmpdir/ -type f
-exec chmod 644 "{}" +
123 chmod +x
$tmpdir/Ventoy2Disk.sh
124 chmod +x
$tmpdir/CreatePersistentImg.sh
126 tar -czvf ventoy
-${curver}-linux.
tar.gz
$tmpdir
130 rm -f ventoy
-${curver}-windows.
zip
131 cp $OPT Ventoy2Disk
*.exe
$tmpdir/
132 cp $OPT $LANG_DIR/languages.ini
$tmpdir/ventoy
/
138 zip -r ventoy
-${curver}-windows.
zip $tmpdir/
143 if [ "$1" = "CI" ]; then
144 echo "=============== run docker_ci.sh ==============="
147 echo "=============== run livecd.sh ==============="
151 mv ..
/LiveCD
/ventoy
*.iso .
/
153 if [ -e ventoy
-${curver}-windows.
zip ] && [ -e ventoy
-${curver}-linux.
tar.gz
]; then
154 echo -e "\n ============= SUCCESS =================\n"
156 echo -e "\n ============= FAILED =================\n"