summaryrefslogtreecommitdiffstats
path: root/meta/recipes-support/bmaptool/files/0003-BmapCopy.py-tweak-suggested-udev-rule.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-support/bmaptool/files/0003-BmapCopy.py-tweak-suggested-udev-rule.patch')
-rw-r--r--meta/recipes-support/bmaptool/files/0003-BmapCopy.py-tweak-suggested-udev-rule.patch43
1 files changed, 43 insertions, 0 deletions
diff --git a/meta/recipes-support/bmaptool/files/0003-BmapCopy.py-tweak-suggested-udev-rule.patch b/meta/recipes-support/bmaptool/files/0003-BmapCopy.py-tweak-suggested-udev-rule.patch
new file mode 100644
index 0000000000..2794eeada3
--- /dev/null
+++ b/meta/recipes-support/bmaptool/files/0003-BmapCopy.py-tweak-suggested-udev-rule.patch
@@ -0,0 +1,43 @@
1From 2a71e0c1a675e4f30f02c03dd0325944b393c434 Mon Sep 17 00:00:00 2001
2From: Trevor Woerner <twoerner@gmail.com>
3Date: Fri, 12 Jan 2024 01:54:26 -0500
4Subject: [PATCH 3/3] BmapCopy.py: tweak suggested udev rule
5
6Both bdi/max_ratio and queue/scheduler are only valid for whole block devices,
7not individual partitions. Therefore, add a
8
9 ENV{DEVTYPE}!="partition",
10
11to the suggested udev rule so that bmaptool doesn't try to check every
12partition of the block device, just the whole device.
13
14Otherwise 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
21Upstream-Status: Submitted [https://github.com/intel/bmap-tools/pull/131]
22Signed-off-by: Trevor Woerner <twoerner@gmail.com>
23---
24 bmaptools/BmapCopy.py | 3 ++-
25 1 file changed, 2 insertions(+), 1 deletion(-)
26
27diff --git a/bmaptools/BmapCopy.py b/bmaptools/BmapCopy.py
28index 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--
422.43.0.76.g1a87c842ece3
43