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

Commit acd740cf authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Fix non-AB ota generation failure" into main

parents d22a5558 782b7528
Loading
Loading
Loading
Loading
+12 −3
Original line number Diff line number Diff line
@@ -16,6 +16,15 @@ import re

import common

# map recovery.fstab's fs_types to mount/format "partition types"
PARTITION_TYPES = {
    "ext4": "EMMC",
    "emmc": "EMMC",
    "f2fs": "EMMC",
    "squashfs": "EMMC",
    "erofs": "EMMC"
}


class ErrorCode(object):
  """Define error_codes for failures that happen during the actual
@@ -268,7 +277,7 @@ class EdifyGenerator(object):
      if p.context is not None:
        mount_flags = p.context + ("," + mount_flags if mount_flags else "")
      self.script.append('mount("%s", "%s", %s, "%s", "%s");' % (
          p.fs_type, common.PARTITION_TYPES[p.fs_type],
          p.fs_type, PARTITION_TYPES[p.fs_type],
          self._GetSlotSuffixDeviceForEntry(p),
          p.mount_point, mount_flags))
      self.mounts.add(p.mount_point)
@@ -304,7 +313,7 @@ class EdifyGenerator(object):
    if fstab:
      p = fstab[partition]
      self.script.append('format("%s", "%s", %s, "%s", "%s");' %
                         (p.fs_type, common.PARTITION_TYPES[p.fs_type],
                         (p.fs_type, PARTITION_TYPES[p.fs_type],
                          self._GetSlotSuffixDeviceForEntry(p),
                          p.length, p.mount_point))

@@ -418,7 +427,7 @@ class EdifyGenerator(object):
    fstab = self.fstab
    if fstab:
      p = fstab[mount_point]
      partition_type = common.PARTITION_TYPES[p.fs_type]
      partition_type = PARTITION_TYPES[p.fs_type]
      device = self._GetSlotSuffixDeviceForEntry(p)
      args = {'device': device, 'fn': fn}
      if partition_type == "EMMC":
+6 −16
Original line number Diff line number Diff line
@@ -26,7 +26,7 @@ import shlex

import common
import edify_generator
from edify_generator import ErrorCode
from edify_generator import ErrorCode, PARTITION_TYPES
from check_target_files_vintf import CheckVintfIfTrebleEnabled, HasPartition
from common import OPTIONS, Run, MakeTempDir, RunAndCheckOutput, ZipWrite, MakeTempFile
from ota_utils import UNZIP_PATTERN, FinalizeMetadata, GetPackageMetadata, PropertyFiles
@@ -1544,16 +1544,6 @@ class DynamicPartitionsDifference(object):
        append('move %s %s' % (p, u.tgt_group))


# map recovery.fstab's fs_types to mount/format "partition types"
PARTITION_TYPES = {
    "ext4": "EMMC",
    "emmc": "EMMC",
    "f2fs": "EMMC",
    "squashfs": "EMMC",
    "erofs": "EMMC"
}


def GetTypeAndDevice(mount_point, info, check_no_slot=True):
  """
  Use GetTypeAndDeviceExpr whenever possible. This function is kept for