diff mbox series

kbuild: pacman-pkg: hardcode module installation path

Message ID 20250315151522.2766939-1-masahiroy@kernel.org (mailing list archive)
State New
Headers show
Series kbuild: pacman-pkg: hardcode module installation path | expand

Commit Message

Masahiro Yamada March 15, 2025, 3:15 p.m. UTC
'make pacman-pkg' for architectures with device tree support (i.e., arm,
arm64, etc.) shows logs like follows:

  Installing dtbs...
    INSTALL /home/masahiro/linux/pacman/linux-upstream/pkg/linux-upstream/usr//lib/modules/6.14.0-rc6+/dtb/actions/s700-cubieboard7.dtb
    INSTALL /home/masahiro/linux/pacman/linux-upstream/pkg/linux-upstream/usr//lib/modules/6.14.0-rc6+/dtb/actions/s900-bubblegum-96.dtb
    INSTALL /home/masahiro/linux/pacman/linux-upstream/pkg/linux-upstream/usr//lib/modules/6.14.0-rc6+/dtb/airoha/en7581-evb.dtb
      ...

The double slashes ('//') between 'usr' and 'lib' are somewhat ugly.

Let's hardcode the module installation path because the package contents
should remain unaffected even if ${MODLIB} is overridden. Please note that
scripts/packages/{builddeb,kernel.spec} also hardcode the module
installation path.

With this change, the log will look better, as follows:

  Installing dtbs...
    INSTALL /home/masahiro/linux/pacman/linux-upstream/pkg/linux-upstream/usr/lib/modules/6.14.0-rc6+/dtb/actions/s700-cubieboard7.dtb
    INSTALL /home/masahiro/linux/pacman/linux-upstream/pkg/linux-upstream/usr/lib/modules/6.14.0-rc6+/dtb/actions/s900-bubblegum-96.dtb
    INSTALL /home/masahiro/linux/pacman/linux-upstream/pkg/linux-upstream/usr/lib/modules/6.14.0-rc6+/dtb/airoha/en7581-evb.dtb
      ...

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

 scripts/package/PKGBUILD | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Thomas Weißschuh March 15, 2025, 3:20 p.m. UTC | #1
On 2025-03-16 00:15:20+0900, Masahiro Yamada wrote:
> 'make pacman-pkg' for architectures with device tree support (i.e., arm,
> arm64, etc.) shows logs like follows:
> 
>   Installing dtbs...
>     INSTALL /home/masahiro/linux/pacman/linux-upstream/pkg/linux-upstream/usr//lib/modules/6.14.0-rc6+/dtb/actions/s700-cubieboard7.dtb
>     INSTALL /home/masahiro/linux/pacman/linux-upstream/pkg/linux-upstream/usr//lib/modules/6.14.0-rc6+/dtb/actions/s900-bubblegum-96.dtb
>     INSTALL /home/masahiro/linux/pacman/linux-upstream/pkg/linux-upstream/usr//lib/modules/6.14.0-rc6+/dtb/airoha/en7581-evb.dtb
>       ...
> 
> The double slashes ('//') between 'usr' and 'lib' are somewhat ugly.
> 
> Let's hardcode the module installation path because the package contents
> should remain unaffected even if ${MODLIB} is overridden. Please note that
> scripts/packages/{builddeb,kernel.spec} also hardcode the module
> installation path.
> 
> With this change, the log will look better, as follows:
> 
>   Installing dtbs...
>     INSTALL /home/masahiro/linux/pacman/linux-upstream/pkg/linux-upstream/usr/lib/modules/6.14.0-rc6+/dtb/actions/s700-cubieboard7.dtb
>     INSTALL /home/masahiro/linux/pacman/linux-upstream/pkg/linux-upstream/usr/lib/modules/6.14.0-rc6+/dtb/actions/s900-bubblegum-96.dtb
>     INSTALL /home/masahiro/linux/pacman/linux-upstream/pkg/linux-upstream/usr/lib/modules/6.14.0-rc6+/dtb/airoha/en7581-evb.dtb
>       ...
> 
> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>

Thanks!

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

> ---
> 
>  scripts/package/PKGBUILD | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/scripts/package/PKGBUILD b/scripts/package/PKGBUILD
> index 0cf3a55b05e1..452374d63c24 100644
> --- a/scripts/package/PKGBUILD
> +++ b/scripts/package/PKGBUILD
> @@ -53,7 +53,7 @@ build() {
>  _package() {
>  	pkgdesc="The ${pkgdesc} kernel and modules"
>  
> -	local modulesdir="${pkgdir}/usr/${MODLIB}"
> +	local modulesdir="${pkgdir}/usr/lib/modules/${KERNELRELEASE}"
>  
>  	_prologue
>  
> @@ -81,7 +81,7 @@ _package() {
>  _package-headers() {
>  	pkgdesc="Headers and scripts for building modules for the ${pkgdesc} kernel"
>  
> -	local builddir="${pkgdir}/usr/${MODLIB}/build"
> +	local builddir="${pkgdir}/usr/lib/modules/${KERNELRELEASE}/build"
>  
>  	_prologue
>  
> @@ -114,7 +114,7 @@ _package-debug(){
>  	pkgdesc="Non-stripped vmlinux file for the ${pkgdesc} kernel"
>  
>  	local debugdir="${pkgdir}/usr/src/debug/${pkgbase}"
> -	local builddir="${pkgdir}/usr/${MODLIB}/build"
> +	local builddir="${pkgdir}/usr/lib/modules/${KERNELRELEASE}/build"
>  
>  	_prologue
>  
> -- 
> 2.43.0
>
Nathan Chancellor March 17, 2025, 5:07 p.m. UTC | #2
On Sun, Mar 16, 2025 at 12:15:20AM +0900, Masahiro Yamada wrote:
> 'make pacman-pkg' for architectures with device tree support (i.e., arm,
> arm64, etc.) shows logs like follows:
> 
>   Installing dtbs...
>     INSTALL /home/masahiro/linux/pacman/linux-upstream/pkg/linux-upstream/usr//lib/modules/6.14.0-rc6+/dtb/actions/s700-cubieboard7.dtb
>     INSTALL /home/masahiro/linux/pacman/linux-upstream/pkg/linux-upstream/usr//lib/modules/6.14.0-rc6+/dtb/actions/s900-bubblegum-96.dtb
>     INSTALL /home/masahiro/linux/pacman/linux-upstream/pkg/linux-upstream/usr//lib/modules/6.14.0-rc6+/dtb/airoha/en7581-evb.dtb
>       ...
> 
> The double slashes ('//') between 'usr' and 'lib' are somewhat ugly.
> 
> Let's hardcode the module installation path because the package contents
> should remain unaffected even if ${MODLIB} is overridden. Please note that
> scripts/packages/{builddeb,kernel.spec} also hardcode the module
> installation path.
> 
> With this change, the log will look better, as follows:
> 
>   Installing dtbs...
>     INSTALL /home/masahiro/linux/pacman/linux-upstream/pkg/linux-upstream/usr/lib/modules/6.14.0-rc6+/dtb/actions/s700-cubieboard7.dtb
>     INSTALL /home/masahiro/linux/pacman/linux-upstream/pkg/linux-upstream/usr/lib/modules/6.14.0-rc6+/dtb/actions/s900-bubblegum-96.dtb
>     INSTALL /home/masahiro/linux/pacman/linux-upstream/pkg/linux-upstream/usr/lib/modules/6.14.0-rc6+/dtb/airoha/en7581-evb.dtb
>       ...
> 
> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>

Seems reasonable to me.

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

> ---
> 
>  scripts/package/PKGBUILD | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/scripts/package/PKGBUILD b/scripts/package/PKGBUILD
> index 0cf3a55b05e1..452374d63c24 100644
> --- a/scripts/package/PKGBUILD
> +++ b/scripts/package/PKGBUILD
> @@ -53,7 +53,7 @@ build() {
>  _package() {
>  	pkgdesc="The ${pkgdesc} kernel and modules"
>  
> -	local modulesdir="${pkgdir}/usr/${MODLIB}"
> +	local modulesdir="${pkgdir}/usr/lib/modules/${KERNELRELEASE}"
>  
>  	_prologue
>  
> @@ -81,7 +81,7 @@ _package() {
>  _package-headers() {
>  	pkgdesc="Headers and scripts for building modules for the ${pkgdesc} kernel"
>  
> -	local builddir="${pkgdir}/usr/${MODLIB}/build"
> +	local builddir="${pkgdir}/usr/lib/modules/${KERNELRELEASE}/build"
>  
>  	_prologue
>  
> @@ -114,7 +114,7 @@ _package-debug(){
>  	pkgdesc="Non-stripped vmlinux file for the ${pkgdesc} kernel"
>  
>  	local debugdir="${pkgdir}/usr/src/debug/${pkgbase}"
> -	local builddir="${pkgdir}/usr/${MODLIB}/build"
> +	local builddir="${pkgdir}/usr/lib/modules/${KERNELRELEASE}/build"
>  
>  	_prologue
>  
> -- 
> 2.43.0
>
diff mbox series

Patch

diff --git a/scripts/package/PKGBUILD b/scripts/package/PKGBUILD
index 0cf3a55b05e1..452374d63c24 100644
--- a/scripts/package/PKGBUILD
+++ b/scripts/package/PKGBUILD
@@ -53,7 +53,7 @@  build() {
 _package() {
 	pkgdesc="The ${pkgdesc} kernel and modules"
 
-	local modulesdir="${pkgdir}/usr/${MODLIB}"
+	local modulesdir="${pkgdir}/usr/lib/modules/${KERNELRELEASE}"
 
 	_prologue
 
@@ -81,7 +81,7 @@  _package() {
 _package-headers() {
 	pkgdesc="Headers and scripts for building modules for the ${pkgdesc} kernel"
 
-	local builddir="${pkgdir}/usr/${MODLIB}/build"
+	local builddir="${pkgdir}/usr/lib/modules/${KERNELRELEASE}/build"
 
 	_prologue
 
@@ -114,7 +114,7 @@  _package-debug(){
 	pkgdesc="Non-stripped vmlinux file for the ${pkgdesc} kernel"
 
 	local debugdir="${pkgdir}/usr/src/debug/${pkgbase}"
-	local builddir="${pkgdir}/usr/${MODLIB}/build"
+	local builddir="${pkgdir}/usr/lib/modules/${KERNELRELEASE}/build"
 
 	_prologue