add debug info

This commit is contained in:
longpanda 2021-06-20 11:28:19 +08:00
parent 667f5bcc1b
commit f383052013
1 changed files with 19 additions and 11 deletions

View File

@ -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() {
} }
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() {
} }
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() {
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