blob: dc2330af280537149e207a1250179f0031c78a54 [file] [log] [blame]
Patrick Williams8b8bc412016-08-17 15:02:23 -05001inherit linux-kernel-base
2
Patrick Williamsb2e6a9b2017-02-23 20:31:26 -06003def get_dts(d, ver=None):
4 import re
Patrick Williams8b8bc412016-08-17 15:02:23 -05005
Patrick Williams8b8bc412016-08-17 15:02:23 -05006 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 Williams8b8bc412016-08-17 15:02:23 -050017 return dts
18
19
Patrick Williamsb2e6a9b2017-02-23 20:31:26 -060020def split_overlays(d, out, ver=None):
21 dts = get_dts(d, ver)
Patrick Williams8b8bc412016-08-17 15:02:23 -050022 if out:
23 overlays = oe.utils.str_filter_out('\S+\-overlay\.dtb$', dts, d)
Patrick Williamsb2e6a9b2017-02-23 20:31:26 -060024 overlays = oe.utils.str_filter_out('\S+\.dtbo$', overlays, d)
Patrick Williams8b8bc412016-08-17 15:02:23 -050025 else:
Patrick Williamsb2e6a9b2017-02-23 20:31:26 -060026 overlays = oe.utils.str_filter('\S+\-overlay\.dtb$', dts, d) + \
27 " " + oe.utils.str_filter('\S+\.dtbo$', dts, d)
Patrick Williams8b8bc412016-08-17 15:02:23 -050028
29 return overlays