On Thu, Aug 25, 2022 at 07:56:29PM -0500, Glenn Washburn wrote:
> From: Li Gen <ligenl...@gmail.com>
>
> This allows the cmp command to be used in GRUB scripts to conditionally
> run commands based on whether two files are the same.
>
> Signed-off-by: Li Gen <ligenl...@gmail.com>
> Signed-off-by: Glenn Washburn <developm...@efficientek.com>
> ---
>  grub-core/commands/cmp.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/grub-core/commands/cmp.c b/grub-core/commands/cmp.c
> index e9c3b25d34..e1665cf27b 100644
> --- a/grub-core/commands/cmp.c
> +++ b/grub-core/commands/cmp.c
> @@ -38,6 +38,7 @@ grub_cmd_cmp (grub_command_t cmd __attribute__ ((unused)),
>    grub_file_t file2 = 0;
>    char *buf1 = 0;
>    char *buf2 = 0;
> +  grub_err_t err = GRUB_ERR_TEST_FAILURE;
>
>    if (argc != 2)
>      return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("two arguments expected"));
> @@ -91,6 +92,7 @@ grub_cmd_cmp (grub_command_t cmd __attribute__ ((unused)),
>
>        /* TRANSLATORS: it's always exactly 2 files.  */
>        grub_printf_ (N_("The files are identical.\n"));

I think we should add a quite option to not switch video mode if it is
not needed. And these new cmp features should be mentioned in doc.

Daniel

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

Reply via email to