Skip to content

Commit 60c7f4c

Browse files
Frank Rowandrobherring
authored andcommitted
scripts/dtc: dtx_diff - add info to error message
If kernel config options are not properly set, "make scripts" will not compile dtc. Update the unable to find dtc error message to check the kernel config and give better advice on how to create dtc. Reword another error message to increase clarity. Signed-off-by: Frank Rowand <frank.rowand@sonymobile.com> Signed-off-by: Rob Herring <robh@kernel.org>
1 parent 10eadc2 commit 60c7f4c

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

‎scripts/dtc/dtx_diff‎

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,7 @@ compile_to_dts() {
136136
echo "" >&2
137137
echo " architecture ${dtx_arch} is in file path," >&2
138138
echo " but does not match shell variable \$ARCH" >&2
139-
echo " (${ARCH}) does not match shell variable" >&2
140-
echo " \$ARCH (${ARCH})" >&2
139+
echo " >>\$ARCH<< is: >>${ARCH}<<" >&2
141140
fi
142141

143142
if [ ! -d ${srctree}/arch/${ARCH} ] ; then
@@ -267,6 +266,14 @@ DTC="${__KBUILD_OUTPUT}/scripts/dtc/dtc"
267266

268267
if [ ! -x ${DTC} ] ; then
269268
__DTC="dtc"
269+
if grep -q "^CONFIG_DTC=y" ${__KBUILD_OUTPUT}/.config ; then
270+
make_command='
271+
make scripts'
272+
else
273+
make_command='
274+
Enable CONFIG_DTC in the kernel configuration
275+
make scripts'
276+
fi
270277
if ( ! which ${__DTC} >/dev/null ) ; then
271278

272279
# use spaces instead of tabs in the error message
@@ -280,8 +287,7 @@ ERROR: unable to find a 'dtc' program
280287
'dtc' is: ${DTC}
281288
282289
If it does not exist, create it from the root of the Linux source tree:
283-
284-
'make scripts'.
290+
${make_command}
285291
286292
If not at the root of the Linux kernel source tree -s SRCTREE or -S
287293
may need to be specified to find 'dtc'.

0 commit comments

Comments
 (0)