mirror of
https://github.com/ventoy/Ventoy.git
synced 2025-04-01 10:13:47 -04:00
Update Ventoy2Disk.sh
This commit is contained in:
parent
487ffc6795
commit
73c196a823
@ -110,6 +110,13 @@ if ! check_tool_work_ok; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
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
|
grep "^$DISK" /proc/mounts | while read mtline; do
|
||||||
mtpnt=$(echo $mtline | awk '{print $2}')
|
mtpnt=$(echo $mtline | awk '{print $2}')
|
||||||
vtdebug "Trying to umount $mtpnt ..."
|
vtdebug "Trying to umount $mtpnt ..."
|
||||||
@ -140,8 +147,12 @@ fi
|
|||||||
if [ "$MODE" = "install" ]; then
|
if [ "$MODE" = "install" ]; then
|
||||||
vtdebug "install ventoy ..."
|
vtdebug "install ventoy ..."
|
||||||
|
|
||||||
if ! fdisk -v >/dev/null 2>&1; then
|
if parted -v > /dev/null 2>&1; then
|
||||||
vterr "fdisk is needed by ventoy installation, but is not found in the system."
|
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
|
cd $OLDDIR
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
@ -205,7 +216,7 @@ if [ "$MODE" = "install" ]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
format_ventoy_disk $DISK
|
format_ventoy_disk $DISK $PARTTOOL
|
||||||
|
|
||||||
# format part1
|
# format part1
|
||||||
if ventoy_is_linux64; then
|
if ventoy_is_linux64; then
|
||||||
|
Loading…
x
Reference in New Issue
Block a user