582 Commits
Author SHA1 Message Date
Igor Opaniuk ba46b53f39 Merge pull request #336 from bhavyaVeera/add-qsahara-error-descriptions
sahara: describe status codes in end-of-image and done packets
2026-10-05 21:32:36 +02:00
Veera, Bhavya 737840b1e1 sahara: describe status codes in end-of-image and done packets
Sahara end-of-image and done packets report compact status values from
the target. Including protocol-defined end-of-image descriptions and
the done transfer state alongside the numeric values makes
authentication, hash verification, and transfer-completion results
easier to identify from logs.

Add descriptions for Sahara status codes when logging end-of-image
results, and print done status as pending or complete.

Signed-off-by: Veera, Bhavya <bveera@qti.qualcomm.com>
2026-10-05 23:44:37 +05:30
Igor Opaniuk afddc7d588 Merge pull request #323 from igoropaniuk/refactor/flash-cli
qdl: split the flashing front-end from the CLI plumbing
2026-10-02 21:11:04 +02:00
Igor Opaniuk e7f8f2fc87 Merge pull request #322 from JohnSagaQuic/UFS_Provisioning_EID
firehose: treat -ENODEV on commit=1 as success after UFS provisioning
2026-10-02 19:56:13 +02:00
Zhirong Chen 3797094362 firehose: treat -ENODEV on commit=1 as success after UFS provisioning
Some UFS programmers reset the device right after committing the
configuration descriptor, dropping the USB link before sending the
ACK, so qdl reports a failure although provisioning succeeded.

Map LIBUSB_ERROR_NO_DEVICE to -ENODEV in usb_read() and, when the
device disappears after commit=1, treat it as success and skip the
final reset. Any real descriptor error would already have been
NAKed during the earlier exchange. A disconnect during the commit=0
dry run remains a hard error.

Signed-off-by: Zhirong Chen <zhirongc@qti.qualcomm.com>
2026-10-02 19:47:45 +02:00
Igor Opaniuk 07a6b5740d Merge pull request #333 from igoropaniuk/fix/meson_lower_version
meson: lower the required meson version to 0.56
2026-10-01 18:26:24 +02:00
Igor Opaniuk b7fdbaecd2 tests: add cli argument parsing tests
With qdl_parse_args() in cli.c it is now unit testable. Cover the
option-to-struct mapping for valid inputs: the defaults, storage and
backend selection, --dry-run/--create-digests pinning the SIM backend
(and a later --backend being ignored), the skipblock mode, the flag
and value options, and that --help/--version report "done" while
too-few positional arguments report a usage error.

Invalid storage/backend/skipblock values errx() out of the process
and so are
left to the integration tests.

Signed-off-by: Igor Opaniuk <igor.opaniuk@oss.qualcomm.com>
2026-10-01 10:54:22 +02:00
Igor Opaniuk ebb28bf027 cli: extract argument parsing into its own module
With qdl_parse_args() self-contained, move it plus print_usage() and
the shared long-option ids into cli.c, out of main()'s compilation
unit, so unit tests can link the option parser directly.

Signed-off-by: Igor Opaniuk <igor.opaniuk@oss.qualcomm.com>
2026-10-01 10:53:46 +02:00
Igor Opaniuk c0688c775d qdl: split qdl_flash into argument parsing, op-list build and run
qdl_flash() mixed three concerns in 330 lines: option decoding, the
positional-argument walk and the device session. Split them into
qdl_parse_args() (filling struct qdl_opts), qdl_build_op_list() and a
plain session sequence, so each can be reasoned about - and tested -
alone. Options, messages and run order are unchanged; the op-list
builder takes the options mutably because the reset verb overrides
skip-reset.

Signed-off-by: Igor Opaniuk <igor.opaniuk@oss.qualcomm.com>
2026-10-01 10:53:46 +02:00
Igor Opaniuk a45bf832cd tests: add read and patch XML loader unit tests
patch_load_xml() and read_op_load() turn XML into firehose op lists
and had no direct coverage. Add a cmocka suite (linking util.c for
the real attribute accessors and stubbing the device/ux layers) that
checks a valid entry produces the expected op, that an unrecognized
child tag is skipped, and - locking in the recently fixed error
propagation - that a malformed entry or a missing file makes the
loader return an error instead of reporting success.

Signed-off-by: Igor Opaniuk <igor.opaniuk@oss.qualcomm.com>
2026-10-01 10:53:46 +02:00
quic-kdybcio a229ad0dc9 Merge pull request #321 from igoropaniuk/fix/debug-timestamps
ux: add consistent timestamps to debug diagnostics
2026-10-01 10:45:21 +02:00
Igor Opaniuk 1c777e2d77 vip: prefix all diagnostics with VIP:
Sahara and Firehose traces carry a "SAHARA: " or "FIREHOSE: " tag, but
most VIP messages have none and the few that do mix "VIP:" with a bare
"VIP TABLE DIGESTS" or a Firehose-tagged packet digest.

Prefix every message from vip.c and the VIP negotiation in firehose.c
with "VIP: ", drop the now redundant "VIP" from message bodies, and
move the packet digest trace under the VIP tag since it belongs to
table generation. The sim's own "sim: VIP ..." messages keep their
prefix.

Signed-off-by: Igor Opaniuk <igor.opaniuk@oss.qualcomm.com>
2026-10-01 10:30:41 +02:00
Igor Opaniuk 6bd50388af oscompat: drop the unused err/warn shims
All diagnostics go through the ux_warn()/ux_die() helpers now, so the
err(3)-style shims and the <err.h> include are dead code.

Signed-off-by: Igor Opaniuk <igor.opaniuk@oss.qualcomm.com>
2026-10-01 10:27:58 +02:00
Igor Opaniuk c7a4e6b56d firehose: tag all traces with a FIREHOSE: prefix
Sahara diagnostics are now tagged "SAHARA: ", while the Firehose
traces use a mix of "FIREHOSE READ:", "FIREHOSE WRITE:" and a bare
"LOG:" for device log lines, so the two stages do not line up in a
debug log.

Use "FIREHOSE: <TAG>: " for every Firehose trace, including device
logs and raw binary writes, so all protocol output
follows the same "<STAGE>: " format.

Signed-off-by: Igor Opaniuk <igor.opaniuk@oss.qualcomm.com>
2026-10-01 10:27:58 +02:00
Igor Opaniuk b6d0f88de7 sahara: prefix all diagnostics with SAHARA:
Firehose traces are tagged FIREHOSE READ/WRITE, but Sahara messages
such as "HELLO version" or "READ image" carry no hint of where they
come from, and only a few had an ad-hoc "Sahara:" prefix. In a
timestamped debug log this makes the two protocol stages hard to tell
apart.

Prefix every message emitted by sahara.c with "SAHARA: ", fold the
existing ad-hoc prefixes into it, and drop the now redundant "Sahara"
from message bodies. The chipinfo report table is command output
rather than a diagnostic and is left unchanged.

Signed-off-by: Igor Opaniuk <igor.opaniuk@oss.qualcomm.com>
2026-10-01 10:21:20 +02:00
Igor Opaniuk b95f0946d2 firehose: trace XML messages on a single debug line
libxml2 dumps a document with a newline after the declaration and at
the end, and some devices terminate their responses the same way. With
timestamped debug output every FIREHOSE WRITE therefore spans two lines
and is followed by a blank one, which makes the trace hard to scan.

Strip newlines from the XML before printing so each read and write is
one line, matching how devices format their responses.

Signed-off-by: Igor Opaniuk <igor.opaniuk@oss.qualcomm.com>
2026-10-01 10:21:20 +02:00
Igor Opaniuk ee3d93fc22 ux: route remaining diagnostics through shared logging
USB warnings, Sahara ramdump failures, fatal CLI and archive errors,
and packet hex dumps bypass the ux helpers, so they never get a
--debug timestamp and leave gaps in the protocol timeline.

Route them through shared logging via new warn and die helpers that
keep the program-name prefix, errno text, and exit status. Output
without --debug is unchanged and hex dumps stay visible in both modes.

Signed-off-by: Igor Opaniuk <igor.opaniuk@oss.qualcomm.com>
2026-10-01 10:21:20 +02:00
Igor Opaniuk 65711e63a1 ux: own the program name used in diagnostics
The error prefix comes from __progname, a BSD-ism that glibc and the
Apple libc export but Windows lacks, so qdl.c and every unit test that
links util.c define their own copy. The nbdkit plugin links neither.

Keep the name in ux.c with a "qdl" default and set it through
ux_set_progname(): from argv[0] in main() and from the plugin's load
hook. Move print_version() into qdl.c, its only caller, so util.c and
the tests no longer need the symbol.

Signed-off-by: Igor Opaniuk <igor.opaniuk@oss.qualcomm.com>
2026-10-01 10:21:20 +02:00
Igor Opaniuk c6774482b6 ux: timestamp messages in debug mode
Debug logs give no indication of when a message was emitted, which
makes stalls and timeouts hard to pin down and host activity hard to
correlate with device logs.

Prefix every message with the local time at millisecond resolution
when --debug is enabled. Keep multi-line messages aligned and track
partial lines per stream so split messages stay readable. Output
without --debug is unchanged.

Signed-off-by: Igor Opaniuk <igor.opaniuk@oss.qualcomm.com>
2026-10-01 10:21:19 +02:00
quic-kdybcio ceec044853 Merge pull request #329 from igoropaniuk/doc/readme-restructure
README: refresh and split into docs/
2026-09-30 15:31:29 +02:00
Igor Opaniuk 6e7fe73d3c meson: lower the required meson version to 0.56
qdl cannot be packaged for EPEL 9, because RHEL 9 ships meson 0.63.3
and the build stops at the version check:

  meson.build:1:0: ERROR: Meson version is 0.63.3 but project
  requires >=1.1.0

The only thing in the build actually requiring meson 1.1 is the
meson.options file name. The build rules themselves need nothing newer
than project_source_root() and project_build_root() from 0.56. Rename
the options file to the older meson_options.txt spelling, which every
meson version understands, and lower the floor to what the rules
require.

Verified by building with meson 0.56.2 (the new floor), 0.63.3 (EL9)
and 1.10.1, each with the zip container both enabled and disabled.

Signed-off-by: Igor Opaniuk <igor.opaniuk@oss.qualcomm.com>
2026-09-30 12:03:36 +02:00
Igor Opaniuk 8f3446f76a README: drop the Repology packaging badge
The repology.org service is no longer available, so the badge renders
as broken. Remove it; the Debian package badge still shows distribution
packaging status.

Signed-off-by: Igor Opaniuk <igor.opaniuk@oss.qualcomm.com>
2026-09-29 18:03:25 +02:00
Igor Opaniuk 76f4d5ed23 README: separate top-level sections with horizontal rules
Top-level sections ran straight into each other when rendered. Put a
horizontal rule before each one so the boundaries are visible.

Signed-off-by: Igor Opaniuk <igor.opaniuk@oss.qualcomm.com>
2026-09-29 17:59:54 +02:00
Igor Opaniuk fa60a80e42 doc: move specialised README sections into docs/
The README had grown into one long page where the basic flashing
workflow was buried between VIP, multi-programmer, ramdump, kickstart,
WSL2 and raw sector guides. Keep only the generic material in the
README and move each specialised workflow into its own file under
docs/, linked from a new "Documentation" index. The moved text is
unchanged apart from heading levels and two cross-references.

Signed-off-by: Igor Opaniuk <igor.opaniuk@oss.qualcomm.com>
2026-09-29 17:59:54 +02:00
Igor Opaniuk 805f44bde5 README: refresh stale build and usage information
Add the cmocka package to every install list (unit tests are silently
skipped without it) and describe all meson feature options in one
place. Replace the fixed product ID list with the vendor ID based
matching qdl actually performs, and filter the usbipd re-attach snippet
on the vendor ID as well. Document the usb/qud/auto device backends, the
test suites, the remaining flashing options and the erase, sha256,
chipinfo and reset commands.

Signed-off-by: Igor Opaniuk <igor.opaniuk@oss.qualcomm.com>
2026-09-29 17:59:54 +02:00