Skip to content

Conversation

@codeshravan
Copy link

This patch adds support for persisting EFI variable changes on embedded boards that store variables in a file on the ESP partition rather than in dedicated hardware storage.

Many embedded boards lack secure hardware storage (like RPMB) for EFI variables and instead store them in a file on the ESP. When using systemd-boot with file-based variable storage, runtime variable changes are lost on reboot since they only exist in memory.

The upstream patch (pr-282.patch) implements automatic persistence by:

  • Detecting RTStorageVolatile and VarToFile EFI variables
  • Automatically writing variable changes back to the ESP file
  • Ensuring EFI variable modifications survive reboots

This enables proper support for:

  • systemd-boot operations that rely on SetVariable at runtime
  • Boot loader variables (LoaderEntryDefault, LoaderEntryOneShot, etc.)
  • UEFI capsule updates that modify variables
  • Any runtime EFI variable changes that need to persist

The patch is currently pending upstream review.

Upstream-Status: Pending

This patch adds support for persisting EFI variable changes on embedded
boards that store variables in a file on the ESP partition rather than
in dedicated hardware storage.

Many embedded boards lack secure hardware storage (like RPMB) for EFI
variables and instead store them in a file on the ESP. When using
systemd-boot with file-based variable storage, runtime variable changes
are lost on reboot since they only exist in memory.

The upstream patch (pr-282.patch) implements automatic persistence by:
- Detecting RTStorageVolatile and VarToFile EFI variables
- Automatically writing variable changes back to the ESP file
- Ensuring EFI variable modifications survive reboots

This enables proper support for:
- systemd-boot operations that rely on SetVariable at runtime
- Boot loader variables (LoaderEntryDefault, LoaderEntryOneShot, etc.)
- UEFI capsule updates that modify variables
- Any runtime EFI variable changes that need to persist

The patch is currently pending upstream review.

Upstream-Status: Pending
Signed-off-by: Shravan Kumar <shrkum@qti.qualcomm.com>
Date: Wed, 18 Jun 2025 22:37:04 +0300
Subject: [PATCH] efivarfs: Update a file variable store On SetVariable RT

Upstream-Status: Pending
Copy link
Contributor

Choose a reason for hiding this comment

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

The tags should be at the end of the message. Also please replace Pending with a proper one.

Copy link
Contributor

Choose a reason for hiding this comment

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

In this case the upstream status is backport

Upstream-Status: Backport [https://github.com/rhboot/efivar/commit/68daa04654acbe1bbaa17ebfc23c371b39e69c6b]

@@ -0,0 +1,2 @@
FILESEXTRAPATHS:prepend:qcom := "${THISDIR}/${PN}:"
SRC_URI:append:qcom = " file://pr-282.patch "
Copy link
Contributor

Choose a reason for hiding this comment

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

I would prefer if this goes to OE-Core, there is nothing Qualcomm-specific in it. If it is rejected there, we will take it into this layer.

Copy link
Member

Choose a reason for hiding this comment

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

@codeshravan the pr is merged in upstream efivars repo.
I have created an issue enquiring about v40 release for efivars.
Once maintainer responds we can decide either to bump oe-core efivars to v40 or otherwise backport.

Copy link
Author

Choose a reason for hiding this comment

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

@sbanerjee-quic @lumag based upon reply on issue:rhboot/efivar#291 we will take it forward

@codeshravan
Copy link
Author

Raised PR on oe-core:openembedded/openembedded-core#111

@lumag
Copy link
Contributor

lumag commented Dec 22, 2025

Raised PR on oe-core:openembedded/openembedded-core#111

Why? Have you read the readme? I don't think so. See https://github.com/openembedded/openembedded-core/blob/master/README.OE-Core.md#contributing
Please follow the outlined procedure.

@codeshravan
Copy link
Author

@lumag I realized it later, I have sent the patch through email, and close the pull request on email.

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.

5 participants