• Ying Wang's avatar
    Support to build image of root file system with /system and ramdisk combined. · a2292c94
    Ying Wang authored
    Added support to build system.img that combines contents of /system and
    the ramdisk, and can be mounted at the root of the file system.
    To enable this feature, define BoardConfig.mk variable:
    BOARD_BUILD_SYSTEM_ROOT_IMAGE := true
    
    Ideally we would just change TARGET_OUT (the path of the staging system
    directory) to under TARGET_ROOT_OUT. But at this point many places in
    the build system assume TARGET_OUT is independent of TARGET_ROOT_OUT and
    we can't make it easily configurable.
    Instead this implementation takes the least intrusive approach:
    We don't change TARGET_OUT or TARGET_ROOT_OUT. We just assemble a
    temporary staging directory that contains contents of both TARGET_OUT
    and TARGET_ROOT_OUT, in build_image.BuildImage() of
    tools/releasetools/build_image.py.
    When build_image.py is directly called from the makefile, we pass in the
    parameters from the global dictionary; when build_image.BuildImage() is
    called from add_img_to_target_files.py, we need to override values to
    point to files extracted from the target_files zip file.
    We need to combine the fs_config files of both /system and ramdisk,
    when fs_config is enabled.
    
    Also this change refactored build_image.BuildImage() by moving the extra
    parameters to the image property dictionary.
    
    (cherry-picked from commit 0eabd4f2)
    
    Bug:19868522
    Change-Id: Iafc467a0e3427b0d6ad3b575abcc98ddcc9ea0f1
    a2292c94
Makefile 72.3 KB