Skip to content

gen_udev_rules: add raw partition rule generator - #156

Open
Wenwen Fu (wenwfu) wants to merge 1 commit into
qualcomm-linux:mainfrom
wenwfu:udev-raw-partition-rules
Open

gen_udev_rules: add raw partition rule generator#156
Wenwen Fu (wenwfu) wants to merge 1 commit into
qualcomm-linux:mainfrom
wenwfu:udev-raw-partition-rules

Conversation

@wenwfu

Copy link
Copy Markdown

Summary

Add a gen_udev_rules subcommand that generates machine-specific udev
rules for reviewed Qualcomm raw GPT partitions.

The generator:

  • reads one or more qcom-ptool partition layouts
  • filters labels through a packaged reviewed policy
  • emits exact partition labels present in the selected layouts
  • skips blkid only for matched raw partitions
  • preserves persistent partition metadata links
  • rejects unsafe labels and invalid policy patterns
  • exits successfully without creating an output file when no approved
    labels are present

Example:

qcom-ptool gen_udev_rules \
    -i platforms/qcs6490-rb3gen2/ufs/partitions.conf \
    -o 55-qcom-raw-partitions-noblkid.rules

Motivation

This functionality was originally implemented in
qualcomm-linux/meta-qcom#2865.

Move the generic generator, reviewed policy, and udev template into
qcom-ptool so they can be reused outside the Yocto layer. The meta-qcom
change will be updated to invoke this subcommand and retain only the
machine-specific integration and packaging.

Unknown or custom partition labels continue through the normal systemd
blkid probing path.

Qualcomm platforms expose firmware and metadata partitions that are not
intended to contain mountable filesystems. Probing each of them with
blkid adds unnecessary work during udev coldplug. Keeping the exclusion
policy in a distribution layer also prevents other qcom-ptool users from
reusing it.

Add a gen_udev_rules subcommand with a reviewed partition-name policy
and udev template. Filter the policy against one or more selected
layouts and emit only exact labels present in those layouts. Unknown or
custom labels retain the default filesystem probing behavior.

The generated rule disables only blkid probing and preserves persistent
partition metadata links.

Signed-off-by: Wenwen Fu <wenwfu@qti.qualcomm.com>
@wenwfu

Copy link
Copy Markdown
Author

Hi Igor Opaniuk (@igoropaniuk), a friendly review ping when you have time. This PR provides the qcom-ptool side of qualcomm-linux/meta-qcom#2865. I would particularly appreciate feedback on:

  • whether qcom-ptool is the right place for this generator and policy;
  • the CLI and packaged policy format;
  • preserving normal blkid handling for unknown or custom labels.

All current CI checks are passing. The meta-qcom integration is waiting on this interface, so an initial review or direction would be very helpful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant