From bccfd47f32f94ad87afc407b41150bce6f896011 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Draszik?= Date: Mon, 30 Jan 2023 17:36:31 +0000 Subject: [PATCH] ANDROID: kbuild: re-add .ko to external modules' modules.order MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since commit f65a486821cf ("kbuild: change module.order to list *.o instead of *.ko") modules.order files contain .o (instead of .ko) and there is code in place to replace them with .ko during installation. In Android we have some extra code which also installs modules.order for external kernel modules as of commit cf74cca8a117 ("kbuild: install the modules.order for external modules") (from https://r.android.com/1962081). We need to update this additional code as otherwise modules.order for the external modules remains incorrect (still stating .o) and various things break, e.g. modules.load, device booting, etc. Bug: 210713925 Bug: 266959026 Test: TH Fixes: 3b153f0a4c23 ("Merge 6feb57c2fd7c ("Merge tag 'kbuild-v6.2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild") into android-mainline") Change-Id: Ib3a1b5b5c4184fdb04cfac1ae6b2a4f38ebe99cf Signed-off-by: André Draszik --- scripts/Makefile.modinst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/Makefile.modinst b/scripts/Makefile.modinst index 16cd970ef913..5bd66bda35db 100644 --- a/scripts/Makefile.modinst +++ b/scripts/Makefile.modinst @@ -89,7 +89,9 @@ $(dst)/%.ko: $(extmod_prefix)%.ko FORCE ifneq ($(KBUILD_EXTMOD),) $(dst)/modules.order.$(extmod_suffix): $(MODORDER) FORCE $(call cmd,install) - @sed -i "s:^$(KBUILD_EXTMOD):$(INSTALL_MOD_DIR):g" $@ + @sed -e "s:^$(KBUILD_EXTMOD):$(INSTALL_MOD_DIR):g" \ + -e 's:^\(.*\)\.o$$:\1.ko:' \ + -i $@ endif else