From bd6e8cac435378d56ed9ea8f8c6174e37a00a40e Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Sat, 27 Jul 2024 18:42:15 -0400 Subject: [PATCH] qubes-usb-proxy: fix usb reset with udevadm --- qubes-usb-proxy/APKBUILD | 2 +- qubes-usb-proxy/usb-import-alpine-udevadm.patch | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/qubes-usb-proxy/APKBUILD b/qubes-usb-proxy/APKBUILD index bd8f336..bd6f246 100644 --- a/qubes-usb-proxy/APKBUILD +++ b/qubes-usb-proxy/APKBUILD @@ -38,5 +38,5 @@ package() { } sha512sums=" 822718decff8d2d15e56208b51603d3104cacb42981576985c2955e2bb73a66119397359314ebb6e6b52e3985b4d797e02b1074faf40aa6ca9cce067c753d830 qubes-usb-proxy-v1.3.0.tar.gz -d0eb969122a41be8fa9647ca824aabf3cb3d39324b156b3e05872099e7c4b600dbc8060ab2a63186d84f60364c28c5db9da4d06e37ad36877a2222bdc2cdbd74 usb-import-alpine-udevadm.patch +c6519982f7eef8586ee823dc96efa7b1b90f489114edcc348bc5221837090d19a2a3533eac83e3269ba68c2cf24447c018e0ac850ed1423a1280ebae364223fa usb-import-alpine-udevadm.patch " diff --git a/qubes-usb-proxy/usb-import-alpine-udevadm.patch b/qubes-usb-proxy/usb-import-alpine-udevadm.patch index adb4ccb..12a2234 100644 --- a/qubes-usb-proxy/usb-import-alpine-udevadm.patch +++ b/qubes-usb-proxy/usb-import-alpine-udevadm.patch @@ -11,3 +11,17 @@ index 7b17799..e718795 100755 } wait_for_detached() { +diff --git a/src/usb-export.orig b/src/usb-export +index ad2ab2b..37cff16 100755 +--- a/src/usb-export.orig ++++ b/src/usb-export +@@ -110,8 +110,7 @@ if [ -n "$attach_to_usbip" ]; then + echo "$busid" > "$SYS_USBIP_HOST/bind" || exit 1 + + # optionally reset the device to clear any state from previous driver +- reset_on_attach=$(udevadm info --query=property \ +- --value --property=QUBES_USB_RESET --path="$devpath") ++ reset_on_attach=$(udevadm info --query=property --path="$devpath" | awk -F "=" '{if($1=="QUBES_USB_RESET"){print $2}}' ) + if [ -f /run/qubes-service/usb-reset-on-attach ]; then + reset_on_attach=1 + fi