> On 15 Sep 2025, at 2:38 PM, Michael Chang via Grub-devel <[email protected]> 
> wrote:
> 
> This patch updates list_variables so that it also prints entries from
> the external environment block when one is present. The function first
> lists all variables from the file based envblk, then iterates over the
> external envblk and prints those as well.
> 
> The output format remains the same as before. The change makes it
> possible to inspect variables regardless of whether they are stored in
> the file envblk or in the reserved block.
> 
> Signed-off-by: Michael Chang <[email protected]>

Reviewed-by: Sudhakar Kuppusamy <[email protected]>

> ---
> util/grub-editenv.c | 7 +++++++
> 1 file changed, 7 insertions(+)
> 
> diff --git a/util/grub-editenv.c b/util/grub-editenv.c
> index 5fe240c42..43c87aa73 100644
> --- a/util/grub-editenv.c
> +++ b/util/grub-editenv.c
> @@ -335,10 +335,17 @@ static void
> list_variables (const char *name)
> {
>   grub_envblk_t envblk;
> +  grub_envblk_t envblk_fs = NULL;
> 
>   envblk = open_envblk_file (name);
> +  grub_envblk_iterate (envblk, &envblk_fs, read_envblk_fs);
>   grub_envblk_iterate (envblk, NULL, print_var);
>   grub_envblk_close (envblk);
> +  if (envblk_fs != NULL)
> +    {
> +      grub_envblk_iterate (envblk_fs, NULL, print_var);
> +      grub_envblk_close (envblk_fs);
> +    }
> }
> 
> static void
> -- 
> 2.51.0
> 
> 
> _______________________________________________
> Grub-devel mailing list
> [email protected]
> https://lists.gnu.org/mailman/listinfo/grub-devel


_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel

Reply via email to