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

Commit dde5f11e authored by Bryan Henry's avatar Bryan Henry Committed by Gerrit Code Review
Browse files

Merge changes from topic "sign_target_files_iot-aosp"

* changes:
  Write combined bpt definition directly into META/partition-table.bpt
  Support regenerating partition table with bpttool in sign_target_files_apks
  Don't suppress stderr for 'avbtool make_vbmeta_image'
  Include default Android Things AVB keys in otatools.zip
parents 5f7e4f6b f130a239
Loading
Loading
Loading
Loading
+3 −0
Original line number Original line Diff line number Diff line
@@ -2352,6 +2352,7 @@ OTATOOLS := $(HOST_OUT_EXECUTABLES)/minigzip \
  $(HOST_OUT_EXECUTABLES)/delta_generator \
  $(HOST_OUT_EXECUTABLES)/delta_generator \
  $(AVBTOOL) \
  $(AVBTOOL) \
  $(BLK_ALLOC_TO_BASE_FS) \
  $(BLK_ALLOC_TO_BASE_FS) \
  $(BPTTOOL) \
  $(BROTLI) \
  $(BROTLI) \
  $(BUILD_VERITY_METADATA) \
  $(BUILD_VERITY_METADATA) \
  $(BUILD_VERITY_TREE)
  $(BUILD_VERITY_TREE)
@@ -2401,6 +2402,8 @@ $(BUILT_OTATOOLS_PACKAGE): zip_root := $(call intermediates-dir-for,PACKAGING,ot


OTATOOLS_DEPS := \
OTATOOLS_DEPS := \
  system/extras/ext4_utils/mke2fs.conf \
  system/extras/ext4_utils/mke2fs.conf \
  external/avb/test/data/atx_metadata.bin \
  external/avb/test/data/testkey_atx_psk.pem \
  external/avb/test/data/testkey_rsa4096.pem \
  external/avb/test/data/testkey_rsa4096.pem \
  $(sort $(shell find system/update_engine/scripts -name \*.pyc -prune -o -type f -print)) \
  $(sort $(shell find system/update_engine/scripts -name \*.pyc -prune -o -type f -print)) \
  $(sort $(shell find build/target/product/security -type f -name \*.x509.pem -o -name \*.pk8 -o \
  $(sort $(shell find build/target/product/security -type f -name \*.x509.pem -o -name \*.pk8 -o \
+9 −7
Original line number Original line Diff line number Diff line
@@ -415,9 +415,10 @@ def AddVBMeta(output_zip, partitions):
        assert found, 'failed to find %s' % (image_path,)
        assert found, 'failed to find %s' % (image_path,)
    cmd.extend(split_args)
    cmd.extend(split_args)


  p = common.Run(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
  p = common.Run(cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
  p.communicate()
  stdoutdata, _ = p.communicate()
  assert p.returncode == 0, "avbtool make_vbmeta_image failed"
  assert p.returncode == 0, \
      "avbtool make_vbmeta_image failed:\n{}".format(stdoutdata)
  img.Write()
  img.Write()




@@ -427,7 +428,7 @@ def AddPartitionTable(output_zip):
  img = OutputFile(
  img = OutputFile(
      output_zip, OPTIONS.input_tmp, "IMAGES", "partition-table.img")
      output_zip, OPTIONS.input_tmp, "IMAGES", "partition-table.img")
  bpt = OutputFile(
  bpt = OutputFile(
      output_zip, OPTIONS.input_tmp, "IMAGES", "partition-table.bpt")
      output_zip, OPTIONS.input_tmp, "META", "partition-table.bpt")


  # use BPTTOOL from environ, or "bpttool" if empty or not set.
  # use BPTTOOL from environ, or "bpttool" if empty or not set.
  bpttool = os.getenv("BPTTOOL") or "bpttool"
  bpttool = os.getenv("BPTTOOL") or "bpttool"
@@ -444,9 +445,10 @@ def AddPartitionTable(output_zip):
  if args:
  if args:
    cmd.extend(shlex.split(args))
    cmd.extend(shlex.split(args))


  p = common.Run(cmd, stdout=subprocess.PIPE)
  p = common.Run(cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
  p.communicate()
  stdoutdata, _ = p.communicate()
  assert p.returncode == 0, "bpttool make_table failed"
  assert p.returncode == 0, \
      "bpttool make_table failed:\n{}".format(stdoutdata)


  img.Write()
  img.Write()
  bpt.Write()
  bpt.Write()
+9 −0
Original line number Original line Diff line number Diff line
@@ -222,6 +222,15 @@ def LoadInfoDict(input_file, input_dir=None):
            vendor_base_fs_file,))
            vendor_base_fs_file,))
        del d["vendor_base_fs_file"]
        del d["vendor_base_fs_file"]


    # If board_bpt_input_files property is defined then bpttool is being used to
    # generate the partition table. When signing target-files, the combined
    # partition table definition is copied into META/partition-table.bpt since
    # the original input files aren't available.
    if "board_bpt_input_files" in d:
      board_bpt_input_files = os.path.join(input_dir, "META", "partition-table.bpt")
      if os.path.exists(board_bpt_input_files):
        d["board_bpt_input_files"] = board_bpt_input_files

  def makeint(key):
  def makeint(key):
    if key in d:
    if key in d:
      d[key] = int(d[key], 0)
      d[key] = int(d[key], 0)