  if load ${devtype} ${devnum}:${distro_bootpart} ${a_script} uEnv.txt ; then
      env import -t ${a_script} ${filesize}
  fi
-@@ -124,12 +137,17 @@ fi
+ setenv bootargs ${bootargs} console=${console},115200 vmalloc=400M consoleblank=0 rootwait fixrtc cpu=${imx_cpu} board=${board}
+ 
+-if load ${devtype} ${devnum}:${distro_bootpart} ${a_fdt} ${prefix}${fdt_file} ; then
++if load ${devtype} ${devnum}:${resin_root_part} ${a_fdt} boot/${fdt_file} ; then
+ 	fdt addr ${a_fdt}
+ 	setenv fdt_high 0xffffffff
++elif load ${devtype} ${devnum}:${resin_boot_part} ${a_fdt} ${fdt_file} ; then
++        echo "Did not find dtb in root filesystem, loaded it from boot partition"
++        fdt addr ${a_fdt}
++        setenv fdt_high 0xffffffff
+ else
+ 	echo "!!!! Error loading ${prefix}${fdt_file}";
+ 	exit;
+@@ -114,12 +131,17 @@ fi
  if itest.s "x" == "x${bpart}" ; then
  	bpart=2
  fi

Upstream-Status: Inappropriate [configuration]
Signed-off-by: Alexandru Costache <alexandru@balena.io>
---
 .../boundary/bootscripts/bootscript-yocto.txt | 36 +++++++++++++++++--
 1 file changed, 34 insertions(+), 2 deletions(-)

diff --git a/board/boundary/bootscripts/bootscript-yocto.txt b/board/boundary/bootscripts/bootscript-yocto.txt
index 45e0f83498..d80ab9ba79 100644
--- a/board/boundary/bootscripts/bootscript-yocto.txt
+++ b/board/boundary/bootscripts/bootscript-yocto.txt
@@ -68,6 +68,19 @@ if itest.s x${distro_bootpart} == x ; then
 	distro_bootpart=1
 fi
 

From 032cffe255b1a56b453d3f6299bdce4f1a7fbddf Mon Sep 17 00:00:00 2001
From: Alexandru Costache <alexandru@balena.io>
Date: Wed, 13 May 2020 11:07:37 +0200
Subject: [PATCH] bootscript-yocto.txt: Allow flashing, integrate balenaOS
