summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert Tiemann <rtie@gmx.de>2025-10-02 11:59:24 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2025-10-06 17:01:10 +0100
commit36687d227194bee38b6f245e425245fb23265f37 (patch)
tree41638a990e042041060f3f52d638871c4c44036d
parent4b9e5931d75d5e16fa2a07f4ef1fc19d1455128b (diff)
downloadpoky-36687d227194bee38b6f245e425245fb23265f37.tar.gz
udev-extraconf: Speed up mount.sh
On devices with many partitions, running blkid without parameters can be rather slow because all block devices are inspected: $ time /sbin/blkid real 0m0.474s user 0m0.026s sys 0m0.172s versus $ time /sbin/blkid /dev/mmcblk0p10 real 0m0.027s user 0m0.002s sys 0m0.018s Plugging in a device with 5 partitions means that mount.sh is going to be executed 5 times, and so will be blkid. In the real-world case outlined above, this adds up to an overhead of about 2.3 seconds for blkid alone. This commit changes mount.sh so that the block device of interest is passed directly to blkid such that blkid inspects only that device, leading to significant speedup. (From OE-Core rev: eb01d26ed9c52e697087b08b805f6c6aa367d105) Signed-off-by: Robert Tiemann <rtie@gmx.de> Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-core/udev/udev-extraconf/mount.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/meta/recipes-core/udev/udev-extraconf/mount.sh b/meta/recipes-core/udev/udev-extraconf/mount.sh
index 0cbae48729..fe78f3aba5 100644
--- a/meta/recipes-core/udev/udev-extraconf/mount.sh
+++ b/meta/recipes-core/udev/udev-extraconf/mount.sh
@@ -178,7 +178,7 @@ rm_dir() {
178 178
179get_label_name() { 179get_label_name() {
180 # Get the LABEL or PARTLABEL 180 # Get the LABEL or PARTLABEL
181 LABEL=`/sbin/blkid | grep "$1:" | grep -o 'LABEL=".*"' | cut -d '"' -f2` 181 LABEL=`/sbin/blkid "$1" | grep -o 'LABEL=".*"' | cut -d '"' -f2`
182 # If the $DEVNAME has a LABEL or a PARTLABEL 182 # If the $DEVNAME has a LABEL or a PARTLABEL
183 if [ -n "$LABEL" ]; then 183 if [ -n "$LABEL" ]; then
184 # Set the mount location dir name to LABEL appended 184 # Set the mount location dir name to LABEL appended