summaryrefslogtreecommitdiffstats
path: root/discover/grub2/env.c
Commit message (Collapse)AuthorAgeFilesLines
* Various fixups and checks to make scan-build happySamuel Mendoza-Jonas2019-05-301-0/+2
| | | | Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
* In GRUB2 parser save_env, treat unset variable value as emptyAlan Dunn2016-03-151-0/+4
| | | | | | | | | | | | | | It seems better to treat unset variable values as empty rather than crashing in save_env. While GRUB's behavior is actually to delete the variable from the environment block, it seems useful to at least not crash while later on someone can do further work to improve GRUB compatibility if desired. Tested: Modified test-grub2-save-env to cover this case. Signed-off-by: Alan Dunn <amdunn@google.com> Signed-off-by: Sam Mendoza-Jonas <sam@mendozajonas.com>
* discover/grub2: Fix behavior of save_env -fAlan Dunn2016-02-081-3/+14
| | | | | | | | | | | | | | | Currently, "save_env -f" in the GRUB2 parser only works with three arguments, which means only commands of the form "save_env -f <path>" that save *no* environment variables are allowed. Allow "save_env -f <path> [<var>]*", making "save_env -f" useful. Tested: Unit test test-grub2-save-env-dash-f tests this change, and the remaining unit tests still pass. Signed-off-by: Alan Dunn <amdunn@google.com> Signed-off-by: Sam Mendoza-Jonas <sam@mendozajonas.com>
* discover: Initialise strtok_r saveptr to NULLSamuel Mendoza-Jonas2015-04-141-1/+1
| | | | | Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* lib: Move generic file-handling code to lib/Jeremy Kerr2014-08-051-1/+1
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover/grub2: Fix free in load_env commandJeremy Kerr2013-11-271-3/+3
| | | | | | We only need to free the buf if parser_request_file returned success. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* lib: consolidate util macros in util/util.hJeremy Kerr2013-11-131-1/+1
| | | | | | | This change groups the offsetof, container_of and ARRAY_SIZE macros in a single header file util/util.h. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover/grub2: Implement save_env commandJeremy Kerr2013-10-041-5/+158
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover/grub2: Implement load_envJeremy Kerr2013-10-011-0/+107
Use the new parser_request_file API to access the GRUB environment block. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
OpenPOWER on IntegriCloud