From 8cad2c82271bacc2a4b7d7ef874654932c5b90a4 Mon Sep 17 00:00:00 2001 From: Florin Sarbu Date: Thu, 29 Feb 2024 14:22:59 +0000 Subject: [PATCH] linux-raspberrypi_%.bbappend: Make sure DEPLOY_DIR_IMAGE dir exists when writing in it We need to make sure the DEPLOY_DIR_IMAGE directory exists at the time we create the overlays.txt file in it. Changelog-entry: Make sure DEPLOY_DIR_IMAGE dir exists when writing overlays.txt into it Signed-off-by: Florin Sarbu --- .../recipes-kernel/linux/linux-raspberrypi_%.bbappend | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/layers/meta-balena-raspberrypi/recipes-kernel/linux/linux-raspberrypi_%.bbappend b/layers/meta-balena-raspberrypi/recipes-kernel/linux/linux-raspberrypi_%.bbappend index 2153c72b2..1c85c3d3e 100644 --- a/layers/meta-balena-raspberrypi/recipes-kernel/linux/linux-raspberrypi_%.bbappend +++ b/layers/meta-balena-raspberrypi/recipes-kernel/linux/linux-raspberrypi_%.bbappend @@ -13,7 +13,7 @@ BALENA_CONFIGS:append:raspberrypi3-64 = " aufs" BALENA_CONFIGS:append:raspberrypi3 = " aufs" python do_overlays() { - import glob, re + import glob, re, os overlays = [] source_path = d.getVar('S', True) + '/arch/' + d.getVar('ARCH',True) + '/boot/dts/overlays/*-overlay.dts' for overlay in glob.glob(source_path): @@ -21,6 +21,8 @@ python do_overlays() { for dtbo in overlays: d.setVar('KERNEL_DEVICETREE', d.getVar('KERNEL_DEVICETREE', True) + ' ' + dtbo) + if not os.path.exists(d.getVar('DEPLOY_DIR_IMAGE')): + os.makedirs(d.getVar('DEPLOY_DIR_IMAGE')) f = open(d.getVar('DEPLOY_DIR_IMAGE') + '/overlays.txt', "w") f.write(d.getVar('KERNEL_DEVICETREE', True)) f.close