Patrick Williams | 8b8bc41 | 2016-08-17 15:02:23 -0500 | [diff] [blame] | 1 | inherit linux-kernel-base |
| 2 | |
| 3 | |
| 4 | def get_dts(d, ver): |
| 5 | staging_dir = d.getVar("STAGING_KERNEL_BUILDDIR", True) |
| 6 | dts = d.getVar("KERNEL_DEVICETREE", True) |
| 7 | |
| 8 | # d.getVar() might return 'None' as a normal string |
| 9 | # leading to 'is None' check isn't enough. |
| 10 | # TODO: Investigate if this is a bug in bitbake |
| 11 | if ver is None or ver == "None": |
| 12 | ''' if 'ver' isn't set try to grab the kernel version |
| 13 | from the kernel staging ''' |
| 14 | ver = get_kernelversion_file(staging_dir) |
| 15 | |
| 16 | if ver is not None: |
| 17 | min_ver = ver.split('.', 3) |
| 18 | else: |
| 19 | return dts |
| 20 | |
| 21 | # Always turn off device tree support for kernel's < 3.18 |
| 22 | try: |
| 23 | if int(min_ver[0]) <= 3: |
| 24 | if int(min_ver[1]) < 18: |
| 25 | dts = "" |
| 26 | except IndexError: |
| 27 | min_ver = None |
| 28 | |
| 29 | return dts |
| 30 | |
| 31 | |
| 32 | def split_overlays(d, out): |
| 33 | dts = get_dts(d, None) |
| 34 | if out: |
| 35 | overlays = oe.utils.str_filter_out('\S+\-overlay\.dtb$', dts, d) |
| 36 | else: |
| 37 | overlays = oe.utils.str_filter('\S+\-overlay\.dtb$', dts, d) |
| 38 | |
| 39 | return overlays |