+ vtinfo "writing data to disk part2_start=$part2_start_sector ..."
+
+ dd status=none conv=fsync if=./boot/boot.img of=$DISK bs=1 count=440
+
+ if [ "$OldStyle" = "GPT" ]; then
+ echo -en '\x22' | dd status=none of=$DISK conv=fsync bs=1 count=1 seek=92
+ xzcat ./boot/core.img.xz | dd status=none conv=fsync of=$DISK bs=512 count=2014 seek=34
+ echo -en '\x23' | dd of=$DISK conv=fsync bs=1 count=1 seek=17908 status=none
+ else
+ xzcat ./boot/core.img.xz | dd status=none conv=fsync of=$DISK bs=512 count=2047 seek=1
+ fi
+
+ xzcat ./ventoy/ventoy.disk.img.xz | dd status=none conv=fsync of=$DISK bs=512 count=$VENTOY_SECTOR_NUM seek=$part2_start_sector
+
+ #test UUID
+ testUUIDStr=$(vtoy_gen_uuid | hexdump -C)
+ vtdebug "test uuid: $testUUIDStr"
+
+ #disk uuid
+ vtoy_gen_uuid | dd status=none conv=fsync of=${DISK} seek=384 bs=1 count=16
+
+ vtinfo "sync data ..."
+ sync
+
+ vtinfo "esp partition processing ..."
+ if [ "$SECUREBOOT" != "YES" ]; then
+ vtoycli partresize -s $DISK $part2_start_sector
+ fi
+
+ vtinfo "update partition table $DISK $part2_start_sector ..."
+ vtoycli partresize -p $DISK $part2_start_sector
+ if [ $? -eq 0 ]; then
+ sync
+ echo ""
+ vtinfo "Ventoy non-destructive installation on $DISK successfully finished."
+ echo ""
+ else
+ echo ""
+ vterr "Ventoy non-destructive installation on $DISK failed."
+ echo ""
+ fi