No such file build-arm64/arch/arm64/boot/dts/qcom/

I followed the directions for “How to create a kernel boot image for the DragonBoard 410c”. Most everything work until I got to the command:
dtbTool -o dt.img -s 2048 build-${ARCH}/arch/arm64/boot/dts/qcom/
The error I get is:

dtbTool -o dt.img -s 2048 build-${ARCH}/arch/arm64/boot/dts/qcom/
Traceback (most recent call last):
  File "/build/user/dragonBoard-410c/skales/dtbTool", line 202, in <module>
    for f in os.listdir(indir)
OSError: [Errno 2] No such file or directory: 'build-arm64/arch/arm64/boot/dts/qcom/'
/build/user/dragonBoard-410c/kernel$ echo $ARCH
arm64
/build/user/dragonBoard-410c/kernel$ which dtbTool
/build/user/dragonBoard-410c/skales/dtbTool

I am doing a cross-compile on a RHEL 64-bit server: Linux 2.6.32-358.11.1.el6.x86_64 #1 SMP Wed May 15 10:48:38 EDT 2013 x86_64 x86_64 x86_64 GNU/Linux.

Any ideas?

I am just stating the obvious but does the directory exist? where are you executing the dtbTool from?
A proper trace would be helpful (not just portions of it)

It is just that I am a bit confused by the “most everything work” statement you made (it either builds correctly until this point or it doesn’t, there is no in between on this)

I had a lot of difficulty getting the aarch64-linux-gnu-gcc compiler working, but after it started working correctly, the compilation process worked up until the ‘dtbTool’ command. I copied and pasted the output from the dtbTool command to this post in its entirety … that is the whole trace. Is there a way to get a more detailed trace?
The skales directory was installed in my kernel “root” directory … that is it is in the same directory as the Documentation, arch, block, certs, crypto, drivers, firmware, fs, include, etc directories.

I cant think of any reasons to have trouble using a cross compiler (there is nothing specific in aarch64 that could have caused you issues)

Also, that is not what your trace says (and actually it wouldn’t make a lot of sense to integrate skales in a kernel tree); your trace says that skales is in

/build/user/dragonBoard-410c/skales/dtbTool

and that your kernel is in

/build/user/dragonBoard-410c/kernel

so that is ok.

I am not sure where you are executing the dtbTool from or whether your kernel compiled properly (that information is not on the trace - this is why I am saying that the trace is not complete)

In any case, just make sure dtbTool can access the necessary files in dts/qcom.

I suppose you could simply do:

dtbTool -v -o dt.img -s 2048 /build/user/dragonBoard-410c/kernel/build-${ARCH}/arch/arm64/boot/dts/qcom/

and make sure the dtb files are actually present in /build/user/dragonBoard-410c/kernel/build-${ARCH}/arch/arm64/boot/dts/qcom/

In my case it looks like this:

[jramirez@calypso qcom (ubuntu-qcom-dragonboard410c-15.09 $%)]$ pwd
/home/jramirez/Src/96b/qualcomm/dragon410c/src/ubuntu/kernel/linux.git/build-arm64/arch/arm64/boot/dts/qcom

ls[jramirez@calypso qcom (ubuntu-qcom-dragonboard410c-15.09 $%)]$ ls -l
total 108
-rw-rw-r-- 1 jramirez jramirez 53303 Oct 29 11:11 apq8016-sbc.dtb
-rw-rw-r-- 1 jramirez jramirez 49603 Oct 29 11:11 msm8916-mtp.dtb

The problem seems to be the ‘fdtget’ utility. This utility does not exist on my version of RHEL. I put some debug prints in the python script to help me debug the problem:

skales/dtbTool -s 2048 -o arch/arm/boot/dt.img -p scripts/dtc/ build-arm64/arch/arm64/boot/dts/qcom/
indir (build-arm64/arch/arm64/boot/dts/qcom/)
flist (['build-arm64/arch/arm64/boot/dts/qcom/msm8916-mtp.dtb', 'build-arm64/arch/arm64/boot/dts/qcom/apq8016-sbc.dtb'])
f (build-arm64/arch/arm64/boot/dts/qcom/msm8916-mtp.dtb) options.dtc (scripts/dtc/) pagesize (2048)
os.path.join (['scripts/dtc/fdtget', 'build-arm64/arch/arm64/boot/dts/qcom/msm8916-mtp.dtb', '/', 'qcom,msm-id']) 
Traceback (most recent call last):
  File "skales/dtbTool", line 210, in <module>
    records += generate_records(f, options.dtc, pagesize)
  File "skales/dtbTool", line 111, in generate_records
    msm_id = subprocess.check_output([os.path.join(dtc, "fdtget"), f, "/", "qcom,msm-id"], stderr=subprocess.PIPE)
  File "/tools/oss/packages/x86_64-rhel6/python/default/lib/python2.7/subprocess.py", line 568, in check_output
    process = Popen(stdout=PIPE, *popenargs, **kwargs)
  File "/tools/oss/packages/x86_64-rhel6/python/default/lib/python2.7/subprocess.py", line 711, in __init__
    errread, errwrite)
  File "/tools/oss/packages/x86_64-rhel6/python/default/lib/python2.7/subprocess.py", line 1308, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory

I noticed that there is a source for fdtget.c in scripts/dtc. When I tried to build it manually, the <libfdt.h> is not found on my RHEL:

Makefile:13: HOSTCFLAGS_DTC -I -I/libfdt
cc     fdtget.c   -o fdtget
fdtget.c:33:20: error: libfdt.h: No such file or directory
fdtget.c: In function &#039;show_data&#039;:
fdtget.c:70: error: expected &#039;=&#039;, &#039;,&#039;, &#039;;&#039;, &#039;asm&#039; or &#039;__attribute__&#039; before &#039;*&#039; token
fdtget.c:70: error: &#039;p&#039; undeclared (first use in this function)
fdtget.c:70: error: (Each undeclared identifier is reported only once
fdtget.c:70: error: for each function it appears in.)
fdtget.c:70: error: expected &#039;)&#039; before &#039;uint8_t&#039;
fdtget.c:70: warning: cast from pointer to integer of different size
fdtget.c:108: error: expected &#039;)&#039; before &#039;uint32_t&#039;

Is there a RHEL version of fdtget that I could use?

I thought you said you had followed the directions:


Getting the skales tools
Somewhere, on your machine, install the following tools:
git clone git://codeaurora.org/quic/kernel/skales
To use this tool you should have the fdtget program.
This is commonly distributed as part of the device tree compiler package.

device-tree-compiler (debian)
dtc (redhat)
sys-apps/dtc (gentoo)

anyway, is it not in the dtc package?

If it is not in that package I mentioned, you might have to enable the extra packages for the enterprise linux (see the fedora case https://fedoraproject.org/wiki/EPEL)

The utility ‘dtc’ is present in my RHEL. Is ‘dtc’ equivalent to ‘fdtget’? If yes, how do I get the dtbTool python script to use ‘dtc’?

I managed to modify the sources and Makefile in scripts/dtc to get fdtget utility to compile and run.

cp dtc-lexer.lex.c_shipped dtc-lexer.lex.c
cp dtc-parser.tab.c_shipped dtc-parser.tab.c
cp dtc-parser.tab.h_shipped dtc-parser.tab.h

find . -name &quot;*&quot; | xargs grep CAD
./dtc.h:#include &quot;libfdt_env.h&quot; /* CAD */
./dtc.h:#include &quot;fdt.h&quot; /* CAD */
./fdtget.c:#include &quot;libfdt.h&quot; /* CAD */
./libfdt/libfdt_internal.h:#include &quot;fdt.h&quot; /* CAD */
./libfdt/fdt_strerror.c:#include &quot;fdt.h&quot; /* CAD */
./libfdt/fdt_strerror.c:#include &quot;libfdt.h&quot; /* CAD */
./libfdt/fdt_ro.c:#include &quot;fdt.h&quot; /* CAD */
./libfdt/fdt_ro.c:#include &quot;libfdt.h&quot; /* CAD */
./libfdt/fdt.c:#include &quot;fdt.h&quot; /* CAD */
./libfdt/fdt.c:#include &quot;libfdt.h&quot; /* CAD */
./Makefile:### CAD export src=.
./Makefile:### CAD export obj=.
./Makefile:$(warning HOSTCFLAGS_DTC $(HOSTCFLAGS_DTC) ... obj $(obj) ) ### CAD

I now have a boot-db410c.img file that I will attempt to boot with.

Many thanks for your quick responses to my questions. :slight_smile: