]> git.ipfire.org Git - thirdparty/grub.git/commit
util/grub-editenv: Add fs_envblk write helper
authorMichael Chang <mchang@suse.com>
Fri, 17 Oct 2025 09:01:35 +0000 (17:01 +0800)
committerDaniel Kiper <daniel.kiper@oracle.com>
Thu, 23 Oct 2025 17:15:01 +0000 (19:15 +0200)
commit2abdd8cd21c93de45d0ee4a3f6d68910fa6b2cb3
treeb64aaa17280f3cc252a5ec0d2f694ed3e1ffb95b
parente4d684cc4230f31addecacc72a2b9e421d01bc07
util/grub-editenv: Add fs_envblk write helper

This patch adds the function fs_envblk_write to update the reserved
environment block on disk. The helper takes an in memory envblk buffer
and writes it back to the device at the location defined by the
fs_envblk specification. It performs size checks and uses file sync to
ensure that the updated data is flushed.

The helper is also added into the fs_envblk ops table, together with the
open helper from the previous patch. With this change the basic input
and output path for an external environment block is complete. The
choice of which variables should be written externally will be handled
by later patches.

Signed-off-by: Michael Chang <mchang@suse.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
Reviewed-by: Avnish Chouhan <avnish@linux.ibm.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
util/grub-editenv.c