diff options
| -rw-r--r-- | meta/classes-recipe/devicetree.bbclass | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/meta/classes-recipe/devicetree.bbclass b/meta/classes-recipe/devicetree.bbclass index 1806cb62cb..2a2ac93e9b 100644 --- a/meta/classes-recipe/devicetree.bbclass +++ b/meta/classes-recipe/devicetree.bbclass | |||
| @@ -109,7 +109,11 @@ def devicetree_compile(dtspath, includes, d): | |||
| 109 | ppargs.append("-I{0}".format(i)) | 109 | ppargs.append("-I{0}".format(i)) |
| 110 | ppargs += ["-o", "{0}.pp".format(dts), dtspath] | 110 | ppargs += ["-o", "{0}.pp".format(dts), dtspath] |
| 111 | bb.note("Running {0}".format(" ".join(ppargs))) | 111 | bb.note("Running {0}".format(" ".join(ppargs))) |
| 112 | subprocess.run(ppargs, check = True) | 112 | try: |
| 113 | subprocess.run(ppargs, check=True, capture_output=True) | ||
| 114 | except subprocess.CalledProcessError as e: | ||
| 115 | bb.fatal(f"Command '{' '.join(ppargs)}' failed with return code {e.returncode}\nstdout: {e.stdout.decode()}\nstderr: {e.stderr.decode()}\ndtspath: {os.path.abspath(dtspath)}") | ||
| 116 | |||
| 113 | 117 | ||
| 114 | # determine if the file is an overlay or not (using the preprocessed file) | 118 | # determine if the file is an overlay or not (using the preprocessed file) |
| 115 | isoverlay = devicetree_source_is_overlay("{0}.pp".format(dts)) | 119 | isoverlay = devicetree_source_is_overlay("{0}.pp".format(dts)) |
| @@ -125,7 +129,11 @@ def devicetree_compile(dtspath, includes, d): | |||
| 125 | dtcargs += ["-o", "{0}.{1}".format(dtname, "dtbo" if isoverlay else "dtb")] | 129 | dtcargs += ["-o", "{0}.{1}".format(dtname, "dtbo" if isoverlay else "dtb")] |
| 126 | dtcargs += ["-I", "dts", "-O", "dtb", "{0}.pp".format(dts)] | 130 | dtcargs += ["-I", "dts", "-O", "dtb", "{0}.pp".format(dts)] |
| 127 | bb.note("Running {0}".format(" ".join(dtcargs))) | 131 | bb.note("Running {0}".format(" ".join(dtcargs))) |
| 128 | subprocess.run(dtcargs, check = True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) | 132 | try: |
| 133 | subprocess.run(dtcargs, check=True, capture_output=True) | ||
| 134 | except subprocess.CalledProcessError as e: | ||
| 135 | bb.fatal(f"Command '{' '.join(dtcargs)}' failed with return code {e.returncode}\nstdout: {e.stdout.decode()}\nstderr: {e.stderr.decode()}\ndtname: {dtname}") | ||
| 136 | |||
| 129 | 137 | ||
| 130 | python devicetree_do_compile() { | 138 | python devicetree_do_compile() { |
| 131 | import re | 139 | import re |
| @@ -144,14 +152,16 @@ python devicetree_do_compile() { | |||
| 144 | } | 152 | } |
| 145 | 153 | ||
| 146 | devicetree_do_install() { | 154 | devicetree_do_install() { |
| 147 | for DTB_FILE in `ls *.dtb *.dtbo`; do | 155 | for dtb_file in *.dtb *.dtbo; do |
| 148 | install -Dm 0644 ${B}/${DTB_FILE} ${D}/boot/devicetree/${DTB_FILE} | 156 | [ -e "$dtb_file" ] || continue |
| 157 | install -Dm 0644 "${B}/$dtb_file" "${D}/boot/devicetree/$dtb_file" | ||
| 149 | done | 158 | done |
| 150 | } | 159 | } |
| 151 | 160 | ||
| 152 | devicetree_do_deploy() { | 161 | devicetree_do_deploy() { |
| 153 | for DTB_FILE in `ls *.dtb *.dtbo`; do | 162 | for dtb_file in *.dtb *.dtbo; do |
| 154 | install -Dm 0644 ${B}/${DTB_FILE} ${DEPLOYDIR}/devicetree/${DTB_FILE} | 163 | [ -e "$dtb_file" ] || continue |
| 164 | install -Dm 0644 "${B}/$dtb_file" "${DEPLOYDIR}/devicetree/$dtb_file" | ||
| 155 | done | 165 | done |
| 156 | } | 166 | } |
| 157 | addtask deploy before do_build after do_install | 167 | addtask deploy before do_build after do_install |
