Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Petazzoni via buildroot <buildroot@buildroot.org>
To: "Michaelis, Adam J Collins via buildroot" <buildroot@buildroot.org>
Cc: "Michaelis, Adam J Collins" <adam.michaelis@collins.com>,
	"Buchmeyer, Neal Collins" <Neal.Buchmeyer@collins.com>,
	"Maier,
	 Brandon L                            Collins"
	<Brandon.Maier@collins.com>, Julien Olivain <ju.o@free.fr>,
	Romain Naour <romain.naour@smile.fr>
Subject: Re: [Buildroot] [PATCH v2 1/1] linux: Install artifacts to staging for kmod build
Date: Tue, 22 Oct 2024 21:24:20 +0200	[thread overview]
Message-ID: <20241022212420.4e850e1c@windsurf> (raw)
In-Reply-To: <BN2P110MB1160FC5A43AA27C6195B68A1974CA@BN2P110MB1160.NAMP110.PROD.OUTLOOK.COM>

Hello Adam,

Thanks a lot for your patch. See below some feedback.

On Tue, 22 Oct 2024 16:06:27 +0000
"Michaelis, Adam J Collins via buildroot" <buildroot@buildroot.org> wrote:

> From 45b18a0b5af619fd90194634530cc75f995ea57a Mon Sep 17 00:00:00 2001
> From: Adam Michaelis <adam.michaelis@collins.com>
> Date: Wed, 16 Oct 2024 09:06:14 -0500
> Subject: [PATCH v2 1/1] linux: Install artifacts to staging for kmod build

Please use git send-email to send your patches, instead of sending the
result of "git format-patch" directly in an e-mail. Indeed, otherwise
we have two times the From:, Date:, Subject:, etc. headers.

> Installing kernel build artifacts to staging so that the user could use
> the exported SDK to build out-of-tree kernel modules.

I think this could be worded a bit better. "This commit adds an option
that allows to install to the staging directory the necessary
files/artefacts that are needed to build out of tree kernel modules.
This is relevant when one wants to build out of tree kernel modules
using the Buildroot-generated SDK".

> +config BR2_LINUX_KERNEL_INSTALL_STAGING
> +       bool "Install kmod build files to staging"
> +       help
> +         Select this option to have the kernel files required for
> +         out-of-tree module building installed to staging. This will
> +         then enable module building from an exported SDK without
> +         the full Linux build and Buildroot.

I am actually wondering whether this should be an option. We don't have
any similar option for any other package.

> +define LINUX_INSTALL_STAGING_CMDS
> +       # Install artifacts needed for module builds into staging for SDK use
> +       if grep -q "CONFIG_MODULES=y" $(@D)/.config; then \
> +               install -d "$(STAGING_DIR)/lib/modules/$(LINUX_VERSION_PROBED)/build/arch" && \
> +               rsync --exclude "*.o" -a "$(@D)/arch/$(KERNEL_ARCH)" \
> +                       "$(STAGING_DIR)/lib/modules/$(LINUX_VERSION_PROBED)/build/arch/" && \
> +               rsync --exclude "*.o" --exclude "*.a" -a "$(@D)/include" \
> +                       "$(@D)/scripts" "$(@D)/certs" "$(@D)/Makefile" \
> +                       "$(@D)/Module.symvers" "$(@D)/.config" \
> +                       "$(STAGING_DIR)/lib/modules/$(LINUX_VERSION_PROBED)/build/" ;\

This feels a bit "crappy", these manual rsyncs. Doesn't the kernel has
some relevant make target that do the right thing?

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

  reply	other threads:[~2024-10-22 19:24 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-22 16:06 [Buildroot] [PATCH v2 1/1] linux: Install artifacts to staging for kmod build Michaelis, Adam J Collins via buildroot
2024-10-22 19:24 ` Thomas Petazzoni via buildroot [this message]
2024-10-22 20:14   ` Brandon Maier via buildroot
2024-10-22 20:23     ` Thomas Petazzoni via buildroot
2024-10-22 21:08       ` [Buildroot] [External] " Michaelis, Adam J Collins via buildroot

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=20241022212420.4e850e1c@windsurf \
    --to=buildroot@buildroot.org \
    --cc=Brandon.Maier@collins.com \
    --cc=Neal.Buchmeyer@collins.com \
    --cc=adam.michaelis@collins.com \
    --cc=ju.o@free.fr \
    --cc=romain.naour@smile.fr \
    --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