Skip to content

Make QDTE usable headless and cross-platform#5

Open
Igor Opaniuk (igoropaniuk) wants to merge 7 commits into
qualcomm:mainfrom
igoropaniuk:feature/headless-ci
Open

Make QDTE usable headless and cross-platform#5
Igor Opaniuk (igoropaniuk) wants to merge 7 commits into
qualcomm:mainfrom
igoropaniuk:feature/headless-ci

Conversation

@igoropaniuk

@igoropaniuk Igor Opaniuk (igoropaniuk) commented Jun 23, 2026

Copy link
Copy Markdown

This series makes QDTE's --nogui flow run reliably on Linux/macOS hosts, minimal Yocto native sysroots, and CI containers - which is what downstream automation (image builds, signing pipelines) actually depends on.

The headless fixes drop mandatory GUI-only dependencies (fs/pyfatfs, Tcl/Tk) and stop the startup path from dereferencing Windows-only state (the QUTS install path), so importing and running the tool no longer requires a desktop environment or the internal pyfdt fork.

The remaining fixes restore correctness for real-world use: zero-arg to_dtb() compatibility with public pyfdt 0.3, hex/oct/bin literals in --modify word values, and launching the GUI on non-Windows platforms.

Finally, a Github workflow definition added in ci: add headless --nogui smoke tests exercises the full --nogui flow end to end against real xbl_config.elf/uefi_dtbs.elf containers, mitigating the risk of silent regressions - especially as more intrusive changes (e.g. the planned GUI/headless split) are on the roadmap.

The NON-HLOS.bin FAT browser is GUI-only, yet controller.py imported it
unconditionally just to resolve the DTGUIController base class. That
pulled fs/pyfatfs into every headless run and made --nogui fail to import
on minimal sysroots (Yocto native, CI) that have no reason to ship those
packages. Import it lazily and stub the base class when absent.

Signed-off-by: Igor Opaniuk <igor.opaniuk@oss.qualcomm.com>
QDTE imports tkinter at module load across many files and defines widget
subclasses at class-definition time, so merely importing the controller
requires Tcl/Tk -- even when no window is ever created. That made --nogui
unusable on headless hosts (Yocto native sysroots, CI containers) where
Tk is not present. Install a permissive tkinter stub before any QDTE
module loads when --nogui is requested; GUI mode is untouched.

Signed-off-by: Igor Opaniuk <igor.opaniuk@oss.qualcomm.com>
flags.global_info only defines the "quts2" install path on Windows, but
the startup probe dereferenced it unconditionally. On Linux that raised
KeyError before any QDTE logic ran, so the tool could not start at all.
Check for the key before using it.

Signed-off-by: Igor Opaniuk <igor.opaniuk@oss.qualcomm.com>
QDTE was written against an internal pyfdt fork whose to_dtb() takes an
out-dict of node byte-offsets for the GUI hex viewer. The only published
pyfdt (0.3) defines to_dtb(self), so every consumer outside Qualcomm's
toolchain hit a TypeError on the first DTB save. The offsets are a
GUI-only convenience and unused headless, so fall back to the zero-arg
call when the dict argument is rejected.

Signed-off-by: Igor Opaniuk <igor.opaniuk@oss.qualcomm.com>
FdtPropertyWords edits cast each token with int(val), which only accepts
decimal. Callers naturally pass 0x.. literals when mirroring fdtdump
output or packing big-endian uint32 blobs (e.g. certificate injection),
and those raised ValueError. int(val, 0) keeps decimal working while
auto-detecting a prefixed base.

Signed-off-by: Igor Opaniuk <igor.opaniuk@oss.qualcomm.com>
GUI startup hid the console window through ctypes.windll, which exists
only on Windows. On other platforms the attribute access raised
AttributeError and the window never opened, so the GUI was effectively
Windows-only. Skip the call when windll is unavailable.

Signed-off-by: Igor Opaniuk <igor.opaniuk@oss.qualcomm.com>
The --nogui command-line flow is what downstream automation (Yocto image
builds, signing pipelines) relies on, yet nothing guarded it, and the
planned GUI/headless split is intrusive enough to break it silently.
Exercise run.py --nogui end to end on real xbl_config.elf and
uefi_dtbs.elf containers and read the edited property back from the
rebuilt ELF with fdtdump, so a broken contract fails CI before it reaches
consumers. Binaries come from public Qualcomm Software Center archives
and QA artifactory.

Signed-off-by: Igor Opaniuk <igor.opaniuk@oss.qualcomm.com>
@igoropaniuk

Copy link
Copy Markdown
Author

Btw, I don't know what commit message convention this downstream project follows, so I went with Conventional Commits (the fix(...)/ci(...) prefixes you'll see).

If that doesn't match your house style, just let me know and I'll reword the commits.

@igoropaniuk

Copy link
Copy Markdown
Author

Yeping-Song Neeraj Jetha (@njjetha) let me know if you have any comments/objections. thanks!

@njjetha

Copy link
Copy Markdown

Igor Opaniuk (@igoropaniuk) commit-msg-check doesn't follow Conventional Commits it just make sure that commit has subject body and Signed-off-by signature and all three should be seperated by blank line you can check the commit-msg-check-action

@igoropaniuk

Copy link
Copy Markdown
Author

Neeraj Jetha (@njjetha) current commit messages already comply with it. I was just curious whether the team working on QDTE has any preferences.

@njjetha

Copy link
Copy Markdown

Igor Opaniuk (@igoropaniuk) I am not sure if they have any standardized format for the commit-msg, but basic commit-msg check are already met.

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.

2 participants