Patrick Williams | 8b8bc41 | 2016-08-17 15:02:23 -0500 | [diff] [blame] | 1 | inherit linux-kernel-base |
| 2 | |
Patrick Williams | b2e6a9b | 2017-02-23 20:31:26 -0600 | [diff] [blame] | 3 | def get_dts(d, ver=None): |
| 4 | import re |
Patrick Williams | 8b8bc41 | 2016-08-17 15:02:23 -0500 | [diff] [blame] | 5 | |
Patrick Williams | 8b8bc41 | 2016-08-17 15:02:23 -0500 | [diff] [blame] | 6 | staging_dir = d.getVar("STAGING_KERNEL_BUILDDIR", True) |
| 7 | dts = d.getVar("KERNEL_DEVICETREE", True) |
| 8 | |
| 9 | # d.getVar() might return 'None' as a normal string |
| 10 | # leading to 'is None' check isn't enough. |
| 11 | # TODO: Investigate if this is a bug in bitbake |
| 12 | if ver is None or ver == "None": |
| 13 | ''' if 'ver' isn't set try to grab the kernel version |
| 14 | from the kernel staging ''' |
| 15 | ver = get_kernelversion_file(staging_dir) |
| 16 | |
Patrick Williams | 8b8bc41 | 2016-08-17 15:02:23 -0500 | [diff] [blame] | 17 | return dts |
| 18 | |
| 19 | |
Patrick Williams | b2e6a9b | 2017-02-23 20:31:26 -0600 | [diff] [blame] | 20 | def split_overlays(d, out, ver=None): |
| 21 | dts = get_dts(d, ver) |
Patrick Williams | 8b8bc41 | 2016-08-17 15:02:23 -0500 | [diff] [blame] | 22 | if out: |
| 23 | overlays = oe.utils.str_filter_out('\S+\-overlay\.dtb$', dts, d) |
Patrick Williams | b2e6a9b | 2017-02-23 20:31:26 -0600 | [diff] [blame] | 24 | overlays = oe.utils.str_filter_out('\S+\.dtbo$', overlays, d) |
Patrick Williams | 8b8bc41 | 2016-08-17 15:02:23 -0500 | [diff] [blame] | 25 | else: |
Patrick Williams | b2e6a9b | 2017-02-23 20:31:26 -0600 | [diff] [blame] | 26 | overlays = oe.utils.str_filter('\S+\-overlay\.dtb$', dts, d) + \ |
| 27 | " " + oe.utils.str_filter('\S+\.dtbo$', dts, d) |
Patrick Williams | 8b8bc41 | 2016-08-17 15:02:23 -0500 | [diff] [blame] | 28 | |
| 29 | return overlays |