Skip to contentSkip to conversation

Revert "Makefile: install modules.builtin even if CONFIG_MODULES=n"

PATCH Superseded Masahiro Yamada 3 participants 3 messages Jun 19, 2020 Kbuild

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Revert "Makefile: install modules.builtin even if CONFIG_MODULES=n"

This reverts commit e0b250b57dcf403529081e5898a9de717f96b76b.

Now that "make install" copies modules.builtin to $(INSTALL_MOD_PATH), it breaks systems that do not set INSTALL_MOD_PATH for "make install".

While modules.builtin is useful for CONFIG_MODULES=n, this way gives unexpected impact to existing systems. Maybe "make modules_install" can install modules.builtin irrespective of CONFIG_MODULES as Jonas originally suggested. Anyway, this commit should be reverted ASAP.

---

 Makefile | 14 +++-----------
 1 file changed, 3 insertions(+), 11 deletions(-)
Makefile +3 -11
index 29abe44ada91..9880e911afe3 100644
@@ -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
Signature · 1 line
2.25.1
#1 lore raw
Quoted 9 lines · Masahiro Yamada

This reverts commit e0b250b57dcf403529081e5898a9de717f96b76b.

Now that "make install" copies modules.builtin to $(INSTALL_MOD_PATH), it breaks systems that do not set INSTALL_MOD_PATH for "make install".

While modules.builtin is useful for CONFIG_MODULES=n, this way gives unexpected impact to existing systems. Maybe "make modules_install" can install modules.builtin irrespective of CONFIG_MODULES as Jonas originally suggested. Anyway, this commit should be reverted ASAP.

What is the "unexpected impact? This commit log needs to explain that.

#2 lore raw
Quoted 6 lines · Christoph Hellwig
Quoted 5 lines · Masahiro Yamada

This reverts commit e0b250b57dcf403529081e5898a9de717f96b76b.

Now that "make install" copies modules.builtin to $(INSTALL_MOD_PATH), it breaks systems that do not set INSTALL_MOD_PATH for "make install".

Quoted 8 lines
Quoted 4 lines

While modules.builtin is useful for CONFIG_MODULES=n, this way gives unexpected impact to existing systems. Maybe "make modules_install" can install modules.builtin irrespective of CONFIG_MODULES as Jonas originally suggested. Anyway, this commit should be reverted ASAP.

What is the "unexpected impact? This commit log needs to explain that.

$ 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

Guenter