From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f67.google.com (mail-wm0-f67.google.com [74.125.82.67]) by mail.openembedded.org (Postfix) with ESMTP id 786406079E for ; Mon, 21 Nov 2016 09:37:13 +0000 (UTC) Received: by mail-wm0-f67.google.com with SMTP id u144so120134wmu.0 for ; Mon, 21 Nov 2016 01:37:15 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=fpskWq0ZsF0ZNLYUgyCA//Q2waJesYsjuCQS2W7BJSw=; b=lzVgsN//sBvuJjV1ajmK4ZnjadaRkfJQ+87jL/x2Z6M+37Oybi6Ts2uQ3lkp3S0CNs ZerD8Yc54WrXDx68uuZXMl+aEBin9HIDg3Ra6FBtH9VjXgLArpSE1nhc2csOVNPCQdQt DBgs2tbtU6BYOK7OoWQz88vHPYYM+IK37xXjdFS33/8FAFJqxQh/mkIibINsBTThZzq1 oqExavbGBSSJUkgMdBoLiJI7Y0tNTKVzNmmm6CRPILc79GS3e1RfHljjQ13gNEp72YrL 6HiCfL6B71UwpmiIdfQC8k1j0860HGhT1XEFtxUHDY8boeFgmzbZKIdcPEmqiX8m5euz M52g== X-Gm-Message-State: AKaTC01gPKfx2/5M7grxn8wCbYBhPqpqcAwQldu4RoBrVHgl8L5Ae+UqnmYH0a+jI7A3Xw== X-Received: by 10.28.43.198 with SMTP id r189mr12670280wmr.67.1479721035144; Mon, 21 Nov 2016 01:37:15 -0800 (PST) Received: from tfsielt31850.tycofs.com ([77.107.218.170]) by smtp.gmail.com with ESMTPSA id ia7sm23840229wjb.23.2016.11.21.01.37.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 21 Nov 2016 01:37:14 -0800 (PST) From: =?UTF-8?q?Andr=C3=A9=20Draszik?= To: openembedded-core@lists.openembedded.org Date: Mon, 21 Nov 2016 09:37:13 +0000 Message-Id: <20161121093713.7220-1-git@andred.net> X-Mailer: git-send-email 2.10.2 MIME-Version: 1.0 Subject: [PATCH] module.bbclass: allow to override location of Module.symvers X-BeenThere: openembedded-core@lists.openembedded.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Patches and discussions about the oe-core layer List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Nov 2016 09:37:16 -0000 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: André Draszik Requiring all build systems for external kernel modules to place Module.symvers directly into ${B}/. is quite an artificial assumption/requirement. It doesn't have to end up there, but could easily end up somewhere below ${B}. Allow to override the location below ${B} Note that we still don't make use of multiple Module.symvers in case there are any generated by one single kernel module build, but this is no change in behaviour from before and could be added if there really is a demand for that. Reported-by: Denys Dmytriyenko Signed-off-by: André Draszik --- meta/classes/module.bbclass | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/meta/classes/module.bbclass b/meta/classes/module.bbclass index 68e3d34..037ca4f 100644 --- a/meta/classes/module.bbclass +++ b/meta/classes/module.bbclass @@ -7,6 +7,7 @@ do_make_scripts[depends] += "virtual/kernel:do_shared_workdir" EXTRA_OEMAKE += "KERNEL_SRC=${STAGING_KERNEL_DIR}" MODULES_INSTALL_TARGET ?= "modules_install" +MODULES_MODULE_SYMVERS_LOCATION ?= "" python __anonymous () { depends = d.getVar('DEPENDS', True) @@ -35,10 +36,17 @@ module_do_install() { O=${STAGING_KERNEL_BUILDDIR} \ ${MODULES_INSTALL_TARGET} - install -d -m0755 ${D}${includedir}/${BPN} - cp -a --no-preserve=ownership ${B}/Module.symvers ${D}${includedir}/${BPN} - # it doesn't actually seem to matter which path is specified here - sed -e 's:${B}/::g' -i ${D}${includedir}/${BPN}/Module.symvers + if [ ! -e "${B}/${MODULES_MODULE_SYMVERS_LOCATION}/Module.symvers" ] ; then + bbwarn "Module.symvers not found in ${B}/${MODULES_MODULE_SYMVERS_LOCATION}" + bbwarn "Please consider setting MODULES_MODULE_SYMVERS_LOCATION to a" + bbwarn "directory below B to get correct inter-module dependencies" + else + install -Dm0644 "${B}/${MODULES_MODULE_SYMVERS_LOCATION}"/Module.symvers ${D}${includedir}/${BPN}/Module.symvers + # Module.symvers contains absolute path to the build directory. + # While it doesn't actually seem to matter which path is specified, + # clear them out to avoid confusion + sed -e 's:${B}/::g' -i ${D}${includedir}/${BPN}/Module.symvers + fi } EXPORT_FUNCTIONS do_compile do_install -- 2.10.2