2018年5月10日 星期四

Compiling specific parts of a ROM

Source https://forum.xda-developers.com/showthread.php?t=2620389

To compile an app-
Code:
make app_name.apk -j4
Wait, there's some more things you must know for compiling a *specific app* ! Thanks to @thewisenerd head over to this post

To compile other parts you also need to enter the folder name, here are some examples from /frameworks/base [Credits-XDA University Article]

Code:
make android.policy        (the power menu and lockscreen)
make framework             (the initial framework files)
make framework-res         (the initial framework resources)
make services              (the services.jar file)
More examples:

Code:
make sdk                   (builds the android sdk)
make modules               (builds all modules)
make installclean          (removes all staging directories, such as out/target/product/boardname/system)
make clean                 (removes the whole /out directory)
make recoveryimage         (builds the recovery from /bootable/recovery, customizable if wanted!)
Configuring a new Product for the AOSP.
Again, I'd recommend you to have a look at this great document.

A detail information about BoardConfig.mk
Well, I believe that BoardConfig.mk is one of the most important files for the device tree. Now, here are few parameters of the file explained-
  • TARGET_ARCH: set to arm for almost all current Android devices.
  • BOARD_KERNEL_CMDLINE: not all devices pass boot parameters however if your device does this must be filled out properly in order to bootsuccessfully.
  • BOARD_KERNEL_PAGESIZE: the pagesize of the stock boot.img and must be set properly in order to boot. Typical values for this are 2048 and 4096 and this information can be extracted from the stock kernel.
  • BOARD_BOOTIMAGE_PARTITION_SIZE: the number of bytes allocated to the kernel image partition.
  • BOARD_RECOVERYIMAGE_PARTITION_SIZE: the number of bytes allocated to the recovery image partition.
  • BOARD_SYSTEMIMAGE_PARTITION_SIZE: the number of bytes allocated to the Android system filesystem partition.
  • BOARD_USERDATAIMAGE_PARTITION_SIZE: the number of bytes allocated to the Android data filesystem partition.
    ^The above information can be gathered by multiplying the size from /proc/partitions by the block size, typically 1024.
  • BOARD_HAS_NO_SELECT_BUTTON: (optional), use this if your device needs to use its Power button to confirm selections in recovery.
  • BOARD_FORCE_RAMDISK_ADDRESS / BOARD_MKBOOTIMG_ARGS: (optional), use these to force a specific address for the ramdisk. This is usually needed on larger partitions in order for the ramdisk to be loaded properly where it's expected to exist. This value can be obtained from the stock kernel. The former is deprecated as of Android 4.2.x and the latter will now be used in 4.2.x and beyond.

沒有留言: