From ac2928baa4ab9aec84507a6244053ecf58581bb8 Mon Sep 17 00:00:00 2001 From: The-going <48602507+The-going@users.noreply.github.com> Date: Wed, 4 Dec 2024 20:58:26 +0300 Subject: [PATCH] bootscript: Remove vendor name and slash from DTB file name After that, the script successfully loads the DTB file from two possible paths and overlays. If the file does not exist, then the default file will be uploaded. --- config/bootscripts/boot-sun50i-next.cmd | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/config/bootscripts/boot-sun50i-next.cmd b/config/bootscripts/boot-sun50i-next.cmd index 69ad79a34d5a..0bd8b1b425c2 100644 --- a/config/bootscripts/boot-sun50i-next.cmd +++ b/config/bootscripts/boot-sun50i-next.cmd @@ -15,8 +15,10 @@ setenv bootlogo "false" setenv vendor "allwinner" -# Remember the default u-boot fdtfile -setenv deffdt_file ${fdtfile} +# Remember the default fdtfile provided by u-boot and delete the vendor name +if setexpr subfdt sub ${vendor}/ "" ${fdtfile};then + setenv deffdt_file ${subfdt} +fi # Remember the default u-boot fdtdir setenv deffdt_dir "${prefix}dtb" @@ -34,6 +36,12 @@ if test -e ${devtype} ${devnum} ${prefix}armbianEnv.txt; then env import -t ${load_addr} ${filesize} fi +# Delete the vendor's name from the fdtfile variable and record the result +# after the file with the environment variables has been read +if setexpr subfdt sub ${vendor}/ "" ${fdtfile};then + setenv fdtfile ${subfdt} +fi + # In this shell, we can only check the existence of the file. # Make a check of reasonable ways to find the dtb file. # Set the true value of the paths.