U-Boot environment management from userspace
Vernon Mauery
vernon.mauery at linux.intel.com
Fri May 31 03:20:04 AEST 2019
On 29-May-2019 10:30 AM, Adriana Kobylak wrote:
>>Am I the only one that has a need for this or is there a wider
>>audience that would benefit?
>
>The software manager (phosphor-bmc-code-mgmt) relies on U-Boot
>environment
>variables for managing the images like for determining which image to
>boot
>from.
>
>>3) Use a one-shot service that parses the 'instance' to extract a
>>variable name and variable value. Then the variable could be activated
>>by launching ubootenv at foo=bar.service. This would require some fancy
>>parameter encoding to make it all work correctly to avoid string
>>injections.
>
>Yeah, we went that route with an obmc-flash-bmc-setenv at .service[1], with
>like you mentioned uses some 'fancy parameter encoding', ex:
>"obmc-flash-bmc-setenv@" + entryId + "\\x3d" + std::to_string(value) +
>".service";
>
>This has worked so far but I'd be open on having a mapping of the env
>variables to D-Bus properties.
>
>>Reading U-Boot environment variables from userspace is not difficult,
>>but to do it in a standard way, (fw_printenv), it requires a fork and
>>exec.
>
>We're actually reading the mtd device to get the values of the variables
>to avoid having a 'system' or 'fork/exec' call, then we put those values
>in D-Bus properties under the software/ path. Having some other app do
>that
>parsing would be nice especially if we're to expand the use of the
>U-Boot
>env vars.
>
>---
>[1] https://github.com/openbmc/phosphor-bmc-code-mgmt/blob/master/obmc-flash-bmc-setenv%40.service
>
>
Brad,
It sounds like Intel is not the only ones that might benefit from a
service like this, so it might be a good time for a new project/repo.
Could you create a new repo for us: phosphor-u-boot-env-mgr
--Vernon
More information about the openbmc
mailing list