官术网_书友最值得收藏!

Getting ready

Since we need to add our code to the Linux sources, let's go into the directory where all sources are located. On my system, I use the Projects/ldddc/linux/ path located in my home directory. Here is what the kernel sources look like:

$ cd Projects/ldddc/linux/
$ ls
arch Documentation Kbuild mm scripts virt
block drivers Kconfig modules.builtin security vmlinux
built-in.a firmware kernel modules.order sound vmlinux.o
certs fs lib Module.symvers stNXtP40
COPYING include LICENSES net System.map
CREDITS init MAINTAINERS README tools
crypto ipc Makefile samples usr

Now, we need to set the environment variables, ARCH and CROSS_COMPILE, as follows in order to be able to cross-compile code for the ESPRESSObin:

$ export ARCH=arm64
$ export CROSS_COMPILE=aarch64-linux-gnu-

So, if we try to execute a make command as follows, the system should start compiling the kernel as usual:

$ make Image dtbs modules
CALL scripts/checksyscalls.sh
...
Note that you may avoid exporting preceding variables by just specifying them on the following command line:
$ make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- \
Image dtbs modules

At this point, kernel sources and the compiling environment are ready.

主站蜘蛛池模板: 柳州市| 澄迈县| 永清县| 资溪县| 福建省| 翼城县| 伊通| 武鸣县| 武川县| 长武县| 长沙县| 讷河市| 黄大仙区| 周宁县| 阿尔山市| 鄂尔多斯市| 呈贡县| 苍南县| 防城港市| 嘉兴市| 乐陵市| 乡城县| 连南| 于都县| 德令哈市| 滨海县| 麟游县| 五常市| 克山县| 阿鲁科尔沁旗| 雅江县| 佛教| 依兰县| 德江县| 北碚区| 襄城县| 台州市| 桦南县| 施甸县| 隆安县| 新晃|