Compile preloader/lk/kernel/framework module separately in ASOP source code

Compile the preloader separately

  • The main steps
    • cd bootable/bootloader/preloader

    • ./build.sh 2>&1 TARGET_PRODUCT=${PROJECT} | tee preloader_build.log

PROJECT is specified by myself. For example, I specify 8p1bsp, and then several bin files will be generated in the out/target/product/8p1bsp/obj/PRELOADER_OBJ/bin/ directory under the source code directory, among which the preloader_8p1bsp.bin file is the preloader bin file

Compile LK separately

When LK is compiled separately, logo.bin will be compiled again at the same time, which can achieve the purpose of updating the logo bin file.

  • method one
    • cd bootable/bootloader/lk
    • make -j32 ${PROJECT} 2>&1 | tee lk_build.log
    • Copy the LK and LOGO bin files generated under bootable/bootloader/lk/build-${PROJECT}/ to out/target/product/[project]/

PROJECT is specified by yourself. When compiling the entire system, these compilation products will be stored in:
out/target/product/8p1bsp/obj/BOOTLOADER_OBJ/build-8p1bsp
One problem is that this method cannot generate signed img and bin files

  • Method two
    Execute the following command, specify to compile the lk module
    mmm vendor/mediatek/proprietary/bootable/bootloader/lk:lk -j8

The following operations need to be performed before compilation:

  1. Delete the lk and logo in the out\target\product\ project name directory
  2. Delete the bin files of lk and logo in the out\target\product\project name\obj\BOOTLOADER_OBJ\build-project name directory
  3. Delete the logo directory in the out\target\product\project name\obj\BOOTLOADER_OBJ\build-project name\dev directory

After using this method to compile , there will be newly compiled lk.img and logo.bin in the out\target\product\ project name directory and the burned file with signature

Compile the kernel separately

Use the command in the root directory of the ASOP source code:mmm kernel-4.4:kernel -j8

After the compilation is successful, the kernel file will be generated in the out/target/product/project name/ directory

Compile the init module separately

Execute under the root directory of ASOP source code:
mmm system/core/init/

Compile the services module of the framework separately

  • First execute in the framework/base directory
    mmm core/res/ 生成framework-res.apk

  • If there are also changes under framework/base/services/, compile:
    mmm framework/base/services

  • Then compile the framework separately
    mmm frameworks/base

Related output files are in system/framework under the output directory, including:

services.jar
framework-res.apk
framework.jar

You can use the adb command to push these files to the system/framework directory on the device side . If you need to test these two new modules, you need to kill all processes using the module first, and the module will be reloaded after the process restarts.
After the system service is killed, it will usually restart automatically (controlled by init)

Package system.img

Use the following command:
make snod 或 make systemimage-nodeps

Package boot.img

Use the following command:
make boot.img

After the compilation is complete, the signed and unsigned boot.img will be regenerated in the out/target/product/project name/ directory

Guess you like

Origin blog.csdn.net/weixin_41388144/article/details/109406241