public inbox for linux-kbuild@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] kbuild: pacman-pkg: move common commands to a separate function
@ 2024-08-16 14:18 Masahiro Yamada
  2024-08-16 14:18 ` [PATCH 2/2] kbuild: pacman-pkg: do not override objtree Masahiro Yamada
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Masahiro Yamada @ 2024-08-16 14:18 UTC (permalink / raw)
  To: linux-kbuild
  Cc: linux-kernel, Masahiro Yamada, Christian Heusel,
	Nathan Chancellor, Nicolas Schier, Thomas Weißschuh

All build and package functions share the following commands:

  export MAKEFLAGS="${KBUILD_MAKEFLAGS}"
  cd "${objtree}"

Factor out the common code.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

 scripts/package/PKGBUILD | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/scripts/package/PKGBUILD b/scripts/package/PKGBUILD
index fbd7eb10a52c..e2d9c2601ca9 100644
--- a/scripts/package/PKGBUILD
+++ b/scripts/package/PKGBUILD
@@ -36,11 +36,15 @@ makedepends=(
 )
 options=(!debug !strip !buildflags !makeflags)
 
-build() {
+_prologue() {
 	# MAKEFLAGS from makepkg.conf override the ones inherited from kbuild.
 	# Bypass this override with a custom variable.
 	export MAKEFLAGS="${KBUILD_MAKEFLAGS}"
 	cd "${objtree}"
+}
+
+build() {
+	_prologue
 
 	${MAKE} KERNELRELEASE="${KERNELRELEASE}" KBUILD_BUILD_VERSION="${pkgrel}"
 }
@@ -48,10 +52,10 @@ build() {
 _package() {
 	pkgdesc="The ${pkgdesc} kernel and modules"
 
-	export MAKEFLAGS="${KBUILD_MAKEFLAGS}"
-	cd "${objtree}"
 	local modulesdir="${pkgdir}/usr/${MODLIB}"
 
+	_prologue
+
 	echo "Installing boot image..."
 	# systemd expects to find the kernel here to allow hibernation
 	# https://github.com/systemd/systemd/commit/edda44605f06a41fb86b7ab8128dcf99161d2344
@@ -76,10 +80,10 @@ _package() {
 _package-headers() {
 	pkgdesc="Headers and scripts for building modules for the ${pkgdesc} kernel"
 
-	export MAKEFLAGS="${KBUILD_MAKEFLAGS}"
-	cd "${objtree}"
 	local builddir="${pkgdir}/usr/${MODLIB}/build"
 
+	_prologue
+
 	if grep -q CONFIG_MODULES=y include/config/auto.conf; then
 		echo "Installing build files..."
 		"${srctree}/scripts/package/install-extmod-build" "${builddir}"
@@ -100,8 +104,7 @@ _package-api-headers() {
 	provides=(linux-api-headers)
 	conflicts=(linux-api-headers)
 
-	export MAKEFLAGS="${KBUILD_MAKEFLAGS}"
-	cd "${objtree}"
+	_prologue
 
 	${MAKE} headers_install INSTALL_HDR_PATH="${pkgdir}/usr"
 }
-- 
2.43.0


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

* [PATCH 2/2] kbuild: pacman-pkg: do not override objtree
  2024-08-16 14:18 [PATCH 1/2] kbuild: pacman-pkg: move common commands to a separate function Masahiro Yamada
@ 2024-08-16 14:18 ` Masahiro Yamada
  2024-08-16 19:01   ` linux
                     ` (3 more replies)
  2024-08-16 18:59 ` [PATCH 1/2] kbuild: pacman-pkg: move common commands to a separate function linux
                   ` (2 subsequent siblings)
  3 siblings, 4 replies; 9+ messages in thread
From: Masahiro Yamada @ 2024-08-16 14:18 UTC (permalink / raw)
  To: linux-kbuild
  Cc: linux-kernel, Masahiro Yamada, Christian Heusel,
	Nathan Chancellor, Nicolas Schier, Thomas Weißschuh

objtree is defined and exported by the top-level Makefile. I prefer
not to override it.

There is no need to pass the absolute pass of objtree. PKGBUILD can
detect it by itself.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

 scripts/Makefile.package | 3 +--
 scripts/package/PKGBUILD | 4 +++-
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/scripts/Makefile.package b/scripts/Makefile.package
index 4a80584ec771..2c261a0d42b0 100644
--- a/scripts/Makefile.package
+++ b/scripts/Makefile.package
@@ -147,8 +147,7 @@ snap-pkg:
 PHONY += pacman-pkg
 pacman-pkg:
 	@ln -srf $(srctree)/scripts/package/PKGBUILD $(objtree)/PKGBUILD
-	+objtree="$(realpath $(objtree))" \
-		BUILDDIR="$(realpath $(objtree))/pacman" \
+	BUILDDIR="$(realpath $(objtree))/pacman" \
 		CARCH="$(UTS_MACHINE)" \
 		KBUILD_MAKEFLAGS="$(MAKEFLAGS)" \
 		KBUILD_REVISION="$(shell $(srctree)/scripts/build-version)" \
diff --git a/scripts/package/PKGBUILD b/scripts/package/PKGBUILD
index e2d9c2601ca9..839cd5e634d2 100644
--- a/scripts/package/PKGBUILD
+++ b/scripts/package/PKGBUILD
@@ -40,7 +40,9 @@ _prologue() {
 	# MAKEFLAGS from makepkg.conf override the ones inherited from kbuild.
 	# Bypass this override with a custom variable.
 	export MAKEFLAGS="${KBUILD_MAKEFLAGS}"
-	cd "${objtree}"
+
+	# Kbuild works in the output directory, where this PKGBUILD is located.
+	cd "$(dirname "${BASH_SOURCE[0]}")"
 }
 
 build() {
-- 
2.43.0


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

* Re: [PATCH 1/2] kbuild: pacman-pkg: move common commands to a separate function
  2024-08-16 14:18 [PATCH 1/2] kbuild: pacman-pkg: move common commands to a separate function Masahiro Yamada
  2024-08-16 14:18 ` [PATCH 2/2] kbuild: pacman-pkg: do not override objtree Masahiro Yamada
@ 2024-08-16 18:59 ` linux
  2024-08-16 21:00 ` Nathan Chancellor
  2024-08-17  9:51 ` Christian Heusel
  3 siblings, 0 replies; 9+ messages in thread
From: linux @ 2024-08-16 18:59 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: linux-kbuild, linux-kernel, Christian Heusel, Nathan Chancellor,
	Nicolas Schier, Thomas Weißschuh

Aug 16, 2024 16:18:53 Masahiro Yamada <masahiroy@kernel.org>:

> All build and package functions share the following commands:
>
>   export MAKEFLAGS="${KBUILD_MAKEFLAGS}"
>   cd "${objtree}"
>
> Factor out the common code.
>
> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>

Acked-by:  Thomas Weißschuh <linux@weissschuh.net>

> ---
>
> scripts/package/PKGBUILD | 17 ++++++++++-------
> 1 file changed, 10 insertions(+), 7 deletions(-)
>
> diff --git a/scripts/package/PKGBUILD b/scripts/package/PKGBUILD
> index fbd7eb10a52c..e2d9c2601ca9 100644
> --- a/scripts/package/PKGBUILD
> +++ b/scripts/package/PKGBUILD
> @@ -36,11 +36,15 @@ makedepends=(
> )
> options=(!debug !strip !buildflags !makeflags)
>
> -build() {
> +_prologue() {
>     # MAKEFLAGS from makepkg.conf override the ones inherited from kbuild.
>     # Bypass this override with a custom variable.
>     export MAKEFLAGS="${KBUILD_MAKEFLAGS}"
>     cd "${objtree}"
> +}
> +
> +build() {
> +   _prologue
>
>     ${MAKE} KERNELRELEASE="${KERNELRELEASE}" KBUILD_BUILD_VERSION="${pkgrel}"
> }
> @@ -48,10 +52,10 @@ build() {
> _package() {
>     pkgdesc="The ${pkgdesc} kernel and modules"
>
> -   export MAKEFLAGS="${KBUILD_MAKEFLAGS}"
> -   cd "${objtree}"
>     local modulesdir="${pkgdir}/usr/${MODLIB}"
>
> +   _prologue
> +
>     echo "Installing boot image..."
>     # systemd expects to find the kernel here to allow hibernation
>     # https://github.com/systemd/systemd/commit/edda44605f06a41fb86b7ab8128dcf99161d2344
> @@ -76,10 +80,10 @@ _package() {
> _package-headers() {
>     pkgdesc="Headers and scripts for building modules for the ${pkgdesc} kernel"
>
> -   export MAKEFLAGS="${KBUILD_MAKEFLAGS}"
> -   cd "${objtree}"
>     local builddir="${pkgdir}/usr/${MODLIB}/build"
>
> +   _prologue
> +
>     if grep -q CONFIG_MODULES=y include/config/auto.conf; then
>         echo "Installing build files..."
>         "${srctree}/scripts/package/install-extmod-build" "${builddir}"
> @@ -100,8 +104,7 @@ _package-api-headers() {
>     provides=(linux-api-headers)
>     conflicts=(linux-api-headers)
>
> -   export MAKEFLAGS="${KBUILD_MAKEFLAGS}"
> -   cd "${objtree}"
> +   _prologue
>
>     ${MAKE} headers_install INSTALL_HDR_PATH="${pkgdir}/usr"
> }
> --
> 2.43.0


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

* Re: [PATCH 2/2] kbuild: pacman-pkg: do not override objtree
  2024-08-16 14:18 ` [PATCH 2/2] kbuild: pacman-pkg: do not override objtree Masahiro Yamada
@ 2024-08-16 19:01   ` linux
  2024-08-16 21:00   ` Nathan Chancellor
                     ` (2 subsequent siblings)
  3 siblings, 0 replies; 9+ messages in thread
From: linux @ 2024-08-16 19:01 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: linux-kbuild, linux-kernel, Christian Heusel, Nathan Chancellor,
	Nicolas Schier, Thomas Weißschuh

Aug 16, 2024 16:18:56 Masahiro Yamada <masahiroy@kernel.org>:

> objtree is defined and exported by the top-level Makefile. I prefer
> not to override it.
>
> There is no need to pass the absolute pass of objtree. PKGBUILD can

s/pass/path/g

> detect it by itself.
>
> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>

Acked-by:  Thomas Weißschuh <linux@weissschuh.net>


> ---
>
> scripts/Makefile.package | 3 +--
> scripts/package/PKGBUILD | 4 +++-
> 2 files changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/scripts/Makefile.package b/scripts/Makefile.package
> index 4a80584ec771..2c261a0d42b0 100644
> --- a/scripts/Makefile.package
> +++ b/scripts/Makefile.package
> @@ -147,8 +147,7 @@ snap-pkg:
> PHONY += pacman-pkg
> pacman-pkg:
>     @ln -srf $(srctree)/scripts/package/PKGBUILD $(objtree)/PKGBUILD
> -   +objtree="$(realpath $(objtree))" \
> -       BUILDDIR="$(realpath $(objtree))/pacman" \
> +   BUILDDIR="$(realpath $(objtree))/pacman" \
>         CARCH="$(UTS_MACHINE)" \
>         KBUILD_MAKEFLAGS="$(MAKEFLAGS)" \
>         KBUILD_REVISION="$(shell $(srctree)/scripts/build-version)" \
> diff --git a/scripts/package/PKGBUILD b/scripts/package/PKGBUILD
> index e2d9c2601ca9..839cd5e634d2 100644
> --- a/scripts/package/PKGBUILD
> +++ b/scripts/package/PKGBUILD
> @@ -40,7 +40,9 @@ _prologue() {
>     # MAKEFLAGS from makepkg.conf override the ones inherited from kbuild.
>     # Bypass this override with a custom variable.
>     export MAKEFLAGS="${KBUILD_MAKEFLAGS}"
> -   cd "${objtree}"
> +
> +   # Kbuild works in the output directory, where this PKGBUILD is located.
> +   cd "$(dirname "${BASH_SOURCE[0]}")"
> }
>
> build() {
> --
> 2.43.0


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

* Re: [PATCH 1/2] kbuild: pacman-pkg: move common commands to a separate function
  2024-08-16 14:18 [PATCH 1/2] kbuild: pacman-pkg: move common commands to a separate function Masahiro Yamada
  2024-08-16 14:18 ` [PATCH 2/2] kbuild: pacman-pkg: do not override objtree Masahiro Yamada
  2024-08-16 18:59 ` [PATCH 1/2] kbuild: pacman-pkg: move common commands to a separate function linux
@ 2024-08-16 21:00 ` Nathan Chancellor
  2024-08-17  9:51 ` Christian Heusel
  3 siblings, 0 replies; 9+ messages in thread
From: Nathan Chancellor @ 2024-08-16 21:00 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: linux-kbuild, linux-kernel, Christian Heusel, Nicolas Schier,
	Thomas Weißschuh

On Fri, Aug 16, 2024 at 11:18:14PM +0900, Masahiro Yamada wrote:
> All build and package functions share the following commands:
> 
>   export MAKEFLAGS="${KBUILD_MAKEFLAGS}"
>   cd "${objtree}"
> 
> Factor out the common code.
> 
> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>

Reviewed-by: Nathan Chancellor <nathan@kernel.org>

> ---
> 
>  scripts/package/PKGBUILD | 17 ++++++++++-------
>  1 file changed, 10 insertions(+), 7 deletions(-)
> 
> diff --git a/scripts/package/PKGBUILD b/scripts/package/PKGBUILD
> index fbd7eb10a52c..e2d9c2601ca9 100644
> --- a/scripts/package/PKGBUILD
> +++ b/scripts/package/PKGBUILD
> @@ -36,11 +36,15 @@ makedepends=(
>  )
>  options=(!debug !strip !buildflags !makeflags)
>  
> -build() {
> +_prologue() {
>  	# MAKEFLAGS from makepkg.conf override the ones inherited from kbuild.
>  	# Bypass this override with a custom variable.
>  	export MAKEFLAGS="${KBUILD_MAKEFLAGS}"
>  	cd "${objtree}"
> +}
> +
> +build() {
> +	_prologue
>  
>  	${MAKE} KERNELRELEASE="${KERNELRELEASE}" KBUILD_BUILD_VERSION="${pkgrel}"
>  }
> @@ -48,10 +52,10 @@ build() {
>  _package() {
>  	pkgdesc="The ${pkgdesc} kernel and modules"
>  
> -	export MAKEFLAGS="${KBUILD_MAKEFLAGS}"
> -	cd "${objtree}"
>  	local modulesdir="${pkgdir}/usr/${MODLIB}"
>  
> +	_prologue
> +
>  	echo "Installing boot image..."
>  	# systemd expects to find the kernel here to allow hibernation
>  	# https://github.com/systemd/systemd/commit/edda44605f06a41fb86b7ab8128dcf99161d2344
> @@ -76,10 +80,10 @@ _package() {
>  _package-headers() {
>  	pkgdesc="Headers and scripts for building modules for the ${pkgdesc} kernel"
>  
> -	export MAKEFLAGS="${KBUILD_MAKEFLAGS}"
> -	cd "${objtree}"
>  	local builddir="${pkgdir}/usr/${MODLIB}/build"
>  
> +	_prologue
> +
>  	if grep -q CONFIG_MODULES=y include/config/auto.conf; then
>  		echo "Installing build files..."
>  		"${srctree}/scripts/package/install-extmod-build" "${builddir}"
> @@ -100,8 +104,7 @@ _package-api-headers() {
>  	provides=(linux-api-headers)
>  	conflicts=(linux-api-headers)
>  
> -	export MAKEFLAGS="${KBUILD_MAKEFLAGS}"
> -	cd "${objtree}"
> +	_prologue
>  
>  	${MAKE} headers_install INSTALL_HDR_PATH="${pkgdir}/usr"
>  }
> -- 
> 2.43.0
> 

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

* Re: [PATCH 2/2] kbuild: pacman-pkg: do not override objtree
  2024-08-16 14:18 ` [PATCH 2/2] kbuild: pacman-pkg: do not override objtree Masahiro Yamada
  2024-08-16 19:01   ` linux
@ 2024-08-16 21:00   ` Nathan Chancellor
  2024-08-17  9:53   ` Christian Heusel
  2024-08-23 13:30   ` Masahiro Yamada
  3 siblings, 0 replies; 9+ messages in thread
From: Nathan Chancellor @ 2024-08-16 21:00 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: linux-kbuild, linux-kernel, Christian Heusel, Nicolas Schier,
	Thomas Weißschuh

On Fri, Aug 16, 2024 at 11:18:15PM +0900, Masahiro Yamada wrote:
> objtree is defined and exported by the top-level Makefile. I prefer
> not to override it.
> 
> There is no need to pass the absolute pass of objtree. PKGBUILD can
> detect it by itself.
> 
> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>

Reviewed-by: Nathan Chancellor <nathan@kernel.org>

> ---
> 
>  scripts/Makefile.package | 3 +--
>  scripts/package/PKGBUILD | 4 +++-
>  2 files changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/scripts/Makefile.package b/scripts/Makefile.package
> index 4a80584ec771..2c261a0d42b0 100644
> --- a/scripts/Makefile.package
> +++ b/scripts/Makefile.package
> @@ -147,8 +147,7 @@ snap-pkg:
>  PHONY += pacman-pkg
>  pacman-pkg:
>  	@ln -srf $(srctree)/scripts/package/PKGBUILD $(objtree)/PKGBUILD
> -	+objtree="$(realpath $(objtree))" \
> -		BUILDDIR="$(realpath $(objtree))/pacman" \
> +	BUILDDIR="$(realpath $(objtree))/pacman" \
>  		CARCH="$(UTS_MACHINE)" \
>  		KBUILD_MAKEFLAGS="$(MAKEFLAGS)" \
>  		KBUILD_REVISION="$(shell $(srctree)/scripts/build-version)" \
> diff --git a/scripts/package/PKGBUILD b/scripts/package/PKGBUILD
> index e2d9c2601ca9..839cd5e634d2 100644
> --- a/scripts/package/PKGBUILD
> +++ b/scripts/package/PKGBUILD
> @@ -40,7 +40,9 @@ _prologue() {
>  	# MAKEFLAGS from makepkg.conf override the ones inherited from kbuild.
>  	# Bypass this override with a custom variable.
>  	export MAKEFLAGS="${KBUILD_MAKEFLAGS}"
> -	cd "${objtree}"
> +
> +	# Kbuild works in the output directory, where this PKGBUILD is located.
> +	cd "$(dirname "${BASH_SOURCE[0]}")"
>  }
>  
>  build() {
> -- 
> 2.43.0
> 

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

* Re: [PATCH 1/2] kbuild: pacman-pkg: move common commands to a separate function
  2024-08-16 14:18 [PATCH 1/2] kbuild: pacman-pkg: move common commands to a separate function Masahiro Yamada
                   ` (2 preceding siblings ...)
  2024-08-16 21:00 ` Nathan Chancellor
@ 2024-08-17  9:51 ` Christian Heusel
  3 siblings, 0 replies; 9+ messages in thread
From: Christian Heusel @ 2024-08-17  9:51 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: linux-kbuild, linux-kernel, Nathan Chancellor, Nicolas Schier,
	Thomas Weißschuh

[-- Attachment #1: Type: text/plain, Size: 337 bytes --]

On 24/08/16 11:18PM, Masahiro Yamada wrote:
> All build and package functions share the following commands:
> 
>   export MAKEFLAGS="${KBUILD_MAKEFLAGS}"
>   cd "${objtree}"
> 
> Factor out the common code.
> 
> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
> ---

Reviewed-by: Christian Heusel <christian@heusel.eu>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [PATCH 2/2] kbuild: pacman-pkg: do not override objtree
  2024-08-16 14:18 ` [PATCH 2/2] kbuild: pacman-pkg: do not override objtree Masahiro Yamada
  2024-08-16 19:01   ` linux
  2024-08-16 21:00   ` Nathan Chancellor
@ 2024-08-17  9:53   ` Christian Heusel
  2024-08-23 13:30   ` Masahiro Yamada
  3 siblings, 0 replies; 9+ messages in thread
From: Christian Heusel @ 2024-08-17  9:53 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: linux-kbuild, linux-kernel, Nathan Chancellor, Nicolas Schier,
	Thomas Weißschuh

[-- Attachment #1: Type: text/plain, Size: 419 bytes --]

On 24/08/16 11:18PM, Masahiro Yamada wrote:
> objtree is defined and exported by the top-level Makefile. I prefer
> not to override it.
> 
> There is no need to pass the absolute pass of objtree. PKGBUILD can
> detect it by itself.

Thomas already spotted the typo in the sentence above :)

> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
> ---

Reviewed-by: Christian Heusel <christian@heusel.eu>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [PATCH 2/2] kbuild: pacman-pkg: do not override objtree
  2024-08-16 14:18 ` [PATCH 2/2] kbuild: pacman-pkg: do not override objtree Masahiro Yamada
                     ` (2 preceding siblings ...)
  2024-08-17  9:53   ` Christian Heusel
@ 2024-08-23 13:30   ` Masahiro Yamada
  3 siblings, 0 replies; 9+ messages in thread
From: Masahiro Yamada @ 2024-08-23 13:30 UTC (permalink / raw)
  To: linux-kbuild
  Cc: linux-kernel, Christian Heusel, Nathan Chancellor, Nicolas Schier,
	Thomas Weißschuh

On Fri, Aug 16, 2024 at 11:18 PM Masahiro Yamada <masahiroy@kernel.org> wrote:
>
> objtree is defined and exported by the top-level Makefile. I prefer
> not to override it.
>
> There is no need to pass the absolute pass of objtree. PKGBUILD can
> detect it by itself.
>
> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
> ---
>
>  scripts/Makefile.package | 3 +--
>  scripts/package/PKGBUILD | 4 +++-
>  2 files changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/scripts/Makefile.package b/scripts/Makefile.package
> index 4a80584ec771..2c261a0d42b0 100644
> --- a/scripts/Makefile.package
> +++ b/scripts/Makefile.package
> @@ -147,8 +147,7 @@ snap-pkg:
>  PHONY += pacman-pkg
>  pacman-pkg:
>         @ln -srf $(srctree)/scripts/package/PKGBUILD $(objtree)/PKGBUILD
> -       +objtree="$(realpath $(objtree))" \
> -               BUILDDIR="$(realpath $(objtree))/pacman" \
> +       BUILDDIR="$(realpath $(objtree))/pacman" \


I restored the '+' prefix
when I applied this.






>                 CARCH="$(UTS_MACHINE)" \
>                 KBUILD_MAKEFLAGS="$(MAKEFLAGS)" \
>                 KBUILD_REVISION="$(shell $(srctree)/scripts/build-version)" \
> diff --git a/scripts/package/PKGBUILD b/scripts/package/PKGBUILD
> index e2d9c2601ca9..839cd5e634d2 100644
> --- a/scripts/package/PKGBUILD
> +++ b/scripts/package/PKGBUILD
> @@ -40,7 +40,9 @@ _prologue() {
>         # MAKEFLAGS from makepkg.conf override the ones inherited from kbuild.
>         # Bypass this override with a custom variable.
>         export MAKEFLAGS="${KBUILD_MAKEFLAGS}"
> -       cd "${objtree}"
> +
> +       # Kbuild works in the output directory, where this PKGBUILD is located.
> +       cd "$(dirname "${BASH_SOURCE[0]}")"
>  }
>
>  build() {
> --
> 2.43.0
>


-- 
Best Regards
Masahiro Yamada

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

end of thread, other threads:[~2024-08-23 13:31 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-16 14:18 [PATCH 1/2] kbuild: pacman-pkg: move common commands to a separate function Masahiro Yamada
2024-08-16 14:18 ` [PATCH 2/2] kbuild: pacman-pkg: do not override objtree Masahiro Yamada
2024-08-16 19:01   ` linux
2024-08-16 21:00   ` Nathan Chancellor
2024-08-17  9:53   ` Christian Heusel
2024-08-23 13:30   ` Masahiro Yamada
2024-08-16 18:59 ` [PATCH 1/2] kbuild: pacman-pkg: move common commands to a separate function linux
2024-08-16 21:00 ` Nathan Chancellor
2024-08-17  9:51 ` Christian Heusel

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