Skip to content

[RFC] Avoid unnecessary systemd .device units for Qualcomm raw partitions  #3166

Description

@wenwfu

Qualcomm devices expose many raw GPT partitions. During coldplug, systemd creates several .device aliases for each partition, even when no systemd unit consumes it. On rb3gen2 this delays the EFI device required by:

dev-sda1.device -> boot.mount -> local-fs.target -> sysinit.target

An experiment applied SYSTEMD_READY=0 to raw partitions. Device nodes and /dev/disk/by-* symlinks remained available.

Metric Baseline Optimized
.device entries in boot plot 723 150
trigger complete -> efi.device 1.263 s 0.522 s
trigger complete -> sysinit.target 1.546 s 1.213 s

The median sysinit.target improvement was about 334 ms. The slowest optimized result was still 244 ms faster than the fastest baseline result.

The open problem is how to select partitions safely. The no-blkid raw classification cannot be reused directly: raw partitions can include modem, secure-storage, licensing, or diagnostic data that may still be referenced by systemd or SYSTEMD_WANTS.

Maintaining another allowlist for every machine is also undesirable.

One possible approach is to generate the rule after the image is populated:

systemd-unready = raw partitions - systemd-referenced partitions

The build step would scan fstab, crypttab, systemd units and udev SYSTEMD_WANTS, then emit exact PARTNAME rules for the remaining raw partitions. The feature would initially remain opt-in because this is static analysis and cannot detect undeclared runtime ordering assumptions.

Questions:

  1. Is this optimization worth pursuing separately from the no-blkid change?
  2. Is build-time image scanning preferable to per-machine policy lists?
  3. Where should such generation live: an image class, rootfs post-process hook, or the raw-partition recipe?

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions