public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: "Maxim Yu. Osipov" <mosipov@ilbers.de>
To: Jan Kiszka <jan.kiszka@siemens.com>,
	isar-users <isar-users@googlegroups.com>
Subject: Re: [PATCH] linux-module: Improve KDIR retrieval
Date: Wed, 19 Dec 2018 14:44:10 +0300	[thread overview]
Message-ID: <739f3c7d-7871-ea09-8b6b-4cfab7ced7fe@ilbers.de> (raw)
In-Reply-To: <ba09a8df-2c35-72ed-3312-8751d8c36632@siemens.com>

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 <jan.kiszka@siemens.com>
> ---
>   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

      reply	other threads:[~2018-12-19 11:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-17 14:57 Jan Kiszka
2018-12-19 11:44 ` Maxim Yu. Osipov [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=739f3c7d-7871-ea09-8b6b-4cfab7ced7fe@ilbers.de \
    --to=mosipov@ilbers.de \
    --cc=isar-users@googlegroups.com \
    --cc=jan.kiszka@siemens.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox