Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v2] package/environment-setup: add variable KERNEL_DIR alongside KERNELDIR
@ 2024-01-31 18:18 Nayab Sayed via buildroot
  2024-02-05 10:16 ` Antoine Coutant
  2024-02-12 21:59 ` Thomas Petazzoni via buildroot
  0 siblings, 2 replies; 5+ messages in thread
From: Nayab Sayed via buildroot @ 2024-01-31 18:18 UTC (permalink / raw)
  To: buildroot; +Cc: Nayab Sayed

Update host environment setup helper script to incorporate the variable
KENREL_DIR alongside the existing KERNELDIR. This adjustment ensures
consistency, as some projects utilize KERNELDIR while others use KERNEL_DIR.

Signed-off-by: Nayab Sayed <nayabbasha.sayed@microchip.com>
---
Changes in v2:
- Keep both KERNEL_DIR and KERNELDIR.
- Update commit message
- Link to v1: https://lore.kernel.org/r/20240124-kernel_dir-v1-1-4125408cf65d@microchip.com
---
 package/environment-setup/environment-setup    | 3 ++-
 package/environment-setup/environment-setup.mk | 2 ++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/package/environment-setup/environment-setup b/package/environment-setup/environment-setup
index 84a9843c24..0bae813e1a 100644
--- a/package/environment-setup/environment-setup
+++ b/package/environment-setup/environment-setup
@@ -10,7 +10,8 @@ cat <<'EOF'
 Some tips:
 * PATH now contains the SDK utilities
 * Standard autotools variables (CC, LD, CFLAGS) are exported
-* Kernel compilation variables (ARCH, CROSS_COMPILE, KERNELDIR) are exported
+* Kernel compilation variables (ARCH, CROSS_COMPILE, KERNELDIR or KERNEL_DIR)
+  are exported
 * To configure do "./configure $CONFIGURE_FLAGS" or use
   the "configure" alias
 * To build CMake-based projects, use the "cmake" alias
diff --git a/package/environment-setup/environment-setup.mk b/package/environment-setup/environment-setup.mk
index 29ec5a9a95..4a71f18f3a 100644
--- a/package/environment-setup/environment-setup.mk
+++ b/package/environment-setup/environment-setup.mk
@@ -35,6 +35,8 @@ define HOST_ENVIRONMENT_SETUP_INSTALL_CMDS
 
 	$(if $(BR2_LINUX_KERNEL),\
 		printf "export \"KERNELDIR=$(LINUX_BUILDDIR)\"\n" \
+			>> $(ENVIRONMENT_SETUP_FILE)
+		printf "export \"KERNEL_DIR=$(LINUX_BUILDDIR)\"\n" \
 			>> $(ENVIRONMENT_SETUP_FILE),)
 endef
 

---
base-commit: 04dfeff6242516a1061973fc7af2cc9c5e3dd4e2
change-id: 20240124-kernel_dir-41a48fd97b75

Best regards,
-- 
Nayab Sayed <nayabbasha.sayed@microchip.com>

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

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

* Re: [Buildroot] [PATCH v2] package/environment-setup: add variable KERNEL_DIR alongside KERNELDIR
  2024-01-31 18:18 [Buildroot] [PATCH v2] package/environment-setup: add variable KERNEL_DIR alongside KERNELDIR Nayab Sayed via buildroot
@ 2024-02-05 10:16 ` Antoine Coutant
  2024-02-12 21:59 ` Thomas Petazzoni via buildroot
  1 sibling, 0 replies; 5+ messages in thread
From: Antoine Coutant @ 2024-02-05 10:16 UTC (permalink / raw)
  To: buildroot


[-- Attachment #1.1: Type: text/plain, Size: 2260 bytes --]


On 31/01/2024 19:18, Nayab Sayed via buildroot wrote:
> Update host environment setup helper script to incorporate the variable
> KENREL_DIR alongside the existing KERNELDIR. This adjustment ensures
> consistency, as some projects utilize KERNELDIR while others use KERNEL_DIR.
>
> Signed-off-by: Nayab Sayed<nayabbasha.sayed@microchip.com>
> ---
> Changes in v2:
> - Keep both KERNEL_DIR and KERNELDIR.
> - Update commit message
> - Link to v1:https://lore.kernel.org/r/20240124-kernel_dir-v1-1-4125408cf65d@microchip.com
> ---
>   package/environment-setup/environment-setup    | 3 ++-
>   package/environment-setup/environment-setup.mk | 2 ++
>   2 files changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/package/environment-setup/environment-setup b/package/environment-setup/environment-setup
> index 84a9843c24..0bae813e1a 100644
> --- a/package/environment-setup/environment-setup
> +++ b/package/environment-setup/environment-setup
> @@ -10,7 +10,8 @@ cat <<'EOF'
>   Some tips:
>   * PATH now contains the SDK utilities
>   * Standard autotools variables (CC, LD, CFLAGS) are exported
> -* Kernel compilation variables (ARCH, CROSS_COMPILE, KERNELDIR) are exported
> +* Kernel compilation variables (ARCH, CROSS_COMPILE, KERNELDIR or KERNEL_DIR)
> +  are exported
>   * To configure do "./configure $CONFIGURE_FLAGS" or use
>     the "configure" alias
>   * To build CMake-based projects, use the "cmake" alias
> diff --git a/package/environment-setup/environment-setup.mk b/package/environment-setup/environment-setup.mk
> index 29ec5a9a95..4a71f18f3a 100644
> --- a/package/environment-setup/environment-setup.mk
> +++ b/package/environment-setup/environment-setup.mk
> @@ -35,6 +35,8 @@ define HOST_ENVIRONMENT_SETUP_INSTALL_CMDS
>   
>   	$(if $(BR2_LINUX_KERNEL),\
>   		printf "export \"KERNELDIR=$(LINUX_BUILDDIR)\"\n" \
> +			>> $(ENVIRONMENT_SETUP_FILE)
> +		printf "export \"KERNEL_DIR=$(LINUX_BUILDDIR)\"\n" \
>   			>> $(ENVIRONMENT_SETUP_FILE),)
>   endef
>   
>
> ---
> base-commit: 04dfeff6242516a1061973fc7af2cc9c5e3dd4e2
> change-id: 20240124-kernel_dir-41a48fd97b75
>
> Best regards,

Looks good to me.


Reviewed-by: Antoine Coutant <antoine.coutant@smile.fr> 
<mailto:antoine.coutant@smile.fr>


Regards,

Antoine Coutant.

[-- Attachment #1.2: Type: text/html, Size: 3061 bytes --]

[-- Attachment #2: Type: text/plain, Size: 150 bytes --]

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

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

* Re: [Buildroot] [PATCH v2] package/environment-setup: add variable KERNEL_DIR alongside KERNELDIR
  2024-01-31 18:18 [Buildroot] [PATCH v2] package/environment-setup: add variable KERNEL_DIR alongside KERNELDIR Nayab Sayed via buildroot
  2024-02-05 10:16 ` Antoine Coutant
@ 2024-02-12 21:59 ` Thomas Petazzoni via buildroot
  2024-02-13  8:23   ` Arnout Vandecappelle via buildroot
  1 sibling, 1 reply; 5+ messages in thread
From: Thomas Petazzoni via buildroot @ 2024-02-12 21:59 UTC (permalink / raw)
  To: Nayab Sayed via buildroot
  Cc: Nayab Sayed, Angelo Compagnucci, Romain Naour, Yann E. MORIN

Hello Nayab,

On Wed, 31 Jan 2024 23:48:28 +0530
Nayab Sayed via buildroot <buildroot@buildroot.org> wrote:

> Update host environment setup helper script to incorporate the variable
> KENREL_DIR alongside the existing KERNELDIR. This adjustment ensures
> consistency, as some projects utilize KERNELDIR while others use KERNEL_DIR.
> 
> Signed-off-by: Nayab Sayed <nayabbasha.sayed@microchip.com>

Thanks for this new iteration, but on my side, I'm tempted to reject
this patch, and actually to remove the support for KERNELDIR as well.

Indeed, even Angelo, who added the environment-setup script was not
able to provide a solid reason for exporting KERNELDIR in the first
place. I don't think there is any standard, or somewhat standard
variable to point to the Linux kernel source directory.

I'm fine with environment-setup exposing CC, LD, CFLAGS, LDFLAGS, or
even CROSS_COMPILE as these are reasonably standardized by various
build systems. But KERNELDIR or KERNEL_DIR are not, and the simple fact
that both would be needed/useful is a clear hint of that. The whole
thing I didn't like in the first place with environment-setup is the
fact that it exports a mixed bag of somewhat random environment
variables, and exposing both KERNELDIR and KERNEL_DIR clearly goes
further into this direction in my opinion.

Best regards,

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] 5+ messages in thread

* Re: [Buildroot] [PATCH v2] package/environment-setup: add variable KERNEL_DIR alongside KERNELDIR
  2024-02-12 21:59 ` Thomas Petazzoni via buildroot
@ 2024-02-13  8:23   ` Arnout Vandecappelle via buildroot
  2024-06-04  5:29     ` Angelo Compagnucci
  0 siblings, 1 reply; 5+ messages in thread
From: Arnout Vandecappelle via buildroot @ 2024-02-13  8:23 UTC (permalink / raw)
  To: Thomas Petazzoni, Nayab Sayed via buildroot
  Cc: Nayab Sayed, Angelo Compagnucci, Yann E. MORIN, Romain Naour



On 12/02/2024 22:59, Thomas Petazzoni wrote:
> Hello Nayab,
> 
> On Wed, 31 Jan 2024 23:48:28 +0530
> Nayab Sayed via buildroot <buildroot@buildroot.org> wrote:
> 
>> Update host environment setup helper script to incorporate the variable
>> KENREL_DIR alongside the existing KERNELDIR. This adjustment ensures
>> consistency, as some projects utilize KERNELDIR while others use KERNEL_DIR.
>>
>> Signed-off-by: Nayab Sayed <nayabbasha.sayed@microchip.com>
> 
> Thanks for this new iteration, but on my side, I'm tempted to reject
> this patch, and actually to remove the support for KERNELDIR as well.
> 
> Indeed, even Angelo, who added the environment-setup script was not
> able to provide a solid reason for exporting KERNELDIR in the first
> place. I don't think there is any standard, or somewhat standard
> variable to point to the Linux kernel source directory.
> 
> I'm fine with environment-setup exposing CC, LD, CFLAGS, LDFLAGS, or
> even CROSS_COMPILE as these are reasonably standardized by various
> build systems. But KERNELDIR or KERNEL_DIR are not, and the simple fact
> that both would be needed/useful is a clear hint of that. The whole
> thing I didn't like in the first place with environment-setup is the
> fact that it exports a mixed bag of somewhat random environment
> variables, and exposing both KERNELDIR and KERNEL_DIR clearly goes
> further into this direction in my opinion.

  Well, without an exported KERNELDIR, it will be very hard to build kernel 
modules outside of buildroot (and the whole point of this environment-setup 
thing is to make it easier to build stuff outside of buildroot). Indeed, 
output/build/linux-* will match stuff like linux-pam as well.

  That said, I agree that exporting both KERNELDIR and KERNEL_DIR sounds a bit 
over the top.

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

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

* Re: [Buildroot] [PATCH v2] package/environment-setup: add variable KERNEL_DIR alongside KERNELDIR
  2024-02-13  8:23   ` Arnout Vandecappelle via buildroot
@ 2024-06-04  5:29     ` Angelo Compagnucci
  0 siblings, 0 replies; 5+ messages in thread
From: Angelo Compagnucci @ 2024-06-04  5:29 UTC (permalink / raw)
  To: Arnout Vandecappelle
  Cc: Nayab Sayed, Thomas Petazzoni, Nayab Sayed via buildroot,
	Romain Naour, Yann E. MORIN


[-- Attachment #1.1: Type: text/plain, Size: 2454 bytes --]

Il mar 13 feb 2024, 09:23 Arnout Vandecappelle <arnout@mind.be> ha scritto:

>
>
> On 12/02/2024 22:59, Thomas Petazzoni wrote:
> > Hello Nayab,
> >
> > On Wed, 31 Jan 2024 23:48:28 +0530
> > Nayab Sayed via buildroot <buildroot@buildroot.org> wrote:
> >
> >> Update host environment setup helper script to incorporate the variable
> >> KENREL_DIR alongside the existing KERNELDIR. This adjustment ensures
> >> consistency, as some projects utilize KERNELDIR while others use
> KERNEL_DIR.
> >>
> >> Signed-off-by: Nayab Sayed <nayabbasha.sayed@microchip.com>
> >
> > Thanks for this new iteration, but on my side, I'm tempted to reject
> > this patch, and actually to remove the support for KERNELDIR as well.
> >
> > Indeed, even Angelo, who added the environment-setup script was not
> > able to provide a solid reason for exporting KERNELDIR in the first
> > place. I don't think there is any standard, or somewhat standard
> > variable to point to the Linux kernel source directory.
> >
> > I'm fine with environment-setup exposing CC, LD, CFLAGS, LDFLAGS, or
> > even CROSS_COMPILE as these are reasonably standardized by various
> > build systems. But KERNELDIR or KERNEL_DIR are not, and the simple fact
> > that both would be needed/useful is a clear hint of that. The whole
> > thing I didn't like in the first place with environment-setup is the
> > fact that it exports a mixed bag of somewhat random environment
> > variables, and exposing both KERNELDIR and KERNEL_DIR clearly goes
> > further into this direction in my opinion.
>
>   Well, without an exported KERNELDIR, it will be very hard to build
> kernel
> modules outside of buildroot (and the whole point of this
> environment-setup
> thing is to make it easier to build stuff outside of buildroot). Indeed,
> output/build/linux-* will match stuff like linux-pam as well.
>

Exactly. I also think the main idea here is to have a simple way to
externally compile something or test if it cross compiles under buildroot.

  That said, I agree that exporting both KERNELDIR and KERNEL_DIR sounds a
> bit
> over the top.
>

I do not agree here: those two variables are almost the standard and we are
not exactly polluting the environment with a variable more.

A user can opt-in to use the environment-setup script, so he will be ok
having it exporting some variable to his current environment.

I think it will make the script only a little bit more useful!


>   Regards,
>   Arnout
>

[-- Attachment #1.2: Type: text/html, Size: 3710 bytes --]

[-- Attachment #2: Type: text/plain, Size: 150 bytes --]

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

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

end of thread, other threads:[~2024-06-04  5:30 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-31 18:18 [Buildroot] [PATCH v2] package/environment-setup: add variable KERNEL_DIR alongside KERNELDIR Nayab Sayed via buildroot
2024-02-05 10:16 ` Antoine Coutant
2024-02-12 21:59 ` Thomas Petazzoni via buildroot
2024-02-13  8:23   ` Arnout Vandecappelle via buildroot
2024-06-04  5:29     ` Angelo Compagnucci

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