Skip to content

Commit

Permalink
Update Ventoy2Disk.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
ventoy authored May 24, 2020
1 parent 487ffc6 commit 73c196a
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions INSTALL/Ventoy2Disk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,13 @@ if ! check_tool_work_ok; then
exit 1
fi

testEF=$(echo -en '\xEF' | ./tool/hexdump -n 1 -e '1/1 "%02X"')
if [ "$testEF" != "EF" ]; then
vtdebug "testEF=##${testEF}##"
vterr "There is something wrong with the interpreter !"
exit 1
fi

grep "^$DISK" /proc/mounts | while read mtline; do
mtpnt=$(echo $mtline | awk '{print $2}')
vtdebug "Trying to umount $mtpnt ..."
Expand Down Expand Up @@ -139,9 +146,13 @@ fi

if [ "$MODE" = "install" ]; then
vtdebug "install ventoy ..."

if ! fdisk -v >/dev/null 2>&1; then
vterr "fdisk is needed by ventoy installation, but is not found in the system."

if parted -v > /dev/null 2>&1; then
PARTTOOL='parted'
elif fdisk -v >/dev/null 2>&1; then
PARTTOOL='fdisk'
else
vterr "Both parted and fdisk are not found in the sysstem, Ventoy can't create new partition."
cd $OLDDIR
exit 1
fi
Expand Down Expand Up @@ -205,7 +216,7 @@ if [ "$MODE" = "install" ]; then
exit 1
fi

format_ventoy_disk $DISK
format_ventoy_disk $DISK $PARTTOOL

# format part1
if ventoy_is_linux64; then
Expand Down

0 comments on commit 73c196a

Please sign in to comment.