From 61d4248d516c1cc9700f7a0d2227e1448bc51912 Mon Sep 17 00:00:00 2001 From: longpanda Date: Wed, 3 Feb 2021 00:40:37 +0800 Subject: [PATCH] Optimization for slax-9.11.0 (#725) --- IMG/cpio/ventoy/hook/debian/slax-disk.sh | 10 ++++++++-- IMG/cpio/ventoy/hook/debian/slax-hook.sh | 6 +++++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/IMG/cpio/ventoy/hook/debian/slax-disk.sh b/IMG/cpio/ventoy/hook/debian/slax-disk.sh index 0e0cbfb9..f38c24ba 100644 --- a/IMG/cpio/ventoy/hook/debian/slax-disk.sh +++ b/IMG/cpio/ventoy/hook/debian/slax-disk.sh @@ -60,8 +60,6 @@ ventoy_os_install_dmsetup() { fi } -wait_for_usb_disk_ready - vtdiskname=$(get_ventoy_disk_name) if [ "$vtdiskname" = "unknown" ]; then vtlog "ventoy disk not found" @@ -69,6 +67,14 @@ if [ "$vtdiskname" = "unknown" ]; then exit 0 fi +if check_usb_disk_ready "$vtdiskname"; then + vtlog "check_usb_disk_ready ok" +else + vtlog "check_usb_disk_ready error" + PATH=$VTPATH_OLD + exit 0 +fi + ventoy_os_install_dmsetup $vtdiskname ventoy_udev_disk_common_hook "${vtdiskname#/dev/}2" "noreplace" diff --git a/IMG/cpio/ventoy/hook/debian/slax-hook.sh b/IMG/cpio/ventoy/hook/debian/slax-hook.sh index 93790fa8..5663c0ee 100644 --- a/IMG/cpio/ventoy/hook/debian/slax-hook.sh +++ b/IMG/cpio/ventoy/hook/debian/slax-hook.sh @@ -17,4 +17,8 @@ # #************************************************************************************ -$SED "/find_data/i\ $BUSYBOX_PATH/sh $VTOY_PATH/hook/debian/slax-disk.sh" -i /init +if [ -f /lib/livekitlib ] && $GREP -q 'debug_log.*find_data_try' /lib/livekitlib; then + $SED "/debug_log.*find_data_try/a\ $BUSYBOX_PATH/sh $VTOY_PATH/hook/debian/slax-disk.sh" -i /lib/livekitlib +else + $SED "/find_data/i\ $BUSYBOX_PATH/sh $VTOY_PATH/hook/debian/slax-disk.sh" -i /init +fi