From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6635976505850593280 X-Received: by 2002:a17:906:1c45:: with SMTP id l5-v6mr3140653ejg.3.1545219858668; Wed, 19 Dec 2018 03:44:18 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a50:97b6:: with SMTP id e51ls5664045edb.6.gmail; Wed, 19 Dec 2018 03:44:18 -0800 (PST) X-Google-Smtp-Source: AFSGD/VlFti9as/TsseshZs20/YUAqDxEwy8pIGyrsel5apP0TfS2sJrNfERdATb7ZkUHG5iU7VF X-Received: by 2002:a50:fd8c:: with SMTP id o12mr3135900edt.10.1545219858204; Wed, 19 Dec 2018 03:44:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545219858; cv=none; d=google.com; s=arc-20160816; b=XtSB8xKz9Bn5WKPjdZrIkVcuDsHNEPpCFkWJjCVo3WJr1QiFOQQB2s1swUeuK7Knbf vPyxMR2BvXjo3yYzQUl1TgxGWBwaUDqWF9Tmco3yLF+MH4emYxJPkzMpi2NsQbubq59m vHbFVAaR7uR1ETOrudXcNTGZ3dBez9QkwvUg3Nbc38brxL3KGPyEaDJPEkaHuLMl/oV1 ZxgrSB8JZeWGk4i+rMV5+2jFjtnJAmyEWClXEyjmEi8uZQ+EbkUI1lbO5i29TGyHPJss 2e+UgPN8iuE+8uT3qovfQj8XUHXfsH3wZjb4nqPSvA0czRlgmg/kxQAK9lt/+/o/L6+i T0Ig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:content-language:in-reply-to:mime-version :user-agent:date:message-id:organization:from:references:to:subject; bh=4E5xiH31Kw5oHuTlbbZxi3SVW54XctGFAiihnqR+cNw=; b=TFDSVLXUWzFm2MwDTphAFlHmuAUz9pvO5Mq1uPCO/tS63Ftg+YJ/wOKWVOhzg9FEgq RSCbNBCY//tyMJAh4gBq3uFLkVXUqtHxw3M3EDIGkW9ju+SvM9tP3Axly3oeN9zpjJCu PDWasE+Ig3TeRn/54HblioQwgunj8I3CliwmR4L1162rqti5+2RK7o9/Hl6IslXTPmJC F9gOa4h0I4+UB2Ilv1XUO9n3cy4bcJ/uYEIE/tjIGvXgtXd4QlyESZ33GkObIrIi4S4z MH+Ac2NMOduzY0pjxll8pjbU/lhF8XLj2MQAFTwH7dPUOYrehAwup0ZKY8v1+aceRrVT Ogpg== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: best guess record for domain of mosipov@ilbers.de designates 85.214.62.211 as permitted sender) smtp.mailfrom=mosipov@ilbers.de Return-Path: Received: from aqmola.ilbers.de (aqmola.ilbers.de. [85.214.62.211]) by gmr-mx.google.com with ESMTPS id d10-v6si871366ejx.0.2018.12.19.03.44.18 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 19 Dec 2018 03:44:18 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of mosipov@ilbers.de designates 85.214.62.211 as permitted sender) client-ip=85.214.62.211; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: best guess record for domain of mosipov@ilbers.de designates 85.214.62.211 as permitted sender) smtp.mailfrom=mosipov@ilbers.de Received: from [192.168.50.180] (nat-ppp-217.71.235.199-satnet-spb.ru [217.71.235.199] (may be forged)) (authenticated bits=0) by aqmola.ilbers.de (8.14.4/8.14.4/Debian-4+deb7u1) with ESMTP id wBJBiFIZ010473 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT); Wed, 19 Dec 2018 12:44:17 +0100 Subject: Re: [PATCH] linux-module: Improve KDIR retrieval To: Jan Kiszka , isar-users References: From: "Maxim Yu. Osipov" Organization: ilbers GmbH Message-ID: <739f3c7d-7871-ea09-8b6b-4cfab7ced7fe@ilbers.de> Date: Wed, 19 Dec 2018 14:44:10 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-TUID: mW/KPyMvHRkg On 12/17/18 5:57 PM, Jan Kiszka wrote: > There might be multiple kernels installed in the buildchroot. Ensure > that we pick the one that is currently selected for the target. Applied to the 'next', Thanks, Maxim. > > Signed-off-by: Jan Kiszka > --- > meta/recipes-kernel/linux-module/files/debian/rules | 2 -- > meta/recipes-kernel/linux-module/module.inc | 14 ++++++++++++++ > 2 files changed, 14 insertions(+), 2 deletions(-) > > diff --git a/meta/recipes-kernel/linux-module/files/debian/rules b/meta/recipes-kernel/linux-module/files/debian/rules > index 49788da..5c1d8be 100755 > --- a/meta/recipes-kernel/linux-module/files/debian/rules > +++ b/meta/recipes-kernel/linux-module/files/debian/rules > @@ -7,8 +7,6 @@ > # > # SPDX-License-Identifier: MIT > > -export KDIR=$(shell ls -d /lib/modules/*/build) > - > export DEB_BUILD_OPTIONS=parallel=$(shell nproc) > > export CROSS_COMPILE=$(DEB_HOST_GNU_TYPE)- > diff --git a/meta/recipes-kernel/linux-module/module.inc b/meta/recipes-kernel/linux-module/module.inc > index 509dd96..5d85200 100644 > --- a/meta/recipes-kernel/linux-module/module.inc > +++ b/meta/recipes-kernel/linux-module/module.inc > @@ -30,3 +30,17 @@ do_prepare_build() { > echo "echo $module >> /etc/modules" >> ${S}/debian/postinst > done > } > + > +dpkg_runbuild_prepend() { > + # Custom kernels contain the build folder directly. > + export KDIR=$(dpkg -L --root=${BUILDCHROOT_DIR} linux-headers-${KERNEL_NAME} | \ > + grep "/lib/modules/.*/build") > + if [ -z "$KDIR" ]; then > + # Debian kernels install that folder indirectly via a dependency. > + KERNEL_DEP=$(dpkg -s --root=${BUILDCHROOT_DIR} linux-headers-${KERNEL_NAME} | \ > + grep "^Depends: .*linux-headers-" | \ > + sed 's/.*\(linux-headers-[^,]*\).*/\1/') > + export KDIR=$(dpkg -L --root=${BUILDCHROOT_DIR} ${KERNEL_DEP} | \ > + grep "/lib/modules/.*/build") > + fi > +} > -- Maxim Osipov ilbers GmbH Maria-Merian-Str. 8 85521 Ottobrunn Germany +49 (151) 6517 6917 mosipov@ilbers.de http://ilbers.de/ Commercial register Munich, HRB 214197 General Manager: Baurzhan Ismagulov