Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion recipes-bsp/partition/qcom-ptool.inc
Original file line number Diff line number Diff line change
Expand Up @@ -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"
46 changes: 46 additions & 0 deletions recipes-bsp/partition/qcom-raw-partitions-udev-rules_git.bb
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
SUMMARY = "udev rules for Qualcomm raw partitions"
DESCRIPTION = "Machine-specific udev rules that skip filesystem probing for reviewed Qualcomm raw GPT partitions"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They are no longer machine-specific. So, please rework the recipe.


require qcom-ptool.inc

DEPENDS = "qcom-ptool-native"

QCOM_PARTITION_FILES_SUBDIR ??= ""
QCOM_PARTITION_FILES_SUBDIR_SPINOR ??= ""

QCOM_RAW_PARTITIONS_RULES = "${B}/55-qcom-raw-partitions-noblkid.rules"
QCOM_RAW_PARTITION_LAYOUTS = " \
${QCOM_PARTITION_FILES_SUBDIR} \
${QCOM_PARTITION_FILES_SUBDIR_SPINOR} \
"

PACKAGE_ARCH = "${MACHINE_ARCH}"

do_compile() {
rm -f ${QCOM_RAW_PARTITIONS_RULES}

set --
for layout in ${QCOM_RAW_PARTITION_LAYOUTS}; do
layout=${layout#partitions/}
set -- "$@" --input "${S}/platforms/$layout/partitions.conf"
done

if [ "$#" -gt 0 ]; then
${STAGING_BINDIR_NATIVE}/qcom-ptool gen_udev_rules \
--output ${QCOM_RAW_PARTITIONS_RULES} \
"$@"
fi
}

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please drop this check, bitbake internal takes care of this

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I kept the file check intentionally, but removed the early exit.

gen_udev_rules may legitimately produce no output when:

  • the machine has no selected qcom-ptool layout;
  • no approved raw partitions exist in the selected layout;
  • the transitional qcom-ptool revision lacks gen_udev_rules.

ALLOW_EMPTY allows BitBake to create an empty package, but it does not prevent
install from failing when its source file does not exist.

With the conditional install, do_install:append still runs normally. Dropping
the check would require qcom-ptool to always emit an empty rules file and would
remove the current optional/compatibility behaviour. Please let me know if that
is the preferred direction.

}

FILES:${PN} = " \
${nonarch_libdir}/udev/rules.d/55-qcom-raw-partitions-noblkid.rules \
"

ALLOW_EMPTY:${PN} = "1"
3 changes: 3 additions & 0 deletions recipes-core/systemd/systemd_%.bbappend
Original file line number Diff line number Diff line change
Expand Up @@ -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 machine-specific raw partition rules whenever udev is installed.
RRECOMMENDS:udev:append:qcom = " qcom-raw-partitions-udev-rules"
Loading