* [Buildroot] [PATCH] boot/grub2/grub2.mk: Fix the installation of target tools
@ 2021-10-21 16:06 Kory Maincent
2021-10-21 16:08 ` Thomas Petazzoni
2021-10-21 18:09 ` Yann E. MORIN
0 siblings, 2 replies; 3+ messages in thread
From: Kory Maincent @ 2021-10-21 16:06 UTC (permalink / raw)
To: buildroot; +Cc: aduskett, yann.morin.1998, thomas.petazzoni
The tools was 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 tuples. 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 not really important as it happens in the same package. This is
the best option to avoid unnecessary and more complexity to this package.
Yann adds also mixes fixes, like no semi-colons but separate lines, or
using && not sime-colon, and the calls to MESSAGE to explicit the different
step of the parallel build.
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 | 24 ++++++++++++++++++------
1 file changed, 18 insertions(+), 6 deletions(-)
diff --git a/boot/grub2/grub2.mk b/boot/grub2/grub2.mk
index e01ebb2edb..19047d02f7 100644
--- a/boot/grub2/grub2.mk
+++ b/boot/grub2/grub2.mk
@@ -149,8 +149,9 @@ HOST_GRUB2_CONF_OPTS = \
define GRUB2_CONFIGURE_CMDS
$(foreach tuple, $(GRUB2_TUPLES-y), \
- mkdir -p $(@D)/build-$(tuple) ; \
- cd $(@D)/build-$(tuple) ; \
+ @$(call MESSAGE,Configuring $(tuple))
+ mkdir -p $(@D)/build-$(tuple)
+ cd $(@D)/build-$(tuple) && \
$(TARGET_CONFIGURE_OPTS) \
$(TARGET_CONFIGURE_ARGS) \
$(GRUB2_CONF_ENV) \
@@ -172,13 +173,15 @@ 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), \
- mkdir -p $(dir $(GRUB2_IMAGE_$(tuple))) ; \
+ @$(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/ \
-O $(tuple) \
@@ -186,14 +189,23 @@ 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
+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
+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] 3+ messages in thread
* Re: [Buildroot] [PATCH] boot/grub2/grub2.mk: Fix the installation of target tools
2021-10-21 16:06 [Buildroot] [PATCH] boot/grub2/grub2.mk: Fix the installation of target tools Kory Maincent
@ 2021-10-21 16:08 ` Thomas Petazzoni
2021-10-21 18:09 ` Yann E. MORIN
1 sibling, 0 replies; 3+ messages in thread
From: Thomas Petazzoni @ 2021-10-21 16:08 UTC (permalink / raw)
To: Kory Maincent; +Cc: yann.morin.1998, aduskett, buildroot
On Thu, 21 Oct 2021 18:06:12 +0200
Kory Maincent <kory.maincent@bootlin.com> wrote:
> The tools was 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 tuples. 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 not really important as it happens in the same package. This is
> the best option to avoid unnecessary and more complexity to this package.
>
> Yann adds also mixes fixes, like no semi-colons but separate lines, or
> using && not sime-colon, and the calls to MESSAGE to explicit the different
> step of the parallel build.
Yann will ask to have these in a separate patch, I'm pretty sure (as I
would request the same).
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] 3+ messages in thread
* Re: [Buildroot] [PATCH] boot/grub2/grub2.mk: Fix the installation of target tools
2021-10-21 16:06 [Buildroot] [PATCH] boot/grub2/grub2.mk: Fix the installation of target tools Kory Maincent
2021-10-21 16:08 ` Thomas Petazzoni
@ 2021-10-21 18:09 ` Yann E. MORIN
1 sibling, 0 replies; 3+ messages in thread
From: Yann E. MORIN @ 2021-10-21 18:09 UTC (permalink / raw)
To: Kory Maincent; +Cc: aduskett, thomas.petazzoni, buildroot
On 2021-10-21 18:06 +0200, Kory Maincent spake thusly:
> The tools was not installed anymore since we move from autotools to
were
> generic-package. This patch fixes their installation.
>
> We have decided to implement the install tool process by running the "make
> install" command for each tuples. This allows to have all different
tuple ('each' is a singular)
> platforms Grub modules installed in the target. The drawback is the
> overwrite of Grub2 binaries tools during each "make install" command. This
> drawback is not really important as it happens in the same package. This is
s/not really/absolutely not/ ;-)
> the best option to avoid unnecessary and more complexity to this package.
Yes, agreed.
> Yann adds also mixes fixes, like no semi-colons but separate lines, or
misc
> using && not sime-colon, and the calls to MESSAGE to explicit the different
semi
Yeah, another guy doing typoes like I do! I like that! :-)
> step of the parallel build.
>
> 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>
As Thomas already replied, this should be done in separate patches:
- fix the tools installation
- remove the unnecessary \-continuations
- adding the MESSAGES calls
Regards,
Yann E. MORIN.
> ---
> boot/grub2/grub2.mk | 24 ++++++++++++++++++------
> 1 file changed, 18 insertions(+), 6 deletions(-)
>
> diff --git a/boot/grub2/grub2.mk b/boot/grub2/grub2.mk
> index e01ebb2edb..19047d02f7 100644
> --- a/boot/grub2/grub2.mk
> +++ b/boot/grub2/grub2.mk
> @@ -149,8 +149,9 @@ HOST_GRUB2_CONF_OPTS = \
>
> define GRUB2_CONFIGURE_CMDS
> $(foreach tuple, $(GRUB2_TUPLES-y), \
> - mkdir -p $(@D)/build-$(tuple) ; \
> - cd $(@D)/build-$(tuple) ; \
> + @$(call MESSAGE,Configuring $(tuple))
> + mkdir -p $(@D)/build-$(tuple)
> + cd $(@D)/build-$(tuple) && \
> $(TARGET_CONFIGURE_OPTS) \
> $(TARGET_CONFIGURE_ARGS) \
> $(GRUB2_CONF_ENV) \
> @@ -172,13 +173,15 @@ 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), \
> - mkdir -p $(dir $(GRUB2_IMAGE_$(tuple))) ; \
> + @$(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/ \
> -O $(tuple) \
> @@ -186,14 +189,23 @@ 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
>
> +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
> +endif
> +
> $(eval $(generic-package))
> $(eval $(host-autotools-package))
> --
> 2.25.1
>
--
.-----------------.--------------------.------------------.--------------------.
| 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] 3+ messages in thread
end of thread, other threads:[~2021-10-21 18:09 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-10-21 16:06 [Buildroot] [PATCH] boot/grub2/grub2.mk: Fix the installation of target tools Kory Maincent
2021-10-21 16:08 ` Thomas Petazzoni
2021-10-21 18:09 ` 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