Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ff48993c authored by Luis Hector Chavez's avatar Luis Hector Chavez
Browse files

Depend on the ramdisk/root files for BOARD_BUILD_SYSTEM_ROOT_IMAGE

When using BOARD_BUILD_SYSTEM_ROOT_IMAGE, there is no direct dependency
on the files that get typically added to the ramdisk.img apart from the
NOTICE.html dependency that some files have. This change explicitly adds
the ramdisk/root files as a dependencies of system.img so that the image
is recreated any time a file in the ramdisk changes. It also creates the
installed-files-root.txt file.

Bug: 62387674
Test: /init.rc is present in system.img's dependencies
Change-Id: I234cb8d8a648f8963610be519de1b70b7efe1fd7
parent 674454f2
Loading
Loading
Loading
Loading
+19 −1
Original line number Diff line number Diff line
@@ -682,11 +682,23 @@ INTERNAL_RAMDISK_FILES := $(filter $(TARGET_ROOT_OUT)/%, \
	$(ALL_GENERATED_SOURCES) \
	$(ALL_DEFAULT_INSTALLED_MODULES))

INSTALLED_FILES_FILE_ROOT := $(PRODUCT_OUT)/installed-files-root.txt
INSTALLED_FILES_JSON_ROOT := $(INSTALLED_FILES_FILE_ROOT:.txt=.json)
$(INSTALLED_FILES_FILE_ROOT): .KATI_IMPLICIT_OUTPUTS := $(INSTALLED_FILES_JSON_ROOT)
$(INSTALLED_FILES_FILE_ROOT) : $(INTERNAL_RAMDISK_FILES) $(FILESLIST)
	@echo Installed file list: $@
	@mkdir -p $(dir $@)
	@rm -f $@
	$(hide) $(FILESLIST) $(TARGET_ROOT_OUT) > $(@:.txt=.json)
	$(hide) build/make/tools/fileslist_util.py -c $(@:.txt=.json) > $@

$(call dist-for-goals, sdk win_sdk sdk_addon, $(INSTALLED_FILES_FILE_ROOT))

BUILT_RAMDISK_TARGET := $(PRODUCT_OUT)/ramdisk.img

# We just build this directly to the install location.
INSTALLED_RAMDISK_TARGET := $(BUILT_RAMDISK_TARGET)
$(INSTALLED_RAMDISK_TARGET): $(MKBOOTFS) $(INTERNAL_RAMDISK_FILES) | $(MINIGZIP)
$(INSTALLED_RAMDISK_TARGET): $(MKBOOTFS) $(INTERNAL_RAMDISK_FILES) $(INSTALLED_FILES_FILE_ROOT) | $(MINIGZIP)
	$(call pretty,"Target ram disk: $@")
	$(hide) $(MKBOOTFS) -d $(TARGET_OUT) $(TARGET_ROOT_OUT) | $(MINIGZIP) > $@

@@ -1530,6 +1542,12 @@ ifneq (,$(SANITIZE_TARGET))
  endif
endif

# When building a system root image, also add the ramdisk image as a dependency
# to ensure all files in it are built before it is created.
ifeq ($(BOARD_BUILD_SYSTEM_ROOT_IMAGE),true)
  FULL_SYSTEMIMAGE_DEPS += $(INTERNAL_RAMDISK_FILES) $(INSTALLED_FILES_FILE_ROOT)
endif

# -----------------------------------------------------------------
# Final System VINTF manifest including fragments. This is not assembled
# on the device because it depends on everything in a given device
+7 −0
Original line number Diff line number Diff line
@@ -1263,6 +1263,13 @@ else # TARGET_BUILD_APPS
  endif
  endif

  ifeq ($(BOARD_BUILD_SYSTEM_ROOT_IMAGE),true)
    $(call dist-for-goals, droidcore, \
      $(INSTALLED_FILES_FILE_ROOT) \
      $(INSTALLED_FILES_JSON_ROOT) \
    )
  endif

  ifeq ($(EMMA_INSTRUMENT),true)
    $(JACOCO_REPORT_CLASSES_ALL) : $(INSTALLED_SYSTEMIMAGE)
    $(call dist-for-goals, dist_files, $(JACOCO_REPORT_CLASSES_ALL))