From e1cd7290a4e2218748ee479850e6f985ca3d05ee Mon Sep 17 00:00:00 2001 From: Viswanath Kraleti Date: Wed, 13 Aug 2025 15:17:25 +0530 Subject: [PATCH 1/6] Makefile: add clean target and preserve partitions.xml To improve build hygiene and to ensure partitions.xml is retained, - Add paritions.xml to the list of build targets to ensure the generated files are not automatically deleted. - Add 'clean' target to remove generated XML and binary files on demand. Signed-off-by: Viswanath Kraleti --- Makefile | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index bfd072f..1912a30 100644 --- a/Makefile +++ b/Makefile @@ -1,11 +1,12 @@ TOPDIR := $(PWD) PLATFORMS := $(foreach platform,$(wildcard platforms/*),$(platform)/gpt) +PARTITIONS_XML := $(foreach platform,$(wildcard platforms/*),$(platform)/partitions.xml) BINS := gen_partition.py msp.py ptool.py PREFIX ?= /usr/local -.PHONY: all check lint integration +.PHONY: all check clean lint integration -all: $(PLATFORMS) +all: $(PLATFORMS) $(PARTITIONS_XML) %/gpt: %/partitions.xml cd $(shell dirname $^) && $(TOPDIR)/ptool.py -x partitions.xml @@ -26,3 +27,6 @@ check: lint integration install: $(BINS) install -d $(DESTDIR)$(PREFIX)/bin install -m 755 $^ $(DESTDIR)$(PREFIX)/bin + +clean: + @rm -f platforms/*/*.xml platforms/*/*.bin From 8c07231cf0ee5effa92876338ff963e42f5e8fac Mon Sep 17 00:00:00 2001 From: Viswanath Kraleti Date: Wed, 13 Aug 2025 15:46:29 +0530 Subject: [PATCH 2/6] gen_contents.py: Add utility to generate contents.xml gen_contents.py accepts a contents template and partition.xml as inputs and generates 'contents.xml' by updating image information in a format compatible with Axiom for automatic image flashing. Signed-off-by: Viswanath Kraleti --- gen_contents.py | 148 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 148 insertions(+) create mode 100755 gen_contents.py diff --git a/gen_contents.py b/gen_contents.py new file mode 100755 index 0000000..3fafbfc --- /dev/null +++ b/gen_contents.py @@ -0,0 +1,148 @@ +#!/usr/bin/env python3 +# Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries. +# SPDX-License-Identifier: BSD-3-Clause + +import getopt +import sys + +from xml.etree import ElementTree as ET + + +def usage(): + print(("\n\tUsage: %s -t