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

Commit 873525e2 authored by Alexandre Roux's avatar Alexandre Roux Committed by Romain Hunault
Browse files

Option to build no boot image


(cherry picked from commit ef900586)
parent 5a4c72ea
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -3980,6 +3980,7 @@ endif
	$(hide) cp $(SELINUX_FC) $(zip_root)/META/file_contexts.bin
	$(hide) echo "recovery_api_version=$(PRIVATE_RECOVERY_API_VERSION)" > $(zip_root)/META/misc_info.txt
	$(hide) echo "fstab_version=$(PRIVATE_RECOVERY_FSTAB_VERSION)" >> $(zip_root)/META/misc_info.txt

ifdef BOARD_FLASH_BLOCK_SIZE
	$(hide) echo "blocksize=$(BOARD_FLASH_BLOCK_SIZE)" >> $(zip_root)/META/misc_info.txt
endif
@@ -3989,6 +3990,12 @@ endif
ifeq ($(INSTALLED_RECOVERYIMAGE_TARGET),)
	$(hide) echo "no_recovery=true" >> $(zip_root)/META/misc_info.txt
endif
ifeq ($(TARGET_NO_BOOTIMAGE),true)
	$(hide) echo "no_boot=true" >> $(zip_root)/META/misc_info.txt
else
	$(hide) echo "no_boot=false" >> $(zip_root)/META/misc_info.txt
endif

ifdef BOARD_INCLUDE_RECOVERY_DTBO
	$(hide) echo "include_recovery_dtbo=true" >> $(zip_root)/META/misc_info.txt
endif
+13 −9
Original line number Diff line number Diff line
@@ -733,6 +733,8 @@ def AddImagesToTargetFiles(filename):

  has_recovery = OPTIONS.info_dict.get("no_recovery") != "true"

  has_boot = OPTIONS.info_dict.get("no_boot") != "true"

  # {vendor,odm,product,product_services}.img are unlike system.img or
  # system_other.img. Because it could be built from source, or dropped into
  # target_files.zip as a prebuilt blob. We consider either of them as
@@ -781,6 +783,8 @@ def AddImagesToTargetFiles(filename):

  banner("boot")
  # common.GetBootableImage() returns the image directly if present.
  boot_image = None
  if(has_boot):
    boot_image = common.GetBootableImage(
        "IMAGES/boot.img", "boot.img", OPTIONS.input_tmp, "BOOT")
    # boot.img may be unavailable in some targets (e.g. aosp_arm64).
+2 −1
Original line number Diff line number Diff line
@@ -779,7 +779,8 @@ def GetBootableImage(name, prebuilt_name, unpack_dir, tree_subdir,

  if info_dict is None:
    info_dict = OPTIONS.info_dict

  if info_dict["no_boot"] == "true" and prebuilt_name == "boot.img":
     return None
  # With system_root_image == "true", we don't pack ramdisk into the boot image.
  # Unless "recovery_as_boot" is specified, in which case we carry the ramdisk
  # for recovery.
+7 −6
Original line number Diff line number Diff line
@@ -992,7 +992,7 @@ def WriteFullOTAPackage(input_zip, output_file):
      input_tmp=OPTIONS.input_tmp,
      metadata=metadata,
      info_dict=OPTIONS.info_dict)

  if target_info["no_boot"] != "true":
    assert HasRecoveryPatch(input_zip)

  # Assertions (e.g. downgrade check, device properties check).
@@ -1100,6 +1100,7 @@ else if get_stage("%(bcb_dev)s") == "3/3" then

  boot_img = common.GetBootableImage(
      "boot.img", "boot.img", OPTIONS.input_tmp, "BOOT")
  if boot_img != None:
    common.CheckSize(boot_img.data, "boot.img", target_info)
    common.ZipWriteStr(output_zip, "boot.img", boot_img.data)

@@ -1108,7 +1109,7 @@ else if get_stage("%(bcb_dev)s") == "3/3" then
  if OPTIONS.backuptool:
    script.ShowProgress(0.02, 10)
    script.RunBackup("restore", sysmount, target_info.get('use_dynamic_partitions') == "true")

  if boot_img != None:
    script.WriteRawImage("/boot", "boot.img")

  script.ShowProgress(0.1, 10)