* [Buildroot] [PATCH] [master] boot/grub2: fix build race condition
@ 2022-08-04 11:45 Stefan Agner
2022-08-04 13:12 ` Thomas Petazzoni via buildroot
0 siblings, 1 reply; 4+ messages in thread
From: Stefan Agner @ 2022-08-04 11:45 UTC (permalink / raw)
To: yann.morin.1998, buildroot; +Cc: stefan
Sometimes buildroot fails with:
../grub-core/kern/emu/hostfs.c:20:10: fatal error: config-util.h: No such file or directory
20 | #include <config-util.h>
| ^~~~~~~~~~~~~~~
Add a patch which fixes the Makefile to correctly generate config-util.h
first.
Signed-off-by: Stefan Agner <stefan@agner.ch>
---
...ub_fstest.pp-depend-on-config-util.h.patch | 24 +++++++++++++++++++
boot/grub2/grub2.mk | 6 +++++
2 files changed, 30 insertions(+)
create mode 100644 boot/grub2/0001-Makefile-Make-grub_fstest.pp-depend-on-config-util.h.patch
diff --git a/boot/grub2/0001-Makefile-Make-grub_fstest.pp-depend-on-config-util.h.patch b/boot/grub2/0001-Makefile-Make-grub_fstest.pp-depend-on-config-util.h.patch
new file mode 100644
index 0000000000..96e6852e86
--- /dev/null
+++ b/boot/grub2/0001-Makefile-Make-grub_fstest.pp-depend-on-config-util.h.patch
@@ -0,0 +1,24 @@
+diff -uraBN grub-2.06.orig/Makefile.am grub-2.06/Makefile.am
+--- grub-2.06.orig/Makefile.am 2020-03-10 21:39:53.000000000 +0100
++++ grub-2.06/Makefile.am 2022-08-04 12:48:15.486566890 +0200
+@@ -51,7 +51,7 @@
+ CLEANFILES += libgrub_a_init.c
+
+ # For grub-fstest
+-grub_fstest.pp: $(grub_fstest_SOURCES)
++grub_fstest.pp: config-util.h $(grub_fstest_SOURCES)
+ $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(grub_fstest_CPPFLAGS) $(CPPFLAGS) \
+ -D'GRUB_MOD_INIT(x)=@MARKER@x@' $^ > $@ || (rm -f $@; exit 1)
+ CLEANFILES += grub_fstest.pp
+diff -uraBN grub-2.06.orig/Makefile.in grub-2.06/Makefile.in
+--- grub-2.06.orig/Makefile.in 2021-06-08 16:41:36.000000000 +0200
++++ grub-2.06/Makefile.in 2022-08-04 12:48:08.116566935 +0200
+@@ -13312,7 +13312,7 @@
+ sh $(top_srcdir)/geninit.sh `cat $<` > $@ || (rm -f $@; exit 1)
+
+ # For grub-fstest
+-grub_fstest.pp: $(grub_fstest_SOURCES)
++grub_fstest.pp: config-util.h $(grub_fstest_SOURCES)
+ $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(grub_fstest_CPPFLAGS) $(CPPFLAGS) \
+ -D'GRUB_MOD_INIT(x)=@MARKER@x@' $^ > $@ || (rm -f $@; exit 1)
+
diff --git a/boot/grub2/grub2.mk b/boot/grub2/grub2.mk
index 57593330dd..6c9c80dc15 100644
--- a/boot/grub2/grub2.mk
+++ b/boot/grub2/grub2.mk
@@ -13,6 +13,12 @@ GRUB2_DEPENDENCIES = host-bison host-flex host-grub2
HOST_GRUB2_DEPENDENCIES = host-bison host-flex
GRUB2_INSTALL_IMAGES = YES
+define GRUB2_AVOID_AUTORECONF
+ $(Q)touch $(@D)/Makefile.in
+endef
+GRUB2_POST_PATCH_HOOKS += GRUB2_AVOID_AUTORECONF
+HOST_GRUB2_POST_PATCH_HOOKS += GRUB2_AVOID_AUTORECONF
+
# CVE-2019-14865 is about a flaw in the grub2-set-bootflag tool, which
# doesn't exist upstream, but is added by the Redhat/Fedora
# packaging. Not applicable to Buildroot.
--
2.37.1
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [Buildroot] [PATCH] [master] boot/grub2: fix build race condition
2022-08-04 11:45 [Buildroot] [PATCH] [master] boot/grub2: fix build race condition Stefan Agner
@ 2022-08-04 13:12 ` Thomas Petazzoni via buildroot
2022-08-04 13:38 ` Stefan Agner
0 siblings, 1 reply; 4+ messages in thread
From: Thomas Petazzoni via buildroot @ 2022-08-04 13:12 UTC (permalink / raw)
To: Stefan Agner; +Cc: yann.morin.1998, buildroot
Hello Stefan,
On Thu, 4 Aug 2022 13:45:27 +0200
Stefan Agner <stefan@agner.ch> wrote:
> Sometimes buildroot fails with:
> ../grub-core/kern/emu/hostfs.c:20:10: fatal error: config-util.h: No such file or directory
> 20 | #include <config-util.h>
> | ^~~~~~~~~~~~~~~
>
> Add a patch which fixes the Makefile to correctly generate config-util.h
> first.
>
> Signed-off-by: Stefan Agner <stefan@agner.ch>
Thanks for this patch.
> ---
> ...ub_fstest.pp-depend-on-config-util.h.patch | 24 +++++++++++++++++++
> boot/grub2/grub2.mk | 6 +++++
> 2 files changed, 30 insertions(+)
> create mode 100644 boot/grub2/0001-Makefile-Make-grub_fstest.pp-depend-on-config-util.h.patch
>
> diff --git a/boot/grub2/0001-Makefile-Make-grub_fstest.pp-depend-on-config-util.h.patch b/boot/grub2/0001-Makefile-Make-grub_fstest.pp-depend-on-config-util.h.patch
> new file mode 100644
> index 0000000000..96e6852e86
> --- /dev/null
> +++ b/boot/grub2/0001-Makefile-Make-grub_fstest.pp-depend-on-config-util.h.patch
We require all patches to have a proper commit log, with commit title +
description, and a Signed-off-by line. Also, we need to have the
upstream status of the patch, i.e where it has been submitted (or taken
from).
Could you rework your patch accordingly?
Thanks a lot!
Thomas
--
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Buildroot] [PATCH] [master] boot/grub2: fix build race condition
2022-08-04 13:12 ` Thomas Petazzoni via buildroot
@ 2022-08-04 13:38 ` Stefan Agner
2022-08-04 14:05 ` Thomas Petazzoni via buildroot
0 siblings, 1 reply; 4+ messages in thread
From: Stefan Agner @ 2022-08-04 13:38 UTC (permalink / raw)
To: Thomas Petazzoni; +Cc: yann.morin.1998, buildroot
On 2022-08-04 15:12, Thomas Petazzoni wrote:
> Hello Stefan,
>
> On Thu, 4 Aug 2022 13:45:27 +0200
> Stefan Agner <stefan@agner.ch> wrote:
>
>> Sometimes buildroot fails with:
>> ../grub-core/kern/emu/hostfs.c:20:10: fatal error: config-util.h: No such file or directory
>> 20 | #include <config-util.h>
>> | ^~~~~~~~~~~~~~~
>>
>> Add a patch which fixes the Makefile to correctly generate config-util.h
>> first.
>>
>> Signed-off-by: Stefan Agner <stefan@agner.ch>
>
> Thanks for this patch.
>
>> ---
>> ...ub_fstest.pp-depend-on-config-util.h.patch | 24 +++++++++++++++++++
>> boot/grub2/grub2.mk | 6 +++++
>> 2 files changed, 30 insertions(+)
>> create mode 100644 boot/grub2/0001-Makefile-Make-grub_fstest.pp-depend-on-config-util.h.patch
>>
>> diff --git a/boot/grub2/0001-Makefile-Make-grub_fstest.pp-depend-on-config-util.h.patch b/boot/grub2/0001-Makefile-Make-grub_fstest.pp-depend-on-config-util.h.patch
>> new file mode 100644
>> index 0000000000..96e6852e86
>> --- /dev/null
>> +++ b/boot/grub2/0001-Makefile-Make-grub_fstest.pp-depend-on-config-util.h.patch
>
> We require all patches to have a proper commit log, with commit title +
> description, and a Signed-off-by line. Also, we need to have the
> upstream status of the patch, i.e where it has been submitted (or taken
> from).
The problem is, this patch is not generated from a source repository but
simply using patch from the release tarball. The source repository does
not contain Makefile.in, which needs to be patched...
So a "proper commit log" as such is not possible. I can of course fake
it and make it look like the patch got generated from a commit, but not
sure if that is sensible?
Best regards
Stefan
>
> Could you rework your patch accordingly?
>
> Thanks a lot!
>
> Thomas
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Buildroot] [PATCH] [master] boot/grub2: fix build race condition
2022-08-04 13:38 ` Stefan Agner
@ 2022-08-04 14:05 ` Thomas Petazzoni via buildroot
0 siblings, 0 replies; 4+ messages in thread
From: Thomas Petazzoni via buildroot @ 2022-08-04 14:05 UTC (permalink / raw)
To: Stefan Agner; +Cc: yann.morin.1998, buildroot
On Thu, 04 Aug 2022 15:38:28 +0200
Stefan Agner <stefan@agner.ch> wrote:
> > We require all patches to have a proper commit log, with commit title +
> > description, and a Signed-off-by line. Also, we need to have the
> > upstream status of the patch, i.e where it has been submitted (or taken
> > from).
>
> The problem is, this patch is not generated from a source repository but
> simply using patch from the release tarball. The source repository does
> not contain Makefile.in, which needs to be patched...
>
> So a "proper commit log" as such is not possible. I can of course fake
> it and make it look like the patch got generated from a commit, but not
> sure if that is sensible?
Regardless of how the patch is generated, we want it to have a commit
log + description as well as an upstream status.
A basic way:
tar xf grub-2.06.tar.xz
cd grub-2.06
git init
git add .
git commit -s -m "Initial import"
and now do your changes
Of course, it's not going to be a patch that we can apply to the
upstream Git repository, but at least you will have the proper tooling to
create a patch that a commit title, description, SoB and contains an
indicate of its upstream status.
Alternatively, I see you're avoiding autoreconf. Any reason to do so?
Autoreconf doesn't work? (I know with some older grub versions,
autoreconf was problematic, so perhaps it is still the case).
Thanks!
Thomas
--
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-08-04 14:05 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-08-04 11:45 [Buildroot] [PATCH] [master] boot/grub2: fix build race condition Stefan Agner
2022-08-04 13:12 ` Thomas Petazzoni via buildroot
2022-08-04 13:38 ` Stefan Agner
2022-08-04 14:05 ` Thomas Petazzoni via buildroot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox