I am trying to compile qemu from source to get my hands dirty with its development. I cloned the package from the repository. I extracted the tarball and started with the configuration using
./configure
when I got the following error:
ERROR: DTC (libfdt) not present. Your options:
(1) Preferred: Install the DTC (libfdt) devel package
(2) Fetch the DTC submodule, using:
git submodule update --init dtc
I tried installing libfdt using sudo apt-get install libfdt-dev
but this did not resolve the error.
There is a similar question I have seen but this too could not solve the error I am facing:
How do I fix this error to successfully compile qemu from source?
Edit:
Executing git submodule update --init dtc
while I am still in the qemu package's directory returned the following error:
fatal: Not a git repository (or any parent up to mount point /home)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
To fix this issue:
Cloned dtc from its repository and extract the tarball to
qemu/dtc/
.Compile dtc from source using
make
Restart configuring qemu using
./configure
when inqemu
directory.The problem was qemu tries to search for dtc binaries in
qemu/dtc
. Even if you have installed dtc usingsudo apt-get install device-tree-compiler
, you will get the above error(mentioned in the question), so you probably need to have the binaries inqemu/dtc
.From the error:
See item (2): use git submodule update --init dtc
Try get the qemu source code from the git:
And after it you can call ./configure.