From ee06359670c7cb8d83b57bb65f69a3210f75d4de Mon Sep 17 00:00:00 2001 From: Romain Gantois Date: Wed, 24 May 2023 10:33:35 +0200 Subject: [PATCH] udev: Use uaccess instead of plugdev --- MANIFEST.in | 2 +- README.md | 17 +-- docs/snagflash.md | 2 +- src/snagflash/utils.py | 4 +- .../{80-snagboot.rules => 50-snagboot.rules} | 118 +++++++++--------- src/snagrecover/cli.py | 2 +- 6 files changed, 73 insertions(+), 72 deletions(-) rename src/snagrecover/{80-snagboot.rules => 50-snagboot.rules} (60%) diff --git a/MANIFEST.in b/MANIFEST.in index 3517b50..4817ccf 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -3,6 +3,6 @@ include src/snagrecover/firmware/sunxi_fw/soc_info.yaml include src/snagrecover/firmware/sunxi_fw/fel-to-spl-thunk.bin include src/snagrecover/firmware/sunxi_fw/fel-to-spl-thunk.S include src/snagrecover/templates/* -include src/snagrecover/80-snagboot.rules +include src/snagrecover/50-snagboot.rules include src/snagrecover/am335x_usb_setup.sh diff --git a/README.md b/README.md index 8acc0bd..e05a7ce 100644 --- a/README.md +++ b/README.md @@ -42,19 +42,20 @@ You also need to install udev rules so that snagrecover has read and write access to the USB devices exposed by the SoCs. ```bash -$ snagrecover --udev > 80-snagboot.rules -$ sudo cp 80-snagboot.rules /etc/udev/rules.d/ +$ snagrecover --udev > 50-snagboot.rules +$ sudo cp 50-snagboot.rules /etc/udev/rules.d/ $ sudo udevadm control --reload-rules $ sudo udevadm trigger ``` -The affected devices will be accessible to the "plugdev" group, so please check -that you are part of this group. You can also modify the udev rules to pick a -more restrictive group if you wish. +These rules work by adding the "uaccess" tag to the relevant USB devices. +Systemd will then add an ACL to give access to currently logged in users. More +info +[here](https://enotty.pipebreaker.pl/2012/05/23/linux-automatic-user-acl-management/). -**Warning:** The "plugdev" group does not exist on Fedora, please make sure you -modify the udev rules before installing them! You should replace "plugdev" with -any group you wish, e.g. "users". +**Warning:** If your distro does not use systemd, the "uaccess" method could +possibly not work. In this case, make sure to customize the provided udev rules +for your specific system. Alternatively, Snagboot can be installed as a local Python wheel. An installation script is provided to automatically build and install the package. diff --git a/docs/snagflash.md b/docs/snagflash.md index 766d923..ea57214 100644 --- a/docs/snagflash.md +++ b/docs/snagflash.md @@ -21,7 +21,7 @@ rights to these devices. Assuming that your U-Boot config has `CONFIG_USB_GADGET_VENDOR_NUM=vid` and `CONFIG_USB_GADGET_PRODUCT_NUM=pid`, you can add the following udev rule to get access: -`SUBSYSTEM=="usb", ATTRS{idVendor}=="vid", ATTRS{idProduct}=="pid", MODE="0660", GROUP="plugdev"` +`SUBSYSTEM=="usb", ATTRS{idVendor}=="vid", ATTRS{idProduct}=="pid", MODE="0660", TAG+="uaccess"` ## DFU mode diff --git a/src/snagflash/utils.py b/src/snagflash/utils.py index 9d7ad05..ce752ca 100644 --- a/src/snagflash/utils.py +++ b/src/snagflash/utils.py @@ -7,8 +7,8 @@ def usb_error(vid: int, pid: int): print(f"Device access error: could not open USB device {vid:04x}:{pid:04x}", file=sys.stderr) print("If the device exists, make sure that you have rw access rights to it", file=sys.stderr) - print("If that is not the case, you can add the following line to your /etc/udev/rules.d/80-snagboot.rules file:\n", file=sys.stderr) - print("SUBSYSTEM==\"usb\", ATTRS{idVendor}==\"" + f"{vid:04x}" + "\", ATTRS{idProduct}==\"" + f"{pid:04x}" + "\", MODE=\"0660\", GROUP=\"plugdev\"", file=sys.stderr) + print("If that is not the case, you can add the following line to your /etc/udev/rules.d/50-snagboot.rules file:\n", file=sys.stderr) + print("SUBSYSTEM==\"usb\", ATTRS{idVendor}==\"" + f"{vid:04x}" + "\", ATTRS{idProduct}==\"" + f"{pid:04x}" + "\", MODE=\"0660\", TAG+=\"uaccess\"", file=sys.stderr) sys.exit(-1) def cli_error(error: str): diff --git a/src/snagrecover/80-snagboot.rules b/src/snagrecover/50-snagboot.rules similarity index 60% rename from src/snagrecover/80-snagboot.rules rename to src/snagrecover/50-snagboot.rules index 15e0e6a..3e4575f 100644 --- a/src/snagrecover/80-snagboot.rules +++ b/src/snagrecover/50-snagboot.rules @@ -1,71 +1,71 @@ #ST STM32MP1 rules -SUBSYSTEM=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="df11", MODE="0660", GROUP="plugdev" +SUBSYSTEM=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="df11", MODE="0660", TAG+="uaccess" #Microchip SAMA5 rules -SUBSYSTEM=="usb", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="6124", MODE="0660", GROUP="plugdev" -SUBSYSTEM=="tty", SUBSYSTEMS=="usb", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="6124", MODE="0660", GROUP="plugdev" +SUBSYSTEM=="usb", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="6124", MODE="0660", TAG+="uaccess" +SUBSYSTEM=="tty", SUBSYSTEMS=="usb", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="6124", MODE="0660", TAG+="uaccess" #NXP i.MX rules for hidraw backend -SUBSYSTEM=="hidraw", SUBSYSTEMS=="usb", ATTRS{idVendor}=="1fc9", ATTRS{idProduct}=="012f", MODE="0660", GROUP="plugdev" -SUBSYSTEM=="hidraw", SUBSYSTEMS=="usb", ATTRS{idVendor}=="1fc9", ATTRS{idProduct}=="0129", MODE="0660", GROUP="plugdev" -SUBSYSTEM=="hidraw", SUBSYSTEMS=="usb", ATTRS{idVendor}=="1fc9", ATTRS{idProduct}=="0147", MODE="0660", GROUP="plugdev" -SUBSYSTEM=="hidraw", SUBSYSTEMS=="usb", ATTRS{idVendor}=="15a2", ATTRS{idProduct}=="004f", MODE="0660", GROUP="plugdev" -SUBSYSTEM=="hidraw", SUBSYSTEMS=="usb", ATTRS{idVendor}=="1fc9", ATTRS{idProduct}=="013e", MODE="0660", GROUP="plugdev" -SUBSYSTEM=="hidraw", SUBSYSTEMS=="usb", ATTRS{idVendor}=="1fc9", ATTRS{idProduct}=="0146", MODE="0660", GROUP="plugdev" -SUBSYSTEM=="hidraw", SUBSYSTEMS=="usb", ATTRS{idVendor}=="1fc9", ATTRS{idProduct}=="014a", MODE="0660", GROUP="plugdev" -SUBSYSTEM=="hidraw", SUBSYSTEMS=="usb", ATTRS{idVendor}=="1fc9", ATTRS{idProduct}=="014b", MODE="0660", GROUP="plugdev" -SUBSYSTEM=="hidraw", SUBSYSTEMS=="usb", ATTRS{idVendor}=="1fc9", ATTRS{idProduct}=="014e", MODE="0660", GROUP="plugdev" -SUBSYSTEM=="hidraw", SUBSYSTEMS=="usb", ATTRS{idVendor}=="15a2", ATTRS{idProduct}=="0076", MODE="0660", GROUP="plugdev" -SUBSYSTEM=="hidraw", SUBSYSTEMS=="usb", ATTRS{idVendor}=="15a2", ATTRS{idProduct}=="0054", MODE="0660", GROUP="plugdev" -SUBSYSTEM=="hidraw", SUBSYSTEMS=="usb", ATTRS{idVendor}=="15a2", ATTRS{idProduct}=="0061", MODE="0660", GROUP="plugdev" -SUBSYSTEM=="hidraw", SUBSYSTEMS=="usb", ATTRS{idVendor}=="15a2", ATTRS{idProduct}=="0063", MODE="0660", GROUP="plugdev" -SUBSYSTEM=="hidraw", SUBSYSTEMS=="usb", ATTRS{idVendor}=="15a2", ATTRS{idProduct}=="0071", MODE="0660", GROUP="plugdev" -SUBSYSTEM=="hidraw", SUBSYSTEMS=="usb", ATTRS{idVendor}=="15a2", ATTRS{idProduct}=="007d", MODE="0660", GROUP="plugdev" -SUBSYSTEM=="hidraw", SUBSYSTEMS=="usb", ATTRS{idVendor}=="15a2", ATTRS{idProduct}=="0080", MODE="0660", GROUP="plugdev" -SUBSYSTEM=="hidraw", SUBSYSTEMS=="usb", ATTRS{idVendor}=="1fc9", ATTRS{idProduct}=="0128", MODE="0660", GROUP="plugdev" -SUBSYSTEM=="hidraw", SUBSYSTEMS=="usb", ATTRS{idVendor}=="1fc9", ATTRS{idProduct}=="0126", MODE="0660", GROUP="plugdev" -SUBSYSTEM=="hidraw", SUBSYSTEMS=="usb", ATTRS{idVendor}=="1fc9", ATTRS{idProduct}=="0135", MODE="0660", GROUP="plugdev" -SUBSYSTEM=="hidraw", SUBSYSTEMS=="usb", ATTRS{idVendor}=="1fc9", ATTRS{idProduct}=="0134", MODE="0660", GROUP="plugdev" -SUBSYSTEM=="hidraw", SUBSYSTEMS=="usb", ATTRS{idVendor}=="1fc9", ATTRS{idProduct}=="012b", MODE="0660", GROUP="plugdev" -SUBSYSTEM=="hidraw", SUBSYSTEMS=="usb", ATTRS{idVendor}=="0525", ATTRS{idProduct}=="b4a4", MODE="0660", GROUP="plugdev" -SUBSYSTEM=="hidraw", SUBSYSTEMS=="usb", ATTRS{idVendor}=="0525", ATTRS{idProduct}=="b4a4", MODE="0660", GROUP="plugdev" -SUBSYSTEM=="hidraw", SUBSYSTEMS=="usb", ATTRS{idVendor}=="3016", ATTRS{idProduct}=="1001", MODE="0660", GROUP="plugdev" -SUBSYSTEM=="hidraw", SUBSYSTEMS=="usb", ATTRS{idVendor}=="0525", ATTRS{idProduct}=="b4a4", MODE="0660", GROUP="plugdev" -SUBSYSTEM=="hidraw", SUBSYSTEMS=="usb", ATTRS{idVendor}=="1fc9", ATTRS{idProduct}=="0151", MODE="0660", GROUP="plugdev" -SUBSYSTEM=="hidraw", SUBSYSTEMS=="usb", ATTRS{idVendor}=="3016", ATTRS{idProduct}=="0100", MODE="0660", GROUP="plugdev" +SUBSYSTEM=="hidraw", SUBSYSTEMS=="usb", ATTRS{idVendor}=="1fc9", ATTRS{idProduct}=="012f", MODE="0660", TAG+="uaccess" +SUBSYSTEM=="hidraw", SUBSYSTEMS=="usb", ATTRS{idVendor}=="1fc9", ATTRS{idProduct}=="0129", MODE="0660", TAG+="uaccess" +SUBSYSTEM=="hidraw", SUBSYSTEMS=="usb", ATTRS{idVendor}=="1fc9", ATTRS{idProduct}=="0147", MODE="0660", TAG+="uaccess" +SUBSYSTEM=="hidraw", SUBSYSTEMS=="usb", ATTRS{idVendor}=="15a2", ATTRS{idProduct}=="004f", MODE="0660", TAG+="uaccess" +SUBSYSTEM=="hidraw", SUBSYSTEMS=="usb", ATTRS{idVendor}=="1fc9", ATTRS{idProduct}=="013e", MODE="0660", TAG+="uaccess" +SUBSYSTEM=="hidraw", SUBSYSTEMS=="usb", ATTRS{idVendor}=="1fc9", ATTRS{idProduct}=="0146", MODE="0660", TAG+="uaccess" +SUBSYSTEM=="hidraw", SUBSYSTEMS=="usb", ATTRS{idVendor}=="1fc9", ATTRS{idProduct}=="014a", MODE="0660", TAG+="uaccess" +SUBSYSTEM=="hidraw", SUBSYSTEMS=="usb", ATTRS{idVendor}=="1fc9", ATTRS{idProduct}=="014b", MODE="0660", TAG+="uaccess" +SUBSYSTEM=="hidraw", SUBSYSTEMS=="usb", ATTRS{idVendor}=="1fc9", ATTRS{idProduct}=="014e", MODE="0660", TAG+="uaccess" +SUBSYSTEM=="hidraw", SUBSYSTEMS=="usb", ATTRS{idVendor}=="15a2", ATTRS{idProduct}=="0076", MODE="0660", TAG+="uaccess" +SUBSYSTEM=="hidraw", SUBSYSTEMS=="usb", ATTRS{idVendor}=="15a2", ATTRS{idProduct}=="0054", MODE="0660", TAG+="uaccess" +SUBSYSTEM=="hidraw", SUBSYSTEMS=="usb", ATTRS{idVendor}=="15a2", ATTRS{idProduct}=="0061", MODE="0660", TAG+="uaccess" +SUBSYSTEM=="hidraw", SUBSYSTEMS=="usb", ATTRS{idVendor}=="15a2", ATTRS{idProduct}=="0063", MODE="0660", TAG+="uaccess" +SUBSYSTEM=="hidraw", SUBSYSTEMS=="usb", ATTRS{idVendor}=="15a2", ATTRS{idProduct}=="0071", MODE="0660", TAG+="uaccess" +SUBSYSTEM=="hidraw", SUBSYSTEMS=="usb", ATTRS{idVendor}=="15a2", ATTRS{idProduct}=="007d", MODE="0660", TAG+="uaccess" +SUBSYSTEM=="hidraw", SUBSYSTEMS=="usb", ATTRS{idVendor}=="15a2", ATTRS{idProduct}=="0080", MODE="0660", TAG+="uaccess" +SUBSYSTEM=="hidraw", SUBSYSTEMS=="usb", ATTRS{idVendor}=="1fc9", ATTRS{idProduct}=="0128", MODE="0660", TAG+="uaccess" +SUBSYSTEM=="hidraw", SUBSYSTEMS=="usb", ATTRS{idVendor}=="1fc9", ATTRS{idProduct}=="0126", MODE="0660", TAG+="uaccess" +SUBSYSTEM=="hidraw", SUBSYSTEMS=="usb", ATTRS{idVendor}=="1fc9", ATTRS{idProduct}=="0135", MODE="0660", TAG+="uaccess" +SUBSYSTEM=="hidraw", SUBSYSTEMS=="usb", ATTRS{idVendor}=="1fc9", ATTRS{idProduct}=="0134", MODE="0660", TAG+="uaccess" +SUBSYSTEM=="hidraw", SUBSYSTEMS=="usb", ATTRS{idVendor}=="1fc9", ATTRS{idProduct}=="012b", MODE="0660", TAG+="uaccess" +SUBSYSTEM=="hidraw", SUBSYSTEMS=="usb", ATTRS{idVendor}=="0525", ATTRS{idProduct}=="b4a4", MODE="0660", TAG+="uaccess" +SUBSYSTEM=="hidraw", SUBSYSTEMS=="usb", ATTRS{idVendor}=="0525", ATTRS{idProduct}=="b4a4", MODE="0660", TAG+="uaccess" +SUBSYSTEM=="hidraw", SUBSYSTEMS=="usb", ATTRS{idVendor}=="3016", ATTRS{idProduct}=="1001", MODE="0660", TAG+="uaccess" +SUBSYSTEM=="hidraw", SUBSYSTEMS=="usb", ATTRS{idVendor}=="0525", ATTRS{idProduct}=="b4a4", MODE="0660", TAG+="uaccess" +SUBSYSTEM=="hidraw", SUBSYSTEMS=="usb", ATTRS{idVendor}=="1fc9", ATTRS{idProduct}=="0151", MODE="0660", TAG+="uaccess" +SUBSYSTEM=="hidraw", SUBSYSTEMS=="usb", ATTRS{idVendor}=="3016", ATTRS{idProduct}=="0100", MODE="0660", TAG+="uaccess" #NXP i.MX rules for libusb backend -SUBSYSTEM=="usb", ATTRS{idVendor}=="1fc9", ATTRS{idProduct}=="012f", MODE="0660", GROUP="plugdev" -SUBSYSTEM=="usb", ATTRS{idVendor}=="1fc9", ATTRS{idProduct}=="0129", MODE="0660", GROUP="plugdev" -SUBSYSTEM=="usb", ATTRS{idVendor}=="1fc9", ATTRS{idProduct}=="0147", MODE="0660", GROUP="plugdev" -SUBSYSTEM=="usb", ATTRS{idVendor}=="15a2", ATTRS{idProduct}=="004f", MODE="0660", GROUP="plugdev" -SUBSYSTEM=="usb", ATTRS{idVendor}=="1fc9", ATTRS{idProduct}=="013e", MODE="0660", GROUP="plugdev" -SUBSYSTEM=="usb", ATTRS{idVendor}=="1fc9", ATTRS{idProduct}=="0146", MODE="0660", GROUP="plugdev" -SUBSYSTEM=="usb", ATTRS{idVendor}=="1fc9", ATTRS{idProduct}=="014a", MODE="0660", GROUP="plugdev" -SUBSYSTEM=="usb", ATTRS{idVendor}=="1fc9", ATTRS{idProduct}=="014b", MODE="0660", GROUP="plugdev" -SUBSYSTEM=="usb", ATTRS{idVendor}=="1fc9", ATTRS{idProduct}=="014e", MODE="0660", GROUP="plugdev" -SUBSYSTEM=="usb", ATTRS{idVendor}=="15a2", ATTRS{idProduct}=="0076", MODE="0660", GROUP="plugdev" -SUBSYSTEM=="usb", ATTRS{idVendor}=="15a2", ATTRS{idProduct}=="0054", MODE="0660", GROUP="plugdev" -SUBSYSTEM=="usb", ATTRS{idVendor}=="15a2", ATTRS{idProduct}=="0061", MODE="0660", GROUP="plugdev" -SUBSYSTEM=="usb", ATTRS{idVendor}=="15a2", ATTRS{idProduct}=="0063", MODE="0660", GROUP="plugdev" -SUBSYSTEM=="usb", ATTRS{idVendor}=="15a2", ATTRS{idProduct}=="0071", MODE="0660", GROUP="plugdev" -SUBSYSTEM=="usb", ATTRS{idVendor}=="15a2", ATTRS{idProduct}=="007d", MODE="0660", GROUP="plugdev" -SUBSYSTEM=="usb", ATTRS{idVendor}=="15a2", ATTRS{idProduct}=="0080", MODE="0660", GROUP="plugdev" -SUBSYSTEM=="usb", ATTRS{idVendor}=="1fc9", ATTRS{idProduct}=="0128", MODE="0660", GROUP="plugdev" -SUBSYSTEM=="usb", ATTRS{idVendor}=="1fc9", ATTRS{idProduct}=="0126", MODE="0660", GROUP="plugdev" -SUBSYSTEM=="usb", ATTRS{idVendor}=="1fc9", ATTRS{idProduct}=="0135", MODE="0660", GROUP="plugdev" -SUBSYSTEM=="usb", ATTRS{idVendor}=="1fc9", ATTRS{idProduct}=="0134", MODE="0660", GROUP="plugdev" -SUBSYSTEM=="usb", ATTRS{idVendor}=="1fc9", ATTRS{idProduct}=="012b", MODE="0660", GROUP="plugdev" -SUBSYSTEM=="usb", ATTRS{idVendor}=="0525", ATTRS{idProduct}=="b4a4", MODE="0660", GROUP="plugdev" -SUBSYSTEM=="usb", ATTRS{idVendor}=="0525", ATTRS{idProduct}=="b4a4", MODE="0660", GROUP="plugdev" -SUBSYSTEM=="usb", ATTRS{idVendor}=="3016", ATTRS{idProduct}=="1001", MODE="0660", GROUP="plugdev" -SUBSYSTEM=="usb", ATTRS{idVendor}=="0525", ATTRS{idProduct}=="b4a4", MODE="0660", GROUP="plugdev" -SUBSYSTEM=="usb", ATTRS{idVendor}=="1fc9", ATTRS{idProduct}=="0151", MODE="0660", GROUP="plugdev" -SUBSYSTEM=="usb", ATTRS{idVendor}=="3016", ATTRS{idProduct}=="0100", MODE="0660", GROUP="plugdev" +SUBSYSTEM=="usb", ATTRS{idVendor}=="1fc9", ATTRS{idProduct}=="012f", MODE="0660", TAG+="uaccess" +SUBSYSTEM=="usb", ATTRS{idVendor}=="1fc9", ATTRS{idProduct}=="0129", MODE="0660", TAG+="uaccess" +SUBSYSTEM=="usb", ATTRS{idVendor}=="1fc9", ATTRS{idProduct}=="0147", MODE="0660", TAG+="uaccess" +SUBSYSTEM=="usb", ATTRS{idVendor}=="15a2", ATTRS{idProduct}=="004f", MODE="0660", TAG+="uaccess" +SUBSYSTEM=="usb", ATTRS{idVendor}=="1fc9", ATTRS{idProduct}=="013e", MODE="0660", TAG+="uaccess" +SUBSYSTEM=="usb", ATTRS{idVendor}=="1fc9", ATTRS{idProduct}=="0146", MODE="0660", TAG+="uaccess" +SUBSYSTEM=="usb", ATTRS{idVendor}=="1fc9", ATTRS{idProduct}=="014a", MODE="0660", TAG+="uaccess" +SUBSYSTEM=="usb", ATTRS{idVendor}=="1fc9", ATTRS{idProduct}=="014b", MODE="0660", TAG+="uaccess" +SUBSYSTEM=="usb", ATTRS{idVendor}=="1fc9", ATTRS{idProduct}=="014e", MODE="0660", TAG+="uaccess" +SUBSYSTEM=="usb", ATTRS{idVendor}=="15a2", ATTRS{idProduct}=="0076", MODE="0660", TAG+="uaccess" +SUBSYSTEM=="usb", ATTRS{idVendor}=="15a2", ATTRS{idProduct}=="0054", MODE="0660", TAG+="uaccess" +SUBSYSTEM=="usb", ATTRS{idVendor}=="15a2", ATTRS{idProduct}=="0061", MODE="0660", TAG+="uaccess" +SUBSYSTEM=="usb", ATTRS{idVendor}=="15a2", ATTRS{idProduct}=="0063", MODE="0660", TAG+="uaccess" +SUBSYSTEM=="usb", ATTRS{idVendor}=="15a2", ATTRS{idProduct}=="0071", MODE="0660", TAG+="uaccess" +SUBSYSTEM=="usb", ATTRS{idVendor}=="15a2", ATTRS{idProduct}=="007d", MODE="0660", TAG+="uaccess" +SUBSYSTEM=="usb", ATTRS{idVendor}=="15a2", ATTRS{idProduct}=="0080", MODE="0660", TAG+="uaccess" +SUBSYSTEM=="usb", ATTRS{idVendor}=="1fc9", ATTRS{idProduct}=="0128", MODE="0660", TAG+="uaccess" +SUBSYSTEM=="usb", ATTRS{idVendor}=="1fc9", ATTRS{idProduct}=="0126", MODE="0660", TAG+="uaccess" +SUBSYSTEM=="usb", ATTRS{idVendor}=="1fc9", ATTRS{idProduct}=="0135", MODE="0660", TAG+="uaccess" +SUBSYSTEM=="usb", ATTRS{idVendor}=="1fc9", ATTRS{idProduct}=="0134", MODE="0660", TAG+="uaccess" +SUBSYSTEM=="usb", ATTRS{idVendor}=="1fc9", ATTRS{idProduct}=="012b", MODE="0660", TAG+="uaccess" +SUBSYSTEM=="usb", ATTRS{idVendor}=="0525", ATTRS{idProduct}=="b4a4", MODE="0660", TAG+="uaccess" +SUBSYSTEM=="usb", ATTRS{idVendor}=="0525", ATTRS{idProduct}=="b4a4", MODE="0660", TAG+="uaccess" +SUBSYSTEM=="usb", ATTRS{idVendor}=="3016", ATTRS{idProduct}=="1001", MODE="0660", TAG+="uaccess" +SUBSYSTEM=="usb", ATTRS{idVendor}=="0525", ATTRS{idProduct}=="b4a4", MODE="0660", TAG+="uaccess" +SUBSYSTEM=="usb", ATTRS{idVendor}=="1fc9", ATTRS{idProduct}=="0151", MODE="0660", TAG+="uaccess" +SUBSYSTEM=="usb", ATTRS{idVendor}=="3016", ATTRS{idProduct}=="0100", MODE="0660", TAG+="uaccess" #Allwinner SUNXI rules -SUBSYSTEM=="usb", ATTRS{idVendor}=="1f3a", ATTRS{idProduct}=="efe8", MODE="0660", GROUP="plugdev" +SUBSYSTEM=="usb", ATTRS{idVendor}=="1f3a", ATTRS{idProduct}=="efe8", MODE="0660", TAG+="uaccess" #TI AM62x rules -SUBSYSTEM=="usb", ATTRS{idVendor}=="0451", ATTRS{idProduct}=="6165", MODE="0660", GROUP="plugdev" +SUBSYSTEM=="usb", ATTRS{idVendor}=="0451", ATTRS{idProduct}=="6165", MODE="0660", TAG+="uaccess" diff --git a/src/snagrecover/cli.py b/src/snagrecover/cli.py index 0b0bf6a..a967a21 100644 --- a/src/snagrecover/cli.py +++ b/src/snagrecover/cli.py @@ -28,7 +28,7 @@ import ast def cli(): - udev_path = os.path.dirname(__file__) + "/80-snagboot.rules" + udev_path = os.path.dirname(__file__) + "/50-snagboot.rules" am335x_script_path = os.path.dirname(__file__) + "/am335x_usb_setup.sh" template_path = os.path.dirname(__file__) + "/templates" templates = [filename[:-5] for filename in os.listdir(template_path)]