All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Petter Mabäcker" <petter@technux.se>
To: Andrei Gherzan <andrei@gherzan.ro>
Cc: Yocto Project <yocto@yoctoproject.org>
Subject: Re: [meta-raspberrypi][PATCH 1/5] devicetree: auto-disable dts for old kernels
Date: Sun, 10 May 2015 19:07:25 +0200	[thread overview]
Message-ID: <554F904D.803@technux.se> (raw)
In-Reply-To: <CAK18fxFkrpjBj-zJXBUkQYiGBoxqzBBhU7yUEaaLPsoLfUWKUA@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 4957 bytes --]

On 05/10/2015 04:24 PM, Andrei Gherzan wrote:
>
>
> On Sun, May 10, 2015 at 4:20 PM, Petter Mabäcker <petter@technux.se 
> <mailto:petter@technux.se>> wrote:
>
>     Hi Andrei,
>
>     See answers inline.
>
>     BR,
>     Petter
>
>
>     On 05/10/2015 12:16 PM, Andrei Gherzan wrote:
>>     Hello Petter,
>>
>>     On Fri, May 8, 2015 at 11:49 PM, Petter Mabäcker
>>     <petter@technux.se <mailto:petter@technux.se>> wrote:
>>
>>         After '6392a63 rpi-base.inc: Use KERNEL_DEVICETREE by
>>         default' was
>>         introduced, kernel versions < 3.18 might not be buildable.
>>         Since full
>>         device tree support was introduced in 3.18 this change
>>         ensures that all
>>         kernel < 3.18 will automatically disable device tree.
>>
>>         Signed-off-by: Petter Mabäcker <petter@technux.se
>>         <mailto:petter@technux.se>>
>>         ---
>>          classes/linux-raspberrypi-base.bbclass  | 29
>>         +++++++++++++++++++++++++++++
>>          classes/sdcard_image-rpi.bbclass  |  6 ++++--
>>          recipes-kernel/linux/linux-raspberrypi.inc |  4 +++-
>>          3 files changed, 36 insertions(+), 3 deletions(-)
>>          create mode 100644 classes/linux-raspberrypi-base.bbclass
>>
>>         diff --git a/classes/linux-raspberrypi-base.bbclass
>>         b/classes/linux-raspberrypi-base.bbclass
>>         new file mode 100644
>>         index 0000000..4bcadd0
>>         --- /dev/null
>>         +++ b/classes/linux-raspberrypi-base.bbclass
>>         @@ -0,0 +1,29 @@
>>         +inherit linux-kernel-base
>>         +
>>         +
>>         +def get_dts(d, ver):
>>         +    staging_dir = d.getVar("STAGING_KERNEL_BUILDDIR", True)
>>         +    dts = d.getVar("KERNEL_DEVICETREE", True)
>>         +
>>         +    # d.getVar() might return 'None' as a normal string
>>         +    # leading to 'is None' check isn't enough.
>>         +    # TODO: Investigate if this is a bug in bitbake
>>         +    if ver is None or ver == "None":
>>         +        ''' if 'ver' isn't set try to grab the kernel version
>>         +        from the kernel staging '''
>>         +        ver = get_kernelversion_file(staging_dir)
>>         +
>>         +    if ver is not None:
>>         +        min_ver = ver.split('.', 3)
>>         +    else:
>>         +        return dts
>>         +
>>         +    # Always turn off device tree support for kernel's < 3.18
>>         +    try:
>>         +        if int(min_ver[0]) <= 3:
>>         +            if int(min_ver[1]) < 18:
>>         +                dts = ""
>>         +    except IndexError:
>>         +        min_ver = None
>>         +
>>         +    return dts
>>         diff --git a/classes/sdcard_image-rpi.bbclass
>>         b/classes/sdcard_image-rpi.bbclass
>>         index 1ff664d..ca94566 100644
>>         --- a/classes/sdcard_image-rpi.bbclass
>>         +++ b/classes/sdcard_image-rpi.bbclass
>>         @@ -1,4 +1,5 @@
>>          inherit image_types
>>         +inherit linux-raspberrypi-base
>>
>>          #
>>          # Create an image that can by written onto a SD card using dd.
>>         @@ -88,7 +89,8 @@ IMAGE_CMD_rpi-sdimg () {
>>                 ROOTFS_SIZE_ALIGNED=$(expr ${ROOTFS_SIZE_ALIGNED} -
>>         ${ROOTFS_SIZE_ALIGNED} % ${IMAGE_ROOTFS_ALIGNMENT})
>>                 SDIMG_SIZE=$(expr ${IMAGE_ROOTFS_ALIGNMENT} +
>>         ${BOOT_SPACE_ALIGNED} + ${ROOTFS_SIZE_ALIGNED})
>>
>>         -       echo "Creating filesystem with Boot partition
>>         ${BOOT_SPACE_ALIGNED} KiB and RootFS ${ROOTFS_SIZE_ALIGNED} KiB"
>>
>>
>>     Why do you remove this line? Maybe by mistake?
>     Yes this is by mistake, thanks for finding it. Will send up a new
>     version with this fixed.
>
> Don't bother. I'll fix it before merging.
Ok, thanks.
>
>>         +      # Check if we are building with device tree support
>>         +       DTS="${@get_dts(d, None)}"
>>
>>
>>     Aren't we able to use the same variable name, KERNEL_DEVICETREE?
>>     What that be a little clearer?
>     No, at least i couldn't get this working. When trying to set the
>     environment variable KERNEL_DEVICETREE in this context the values
>     was only ignored. Don't know if the image recipe (or at least the
>     IMAGE_CMD func) are doing something special. Perhaps it's possible
>     to use 'eval' or something similar to enforce the expansion of the
>     variable. If you have any good advice please share them, otherwise
>     I can at least write some comment about this.
>
>
> I'll try it a little. But I didn't expect this. Will see. Otherwise 
> this is fine.
Neither did I, let me know if you find anything interesting about this.
>
>
> -- 
> *Andrei Gherzan*
> *e: */andrei@gherzan.ro <mailto:andrei@gherzan.ro>/
> /*w:* /www.gherzan.ro <http://www.gherzan.ro>


[-- Attachment #2: Type: text/html, Size: 13108 bytes --]

  reply	other threads:[~2015-05-10 17:07 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-08 21:49 [meta-raspberrypi][PATCH 0/5] kernel fixes Petter Mabäcker
2015-05-08 21:49 ` [meta-raspberrypi][PATCH 1/5] devicetree: auto-disable dts for old kernels Petter Mabäcker
2015-05-10 10:16   ` Andrei Gherzan
2015-05-10 14:20     ` Petter Mabäcker
2015-05-10 14:24       ` Andrei Gherzan
2015-05-10 17:07         ` Petter Mabäcker [this message]
2015-05-17 22:46   ` Andrei Gherzan
2015-05-25 14:48     ` Petter Mabäcker
2015-05-08 21:49 ` [meta-raspberrypi][PATCH 2/5] README: fix outdated device tree info Petter Mabäcker
2015-05-08 21:49 ` [meta-raspberrypi][PATCH 3/5] linux-raspberrypi: Add 3.14 support Petter Mabäcker
2015-05-17 22:53   ` Andrei Gherzan
2015-05-08 21:49 ` [meta-raspberrypi][PATCH 4/5] linux-raspberrypi: Drop support for old kernel versions Petter Mabäcker
2015-05-17 22:51   ` Andrei Gherzan
2015-05-08 21:49 ` [meta-raspberrypi][PATCH 5/5] linux-raspberrypi: Update 3.12 branch to latest Petter Mabäcker
2015-05-17 22:53   ` Andrei Gherzan

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=554F904D.803@technux.se \
    --to=petter@technux.se \
    --cc=andrei@gherzan.ro \
    --cc=yocto@yoctoproject.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.