From e15a1c5eced3509c807e96ca329fe96a329a913d Mon Sep 17 00:00:00 2001 From: longpanda Date: Fri, 22 Oct 2021 18:16:50 +0800 Subject: [PATCH] Optimization for pyabr --- IMG/cpio/ventoy/hook/debian/pyabr-disk.sh | 25 +++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/IMG/cpio/ventoy/hook/debian/pyabr-disk.sh b/IMG/cpio/ventoy/hook/debian/pyabr-disk.sh index f0e81f9e..993b4d22 100644 --- a/IMG/cpio/ventoy/hook/debian/pyabr-disk.sh +++ b/IMG/cpio/ventoy/hook/debian/pyabr-disk.sh @@ -47,8 +47,29 @@ ventoy_os_install_dmsetup_by_fuse() { umount $VTOY_PATH/mnt/fuse } - -wait_for_usb_disk_ready +while [ -n "Y" ]; do + vtdiskname=$(get_ventoy_disk_name) + if [ "$vtdiskname" = "unknown" ]; then + vtlog "ventoy disk not found" + if [ -r /proc/sys/kernel/hotplug ]; then + echo /sbin/mdev > /proc/sys/kernel/hotplug + fi + mdev -s + sleep 1 + else + if check_usb_disk_ready "$vtdiskname"; then + vtlog "check_usb_disk_ready $vtdiskname ok" + break + else + vtlog "check_usb_disk_ready $vtdiskname error" + if [ -r /proc/sys/kernel/hotplug ]; then + echo /sbin/mdev > /proc/sys/kernel/hotplug + fi + mdev -s + sleep 1 + fi + fi +done vtdiskname=$(get_ventoy_disk_name) if [ "$vtdiskname" = "unknown" ]; then