* [PATCH 1/3] bootstrap: Fix patching warnings
2025-10-24 20:56 [PATCH 0/3] Some fixes and cleanups Daniel Kiper via Grub-devel
@ 2025-10-24 20:56 ` Daniel Kiper via Grub-devel
2025-10-24 22:50 ` Andrew Hamilton
2025-10-24 20:56 ` [PATCH 2/3] lib/xzembed/xz_dec_stream: Replace grub_memcpy() call with memcpy() Daniel Kiper via Grub-devel
` (2 subsequent siblings)
3 siblings, 1 reply; 10+ messages in thread
From: Daniel Kiper via Grub-devel @ 2025-10-24 20:56 UTC (permalink / raw)
To: grub-devel; +Cc: Daniel Kiper, alec.r.brown, phcoder, ross.philipson
Currently bootstrap complains in the following way when
patching gnulib files:
patching file regcomp.c
Hunk #2 succeeded at 1029 with fuzz 2.
Hunk #5 succeeded at 1716 with fuzz 2.
patching file regexec.c
patching file base64.c
patching file regexec.c
Hunk #1 succeeded at 807 (offset -21 lines).
Let's fix it by adding missing "\f" and amending line
numbers in the patches.
Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
---
grub-core/lib/gnulib-patches/fix-regcomp-resource-leak.patch | 4 ++--
grub-core/lib/gnulib-patches/fix-unused-value.patch | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/grub-core/lib/gnulib-patches/fix-regcomp-resource-leak.patch b/grub-core/lib/gnulib-patches/fix-regcomp-resource-leak.patch
index b2e900023..62e7623a6 100644
--- a/grub-core/lib/gnulib-patches/fix-regcomp-resource-leak.patch
+++ b/grub-core/lib/gnulib-patches/fix-regcomp-resource-leak.patch
@@ -50,7 +50,7 @@
- return REG_NOERROR;
+ return err;
}
-
+ \f
/* If it is possible to do searching in single byte encoding instead of UTF-8
@@ -1677,12 +1677,11 @@ calc_eclosure_iter (re_node_set *new_set, re_dfa_t *dfa, Idx node, bool root)
{
@@ -106,5 +106,5 @@
+
+ return err;
}
-
+ \f
/* Functions for token which are used in the parser. */
diff --git a/grub-core/lib/gnulib-patches/fix-unused-value.patch b/grub-core/lib/gnulib-patches/fix-unused-value.patch
index ba51f1bf2..b56ab4bb4 100644
--- a/grub-core/lib/gnulib-patches/fix-unused-value.patch
+++ b/grub-core/lib/gnulib-patches/fix-unused-value.patch
@@ -1,6 +1,6 @@
--- a/lib/regexec.c 2020-10-21 14:25:35.310195912 +0000
+++ b/lib/regexec.c 2020-10-21 14:32:07.961765604 +0000
-@@ -828,7 +828,11 @@
+@@ -807,7 +807,11 @@
break;
if (__glibc_unlikely (err != REG_NOMATCH))
goto free_return;
--
2.11.0
_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel
^ permalink raw reply related [flat|nested] 10+ messages in thread* Re: [PATCH 1/3] bootstrap: Fix patching warnings
2025-10-24 20:56 ` [PATCH 1/3] bootstrap: Fix patching warnings Daniel Kiper via Grub-devel
@ 2025-10-24 22:50 ` Andrew Hamilton
0 siblings, 0 replies; 10+ messages in thread
From: Andrew Hamilton @ 2025-10-24 22:50 UTC (permalink / raw)
To: The development of GNU GRUB
Cc: Daniel Kiper, alec.r.brown, phcoder, ross.philipson
Looks good to me, thank you.
Reviewed-by: Andrew Hamilton <adhamilt@gmail.com>
On Fri, Oct 24, 2025 at 3:58 PM Daniel Kiper via Grub-devel
<grub-devel@gnu.org> wrote:
>
> Currently bootstrap complains in the following way when
> patching gnulib files:
>
> patching file regcomp.c
> Hunk #2 succeeded at 1029 with fuzz 2.
> Hunk #5 succeeded at 1716 with fuzz 2.
> patching file regexec.c
> patching file base64.c
> patching file regexec.c
> Hunk #1 succeeded at 807 (offset -21 lines).
>
> Let's fix it by adding missing "\f" and amending line
> numbers in the patches.
>
> Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
> ---
> grub-core/lib/gnulib-patches/fix-regcomp-resource-leak.patch | 4 ++--
> grub-core/lib/gnulib-patches/fix-unused-value.patch | 2 +-
> 2 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/grub-core/lib/gnulib-patches/fix-regcomp-resource-leak.patch b/grub-core/lib/gnulib-patches/fix-regcomp-resource-leak.patch
> index b2e900023..62e7623a6 100644
> --- a/grub-core/lib/gnulib-patches/fix-regcomp-resource-leak.patch
> +++ b/grub-core/lib/gnulib-patches/fix-regcomp-resource-leak.patch
> @@ -50,7 +50,7 @@
> - return REG_NOERROR;
> + return err;
> }
> -
> +
> /* If it is possible to do searching in single byte encoding instead of UTF-8
> @@ -1677,12 +1677,11 @@ calc_eclosure_iter (re_node_set *new_set, re_dfa_t *dfa, Idx node, bool root)
> {
> @@ -106,5 +106,5 @@
> +
> + return err;
> }
> -
> +
> /* Functions for token which are used in the parser. */
> diff --git a/grub-core/lib/gnulib-patches/fix-unused-value.patch b/grub-core/lib/gnulib-patches/fix-unused-value.patch
> index ba51f1bf2..b56ab4bb4 100644
> --- a/grub-core/lib/gnulib-patches/fix-unused-value.patch
> +++ b/grub-core/lib/gnulib-patches/fix-unused-value.patch
> @@ -1,6 +1,6 @@
> --- a/lib/regexec.c 2020-10-21 14:25:35.310195912 +0000
> +++ b/lib/regexec.c 2020-10-21 14:32:07.961765604 +0000
> -@@ -828,7 +828,11 @@
> +@@ -807,7 +807,11 @@
> break;
> if (__glibc_unlikely (err != REG_NOMATCH))
> goto free_return;
> --
> 2.11.0
>
>
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> https://lists.gnu.org/mailman/listinfo/grub-devel
_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 2/3] lib/xzembed/xz_dec_stream: Replace grub_memcpy() call with memcpy()
2025-10-24 20:56 [PATCH 0/3] Some fixes and cleanups Daniel Kiper via Grub-devel
2025-10-24 20:56 ` [PATCH 1/3] bootstrap: Fix patching warnings Daniel Kiper via Grub-devel
@ 2025-10-24 20:56 ` Daniel Kiper via Grub-devel
2025-10-24 22:50 ` Andrew Hamilton
2025-10-24 20:56 ` [PATCH 3/3] build: Add appended signatures header file to EXTRA_DIST Daniel Kiper via Grub-devel
2025-10-24 21:21 ` [PATCH 0/3] Some fixes and cleanups Alec Brown via Grub-devel
3 siblings, 1 reply; 10+ messages in thread
From: Daniel Kiper via Grub-devel @ 2025-10-24 20:56 UTC (permalink / raw)
To: grub-devel; +Cc: Daniel Kiper, alec.r.brown, phcoder, ross.philipson
Make the code consistent.
Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
---
grub-core/lib/xzembed/xz_dec_stream.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/grub-core/lib/xzembed/xz_dec_stream.c b/grub-core/lib/xzembed/xz_dec_stream.c
index f2dd42dc2..13658d448 100644
--- a/grub-core/lib/xzembed/xz_dec_stream.c
+++ b/grub-core/lib/xzembed/xz_dec_stream.c
@@ -387,8 +387,7 @@ static enum xz_ret hash_validate(struct xz_dec *s, struct xz_buf *b,
&& sizeof (s->hash_value) >= hash->mdlen)
{
hash->final(hash_context);
- grub_memcpy (s->hash_value, hash->read(hash_context),
- hash->mdlen);
+ memcpy (s->hash_value, hash->read (hash_context), hash->mdlen);
s->have_hash_value = 1;
if (s->hash_id == 1 || crc32)
{
--
2.11.0
_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel
^ permalink raw reply related [flat|nested] 10+ messages in thread* Re: [PATCH 2/3] lib/xzembed/xz_dec_stream: Replace grub_memcpy() call with memcpy()
2025-10-24 20:56 ` [PATCH 2/3] lib/xzembed/xz_dec_stream: Replace grub_memcpy() call with memcpy() Daniel Kiper via Grub-devel
@ 2025-10-24 22:50 ` Andrew Hamilton
0 siblings, 0 replies; 10+ messages in thread
From: Andrew Hamilton @ 2025-10-24 22:50 UTC (permalink / raw)
To: The development of GNU GRUB
Cc: Daniel Kiper, alec.r.brown, phcoder, ross.philipson
Looks good to me, thank you.
Reviewed-by: Andrew Hamilton <adhamilt@gmail.com>
On Fri, Oct 24, 2025 at 3:58 PM Daniel Kiper via Grub-devel
<grub-devel@gnu.org> wrote:
>
> Make the code consistent.
>
> Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
> ---
> grub-core/lib/xzembed/xz_dec_stream.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/grub-core/lib/xzembed/xz_dec_stream.c b/grub-core/lib/xzembed/xz_dec_stream.c
> index f2dd42dc2..13658d448 100644
> --- a/grub-core/lib/xzembed/xz_dec_stream.c
> +++ b/grub-core/lib/xzembed/xz_dec_stream.c
> @@ -387,8 +387,7 @@ static enum xz_ret hash_validate(struct xz_dec *s, struct xz_buf *b,
> && sizeof (s->hash_value) >= hash->mdlen)
> {
> hash->final(hash_context);
> - grub_memcpy (s->hash_value, hash->read(hash_context),
> - hash->mdlen);
> + memcpy (s->hash_value, hash->read (hash_context), hash->mdlen);
> s->have_hash_value = 1;
> if (s->hash_id == 1 || crc32)
> {
> --
> 2.11.0
>
>
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> https://lists.gnu.org/mailman/listinfo/grub-devel
_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 3/3] build: Add appended signatures header file to EXTRA_DIST
2025-10-24 20:56 [PATCH 0/3] Some fixes and cleanups Daniel Kiper via Grub-devel
2025-10-24 20:56 ` [PATCH 1/3] bootstrap: Fix patching warnings Daniel Kiper via Grub-devel
2025-10-24 20:56 ` [PATCH 2/3] lib/xzembed/xz_dec_stream: Replace grub_memcpy() call with memcpy() Daniel Kiper via Grub-devel
@ 2025-10-24 20:56 ` Daniel Kiper via Grub-devel
2025-10-24 22:50 ` Andrew Hamilton
2025-10-24 21:21 ` [PATCH 0/3] Some fixes and cleanups Alec Brown via Grub-devel
3 siblings, 1 reply; 10+ messages in thread
From: Daniel Kiper via Grub-devel @ 2025-10-24 20:56 UTC (permalink / raw)
To: grub-devel; +Cc: Daniel Kiper, alec.r.brown, phcoder, ross.philipson
This file was not added to EXTRA_DIST during the appended signatures merge.
Fixes: 3e4ff6ffb (appended signatures: Parse ASN1 node)
Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
---
| 2 ++
1 file changed, 2 insertions(+)
--git a/conf/Makefile.extra-dist b/conf/Makefile.extra-dist
index 846d45341..dcb0bed07 100644
--- a/conf/Makefile.extra-dist
+++ b/conf/Makefile.extra-dist
@@ -76,6 +76,8 @@ EXTRA_DIST += grub-core/tests/asn1/asn1_test.h
EXTRA_DIST += $(shell find $(top_srcdir)/grub-core/tests/asn1/tests -name '*.h')
EXTRA_DIST += $(shell find $(top_srcdir)/grub-core/commands/tpm2_key_protector -name '*.h')
+EXTRA_DIST += grub-core/commands/appendedsig/appendedsig.h
+
EXTRA_DIST += grub-core/lib/LzmaDec.c
EXTRA_DIST += grub-core/fs/cpio_common.c
--
2.11.0
_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH 3/3] build: Add appended signatures header file to EXTRA_DIST
2025-10-24 20:56 ` [PATCH 3/3] build: Add appended signatures header file to EXTRA_DIST Daniel Kiper via Grub-devel
@ 2025-10-24 22:50 ` Andrew Hamilton
2025-10-25 14:29 ` Andrew Hamilton
0 siblings, 1 reply; 10+ messages in thread
From: Andrew Hamilton @ 2025-10-24 22:50 UTC (permalink / raw)
To: The development of GNU GRUB
Cc: Daniel Kiper, alec.r.brown, phcoder, ross.philipson
Hello,
I notice that these files aren't in the dist archive currently, should
they be added too?
grub-core/commands/tpm2_key_protector/tpm2key.asn
grub-core/lib/libgcrypt-grub/mpi: ec.c
grub-core/lib/libgcrypt-grub/mpi: ec-ed25519.c
grub-core/lib/libgcrypt-grub/mpi: ec-hw-s390x.c
grub-core/lib/libgcrypt-grub/mpi: ec-nist.c
grub-core/lib/libgcrypt-grub/src: context.c
grub-core/lib/libgcrypt-grub/src: gen-note-integrity.sh
grub-core/lib/libgcrypt-grub/src: hwf-arm.c
grub-core/lib/libgcrypt-grub/src: hwf-ppc.c
grub-core/lib/libgcrypt-grub/src: hwf-s390x.c
grub-core/lib/libgcrypt-grub/src: hwf-x86.c
grub-core/lib/libgcrypt-grub/src: mpicalc.c
grub-core/tests: cmdline_cat_test.c
grub-core/tests: gfxterm_menu.c
These I wasn't sure if it was intentional to leave them out?
MAINTAINERS
SECURITY
.travis.yml
Thanks,
Andrew
On Fri, Oct 24, 2025 at 3:58 PM Daniel Kiper via Grub-devel
<grub-devel@gnu.org> wrote:
>
> This file was not added to EXTRA_DIST during the appended signatures merge.
>
> Fixes: 3e4ff6ffb (appended signatures: Parse ASN1 node)
>
> Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
> ---
> conf/Makefile.extra-dist | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/conf/Makefile.extra-dist b/conf/Makefile.extra-dist
> index 846d45341..dcb0bed07 100644
> --- a/conf/Makefile.extra-dist
> +++ b/conf/Makefile.extra-dist
> @@ -76,6 +76,8 @@ EXTRA_DIST += grub-core/tests/asn1/asn1_test.h
> EXTRA_DIST += $(shell find $(top_srcdir)/grub-core/tests/asn1/tests -name '*.h')
> EXTRA_DIST += $(shell find $(top_srcdir)/grub-core/commands/tpm2_key_protector -name '*.h')
>
> +EXTRA_DIST += grub-core/commands/appendedsig/appendedsig.h
> +
> EXTRA_DIST += grub-core/lib/LzmaDec.c
>
> EXTRA_DIST += grub-core/fs/cpio_common.c
> --
> 2.11.0
>
>
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> https://lists.gnu.org/mailman/listinfo/grub-devel
_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 3/3] build: Add appended signatures header file to EXTRA_DIST
2025-10-24 22:50 ` Andrew Hamilton
@ 2025-10-25 14:29 ` Andrew Hamilton
0 siblings, 0 replies; 10+ messages in thread
From: Andrew Hamilton @ 2025-10-25 14:29 UTC (permalink / raw)
To: The development of GNU GRUB
Cc: Daniel Kiper, alec.r.brown, phcoder, ross.philipson
I did some more investigation on these and found the following:
grub-core/commands/tpm2_key_protector/tpm2key.asn
- Seems only required if manually regenerating file
grub-core/commands/tpm2_key_protector/tpm2key_asn1_tab.c but may be
helpful to include for reference or if someone wants to change it for
some reason. I will send a patch to include it.
grub-core/lib/libgcrypt-grub/mpi: ec.c
grub-core/lib/libgcrypt-grub/mpi: ec-ed25519.c
grub-core/lib/libgcrypt-grub/mpi: ec-hw-s390x.c
grub-core/lib/libgcrypt-grub/mpi: ec-nist.c
grub-core/lib/libgcrypt-grub/src: context.c
grub-core/lib/libgcrypt-grub/src: gen-note-integrity.sh
grub-core/lib/libgcrypt-grub/src: hwf-arm.c
grub-core/lib/libgcrypt-grub/src: hwf-ppc.c
grub-core/lib/libgcrypt-grub/src: hwf-s390x.c
grub-core/lib/libgcrypt-grub/src: hwf-x86.c
grub-core/lib/libgcrypt-grub/src: mpicalc.c
- These don't seem to be needed in the dist archive, building from
git source and dist results in the same output either way.
grub-core/tests: cmdline_cat_test.c
grub-core/tests: gfxterm_menu.c
- These tests are disabled so make sense they aren't included.
MAINTAINERS
SECURITY
- These may be worth including, I'll submit a patch that adds them
for consideration.
.travis.yml
- I guess this was intended for a CI process but may not be actually
used anywhere currently.
I also found the new zstd test files need to be added so will send a
patch for those too.
In summary, this looks good to me, I'll send a patch for other possible updates.
Reviewed-by: Andrew Hamilton <adhamilt@gmail.com>
Thanks,
Andrew
On Fri, Oct 24, 2025 at 5:50 PM Andrew Hamilton <adhamilt@gmail.com> wrote:
>
> Hello,
>
> I notice that these files aren't in the dist archive currently, should
> they be added too?
>
> grub-core/commands/tpm2_key_protector/tpm2key.asn
> grub-core/lib/libgcrypt-grub/mpi: ec.c
> grub-core/lib/libgcrypt-grub/mpi: ec-ed25519.c
> grub-core/lib/libgcrypt-grub/mpi: ec-hw-s390x.c
> grub-core/lib/libgcrypt-grub/mpi: ec-nist.c
> grub-core/lib/libgcrypt-grub/src: context.c
> grub-core/lib/libgcrypt-grub/src: gen-note-integrity.sh
> grub-core/lib/libgcrypt-grub/src: hwf-arm.c
> grub-core/lib/libgcrypt-grub/src: hwf-ppc.c
> grub-core/lib/libgcrypt-grub/src: hwf-s390x.c
> grub-core/lib/libgcrypt-grub/src: hwf-x86.c
> grub-core/lib/libgcrypt-grub/src: mpicalc.c
> grub-core/tests: cmdline_cat_test.c
> grub-core/tests: gfxterm_menu.c
>
> These I wasn't sure if it was intentional to leave them out?
> MAINTAINERS
> SECURITY
> .travis.yml
>
> Thanks,
> Andrew
>
> On Fri, Oct 24, 2025 at 3:58 PM Daniel Kiper via Grub-devel
> <grub-devel@gnu.org> wrote:
> >
> > This file was not added to EXTRA_DIST during the appended signatures merge.
> >
> > Fixes: 3e4ff6ffb (appended signatures: Parse ASN1 node)
> >
> > Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
> > ---
> > conf/Makefile.extra-dist | 2 ++
> > 1 file changed, 2 insertions(+)
> >
> > diff --git a/conf/Makefile.extra-dist b/conf/Makefile.extra-dist
> > index 846d45341..dcb0bed07 100644
> > --- a/conf/Makefile.extra-dist
> > +++ b/conf/Makefile.extra-dist
> > @@ -76,6 +76,8 @@ EXTRA_DIST += grub-core/tests/asn1/asn1_test.h
> > EXTRA_DIST += $(shell find $(top_srcdir)/grub-core/tests/asn1/tests -name '*.h')
> > EXTRA_DIST += $(shell find $(top_srcdir)/grub-core/commands/tpm2_key_protector -name '*.h')
> >
> > +EXTRA_DIST += grub-core/commands/appendedsig/appendedsig.h
> > +
> > EXTRA_DIST += grub-core/lib/LzmaDec.c
> >
> > EXTRA_DIST += grub-core/fs/cpio_common.c
> > --
> > 2.11.0
> >
> >
> > _______________________________________________
> > Grub-devel mailing list
> > Grub-devel@gnu.org
> > https://lists.gnu.org/mailman/listinfo/grub-devel
_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel
^ permalink raw reply [flat|nested] 10+ messages in thread
* RE: [PATCH 0/3] Some fixes and cleanups
2025-10-24 20:56 [PATCH 0/3] Some fixes and cleanups Daniel Kiper via Grub-devel
` (2 preceding siblings ...)
2025-10-24 20:56 ` [PATCH 3/3] build: Add appended signatures header file to EXTRA_DIST Daniel Kiper via Grub-devel
@ 2025-10-24 21:21 ` Alec Brown via Grub-devel
3 siblings, 0 replies; 10+ messages in thread
From: Alec Brown via Grub-devel @ 2025-10-24 21:21 UTC (permalink / raw)
To: Daniel Kiper, grub-devel@gnu.org
Cc: Alec Brown, phcoder@gmail.com, Ross Philipson
Confidential – Oracle Internal
On Fri, Oct 24, 2025 at 4:56 PM, Daniel Kiper <daniel.kiper@oracle.com> wrote:
>
> Hey,
>
> As in subject...
>
> Daniel
>
> Daniel Kiper (3):
> bootstrap: Fix patching warnings
> lib/xzembed/xz_dec_stream: Replace grub_memcpy() call with memcpy()
> build: Add appended signatures header file to EXTRA_DIST
>
> conf/Makefile.extra-dist | 2 ++
> grub-core/lib/gnulib-patches/fix-regcomp-resource-leak.patch | 4 ++--
> grub-core/lib/gnulib-patches/fix-unused-value.patch | 2 +-
> grub-core/lib/xzembed/xz_dec_stream.c | 3 +--
> 4 files changed, 6 insertions(+), 5 deletions(-)
All these patches LGTM.
Reviewed-by: Alec Brown <alec.r.brown@oracle.com>
_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel
^ permalink raw reply [flat|nested] 10+ messages in thread