From 950d723b9d1f2012a875fd380a38bdcdd02dcc48 Mon Sep 17 00:00:00 2001 From: Steve Muckle Date: Fri, 5 Jun 2020 11:31:22 -0700 Subject: [PATCH] fix spurious / on toplevel kernel module installations When kernel modules are being put directly into lib/modules/ (as opposed to lib/modules//), the empty part of the destination path causes a target containing a redundant /. If the target is also added elsewhere in the build without the redundant /, then rule merging will miss it, and a build error will occur. Bug: 158158635 Change-Id: I797addce760f4886166efa283302a53783581625 --- core/Makefile | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/core/Makefile b/core/Makefile index dcabf61261..52239af862 100644 --- a/core/Makefile +++ b/core/Makefile @@ -220,17 +220,20 @@ endef # $(9): module directory name # Returns the a list of src:dest pairs to install the modules using copy-many-files. define build-image-kernel-modules + $(if $(9), \ + $(eval _dir := $(9)/), \ + $(eval _dir :=)) \ $(foreach module,$(1), \ $(eval _src := $(module)) \ $(if $(8), \ $(eval _src := $(8)/$(notdir $(module))) \ $(eval $(call copy-and-strip-kernel-module,$(module),$(_src)))) \ - $(_src):$(2)/lib/modules/$(9)/$(notdir $(module))) \ + $(_src):$(2)/lib/modules/$(_dir)$(notdir $(module))) \ $(eval $(call build-image-kernel-modules-depmod,$(1),$(3),$(4),$(5),$(6),$(7),$(2),$(9))) \ - $(4)/$(DEPMOD_STAGING_SUBDIR)/modules.dep:$(2)/lib/modules/$(9)/modules.dep \ - $(4)/$(DEPMOD_STAGING_SUBDIR)/modules.alias:$(2)/lib/modules/$(9)/modules.alias \ - $(4)/$(DEPMOD_STAGING_SUBDIR)/modules.softdep:$(2)/lib/modules/$(9)/modules.softdep \ - $(4)/$(DEPMOD_STAGING_SUBDIR)/$(6):$(2)/lib/modules/$(9)/$(6) + $(4)/$(DEPMOD_STAGING_SUBDIR)/modules.dep:$(2)/lib/modules/$(_dir)modules.dep \ + $(4)/$(DEPMOD_STAGING_SUBDIR)/modules.alias:$(2)/lib/modules/$(_dir)modules.alias \ + $(4)/$(DEPMOD_STAGING_SUBDIR)/modules.softdep:$(2)/lib/modules/$(_dir)modules.softdep \ + $(4)/$(DEPMOD_STAGING_SUBDIR)/$(6):$(2)/lib/modules/$(_dir)$(6) endef # $(1): modules list