efi_capsule_update(9)
π efi_capsule_update(9)
okay so real talk, this is a page from the Kernel API Manual, and it's about efi_capsule_update β the lil function that hands a capsule over to your firmware. yes bestie, that kind of capsule. no, not the medicine one π it's the firmware update kind. buckle up π
β¨ NAME β¨
efi_capsule_update β send a capsule to the firmware π
πΈ SYNOPSIS πΈ
int efi_capsule_update (efi_capsule_header_t *capsule , phys_addr_t *pages );
like, that's the whole signature. short king. π
π¦ ARGUMENTS π¦
capsuleβ the capsule you're sending to the firmware, literally the whole point of the function πpagesβ an array of capsule data pages, i.e. where the actual payload lives π
π₯ DESCRIPTION π₯
So what does it do? It builds a scatter gather list with EFI capsule block descriptors β yes, that's a lot of words, it ate β and uses them to map the capsule described by capsule together with its data in pages, then sends the whole thing to the firmware via the UpdateCapsule runtime service. periodt. β¨
Big important thing: capsule must be a virtual mapping of the complete capsule update in the kernel address space, because the capsule can be consumed immediately β like, not "in a sec", not "after you finish your iced coffee", immediately π. And a capsule_header_t that describes the entire contents of the capsule must be at the start of the first data page. no exceptions bestie π
Now, this function will validate that the firmware supports the capsule guid, but honestly? users will likely want to check that efi_capsule_supported returns true before calling this function, because it makes it way easier to print helpful error messages. you know, the ones that actually tell you what went wrong instead of just vibing mysteriously π
If the capsule is successfully submitted to the firmware, any subsequent calls to efi_capsule_pending will return true. So pages must not be released or modified if this function returns successfully. like, do NOT touch them. leave them alone. they're busy π«Ά
β οΈ Callers must be prepared for this function to fail, which can happen if we raced with system reboot, or if there is already a pending capsule that has a reset type that conflicts with the one required by capsule. scary? a little. real? very. π
And this next part is the big one, so listen up: do NOT use efi_capsule_pending to detect this conflict, because that would be racy. Instead, submit the capsule to efi_capsule_update and check the return value. that's the move. that's the whole strategy. iykyk π
Return 0 on success, and a converted EFI status code on failure. that's it, that's the deal β
π SEE ALSO π
Kernel file ./drivers/firmware/efi/capsule.c, plus the whole friend group:
go read them, they're iconic too π§
aaaand that's the page!! π brought to you from ./drivers/firmware/efi, dated October 2026, and yes the manual page is literally named efi_capsule_update(9) because we keep it consistent in this house π slay, go update some firmware responsibly, mwah π«Άβ¨
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms