"""Qualify and carry GUI/font notices without changing firmware or DFU ZIPs.""" import hashlib import json from pathlib import Path import shutil import struct import subprocess import sys import tempfile import unittest ROOT = Path(__file__).resolve().parents[1] sys.path.insert(0, str(ROOT / "scripts")) import package_pocket_gui_license as notice import firmware_memory_manifest as memory import firmware_build_recipe as recipe import package_cascade_release as release GUI = "_ZN4mesh2ui6pocket9PocketGui6headerEPKcS5_" FONT = "u8g2_font_helvR08_tf" def elf32(path, symbols=(GUI, FONT), flags=6, section_type=1, undefined=(), zero=()): names, table = bytearray(b"\0"), bytearray(16) data = b"CODE" * max(1, len(symbols)) for i, name in enumerate(symbols): offset = len(names) names += name.encode() + b"\0" table += struct.pack("