Patrick Williams | 56b44a9 | 2024-01-19 08:49:29 -0600 | [diff] [blame] | 1 | From 2a71e0c1a675e4f30f02c03dd0325944b393c434 Mon Sep 17 00:00:00 2001 |
| 2 | From: Trevor Woerner <twoerner@gmail.com> |
| 3 | Date: Fri, 12 Jan 2024 01:54:26 -0500 |
| 4 | Subject: [PATCH 3/3] BmapCopy.py: tweak suggested udev rule |
| 5 | |
| 6 | Both bdi/max_ratio and queue/scheduler are only valid for whole block devices, |
| 7 | not individual partitions. Therefore, add a |
| 8 | |
| 9 | ENV{DEVTYPE}!="partition", |
| 10 | |
| 11 | to the suggested udev rule so that bmaptool doesn't try to check every |
| 12 | partition of the block device, just the whole device. |
| 13 | |
| 14 | Otherwise the following will appear in the logs: |
| 15 | |
| 16 | Jan 10 01:30:31 localhost (udev-worker)[10399]: sdk1: /etc/udev/rules.d/60-bmaptool-optimizations.rules:5 Failed to write ATTR{/sys/devices/pci0000:00/0000:00:14.0/usb2/2-3/2-3.1/2-3.1.2/2-3.1.2:1.0/host14/target14:0:0/14:0:0:0/block/sdk/sdk1/bdi/min_ratio}, ignoring: No such file or directory |
| 17 | Jan 10 01:30:31 localhost (udev-worker)[10399]: sdk1: /etc/udev/rules.d/60-bmaptool-optimizations.rules:5 Failed to write ATTR{/sys/devices/pci0000:00/0000:00:14.0/usb2/2-3/2-3.1/2-3.1.2/2-3.1.2:1.0/host14/target14:0:0/14:0:0:0/block/sdk/sdk1/bdi/max_ratio}, ignoring: No such file or directory |
| 18 | Jan 10 01:30:31 localhost (udev-worker)[10399]: sdk1: /etc/udev/rules.d/60-bmaptool-optimizations.rules:5 Failed to write ATTR{/sys/devices/pci0000:00/0000:00:14.0/usb2/2-3/2-3.1/2-3.1.2/2-3.1.2:1.0/host14/target14:0:0/14:0:0:0/block/sdk/sdk1/queue/scheduler}, ignoring: No such file or directory |
| 19 | [... and so on for every partition on your block device ...] |
| 20 | |
| 21 | Upstream-Status: Submitted [https://github.com/intel/bmap-tools/pull/131] |
| 22 | Signed-off-by: Trevor Woerner <twoerner@gmail.com> |
| 23 | --- |
| 24 | bmaptools/BmapCopy.py | 3 ++- |
| 25 | 1 file changed, 2 insertions(+), 1 deletion(-) |
| 26 | |
| 27 | diff --git a/bmaptools/BmapCopy.py b/bmaptools/BmapCopy.py |
| 28 | index b1e8e0fcbdb7..a4c1177246a9 100644 |
| 29 | --- a/bmaptools/BmapCopy.py |
| 30 | +++ b/bmaptools/BmapCopy.py |
| 31 | @@ -906,7 +906,8 @@ class BmapBdevCopy(BmapCopy): |
| 32 | "\n" |
| 33 | 'ACTION=="add", SUBSYSTEMS=="usb", ATTRS{idVendor}=="xxxx", ' |
| 34 | 'ATTRS{idProduct}=="xxxx", TAG+="uaccess"\n' |
| 35 | - 'SUBSYSTEMS=="usb", ATTRS{idVendor}=="xxxx", ' |
| 36 | + 'SUBSYSTEMS=="usb", ENV{DEVTYPE}!="partition", ' |
| 37 | + 'ATTRS{idVendor}=="xxxx", ' |
| 38 | 'ATTRS{idProduct}=="xxxx", ATTR{bdi/min_ratio}="0", ' |
| 39 | 'ATTR{bdi/max_ratio}="1", ATTR{queue/scheduler}="none"\n' |
| 40 | "\n" |
| 41 | -- |
| 42 | 2.43.0.76.g1a87c842ece3 |
| 43 | |