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

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.

主站蜘蛛池模板: 边坝县| 嵊泗县| 永和县| 五大连池市| 东港市| 南部县| 津南区| 沾化县| 桑日县| 凤翔县| 顺义区| 平江县| 甘孜县| 高密市| 莒南县| 怀安县| 通城县| 宿州市| 横峰县| 星座| 沁阳市| 宁城县| 文化| 通州区| 商丘市| 民县| 晋中市| 宜良县| 达尔| 新绛县| 长岛县| 县级市| 和顺县| 岑巩县| 徐州市| 定日县| 华安县| 柯坪县| 阳江市| 嘉鱼县| 藁城市|