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

Commit b8ae759c authored by Brint E. Kriebel's avatar Brint E. Kriebel
Browse files

releasetools: Properly handle boot images that use dt

Instead of using a prebuilt boot/recovery image, bring the dt image
into the target files package and use it during package creation

Change-Id: I70ecf74423aad95a3eb8e085029c37450ae354a2
parent 389c621d
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -1293,6 +1293,9 @@ $(BUILT_TARGET_FILES_PACKAGE): \
ifdef INSTALLED_KERNEL_TARGET
	$(hide) $(ACP) $(INSTALLED_KERNEL_TARGET) $(zip_root)/RECOVERY/kernel
endif
ifdef INSTALLED_DTIMAGE_TARGET
	$(hide) $(ACP) $(INSTALLED_DTIMAGE_TARGET) $(zip_root)/RECOVERY/dt
endif
ifdef INSTALLED_2NDBOOTLOADER_TARGET
	$(hide) $(ACP) \
		$(INSTALLED_2NDBOOTLOADER_TARGET) $(zip_root)/RECOVERY/second
@@ -1314,6 +1317,9 @@ endif
ifdef INSTALLED_KERNEL_TARGET
	$(hide) $(ACP) $(INSTALLED_KERNEL_TARGET) $(zip_root)/BOOT/kernel
endif
ifdef INSTALLED_DTIMAGE_TARGET
        $(hide) $(ACP) $(INSTALLED_DTIMAGE_TARGET) $(zip_root)/BOOT/dt
endif
ifdef INSTALLED_RAMDISK_TARGET
	$(hide) $(ACP) $(INSTALLED_RAMDISK_TARGET) $(zip_root)/BOOT/ramdisk.img
endif
@@ -1444,7 +1450,6 @@ endif
$(INTERNAL_OTA_PACKAGE_TARGET): $(BUILT_TARGET_FILES_PACKAGE) $(DISTTOOLS)
	@echo "$(OTA_FROM_TARGET_SCRIPT)" > $(PRODUCT_OUT)/ota_script_path
	@echo "$(override_device)" > $(PRODUCT_OUT)/ota_override_device
	@echo "$(BOARD_CUSTOM_BOOTIMG_MK)" > $(PRODUCT_OUT)/ota_custom_bootimg_mk
	@echo -e ${CL_YLW}"Package OTA:"${CL_RST}" $@"
	MKBOOTIMG=$(BOARD_CUSTOM_BOOTIMG_MK) \
	$(OTA_FROM_TARGET_SCRIPT) -v \
+5 −7
Original line number Diff line number Diff line
@@ -300,6 +300,11 @@ def BuildBootableImage(sourcedir, fs_config_file, info_dict=None):
  else:
    cmd = ["mkbootimg", "--kernel", os.path.join(sourcedir, "kernel")]

    fn = os.path.join(sourcedir, "dt")
    if os.access(fn, os.F_OK):
      cmd.append("--dt")
      cmd.append(fn)

    fn = os.path.join(sourcedir, "cmdline")
    if os.access(fn, os.F_OK):
      cmd.append("--cmdline")
@@ -345,13 +350,6 @@ def GetBootableImage(name, prebuilt_name, unpack_dir, tree_subdir,

  prebuilt_dir = os.path.join(unpack_dir, "BOOTABLE_IMAGES")
  prebuilt_path = os.path.join(prebuilt_dir, prebuilt_name)
  custom_bootimg_mk = os.getenv('MKBOOTIMG')
  if custom_bootimg_mk:
    bootimage_path = os.path.join(os.getenv('OUT'), prebuilt_name)
    print "using custom bootimage makefile %s..." % (custom_bootimg_mk,)
    if not os.path.isdir(prebuilt_dir):
        os.mkdir(prebuilt_dir)
    shutil.copyfile(bootimage_path, prebuilt_path)
  if os.path.exists(prebuilt_path):
    print "using prebuilt %s..." % (prebuilt_name,)
    return File.FromLocalFile(name, prebuilt_path)