From 722202063190a85a9d7ec0043be87f0095faa87d Mon Sep 17 00:00:00 2001 From: Brad Stein Date: Sat, 5 Jul 2025 15:21:12 -0500 Subject: [PATCH] usb fix --- scripts/daemon/lesavka-core.sh | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/scripts/daemon/lesavka-core.sh b/scripts/daemon/lesavka-core.sh index 8423223..c527c35 100644 --- a/scripts/daemon/lesavka-core.sh +++ b/scripts/daemon/lesavka-core.sh @@ -156,21 +156,14 @@ for s in fs hs ss; do done # ── 4. Video‑Control interface (must be a real directory) ─────────── -mkdir -p "$F/control/header/h" # real dir – must exist first +mkdir -p "$F/control/header/h" # real directory – mandatory -# The kernel may need a few ms to add class/{fs,hs,ss}; wait and link +# Create the single 'class' directory once … +mkdir -p "$F/control/class" + +# … and for every speed make the symlink *itself* (NOT a sub‑dir) for s in fs hs ss; do - mkdir -p "$F/control/class/$s" - # give the kernel up to 0.5 s to create the directory - for _ in {1..50}; do - [[ -d "$F/control/class/$s" ]] && break - sleep 0.010 - done - # some gadgets (FS‑only) never get “hs” – skip gracefully - [[ -d "$F/control/class/$s" ]] || continue - - # finally create the mandatory ‘h’ link - ln -sf ../../header/h "$F/control/class/$s/h" + ln -sf ../header/h "$F/control/class/$s" # ../header/h relative to …/control/class done echo 0x0 >"$F/control/terminal/camera/default/bmControls" 2>/dev/null || true @@ -178,7 +171,7 @@ echo 0x0 >"$F/control/processing/default/bmControls" 2>/dev/null || true # friendly label mkdir -p "$F/control/header/strings/0x409" -echo "Lesavka UVC" >"$F/control/header/strings/0x409/label" +echo "Lesavka UVC" >"$F/control/header/strings/0x409/label" # ----------------------- configuration ----------------------------- mkdir -p "$G/configs/c.1/strings/0x409"