mirror of
https://git.yoctoproject.org/meta-raspberrypi
synced 2026-07-16 15:56:57 +00:00
devicetree: auto-disable dts for old kernels
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>
This commit is contained in:
committed by
Andrei Gherzan
parent
6ef9d94a2c
commit
4a4373c02d
@@ -0,0 +1,39 @@
|
||||
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
|
||||
|
||||
|
||||
def split_overlays(d, out):
|
||||
dts = get_dts(d, None)
|
||||
if out:
|
||||
overlays = oe.utils.str_filter_out('\S+\-overlay\.dtb$', dts, d)
|
||||
else:
|
||||
overlays = oe.utils.str_filter('\S+\-overlay\.dtb$', dts, d)
|
||||
|
||||
return overlays
|
||||
Reference in New Issue
Block a user