Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v2 1/5] boot/grub2/grub2.mk: fix the installation of target tools
@ 2021-10-22 11:51 Kory Maincent
  2021-10-22 11:51 ` [Buildroot] [PATCH v2 2/5] boot/grub2/grub2.mk: remove the unnecessary \-continuations Kory Maincent
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Kory Maincent @ 2021-10-22 11:51 UTC (permalink / raw)
  To: buildroot; +Cc: aduskett, yann.morin.1998, thomas.petazzoni

The tools were not installed anymore since we move from autotools to
generic-package. This patch fixes their installation.

We have decided to implement the install tool process by running the "make
install" command for each tuple. This allows to have all different
platforms Grub modules installed in the target. The drawback is the
overwrite of Grub2 binaries tools during each "make install" command. This
drawback is absolutely not important as it happens in the same package. This is
the best option to avoid unnecessary and more complexity to this package.

Signed-off-by: Kory Maincent <kory.maincent@bootlin.com>
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Tested-by: Adam Duskett <aduskett@gmail.com>
---
 boot/grub2/grub2.mk | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/boot/grub2/grub2.mk b/boot/grub2/grub2.mk
index e01ebb2edb..a18696b6cc 100644
--- a/boot/grub2/grub2.mk
+++ b/boot/grub2/grub2.mk
@@ -195,5 +195,13 @@ define GRUB2_INSTALL_IMAGES_CMDS
 	)
 endef
 
+ifeq ($(BR2_TARGET_GRUB2_INSTALL_TOOLS),y)
+define GRUB2_INSTALL_TARGET_CMDS
+	$(foreach tuple, $(GRUB2_TUPLES-y), \
+		$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)/build-$(tuple) DESTDIR=$(TARGET_DIR) install
+	)
+endef
+endif
+
 $(eval $(generic-package))
 $(eval $(host-autotools-package))
-- 
2.25.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [Buildroot] [PATCH v2 2/5] boot/grub2/grub2.mk: remove the unnecessary \-continuations
  2021-10-22 11:51 [Buildroot] [PATCH v2 1/5] boot/grub2/grub2.mk: fix the installation of target tools Kory Maincent
@ 2021-10-22 11:51 ` Kory Maincent
  2021-10-22 11:51 ` [Buildroot] [PATCH v2 3/5] boot/grub2/grub2.mk: add more explicit build messages Kory Maincent
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Kory Maincent @ 2021-10-22 11:51 UTC (permalink / raw)
  To: buildroot; +Cc: aduskett, yann.morin.1998, thomas.petazzoni

This patch cleans the code by removing unnecessary \-continuations.
It replaces the semi-colons by separate lines and uses && not semi-colon.

Signed-off-by: Kory Maincent <kory.maincent@bootlin.com>
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
---
 boot/grub2/grub2.mk | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/boot/grub2/grub2.mk b/boot/grub2/grub2.mk
index a18696b6cc..e72a91d21a 100644
--- a/boot/grub2/grub2.mk
+++ b/boot/grub2/grub2.mk
@@ -149,8 +149,8 @@ HOST_GRUB2_CONF_OPTS = \
 
 define GRUB2_CONFIGURE_CMDS
 	$(foreach tuple, $(GRUB2_TUPLES-y), \
-		mkdir -p $(@D)/build-$(tuple) ; \
-		cd $(@D)/build-$(tuple) ; \
+		mkdir -p $(@D)/build-$(tuple)
+		cd $(@D)/build-$(tuple) && \
 		$(TARGET_CONFIGURE_OPTS) \
 		$(TARGET_CONFIGURE_ARGS) \
 		$(GRUB2_CONF_ENV) \
@@ -178,7 +178,7 @@ endef
 
 define GRUB2_INSTALL_IMAGES_CMDS
 	$(foreach tuple, $(GRUB2_TUPLES-y), \
-		mkdir -p $(dir $(GRUB2_IMAGE_$(tuple))) ; \
+		mkdir -p $(dir $(GRUB2_IMAGE_$(tuple)))
 		$(HOST_DIR)/usr/bin/grub-mkimage \
 			-d $(@D)/build-$(tuple)/grub-core/ \
 			-O $(tuple) \
@@ -186,11 +186,11 @@ define GRUB2_INSTALL_IMAGES_CMDS
 			-p "$(GRUB2_PREFIX_$(tuple))" \
 			$(if $(GRUB2_BUILTIN_CONFIG_$(tuple)), \
 				-c $(GRUB2_BUILTIN_CONFIG_$(tuple))) \
-			$(GRUB2_BUILTIN_MODULES_$(tuple)) ; \
-		$(INSTALL) -D -m 0644 boot/grub2/grub.cfg $(GRUB2_CFG_$(tuple)) ; \
+			$(GRUB2_BUILTIN_MODULES_$(tuple))
+		$(INSTALL) -D -m 0644 boot/grub2/grub.cfg $(GRUB2_CFG_$(tuple))
 		$(if $(findstring $(GRUB2_PLATFORM_$(tuple)), pc), \
 			cat $(HOST_DIR)/lib/grub/$(tuple)/cdboot.img $(GRUB2_IMAGE_$(tuple)) > \
-				$(BINARIES_DIR)/grub-eltorito.img ; \
+				$(BINARIES_DIR)/grub-eltorito.img
 		) \
 	)
 endef
-- 
2.25.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [Buildroot] [PATCH v2 3/5] boot/grub2/grub2.mk: add more explicit build messages
  2021-10-22 11:51 [Buildroot] [PATCH v2 1/5] boot/grub2/grub2.mk: fix the installation of target tools Kory Maincent
  2021-10-22 11:51 ` [Buildroot] [PATCH v2 2/5] boot/grub2/grub2.mk: remove the unnecessary \-continuations Kory Maincent
@ 2021-10-22 11:51 ` Kory Maincent
  2021-10-22 11:51 ` [Buildroot] [PATCH v2 4/5] boot/grub2/grub2.mk: fix the cdboot.img source from host to target Kory Maincent
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Kory Maincent @ 2021-10-22 11:51 UTC (permalink / raw)
  To: buildroot; +Cc: aduskett, yann.morin.1998, thomas.petazzoni

This patch adds the calls to MESSAGE, to explicit the different step of the
parallel build, following the current tuple loop.

Signed-off-by: Kory Maincent <kory.maincent@bootlin.com>
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
---
 boot/grub2/grub2.mk | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/boot/grub2/grub2.mk b/boot/grub2/grub2.mk
index e72a91d21a..19047d02f7 100644
--- a/boot/grub2/grub2.mk
+++ b/boot/grub2/grub2.mk
@@ -149,6 +149,7 @@ HOST_GRUB2_CONF_OPTS = \
 
 define GRUB2_CONFIGURE_CMDS
 	$(foreach tuple, $(GRUB2_TUPLES-y), \
+		@$(call MESSAGE,Configuring $(tuple))
 		mkdir -p $(@D)/build-$(tuple)
 		cd $(@D)/build-$(tuple) && \
 		$(TARGET_CONFIGURE_OPTS) \
@@ -172,12 +173,14 @@ endef
 
 define GRUB2_BUILD_CMDS
 	$(foreach tuple, $(GRUB2_TUPLES-y), \
+		@$(call MESSAGE,Building $(tuple))
 		$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)/build-$(tuple)
 	)
 endef
 
 define GRUB2_INSTALL_IMAGES_CMDS
 	$(foreach tuple, $(GRUB2_TUPLES-y), \
+		@$(call MESSAGE,Installing $(tuple) to images directory)
 		mkdir -p $(dir $(GRUB2_IMAGE_$(tuple)))
 		$(HOST_DIR)/usr/bin/grub-mkimage \
 			-d $(@D)/build-$(tuple)/grub-core/ \
@@ -198,6 +201,7 @@ endef
 ifeq ($(BR2_TARGET_GRUB2_INSTALL_TOOLS),y)
 define GRUB2_INSTALL_TARGET_CMDS
 	$(foreach tuple, $(GRUB2_TUPLES-y), \
+		@$(call MESSAGE,Installing $(tuple) to target directory)
 		$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)/build-$(tuple) DESTDIR=$(TARGET_DIR) install
 	)
 endef
-- 
2.25.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [Buildroot] [PATCH v2 4/5] boot/grub2/grub2.mk: fix the cdboot.img source from host to target
  2021-10-22 11:51 [Buildroot] [PATCH v2 1/5] boot/grub2/grub2.mk: fix the installation of target tools Kory Maincent
  2021-10-22 11:51 ` [Buildroot] [PATCH v2 2/5] boot/grub2/grub2.mk: remove the unnecessary \-continuations Kory Maincent
  2021-10-22 11:51 ` [Buildroot] [PATCH v2 3/5] boot/grub2/grub2.mk: add more explicit build messages Kory Maincent
@ 2021-10-22 11:51 ` Kory Maincent
  2021-10-22 11:51 ` [Buildroot] [PATCH v2 5/5] boot/grub2/grub2.mk: use none platform when building for host Kory Maincent
  2021-10-23 22:02 ` [Buildroot] [PATCH v2 1/5] boot/grub2/grub2.mk: fix the installation of target tools Yann E. MORIN
  4 siblings, 0 replies; 6+ messages in thread
From: Kory Maincent @ 2021-10-22 11:51 UTC (permalink / raw)
  To: buildroot; +Cc: aduskett, yann.morin.1998, thomas.petazzoni

This patch updates the location of cdboot.img used, to select the one from
the target directory and not from the host.
The host-grub2 is built only to have access to the Grub tools binaries.

Signed-off-by: Kory Maincent <kory.maincent@bootlin.com>
Cc: Yann E. MORIN <yann.morin.1998@free.fr>
---
 boot/grub2/grub2.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/boot/grub2/grub2.mk b/boot/grub2/grub2.mk
index 19047d02f7..270f289cfd 100644
--- a/boot/grub2/grub2.mk
+++ b/boot/grub2/grub2.mk
@@ -192,7 +192,7 @@ define GRUB2_INSTALL_IMAGES_CMDS
 			$(GRUB2_BUILTIN_MODULES_$(tuple))
 		$(INSTALL) -D -m 0644 boot/grub2/grub.cfg $(GRUB2_CFG_$(tuple))
 		$(if $(findstring $(GRUB2_PLATFORM_$(tuple)), pc), \
-			cat $(HOST_DIR)/lib/grub/$(tuple)/cdboot.img $(GRUB2_IMAGE_$(tuple)) > \
+			cat $(@D)/build-$(tuple)/grub-core/cdboot.img $(GRUB2_IMAGE_$(tuple)) > \
 				$(BINARIES_DIR)/grub-eltorito.img
 		) \
 	)
-- 
2.25.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [Buildroot] [PATCH v2 5/5] boot/grub2/grub2.mk: use none platform when building for host
  2021-10-22 11:51 [Buildroot] [PATCH v2 1/5] boot/grub2/grub2.mk: fix the installation of target tools Kory Maincent
                   ` (2 preceding siblings ...)
  2021-10-22 11:51 ` [Buildroot] [PATCH v2 4/5] boot/grub2/grub2.mk: fix the cdboot.img source from host to target Kory Maincent
@ 2021-10-22 11:51 ` Kory Maincent
  2021-10-23 22:02 ` [Buildroot] [PATCH v2 1/5] boot/grub2/grub2.mk: fix the installation of target tools Yann E. MORIN
  4 siblings, 0 replies; 6+ messages in thread
From: Kory Maincent @ 2021-10-22 11:51 UTC (permalink / raw)
  To: buildroot; +Cc: aduskett, yann.morin.1998, thomas.petazzoni

When creating the image we are using the target modules. Building the
modules for host is then unnecessary.
Let configure Host Grub2 for none platform.

Signed-off-by: Kory Maincent <kory.maincent@bootlin.com>
Cc: Yann E. MORIN <yann.morin.1998@free.fr>
---
 boot/grub2/grub2.mk | 1 +
 1 file changed, 1 insertion(+)

diff --git a/boot/grub2/grub2.mk b/boot/grub2/grub2.mk
index 270f289cfd..d93e383422 100644
--- a/boot/grub2/grub2.mk
+++ b/boot/grub2/grub2.mk
@@ -140,6 +140,7 @@ GRUB2_CONF_ENV = \
 	TARGET_STRIP="$(TARGET_CROSS)strip"
 
 HOST_GRUB2_CONF_OPTS = \
+	--with-platform=none \
 	--disable-grub-mkfont \
 	--enable-efiemu=no \
 	ac_cv_lib_lzma_lzma_code=no \
-- 
2.25.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [Buildroot] [PATCH v2 1/5] boot/grub2/grub2.mk: fix the installation of target tools
  2021-10-22 11:51 [Buildroot] [PATCH v2 1/5] boot/grub2/grub2.mk: fix the installation of target tools Kory Maincent
                   ` (3 preceding siblings ...)
  2021-10-22 11:51 ` [Buildroot] [PATCH v2 5/5] boot/grub2/grub2.mk: use none platform when building for host Kory Maincent
@ 2021-10-23 22:02 ` Yann E. MORIN
  4 siblings, 0 replies; 6+ messages in thread
From: Yann E. MORIN @ 2021-10-23 22:02 UTC (permalink / raw)
  To: Kory Maincent; +Cc: thomas.petazzoni, aduskett, buildroot

Köry, All,

On 2021-10-22 13:51 +0200, Kory Maincent spake thusly:
> The tools were not installed anymore since we move from autotools to
> generic-package. This patch fixes their installation.
> 
> We have decided to implement the install tool process by running the "make
> install" command for each tuple. This allows to have all different
> platforms Grub modules installed in the target. The drawback is the
> overwrite of Grub2 binaries tools during each "make install" command. This
> drawback is absolutely not important as it happens in the same package. This is
> the best option to avoid unnecessary and more complexity to this package.
> 
> Signed-off-by: Kory Maincent <kory.maincent@bootlin.com>
> Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
> Tested-by: Adam Duskett <aduskett@gmail.com>

Series of 5 patches applied to master, thanks.

I've tweaked some of the commit logs...

Regards,
Yann E. MORIN.

> ---
>  boot/grub2/grub2.mk | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/boot/grub2/grub2.mk b/boot/grub2/grub2.mk
> index e01ebb2edb..a18696b6cc 100644
> --- a/boot/grub2/grub2.mk
> +++ b/boot/grub2/grub2.mk
> @@ -195,5 +195,13 @@ define GRUB2_INSTALL_IMAGES_CMDS
>  	)
>  endef
>  
> +ifeq ($(BR2_TARGET_GRUB2_INSTALL_TOOLS),y)
> +define GRUB2_INSTALL_TARGET_CMDS
> +	$(foreach tuple, $(GRUB2_TUPLES-y), \
> +		$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)/build-$(tuple) DESTDIR=$(TARGET_DIR) install
> +	)
> +endef
> +endif
> +
>  $(eval $(generic-package))
>  $(eval $(host-autotools-package))
> -- 
> 2.25.1
> 
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-10-23 22:02 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-10-22 11:51 [Buildroot] [PATCH v2 1/5] boot/grub2/grub2.mk: fix the installation of target tools Kory Maincent
2021-10-22 11:51 ` [Buildroot] [PATCH v2 2/5] boot/grub2/grub2.mk: remove the unnecessary \-continuations Kory Maincent
2021-10-22 11:51 ` [Buildroot] [PATCH v2 3/5] boot/grub2/grub2.mk: add more explicit build messages Kory Maincent
2021-10-22 11:51 ` [Buildroot] [PATCH v2 4/5] boot/grub2/grub2.mk: fix the cdboot.img source from host to target Kory Maincent
2021-10-22 11:51 ` [Buildroot] [PATCH v2 5/5] boot/grub2/grub2.mk: use none platform when building for host Kory Maincent
2021-10-23 22:02 ` [Buildroot] [PATCH v2 1/5] boot/grub2/grub2.mk: fix the installation of target tools Yann E. MORIN

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox