Skip to content

For linux msm/create sahara archive - #303

Open
quic-bjorande wants to merge 2 commits into
linux-msm:masterfrom
quic-bjorande:for-linux-msm/create-sahara-archive
Open

For linux msm/create sahara archive#303
quic-bjorande wants to merge 2 commits into
linux-msm:masterfrom
quic-bjorande:for-linux-msm/create-sahara-archive

Conversation

@quic-bjorande

@quic-bjorande quic-bjorande commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

QDL was taught to consume Sahara payload from a custom cpio-package, but no convenient tooling was provided to generate such files.

Introduce a mechanism that allow such archive to be created directly from a contents.xml file or a list of images.

@quic-bjorande
quic-bjorande requested a review from a team as a code owner August 10, 2026 21:10
Comment thread src/qdl.c Fixed
Multi-payload Sahara targets can already consume a programmer archive,
but creating one required users to assemble the archive by hand.

Reuse the existing programmer, Sahara XML, and contents.xml parsing
paths to build the image map and write the archive from QDL itself.

Signed-off-by: Bjorn Andersson <bjorn.andersson@oss.qualcomm.com>
Exercise the sahara-archive command through the built qdl binary. Cover
the supported programmer map, Sahara XML, contents.xml, and archive input
forms, and verify that invalid inputs do not create output archives.

Parse the generated archive in the test itself so the coverage does not
depend on an external cpio implementation.

Signed-off-by: Bjorn Andersson <bjorn.andersson@oss.qualcomm.com>
@quic-bjorande
quic-bjorande force-pushed the for-linux-msm/create-sahara-archive branch from 9495c57 to c565784 Compare August 10, 2026 21:16
Comment thread src/qdl.c

ret = sahara_archive_write_entry(out, ino++, "TRAILER!!!", NULL, 0);

out_close:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A failed write leaves a truncated archive behind, should we also remove(filename) in case of error?

Comment thread src/qdl.c
}

if (qdl_is_contents_xml(filename)) {
ret = contents_load_programmers(filename, specifier, images);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

contents_load_programmers() decodes the selector (so contents.xml::ufs parses fine and errors are reported), but seems contents_find_programmers() never sees it - it walks the entry list unfiltered and returns the first programmer XML it finds. So ::ufs and ::emmc produce byte-identical archives with no hint that the selector was ignored.

@igoropaniuk

Copy link
Copy Markdown
Contributor

two comments, none blocking, apart of this LGTM

Comment thread src/qdl.c
fprintf(out, " %s ks [-p <sahara-dev-node> | --serial=T] -s <id:file-path>...\n", __progname);
fprintf(out, " %s flash (<flashmap>[::specifier] | <contents>[::<specifier>])\n", __progname);
fprintf(out, " %s create-zip <zipfile> <contents>[::<specifier>]\n", __progname);
fprintf(out, " %s sahara-archive <archive.bin> "

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

create-sahara-archive maybe? so it aligns with create-zip naming

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants