Build linux kernel(db820c)

this is my first time using db820c.
I want to build my own kernel image, and I have followed tips in
https://github.com/96boards/documentation/wiki/Dragonboard-Boot-Image .
I have downloaded release/4.14 branch.
when using the command :
make defconfig distro.config
let “PROCS=$(nproc)/2”
make -j $PROCS Image.gz dtbs KERNELRELEASE=4.14.0-qcomlt-${ARCH},
I didn’t find any dtbs in ./arch/arm64/boot/dts/qcom/,since I will use it to create img.
I don’t know what is wrong, so I have to ask how to build the kernel.
Can someone give me a hand? thanks!

Did you correctly setup toolchain and ARCH/CROSS_COMPILE env variables?
What happens when you just enter perform the following:

touch arch/arm64/boot/dts/qcom/apq8096-db820c.dtsi
make dtbs

Documentation is available here:

hi Loic:
I have setup ARCH and CROSS_COMPILE correctly.

I have tried your command.
It creates apq8096-db820c.dtsi in arch/arm64/boot/dts/qcom/ and have compile errors :
/******************************************
CHK include/config/kernel.release
CHK include/generated/uapi/linux/version.h
CHK include/generated/utsrelease.h
UPD include/generated/utsrelease.h
CHK include/generated/bounds.h
CHK include/generated/timeconst.h
CHK include/generated/asm-offsets.h
CALL scripts/checksyscalls.sh
DTC arch/arm64/boot/dts/altera/socfpga_stratix10_socdk.dtb
DTC arch/arm64/boot/dts/amd/amd-overdrive.dtb
DTC arch/arm64/boot/dts/apm/apm-mustang.dtb
DTC arch/arm64/boot/dts/apm/apm-merlin.dtb
DTC arch/arm64/boot/dts/arm/juno.dtb
arch/arm64/boot/dts/arm/juno.dts:11:10: fatal error: dt-bindings/interrupt-controller/arm-gic.h: No such file or directory
#include <dt-bindings/interrupt-controller/arm-gic.h>
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
scripts/Makefile.lib:293: recipe for target ‘arch/arm64/boot/dts/arm/juno.dtb’ failed
make[2]: *** [arch/arm64/boot/dts/arm/juno.dtb] Error 1
scripts/Makefile.build:403: recipe for target ‘arch/arm64/boot/dts/arm’ failed
make[1]: *** [arch/arm64/boot/dts/arm] Error 2
arch/arm64/Makefile:99: recipe for target ‘dtbs’ failed
******************************************************/

No, you should already have this dtsi, dts//dtsi are device tree source files and part of the Linux source tree. These files describe the hardware in an human readable way (e.g. register address to control gpios, CPU info, etc). In order to be used by the Linux kernel, they need to be compiled/converted in a binary format (dtb), this is what is done when running make dtbs. So if these files are not already present, this is a problem.

Are you previous steps, does your git clone completed successfully ?
I would suggest to:

git fetch origin
git reset --hard origin/release/qcomlt-4.14

Then set your env variable, perform the ‘make defconfig distro.config’ and retry.

@Loic
I have git clone the whole source code again!
when make dtbs, there are some errors:

scripts/kconfig/conf --silentoldconfig Kconfig
CHK include/config/kernel.release
CHK include/generated/uapi/linux/version.h
CHK scripts/mod/devicetable-offsets.h
CHK include/generated/utsrelease.h
UPD include/generated/utsrelease.h
CHK include/generated/timeconst.h
CHK include/generated/bounds.h
CHK include/generated/asm-offsets.h
CALL scripts/checksyscalls.sh
CHK include/generated/compile.h
CC init/version.o
AR init/built-in.o
CC kernel/sys.o
CC drivers/base/firmware_class.o
CC kernel/module.o
AR drivers/base/built-in.o
DTC arch/arm64/boot/dts/al/alpine-v2-evp.dtb
In file included from arch/arm64/boot/dts/al/alpine-v2-evp.dts:35:0:
arch/arm64/boot/dts/al/alpine-v2.dtsi:37:10: fatal error: dt-bindings/interrupt-controller/arm-gic.h: No such file or directory
#include <dt-bindings/interrupt-controller/arm-gic.h>
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
scripts/Makefile.lib:317: recipe for target ‘arch/arm64/boot/dts/al/alpine-v2-evp.dtb’ failed
make[2]: *** [arch/arm64/boot/dts/al/alpine-v2-evp.dtb] Error 1
scripts/Makefile.build:579: recipe for target ‘arch/arm64/boot/dts/al’ failed
make[1]: *** [arch/arm64/boot/dts/al] Error 2
arch/arm64/Makefile:138: recipe for target ‘dtbs’ failed
make: *** [dtbs] Error 2
make: *** Waiting for unfinished jobs…
GZIP kernel/config_data.gz
CHK kernel/config_data.h
AR kernel/built-in.o
AR drivers/built-in.o

Can you give some tips?

I think you may need to do

sudo apt-get install device-tree-compiler

before the build to resolve this error. Here is what I ended up installing on my 18.04 linux box to get everything to compile. however I may have missed some things I had installed earlier so this may not be a complete list:

sudo apt-get update
sudo apt-get install -y build-essential flex bison libssl-dev
sudo apt-get install -y device-tree-compiler python libfdt-dev
sudo apt-get install -y fai-server qemu-utils fai-setup-storage
sudo apt-get install -y devscripts asciidoc w3m-img debhelper

Hopefully this helps.

Full Disclosure: I am currently taking the summer off and looking for new opportunities in the fall.

very much thanks for your patient replies!
It has been settled down.
It seems that my host computer didn’t install some lib files.
There is another problem: what is the password for root user in linaro Debain?
@ljking @Loic Thanks!!

With Debian the root user/account password is locked by default.
There is a root console attached to the UART1 at boot.
The common way to switch to root user is using sudo su command from administrative account (linaro).

To unlock root account, you need to assign it a password:

sudo passwd root

To (re)lock the root account:

sudo passwd -l root