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:
Petter Mabäcker
2015-05-25 16:59:21 +02:00
committed by Andrei Gherzan
parent 6ef9d94a2c
commit 4a4373c02d
3 changed files with 51 additions and 7 deletions
+9 -6
View File
@@ -1,4 +1,5 @@
inherit image_types
inherit linux-raspberrypi-base
#
# Create an image that can by written onto a SD card using dd.
@@ -70,11 +71,6 @@ SDIMG = "${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.rpi-sdimg"
# Additional files and/or directories to be copied into the vfat partition from the IMAGE_ROOTFS.
FATPAYLOAD ?= ""
# Device Tree Overlays are assumed to be suffixed by '-overlay.dtb' string and will be put in a dedicated folder
DT_ALL = "${@d.getVar('KERNEL_DEVICETREE', True) or ''}"
DT_OVERLAYS = "${@oe.utils.str_filter('\S+\-overlay\.dtb$', '${DT_ALL}', d)}"
DT_ROOT = "${@oe.utils.str_filter_out('\S+\-overlay\.dtb$', '${DT_ALL}', d)}"
IMAGEDATESTAMP = "${@time.strftime('%Y.%m.%d',time.gmtime())}"
IMAGE_CMD_rpi-sdimg () {
@@ -90,6 +86,9 @@ IMAGE_CMD_rpi-sdimg () {
echo "Creating filesystem with Boot partition ${BOOT_SPACE_ALIGNED} KiB and RootFS ${ROOTFS_SIZE_ALIGNED} KiB"
# Check if we are building with device tree support
DTS="${@get_dts(d, None)}"
# Initialize sdcard image file
dd if=/dev/zero of=${SDIMG} bs=1024 count=0 seek=${SDIMG_SIZE}
@@ -112,7 +111,11 @@ IMAGE_CMD_rpi-sdimg () {
mcopy -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}${KERNEL_INITRAMFS}-${MACHINE}.bin ::uImage
;;
*)
if test -n "${KERNEL_DEVICETREE}"; then
if test -n "${DTS}"; then
# Device Tree Overlays are assumed to be suffixed by '-overlay.dtb' string and will be put in a dedicated folder
DT_OVERLAYS="${@split_overlays(d, 0)}"
DT_ROOT="${@split_overlays(d, 1)}"
# Copy board device trees to root folder
for DTB in ${DT_ROOT}; do
DTB_BASE_NAME=`basename ${DTB} .dtb`