linuxboot / linuxboot/heads

Have qemu boards support writeable pflash and internal flashing

Open
#1,203 18 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

automated testing buildsystem CI debug enhancement / improvement help wanted UX
Dominant language
Makefile
Stars
1.6k
Forks
211
Avg merge
4d 21h
Merged PRs (30d)
6

Description

Seems like both qemu and flashrom will need to be patched. Meanwhile, injecting key is made from separate qemu board build statement, and "reflashing" is rebooting qemu/kvm with newer built rom.

------
Current limitations stated under OP under #1188, where the following traces are what needs to be resolved:

> @JonathonHall-Purism : would like to know what is the issue with nvram you were talking about earlier, and also what avenues possible with pflash since from what I've read from libvirt XML and qemu doc, the flash is not writable. Any input you have there would be useful in other open issues

Looks like the size limit is just a matter of changing this default for max_fw_size: https://gitlab.com/qemu-project/qemu/-/blob/master/hw/i386/pc.c#L1833

Re: writable flash, it seems to exist but the only discussion I can find is about people using it incorrectly: https://bugs.launchpad.net/qemu/+bug/1818367/comments/4

>The element, with @type='pflash', no other attributes, and then
>no sibling element either, happens to be valid, but it is an
>extremely niche use case. It is used when you have a unified, writeable,
>OVMF.fd file that contains both the firmware executable and the live
>variable store.

This does sound like what we want, I have no idea right now how this works with plain qemu, whether flashrom supports it, or what it would take to add.

_Originally posted by @JonathonHall-Purism in https://github.com/osresearch/heads/issues/1188#issuecomment-1218004671_

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the QEMU limit in hw/i386/pc.c, the libvirt pflash and nvram behavior, and the separate QEMU board build and reflashing flow described here. Check how flashrom handles writable pflash and document the required changes across QEMU and flashrom; done means QEMU boards can use writable pflash and flash internally.

Written by the indexing model from the issue text.

Assessment

Domain
embedded-iot
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.