Commit f3830520 authored by longpanda's avatar longpanda
Browse files

add debug info

parent 667f5bcc
...@@ -57,14 +57,14 @@ vterr() { ...@@ -57,14 +57,14 @@ vterr() {
is_ventoy_hook_finished() { is_ventoy_hook_finished() {
[ -e $VTOY_PATH/hook_finish ] [ -e $VTOY_PATH/hook_finish ]
} }
set_ventoy_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) line=$($VTOY_PATH/tool/vtoydump -f /ventoy/ventoy_os_param)
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
echo ${line%%#*} echo ${line%%#*}
...@@ -74,7 +74,7 @@ get_ventoy_disk_name() { ...@@ -74,7 +74,7 @@ get_ventoy_disk_name() {
} }
get_ventoy_iso_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 if [ $? -eq 0 ]; then
echo ${line##*#} echo ${line##*#}
else else
...@@ -83,8 +83,9 @@ get_ventoy_iso_name() { ...@@ -83,8 +83,9 @@ get_ventoy_iso_name() {
} }
wait_for_usb_disk_ready() { wait_for_usb_disk_ready() {
while [ -n "Y" ]; do vtloop=0
usb_disk=$(get_ventoy_disk_name) while [ -n "Y" ]; do
usb_disk=$(get_ventoy_disk_name)
vtlog "wait_for_usb_disk_ready $usb_disk ..." vtlog "wait_for_usb_disk_ready $usb_disk ..."
if echo $usb_disk | $EGREP -q "nvme|mmc|nbd"; then if echo $usb_disk | $EGREP -q "nvme|mmc|nbd"; then
...@@ -95,13 +96,20 @@ wait_for_usb_disk_ready() { ...@@ -95,13 +96,20 @@ wait_for_usb_disk_ready() {
if [ -e "${vtpart2}" ]; then if [ -e "${vtpart2}" ]; then
vtlog "wait_for_usb_disk_ready $usb_disk finish" vtlog "wait_for_usb_disk_ready $usb_disk finish"
break break
else else
$SLEEP 0.3 let vtloop=vtloop+1
fi if [ $vtloop -gt 2 ]; then
done 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() { check_usb_disk_ready() {
if echo $1 | $EGREP -q "nvme|mmc|nbd"; then if echo $1 | $EGREP -q "nvme|mmc|nbd"; then
vtpart2=${1}p2 vtpart2=${1}p2
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment