Skip to content

Commit f990567

Browse files
authored
Merge pull request qualcomm-linux#36 from ndechesne/emmc
Prepare support for platforms variants
2 parents cbd3b8e + 5058a64 commit f990567

File tree

3 files changed

+15
-13
lines changed

3 files changed

+15
-13
lines changed

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
platforms/*/*.xml
2-
platforms/*/*.bin
1+
platforms/**/*.xml
2+
platforms/**/*.bin

Makefile

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
TOPDIR := $(PWD)
2-
PLATFORMS := $(foreach platform,$(wildcard platforms/*),$(platform)/gpt)
3-
PARTITIONS_XML := $(foreach platform,$(wildcard platforms/*),$(platform)/partitions.xml)
4-
CONTENTS_XML := $(patsubst %.xml.in,%.xml,$(wildcard platforms/*/contents.xml.in))
2+
PARTITIONS := $(wildcard platforms/*/partitions.conf platforms/*/*/partitions.conf)
3+
PARTITIONS_XML := $(patsubst %.conf,%.xml, $(PARTITIONS))
4+
PLATFORMS := $(patsubst %/partitions.conf,%/gpt, $(PARTITIONS))
5+
6+
CONTENTS_XML_IN := $(wildcard platforms/*/contents.xml.in platforms/*/*/contents.xml.in)
7+
CONTENTS_XML := $(patsubst %.xml.in,%.xml, $(CONTENTS_XML_IN))
58
BINS := gen_contents.py gen_partition.py msp.py ptool.py
69
PREFIX ?= /usr/local
710

gen_contents.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,13 @@ def UpdateMetaData(TemplateRoot, PartitionRoot):
3838
DefaultStorageType = ChipId.get('storage_type')
3939

4040
PhyPartition = PartitionRoot.findall('physical_partition')
41-
PartitionsSet = set()
42-
Partitions = PartitionRoot.findall('physical_partition/partition')
43-
for partition in Partitions:
41+
Partitions = []
42+
for partition in PartitionRoot.findall('physical_partition/partition'):
4443
label = partition.get('label')
4544
filename = partition.get('filename')
4645
if label and filename:
47-
PartitionsSet.add((label, filename))
48-
print(f"PartitionsSet: {PartitionsSet}")
46+
Partitions.append({'label': label, 'filename': filename})
47+
print(f"Partitions: {Partitions}")
4948

5049
def _add_file_elements(parent_element, pathname, file_path_flavor=None):
5150
"""Helper function to add file_name and file_path sub-elements."""
@@ -71,10 +70,10 @@ def _add_file_elements(parent_element, pathname, file_path_flavor=None):
7170
if DownloadFile is not None:
7271
build.remove(DownloadFile)
7372
# Partition entires
74-
for Partition in PartitionsSet:
73+
for Partition in Partitions:
7574
new_download_file = ET.SubElement(build, "download_file")
76-
new_download_file.set("fastboot_complete", Partition[0])
77-
_add_file_elements(new_download_file, Partition[1])
75+
new_download_file.set("fastboot_complete", Partition['label'])
76+
_add_file_elements(new_download_file, Partition['filename'])
7877
# GPT Main & GPT Backup entries
7978
for PhysicalPartitionNumber in range(0, len(PhyPartition)):
8079
new_download_file = ET.SubElement(build, "download_file")

0 commit comments

Comments
 (0)