Skip to content

Detached partition entry - #6056

Merged
SergioGasquez merged 3 commits into
esp-rs:mainfrom
bjoernQ:detached-partition-entry
Aug 6, 2026
Merged

Detached partition entry#6056
SergioGasquez merged 3 commits into
esp-rs:mainfrom
bjoernQ:detached-partition-entry

Conversation

@bjoernQ

@bjoernQ bjoernQ commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Closes #4838
Related #4687
Supersedes #4839

The general idea of the two issues is that if PartitionEntry doesn't reference PartitionTable lifetimes get easier and users can drop the PartitionTable if all they need is one (or a few) entries.

The original PR mandated to use zerocopy which is a nice idea in general but that crate is not used by any of our other crates and adds a non neglectable compile time penalty. In addition esp-bootloader-esp-idf is included in the dependency tree of basically every binary crate today. (And partition-table etc. is non-optional today - something we might want to reconsider)

While this doesn't help when using e.g. the OtaHelper (in fact it's using a little bit more stack space temporarily) it helps in other situations - e.g. when just needing access to a single data partition during the whole life-time of an application.


Changelog

esp-bootloader-esp-idf

  • Changed: PartitionEntry is now no longer lifetime-tied to PartitionTable.

@bjoernQ
bjoernQ requested a review from SergioGasquez as a code owner August 5, 2026 14:30
Comment on lines +615 to +621
pub(crate) offset: u32,
pub(crate) len: u32,
pub(crate) partition_type: PartitionType,
pub(crate) read_only: bool,
/// Whether the partition is effectively encrypted (see
/// `PartitionEntry::is_effectively_encrypted`).
pub(crate) encrypted: bool,

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.

It's very hard to discover that this is basically half of the meaningful changes in this PR.

Comment on lines +28 to +29
pub struct PartitionEntry {
pub(crate) binary: [u8; RAW_ENTRY_LEN],

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.

And this one is the other half.

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 could split off a followup PR just containing the last commit - or would a more detailed description help?

Just judging by the changed-LOCs I assumed the PR is small enough

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.

this is fine, I'm just pointing at these trying to help 😅

@SergioGasquez
SergioGasquez added this pull request to the merge queue Aug 6, 2026
Merged via the queue into esp-rs:main with commit ae7e3ff Aug 6, 2026
25 checks passed
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.

[esp-bootloader-esp-idf] Use zerocopy for PartitionEntry instead of storing references to partition table.

3 participants