Skip to content

lib: qrcodegen: import Nayuki QR Code generator

Petr Hodina b4-sent u-boot 2 versions – In review

Get series with b4
b4 am [email protected] change-id 20260611-b4-lib-qrcode-a5ce89e68f85

Versions newest first

  1. v2 Latest3 patches 2 repliesIn review
  2. v13 patches 0 repliesSuperseded

Changes in v2 from the cover letter

- No code or commit changes; correct the cover letter's To: address. v1 was mistakenly sent to the old lists.denx.de address instead of the current [email protected].

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3lib: qrcodegen: Import Nayuki QR Code generator libraryinclude/qrcodegen.h lib/Kconfig lib/Makefile +1 more+1435 -00 replies
2/3lib: qrcodegen: configurable maximum QR code versioninclude/qrcodegen.h lib/Kconfig+22 -00 replies
3/3lib: qrcodegen: optional gzip pre-compression of payloadsinclude/qrcodegen.h lib/Kconfig lib/Makefile +1 more+75 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH u-boot v2 0/3] lib: qrcodegen: import Nayuki QR Code generator

Add a small QR code generator library so U-Boot boards can encode arbitrary text or binary into a QR symbol. Main use cases include displaying URLs, pairing tokens, serial numbers or self-diagnostic state from the bootloader (e.g. during porting to a new mobile device with no serial console or usb peripheral working).

Optionally apply gzip compression for the QR code payload.

Three patches:

1. Verbatim import of Nayuki's public-domain / MIT-licensed C QR Code generator (qrcodegen.{h,c}) under CONFIG_LIB_QRCODE. No code changes and the only adjustments are SPDX header, swapping <assert.h> for U-Boot's <log.h>.

2. CONFIG_LIB_QRCODE_MAX_VERSION (int, 1..40, default 40) so callers can cap the maximum QR version. The version trades payload capacity for smaller static scratch buffers.

3. CONFIG_LIB_QRCODE_GZIP (bool, depends on GZIP_COMPRESSED) and a helper qrcodegen_encodeBinaryCompressed(). Perpends four-byte "QRGZ" magic header so the scanner side can detect and decompress.

---
Changes in v2:
- No code or commit changes; correct the cover letter's To: address. v1 was mistakenly sent to the old lists.denx.de address instead of the current [email protected].

---
Petr Hodina (3):
lib: qrcodegen: Import Nayuki QR Code generator library
lib: qrcodegen: configurable maximum QR code version
lib: qrcodegen: optional gzip pre-compression of payloads

 include/qrcodegen.h  |  407 ++++++++++++++++++++
 lib/Kconfig          |   44 +++
 lib/Makefile         |    2 +
 lib/qrcodegen.c      | 1034 ++++++++++++++++++++++++++++++++++++++++++++++++++
 lib/qrcodegen_gzip.c |   45 +++
 5 files changed, 1532 insertions(+)

---
base-commit: ece349ade2973e220f524ce59e59711cc919263f
change-id: 20260611-b4-lib-qrcode-a5ce89e68f85

Best regards,

Signature · 1 line
Petr Hodina <[email protected]>