All of lore.kernel.org
 help / color / mirror / Atom feed
From: Avnish Chouhan <avnish@linux.ibm.com>
To: mchang@suse.com
Cc: grub-devel@gnu.org, ngompa13@gmail.com, mlewando@redhat.com,
	Daniel Kiper <daniel.kiper@oracle.com>
Subject: Re: [PATCH v2 4/9] util/grub-editenv: wire set_variables to optional fs_envblk
Date: Wed, 17 Sep 2025 22:38:17 +0530	[thread overview]
Message-ID: <1104d0ab4db1fff449129f11a64babf2@linux.ibm.com> (raw)
In-Reply-To: <mailman.4164.1757927381.1199.grub-devel@gnu.org>

On 2025-09-15 14:39, grub-devel-request@gnu.org wrote:
> Message: 1
> Date: Mon, 15 Sep 2025 17:08:43 +0800
> From: Michael Chang <mchang@suse.com>
> To: The development of GNU GRUB <grub-devel@gnu.org>
> Cc: Neal Gompa <ngompa13@gmail.com>,	Marta Lewandowska
> 	<mlewando@redhat.com>
> Subject: [PATCH v2 4/9] util/grub-editenv: wire set_variables to
> 	optional fs_envblk
> Message-ID: <20250915090848.131937-5-mchang@suse.com>
> 
> This patch changes set_variables so that it can use an external
> environment block when one is present. The variable next_entry is
> written into the external block, env_block is treated as read only, and
> all other variables are written into the normal file based envblk.
> 
> A cleanup step is added to handle cases where GRUB at runtime writes
> variables into the external block because file based updates are not
> safe on a copy on write filesystem such as Btrfs. For example, the
> savedefault command can update saved_entry, and on Btrfs GRUB will 
> place
> that update in the external block instead of the file envblk. If an
> older copy remains in the external block, it would override the newer
> value from the file envblk when GRUB first loads the file and then
> applies the external block on top of it. To avoid this, whenever a
> variable is updated in the file envblk, any same named key in the
> external block is deleted.
> 
> Signed-off-by: Michael Chang <mchang@suse.com>
> ---
>  util/grub-editenv.c | 55 +++++++++++++++++++++++++++++++++++++++++++--
>  1 file changed, 53 insertions(+), 2 deletions(-)
> 
> diff --git a/util/grub-editenv.c b/util/grub-editenv.c
> index 26a81d2d0..d47adeb5e 100644
> --- a/util/grub-editenv.c
> +++ b/util/grub-editenv.c
> @@ -394,12 +394,33 @@ fs_envblk_write (grub_envblk_t envblk)
>    fclose (fp);
>  }
> 
> +struct var_lookup_ctx {
> +  const char *varname;
> +  bool found;
> +};
> +
> +static int
> +var_lookup_iter (const char *varname, const char *value __attribute__
> ((unused)), void *hook_data)
> +{
> +  struct var_lookup_ctx *ctx = (struct var_lookup_ctx *)hook_data;

Hi Michael,

Missing a space before "hook_data;"

Thank you!

Regards,
Avnish Chouhan

****

Reviewed-by: Avnish Chouhan <avnish@linux.ibm.com>


_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel

       reply	other threads:[~2025-09-17 17:09 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.4164.1757927381.1199.grub-devel@gnu.org>
2025-09-17 17:08 ` Avnish Chouhan [this message]
2025-09-24  2:29   ` [PATCH v2 4/9] util/grub-editenv: wire set_variables to optional fs_envblk Michael Chang via Grub-devel
2025-09-17 17:23 ` [PATCH v2 5/9] util/grub-editenv: wire unset_variables " Avnish Chouhan
2025-09-17 17:27 ` [PATCH v2 6/9] util/grub-editenv: wire list_variables " Avnish Chouhan
2025-09-15  9:08 [PATCH v2 0/9] Add support for external environment block on Btrfs Michael Chang via Grub-devel
2025-09-15  9:08 ` [PATCH v2 4/9] util/grub-editenv: wire set_variables to optional fs_envblk Michael Chang via Grub-devel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1104d0ab4db1fff449129f11a64babf2@linux.ibm.com \
    --to=avnish@linux.ibm.com \
    --cc=daniel.kiper@oracle.com \
    --cc=grub-devel@gnu.org \
    --cc=mchang@suse.com \
    --cc=mlewando@redhat.com \
    --cc=ngompa13@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.