linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] Revert "Makefile: install modules.builtin even if CONFIG_MODULES=n"
@ 2020-06-19 15:09 Masahiro Yamada
  2020-06-19 15:40 ` Guenter Roeck
  0 siblings, 1 reply; 3+ messages in thread
From: Masahiro Yamada @ 2020-06-19 15:09 UTC (permalink / raw)
  To: linux-kbuild
  Cc: Christoph Hellwig, Masahiro Yamada, Douglas Anderson,
	Guenter Roeck, Jonas Karlman, Michal Marek, linux-kernel

This reverts commit e0b250b57dcf403529081e5898a9de717f96b76b,
which broke build systems that need to install files to a certain
path, but do not set INSTALL_MOD_PATH when invoking 'make install'.

  $ make INSTALL_PATH=/tmp/destdir install
  mkdir: cannot create directory ‘/lib/modules/5.8.0-rc1+/’: Permission denied
  Makefile:1342: recipe for target '_builtin_inst_' failed
  make: *** [_builtin_inst_] Error 1

While modules.builtin is useful also for CONFIG_MODULES=n, this change
in the behavior is quite unexpected. Maybe "make modules_install"
can install modules.builtin irrespective of CONFIG_MODULES as Jonas
originally suggested.

Anyway, that commit should be reverted ASAP.

Reported-by: Douglas Anderson <dianders@chromium.org>
Reported-by: Guenter Roeck <linux@roeck-us.net>
Cc: Jonas Karlman <jonas@kwiboo.se>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

Changes in v2:
  - add more commit description

 Makefile | 14 +++-----------
 1 file changed, 3 insertions(+), 11 deletions(-)

diff --git a/Makefile b/Makefile
index 29abe44ada91..9880e911afe3 100644
--- a/Makefile
+++ b/Makefile
@@ -1336,16 +1336,6 @@ dt_binding_check: scripts_dtc
 # ---------------------------------------------------------------------------
 # Modules
 
-# install modules.builtin regardless of CONFIG_MODULES
-PHONY += _builtin_inst_
-_builtin_inst_:
-	@mkdir -p $(MODLIB)/
-	@cp -f modules.builtin $(MODLIB)/
-	@cp -f $(objtree)/modules.builtin.modinfo $(MODLIB)/
-
-PHONY += install
-install: _builtin_inst_
-
 ifdef CONFIG_MODULES
 
 # By default, build modules as well
@@ -1389,7 +1379,7 @@ PHONY += modules_install
 modules_install: _modinst_ _modinst_post
 
 PHONY += _modinst_
-_modinst_: _builtin_inst_
+_modinst_:
 	@rm -rf $(MODLIB)/kernel
 	@rm -f $(MODLIB)/source
 	@mkdir -p $(MODLIB)/kernel
@@ -1399,6 +1389,8 @@ _modinst_: _builtin_inst_
 		ln -s $(CURDIR) $(MODLIB)/build ; \
 	fi
 	@sed 's:^:kernel/:' modules.order > $(MODLIB)/modules.order
+	@cp -f modules.builtin $(MODLIB)/
+	@cp -f $(objtree)/modules.builtin.modinfo $(MODLIB)/
 	$(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modinst
 
 # This depmod is only for convenience to give the initial
-- 
2.25.1


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

* Re: [PATCH v2] Revert "Makefile: install modules.builtin even if CONFIG_MODULES=n"
  2020-06-19 15:09 [PATCH v2] Revert "Makefile: install modules.builtin even if CONFIG_MODULES=n" Masahiro Yamada
@ 2020-06-19 15:40 ` Guenter Roeck
  0 siblings, 0 replies; 3+ messages in thread
From: Guenter Roeck @ 2020-06-19 15:40 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: linux-kbuild, Christoph Hellwig, Douglas Anderson, Jonas Karlman,
	Michal Marek, linux-kernel

On Sat, Jun 20, 2020 at 12:09:55AM +0900, Masahiro Yamada wrote:
> This reverts commit e0b250b57dcf403529081e5898a9de717f96b76b,
> which broke build systems that need to install files to a certain
> path, but do not set INSTALL_MOD_PATH when invoking 'make install'.
> 
>   $ make INSTALL_PATH=/tmp/destdir install
>   mkdir: cannot create directory ‘/lib/modules/5.8.0-rc1+/’: Permission denied
>   Makefile:1342: recipe for target '_builtin_inst_' failed
>   make: *** [_builtin_inst_] Error 1
> 
> While modules.builtin is useful also for CONFIG_MODULES=n, this change
> in the behavior is quite unexpected. Maybe "make modules_install"
> can install modules.builtin irrespective of CONFIG_MODULES as Jonas
> originally suggested.
> 
> Anyway, that commit should be reverted ASAP.
> 
> Reported-by: Douglas Anderson <dianders@chromium.org>
> Reported-by: Guenter Roeck <linux@roeck-us.net>
> Cc: Jonas Karlman <jonas@kwiboo.se>
> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>

Reviewed-by: Guenter Roeck <linux@roeck-us.net>

> ---
> 
> Changes in v2:
>   - add more commit description
> 
>  Makefile | 14 +++-----------
>  1 file changed, 3 insertions(+), 11 deletions(-)
> 
> diff --git a/Makefile b/Makefile
> index 29abe44ada91..9880e911afe3 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -1336,16 +1336,6 @@ dt_binding_check: scripts_dtc
>  # ---------------------------------------------------------------------------
>  # Modules
>  
> -# install modules.builtin regardless of CONFIG_MODULES
> -PHONY += _builtin_inst_
> -_builtin_inst_:
> -	@mkdir -p $(MODLIB)/
> -	@cp -f modules.builtin $(MODLIB)/
> -	@cp -f $(objtree)/modules.builtin.modinfo $(MODLIB)/
> -
> -PHONY += install
> -install: _builtin_inst_
> -
>  ifdef CONFIG_MODULES
>  
>  # By default, build modules as well
> @@ -1389,7 +1379,7 @@ PHONY += modules_install
>  modules_install: _modinst_ _modinst_post
>  
>  PHONY += _modinst_
> -_modinst_: _builtin_inst_
> +_modinst_:
>  	@rm -rf $(MODLIB)/kernel
>  	@rm -f $(MODLIB)/source
>  	@mkdir -p $(MODLIB)/kernel
> @@ -1399,6 +1389,8 @@ _modinst_: _builtin_inst_
>  		ln -s $(CURDIR) $(MODLIB)/build ; \
>  	fi
>  	@sed 's:^:kernel/:' modules.order > $(MODLIB)/modules.order
> +	@cp -f modules.builtin $(MODLIB)/
> +	@cp -f $(objtree)/modules.builtin.modinfo $(MODLIB)/
>  	$(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modinst
>  
>  # This depmod is only for convenience to give the initial
> -- 
> 2.25.1
> 

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

* Re: [PATCH v2] Revert "Makefile: install modules.builtin even if CONFIG_MODULES=n"
@ 2020-06-19 15:41 Guenter Roeck
  0 siblings, 0 replies; 3+ messages in thread
From: Guenter Roeck @ 2020-06-19 15:41 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: linux-kbuild, Christoph Hellwig, Douglas Anderson, Jonas Karlman,
	Michal Marek, linux-kernel

On Sat, Jun 20, 2020 at 12:09:55AM +0900, Masahiro Yamada wrote:
> This reverts commit e0b250b57dcf403529081e5898a9de717f96b76b,
> which broke build systems that need to install files to a certain
> path, but do not set INSTALL_MOD_PATH when invoking 'make install'.
> 
>   $ make INSTALL_PATH=/tmp/destdir install
>   mkdir: cannot create directory ‘/lib/modules/5.8.0-rc1+/’: Permission denied
>   Makefile:1342: recipe for target '_builtin_inst_' failed
>   make: *** [_builtin_inst_] Error 1
> 
> While modules.builtin is useful also for CONFIG_MODULES=n, this change
> in the behavior is quite unexpected. Maybe "make modules_install"
> can install modules.builtin irrespective of CONFIG_MODULES as Jonas
> originally suggested.
> 
> Anyway, that commit should be reverted ASAP.
> 
> Reported-by: Douglas Anderson <dianders@chromium.org>
> Reported-by: Guenter Roeck <linux@roeck-us.net>
> Cc: Jonas Karlman <jonas@kwiboo.se>
> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>

Tested-by: Guenter Roeck <linux@roeck-us.net>

> ---
> 
> Changes in v2:
>   - add more commit description
> 
>  Makefile | 14 +++-----------
>  1 file changed, 3 insertions(+), 11 deletions(-)
> 
> diff --git a/Makefile b/Makefile
> index 29abe44ada91..9880e911afe3 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -1336,16 +1336,6 @@ dt_binding_check: scripts_dtc
>  # ---------------------------------------------------------------------------
>  # Modules
>  
> -# install modules.builtin regardless of CONFIG_MODULES
> -PHONY += _builtin_inst_
> -_builtin_inst_:
> -	@mkdir -p $(MODLIB)/
> -	@cp -f modules.builtin $(MODLIB)/
> -	@cp -f $(objtree)/modules.builtin.modinfo $(MODLIB)/
> -
> -PHONY += install
> -install: _builtin_inst_
> -
>  ifdef CONFIG_MODULES
>  
>  # By default, build modules as well
> @@ -1389,7 +1379,7 @@ PHONY += modules_install
>  modules_install: _modinst_ _modinst_post
>  
>  PHONY += _modinst_
> -_modinst_: _builtin_inst_
> +_modinst_:
>  	@rm -rf $(MODLIB)/kernel
>  	@rm -f $(MODLIB)/source
>  	@mkdir -p $(MODLIB)/kernel
> @@ -1399,6 +1389,8 @@ _modinst_: _builtin_inst_
>  		ln -s $(CURDIR) $(MODLIB)/build ; \
>  	fi
>  	@sed 's:^:kernel/:' modules.order > $(MODLIB)/modules.order
> +	@cp -f modules.builtin $(MODLIB)/
> +	@cp -f $(objtree)/modules.builtin.modinfo $(MODLIB)/
>  	$(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modinst
>  
>  # This depmod is only for convenience to give the initial
> -- 
> 2.25.1
> 

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

end of thread, other threads:[~2020-06-19 16:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-19 15:09 [PATCH v2] Revert "Makefile: install modules.builtin even if CONFIG_MODULES=n" Masahiro Yamada
2020-06-19 15:40 ` Guenter Roeck
2020-06-19 15:41 Guenter Roeck

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).