Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Yann E. MORIN" <yann.morin.1998@free.fr>
To: Kory Maincent <kory.maincent@bootlin.com>
Cc: aduskett@gmail.com, thomas.petazzoni@bootlin.com,
	buildroot@buildroot.org
Subject: Re: [Buildroot] [PATCH] boot/grub2/grub2.mk: Fix the installation of target tools
Date: Thu, 21 Oct 2021 20:09:02 +0200	[thread overview]
Message-ID: <20211021180902.GF2400@scaer> (raw)
In-Reply-To: <20211021160612.475456-1-kory.maincent@bootlin.com>

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

      parent reply	other threads:[~2021-10-21 18:09 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211021180902.GF2400@scaer \
    --to=yann.morin.1998@free.fr \
    --cc=aduskett@gmail.com \
    --cc=buildroot@buildroot.org \
    --cc=kory.maincent@bootlin.com \
    --cc=thomas.petazzoni@bootlin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox