Compile Hongmeng Liteos-a for IMX6ULL

Chapter 2 Compile Liteos-a for IMX6ULL

Please download the following file first, which contains the patch file:
https://gitee.com/weidongshan/openharmony_for_imx6ull/repository/archive/master.zip

1.1 Download patch files, etc.

Execute the following commands in Ubuntu:

cd  /home/book
git  clone  https://gitee.com/weidongshan/openharmony_for_imx6ull.git

The results are as follows:
Insert picture description here
the "apps" in the figure above contains several example applications, the "patch" contains the patch file made for IMX6ULL, and the "tools" is the burning tool.

1.2 Use patch files to modify the code

Assuming that the source code of Hongmeng is in the /home/book/openharmony directory, the patch file hmos_v1.0_imx6ull.patch is placed in the /home/book/openharmony_for_imx6ull/patch directory.
Execute the following command to patch:

cd  /home/book/openharmony
patch -p1 < /home/book/openharmony_for_imx6ull/patch/hmos_v1.0_imx6ull.patch

Note: Hongmeng's kernel is constantly being updated, and this patch is for the "OpenHarmony-1.0" version.

Therefore, you must specify "-b OpenHarmony-1.0" when using repo to download the code, refer to "1.2.3 Download source code".

1.3 Compile

My modification is not perfect yet, and it cannot be compiled in the root directory.
Need to enter the kernel/liteos_a directory to configure and compile:

cd  /home/book/openharmony/kernel/liteos_a
cp  tools/build/config/debug/imx6ull_clang.config .config   // 配置
make clean      // 先清除一下,否则会提示错误
make  -j  8     // 编译内核,可以得到out/imx6ull/liteos.bin
make  rootfs    // 编译根文件系统,可以得到rootfs.img
cp  out/imx6ull/rootfs.img out/imx6ull/rootfs.jffs2 // 改个名易辨认,烧写工具使用rootfs.jffs2

If everything is normal, the result is as follows:
Insert picture description here
The liteos.bin and rootfs.jffs2 obtained above can be directly run using the burning tool.
Please refer to "Part 3 Experience Hongmeng Kernel Liteos-a".

Full text download
Technical Exchange Group (
Hongmeng Development/Linux/Embedded/Driver/Data Download) QQ Group: 869222007

Guess you like

Origin blog.csdn.net/thisway_diy/article/details/108666513