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

Commit d489a138 authored by Jesse Chan's avatar Jesse Chan Committed by Michael Bestas
Browse files

releasetools: support dynamic partitions for backuptool



Change-Id: I4a04e52f64e307a9852d786aabf17975a020b4b8
Signed-off-by: default avatarJesse Chan <jc@lineageos.org>
parent bd80e0ca
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
@@ -156,9 +156,14 @@ class EdifyGenerator(object):
           ");")
    self.script.append(self.WordWrap(cmd))

  def RunBackup(self, command, mount_point):
  def RunBackup(self, command, mount_point, dynamic=False):
    if self.fstab:
      p = self.fstab[mount_point]
    if dynamic:
      self.script.append(('run_program("/tmp/install/bin/backuptool.sh", "%s", map_partition("%s"), "%s");' % (
          command, p.device, p.fs_type)))
      self.script.append(('unmap_partition("%s");' % (p.device)))
    else:
      self.script.append(('run_program("/tmp/install/bin/backuptool.sh", "%s", "%s", "%s");' % (
          command, p.device, p.fs_type)))

+2 −2
Original line number Diff line number Diff line
@@ -835,7 +835,7 @@ else if get_stage("%(bcb_dev)s") == "3/3" then
    sysmount = "/system"

  if OPTIONS.backuptool:
    script.RunBackup("backup", sysmount)
    script.RunBackup("backup", sysmount, target_info.get('use_dynamic_partitions') == "true")

  # All other partitions as well as the data wipe use 10% of the progress, and
  # the update of the system partition takes the remaining progress.
@@ -871,7 +871,7 @@ else if get_stage("%(bcb_dev)s") == "3/3" then

  if OPTIONS.backuptool:
    script.ShowProgress(0.02, 10)
    script.RunBackup("restore", sysmount)
    script.RunBackup("restore", sysmount, target_info.get('use_dynamic_partitions') == "true")

  script.WriteRawImage("/boot", "boot.img")