From b79f372aaf6f0f15a49832366c78a2e77c1b1796 Mon Sep 17 00:00:00 2001 From: Wenwen Fu Date: Tue, 4 Aug 2026 10:09:31 +0800 Subject: [PATCH] systemd: skip blkid probing for Qualcomm raw partitions Qualcomm platforms expose many bootloader, firmware, metadata, modem NV, and dump partitions during coldplug. systemd's persistent-storage rules run blkid for every partition, even though these partitions are accessed as raw GPT partitions rather than mounted filesystems. Add a common udev rules recipe that uses qcom-ptool to generate rules for raw partitions from all supported layouts. Set UDEV_DISABLE_PERSISTENT_STORAGE_BLKID_FLAG before the stock rules and preserve partition metadata links using kernel-provided properties. Recommend the generated package when udev is installed on Qualcomm machines. Update qcom-ptool to the revision that provides gen_udev_rules. On rb3gen2-core-kit, this reduces sysinit.target time from 5.74s to 5.37s (about 0.38s) in the QLI-2.0 wrynose-260627.1 build. Assisted-by: Codex:GPT-5 Signed-off-by: Wenwen Fu --- recipes-bsp/partition/qcom-ptool.inc | 2 +- .../qcom-raw-partitions-udev-rules_git.bb | 27 +++++++++++++++++++ recipes-core/systemd/systemd_%.bbappend | 3 +++ 3 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 recipes-bsp/partition/qcom-raw-partitions-udev-rules_git.bb diff --git a/recipes-bsp/partition/qcom-ptool.inc b/recipes-bsp/partition/qcom-ptool.inc index d4c787628..c270b157f 100644 --- a/recipes-bsp/partition/qcom-ptool.inc +++ b/recipes-bsp/partition/qcom-ptool.inc @@ -3,4 +3,4 @@ LICENSE = "BSD-3-Clause" LIC_FILES_CHKSUM = "file://LICENSE;md5=b0a8acd90d872086b279ead88af03369" SRC_URI = "git://github.com/qualcomm-linux/qcom-ptool.git;branch=main;protocol=https" -SRCREV = "9a38c842132362bb635edfe2b1172a7d12f9a875" +SRCREV = "8345d95fe62984e3dea70ca8f3a3229d80a4850e" diff --git a/recipes-bsp/partition/qcom-raw-partitions-udev-rules_git.bb b/recipes-bsp/partition/qcom-raw-partitions-udev-rules_git.bb new file mode 100644 index 000000000..eac123f67 --- /dev/null +++ b/recipes-bsp/partition/qcom-raw-partitions-udev-rules_git.bb @@ -0,0 +1,27 @@ +SUMMARY = "udev rules for Qualcomm raw partitions" +DESCRIPTION = "udev rules that skip filesystem probing for known Qualcomm raw GPT partitions" + +require qcom-ptool.inc + +DEPENDS = "qcom-ptool-native" + +inherit allarch + +QCOM_RAW_PARTITIONS_RULES = "${B}/55-qcom-raw-partitions-noblkid.rules" + +do_compile() { + cd ${S} + ${STAGING_BINDIR_NATIVE}/qcom-ptool gen_udev_rules \ + --output ${QCOM_RAW_PARTITIONS_RULES} +} + +do_install() { + if [ -f ${QCOM_RAW_PARTITIONS_RULES} ]; then + install -Dm 0644 ${QCOM_RAW_PARTITIONS_RULES} \ + ${D}${nonarch_libdir}/udev/rules.d/55-qcom-raw-partitions-noblkid.rules + fi +} + +FILES:${PN} = " \ + ${nonarch_libdir}/udev/rules.d/55-qcom-raw-partitions-noblkid.rules \ +" diff --git a/recipes-core/systemd/systemd_%.bbappend b/recipes-core/systemd/systemd_%.bbappend index abb92268c..624c0f960 100644 --- a/recipes-core/systemd/systemd_%.bbappend +++ b/recipes-core/systemd/systemd_%.bbappend @@ -15,3 +15,6 @@ do_install:append:qcom() { } FILES:${PN}-udev-rules:append:qcom = " ${nonarch_libdir}/udev/rules.d/99-dma-heap.rules" + +# Install the common Qualcomm raw partition rules whenever udev is installed. +RRECOMMENDS:udev:append:qcom = " qcom-raw-partitions-udev-rules"