Skip to content

grub: add grub variable extend functionality

Prarit Bhargava grub-devel 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest3 patches 3 repliesIn review
  2. v11 patch 3 repliesSuperseded

Changes in v2 from the cover letter

- Split into 3 patches.
- fix "=value" bug. An additional consequence of this is that the value pointer p in set_variable() cannot underflow.
- make grub_envblk_iterate return an int and fix return values.
- add "+=" functionality
- Changes suggested by David Kiper: Change name to grub_envblk_extend(), capitalize comments, use standard GRUB error enum, change goto from "out" to "err", drop cast in grub_strlen() call, use grub_snprintf() instead of strcpy & memcpy.
- Instead of parsing envblk separately, use grub_envblk_iterate()
- use a case statement in set_variable() error handling, and add a comment about deleting the "=" sign.

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3grub-editenv: Verify the variable sizeutil/grub-editenv.c+3 -01 reply
2/3grub: Make grub_envblk_iterate() return an intgrub-core/commands/loadenv.c grub-core/lib/envblk.c include/grub/err.h +2 more+18 -171 reply
3/3grub: add extend variable functionalityutil/grub-editenv.c+79 -21 reply

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH v2 0/3] grub: add grub variable extend functionality

This patchset allows a user to update an existing grub variable on the commandline.

v2:
- Split into 3 patches.
- fix "=value" bug. An additional consequence of this is that the value pointer p in set_variable() cannot underflow.
- make grub_envblk_iterate return an int and fix return values.
- add "+=" functionality
- Changes suggested by David Kiper: Change name to grub_envblk_extend(), capitalize comments, use standard GRUB error enum, change goto from "out" to "err", drop cast in grub_strlen() call, use grub_snprintf() instead of strcpy & memcpy.
- Instead of parsing envblk separately, use grub_envblk_iterate()
- use a case statement in set_variable() error handling, and add a comment about deleting the "=" sign.

Prarit Bhargava (3):
grub-editenv: Verify the variable size
grub: Make grub_envblk_iterate() return an int
grub: add extend variable functionality

 grub-core/commands/loadenv.c |  6 +--
 grub-core/lib/envblk.c       | 17 ++++---
 include/grub/err.h           |  4 +-
 include/grub/lib/envblk.h    |  6 +--
 util/grub-editenv.c          | 86 ++++++++++++++++++++++++++++++++++--
 5 files changed, 100 insertions(+), 19 deletions(-)
Signature · 1 line
2.17.2