3 dos2unix
-q .
/tool
/ventoy_lib.sh
4 dos2unix
-q .
/tool
/VentoyWorker.sh
8 GRUB_DIR
=..
/GRUB
2/INSTALL
11 if ! [ -d $GRUB_DIR ]; then
12 echo "$GRUB_DIR not exist"
25 dd if=/dev
/zero of
=img.bin bs
=1M count
=256 status
=none
27 losetup
-P $LOOP img.bin
29 while ! grep -q 524288 /sys
/block
/${LOOP#/dev/}/size
2>/dev
/null
; do
34 format_ventoy_disk
$LOOP fdisk
36 $GRUB_DIR/sbin
/grub
-bios-setup --skip-fs-probe --directory="./grub/i386-pc" $LOOP
38 curver
=$(get_ventoy_version_from_cfg ./grub/grub.cfg)
40 tmpmnt
=.
/ventoy
-${curver}-mnt
41 tmpdir
=.
/ventoy
-${curver}
46 mount
${LOOP}p2
$tmpmnt
50 # First copy grub.cfg file, to make it locate at front of the part2
51 cp -a .
/grub
/grub.cfg
$tmpmnt/grub
/
53 ls -1 .
/grub
/ | grep -v 'grub\.cfg' | while read line
; do
54 cp -a .
/grub
/$line $tmpmnt/grub
/
57 cp -a .
/ventoy
$tmpmnt/
59 cp -a .
/tool
/ENROLL_THIS_KEY_IN_MOKMANAGER.cer
$tmpmnt/
63 cp -a .
/tool
/mount
* $tmpmnt/tool
/
65 rm -f $tmpmnt/grub
/i386
-pc/*
68 umount
$tmpmnt && rm -rf $tmpmnt
73 mkdir -p $tmpdir/ventoy
74 echo $curver > $tmpdir/ventoy
/version
75 dd if=$LOOP of
=$tmpdir/boot
/boot.img bs
=1 count
=512 status
=none
76 dd if=$LOOP of
=$tmpdir/boot
/core.img bs
=512 count
=2047 skip
=1 status
=none
77 xz
--check=crc32
$tmpdir/boot
/core.img
80 cp -a Ventoy2Disk.sh
$tmpdir/
81 cp -a CreatePersistentImg.sh
$tmpdir/
82 dos2unix
-q $tmpdir/Ventoy2Disk.sh
83 dos2unix
-q $tmpdir/CreatePersistentImg.sh
86 dd status
=none
if=$LOOP of
=$tmpdir/ventoy
/ventoy.disk.img bs
=512 count
=$VENTOY_SECTOR_NUM skip
=$part2_start_sector
87 xz
--check=crc32
$tmpdir/ventoy
/ventoy.disk.img
89 losetup
-d $LOOP && rm -f img.bin
91 rm -f ventoy
-${curver}-linux.
tar.gz
98 if [ "$file" != "xzcat" ] && [ "$file" != "ventoy_lib.sh" ]; then
99 xz
--check=crc32
$file
104 tar -czvf ventoy
-${curver}-linux.
tar.gz
$tmpdir
106 rm -f ventoy
-${curver}-windows.
zip
107 cp -a Ventoy2Disk.exe
$tmpdir/
108 cp -a $LANG_DIR/languages.ini
$tmpdir/ventoy
/
113 zip -r ventoy
-${curver}-windows.
zip $tmpdir/
117 if [ -e ventoy
-${curver}-windows.
zip ] && [ -e ventoy
-${curver}-linux.
tar.gz
]; then
118 echo -e "\n ============= SUCCESS =================\n"
120 echo -e "\n ============= FAILED =================\n"