add debug info

This commit is contained in:
longpanda 2021-06-20 11:28:19 +08:00
parent 667f5bcc1b
commit f383052013

View File

@ -57,14 +57,14 @@ vterr() {
is_ventoy_hook_finished() {
[ -e $VTOY_PATH/hook_finish ]
[ -e $VTOY_PATH/hook_finish ]
}
set_ventoy_hook_finish() {
echo 'Y' > $VTOY_PATH/hook_finish
echo 'Y' > $VTOY_PATH/hook_finish
}
get_ventoy_disk_name() {
get_ventoy_disk_name() {
line=$($VTOY_PATH/tool/vtoydump -f /ventoy/ventoy_os_param)
if [ $? -eq 0 ]; then
echo ${line%%#*}
@ -74,7 +74,7 @@ get_ventoy_disk_name() {
}
get_ventoy_iso_name() {
line=$($VTOY_PATH/tool/vtoydump -f /ventoy/ventoy_os_param)
line=$($VTOY_PATH/tool/vtoydump -f /ventoy/ventoy_os_param)
if [ $? -eq 0 ]; then
echo ${line##*#}
else
@ -83,8 +83,9 @@ get_ventoy_iso_name() {
}
wait_for_usb_disk_ready() {
while [ -n "Y" ]; do
usb_disk=$(get_ventoy_disk_name)
vtloop=0
while [ -n "Y" ]; do
usb_disk=$(get_ventoy_disk_name)
vtlog "wait_for_usb_disk_ready $usb_disk ..."
if echo $usb_disk | $EGREP -q "nvme|mmc|nbd"; then
@ -95,13 +96,20 @@ wait_for_usb_disk_ready() {
if [ -e "${vtpart2}" ]; then
vtlog "wait_for_usb_disk_ready $usb_disk finish"
break
else
$SLEEP 0.3
fi
done
break
else
let vtloop=vtloop+1
if [ $vtloop -gt 2 ]; then
if [ "$VTLOG" != "$VTOY_PATH/log" ]; then
$VTOY_PATH/tool/vtoydump -f /ventoy/ventoy_os_param -v > $VTLOG
fi
fi
$SLEEP 0.3
fi
done
}
check_usb_disk_ready() {
if echo $1 | $EGREP -q "nvme|mmc|nbd"; then
vtpart2=${1}p2