Skip to content

Commit

Permalink
fix linux unbind command (#63)
Browse files Browse the repository at this point in the history
* fix detachScript

* unbind every qcserial device

* detachScript wrap
  • Loading branch information
andiradulescu authored Sep 16, 2024
1 parent 0484fb0 commit 786081d
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/app/Flash.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,7 @@ const errors = {
}

const detachScript = [
"bus=$(lsusb | grep 05c6:9008 | awk '{print $2}' | sed 's/Bus //;s/^0*//')",
"port=$(lsusb -t | grep Driver=qcserial | awk -F'Port ' '{print $2}' | cut -d ':' -f 1)",
"echo -n \"$bus-$port:1.0\" | sudo tee /sys/bus/usb/drivers/qcserial/unbind > /dev/null"
"for d in /sys/bus/usb/drivers/qcserial/*-*; do [ -e \"$d\" ] && echo -n \"$(basename $d)\" | sudo tee /sys/bus/usb/drivers/qcserial/unbind > /dev/null; done"
];

const isLinux = navigator.userAgent.toLowerCase().includes('linux');
Expand Down Expand Up @@ -265,10 +263,10 @@ export default function Flash() {
<span className={`text-l dark:text-white px-2 max-w-xl`}>
It seems that you&apos;re on Linux, make sure to run the script below in your terminal after plugging in your device.
</span>
<div className="relative mt-2">
<div className="relative mt-2 max-w-3xl">
<div className="bg-gray-200 dark:bg-gray-800 rounded-md overflow-x-auto">
<div className="relative">
<pre className="font-mono text-sm text-gray-800 dark:text-gray-200 bg-gray-300 dark:bg-gray-700 rounded-md p-6 flex-grow max-w-m">
<pre className="font-mono text-sm text-gray-800 dark:text-gray-200 bg-gray-300 dark:bg-gray-700 rounded-md p-6 flex-grow max-w-m text-wrap">
{detachScript.map((line, index) => (
<span key={index} className="block">
{line}
Expand Down

0 comments on commit 786081d

Please sign in to comment.