merge_dtbs: Craft unique name for final saved merged trees

Incorporate the hash of a combination of all msm-ids, board-ids, and
pmic-ids of the InnerMergedDeviceTree in the final filenames of the
saved InnerMergedDeviceTrees.

Change-Id: I629e1a274b23d71061c547578d1ddbcf92c8cf79
Signed-off-by: Guru Das Srinagesh <quic_gurus@quicinc.com>
This commit is contained in:
Guru Das Srinagesh
2023-02-27 18:17:54 -08:00
committed by dianlujitao
parent 81c8cad9e8
commit 8e2709c91e

View File

@@ -329,7 +329,10 @@ class InnerMergedDeviceTree(DeviceTreeInfo):
def get_name(self):
ext = os.path.splitext(os.path.basename(self.base))[1]
base_parts = self.filename_to_parts(self.base)
return '-'.join(chain.from_iterable([base_parts] + [self.filename_to_parts(tp.filename, ignored_parts=base_parts) for tp in self.techpacks])) + ext
name_hash = hex(hash((self.plat_id, self.board_id, self.pmic_id)))
name = '-'.join(chain.from_iterable([base_parts] + [self.filename_to_parts(tp.filename, ignored_parts=base_parts) for tp in self.techpacks]))
final_name = '-'.join([name, name_hash]) + ext
return final_name
@staticmethod
def filename_to_parts(name, ignored_parts=[]):