V.E.Y.R stick bootloader: corresponding source (GNU GPL version 2)

The aboot partition of a V.E.Y.R USB stick runs lk2nd (https://github.com/msm8916-mainline/lk2nd) built as
"lk1st-msm8916" with small patches. 0000 is the OpenStick project's own eMMC speed line (its build adds it too).
0001 gives lk2nd's fastboot interface USB descriptors that let Windows bind its built-in WinUSB driver. 0002 then
removes fastboot altogether: the bootloader only boots the stick, and when it cannot, it stops; the stick is recovered
over EDL, the chip's own download mode. The SHIP build (0000 + 0001 + 0002) is what a V.E.Y.R stick as sold runs once
it has been proven on hardware; the DEV build (0000 + 0001, fastboot kept) is for the vendor's development sticks;
the STOCK build (0000 only) is the OpenStick package's own bootloader, byte for byte, which V.E.Y.R images carry until
the SHIP build is proven. This archive is the complete source of all three binaries, offered under the
GNU General Public License version 2 (lk2nd-99297666a4b0/lk2nd/COPYING-GPL).

Licences: lk2nd's LK core is MIT, the Qualcomm and lk2nd code BSD-3-Clause, some lk2nd files GPL-2.0 (the */gpl/*
folders; this build compiles them in, GPL ?= 1, so the binary as a whole is GPL-2.0). The V.E.Y.R patches, header and
scripts in veyr/ are BSD-3-Clause. qtestsign (GPL-2.0) is the tool that wraps the compiled ELF into aboot.mbn; it runs
at build time and is not part of the stick's software. Each project's own licence files are inside its folder.

Contents
  lk2nd-99297666a4b0/      upstream lk2nd at commit 99297666a4b0a5b0ceb67d42b2a2ee6e0c3963ff, unmodified
  qtestsign-0eef3b552b1a/  upstream qtestsign at commit 0eef3b552b1ada848f22bad38ab2e40407307c5b, unmodified
  veyr/                0000-openstick-mmc-hs200-caps.patch, 0001-veyr-winusb-ms-os-descriptors.patch and
                       0002-veyr-ship-no-fastboot.patch (the only changes to lk2nd), veyr_winusb.h (the
                       descriptor arrays 0001 includes, generated by msos.py),
                       build.sh (the build we run), lk2nd.pins (every input pinned), README.md (what the patches do)

Rebuild the exact binary (Linux, any architecture with Ubuntu packages for the toolchain):
  1. An Ubuntu 22.04 container, the pinned image: ubuntu@sha256:0a9887931b0e38af2e3487ed39e29436b0535c4f3f52e57745baaf79d1898956
     with git and these packages: gcc-arm-none-eabi=15:10.3-2021.07-4 binutils-arm-none-eabi=2.38-3ubuntu1+15build1 libnewlib-arm-none-eabi=3.3.0-1.3 device-tree-compiler=1.6.1-1 make=4.3-4.1build1 python3-cryptography
  2. cp veyr/veyr_winusb.h lk2nd-99297666a4b0/platform/msm_shared/veyr_winusb.h   (harmless for STOCK)
     cd lk2nd-99297666a4b0 && git init -q && git apply ../veyr/0000-openstick-mmc-hs200-caps.patch
     the DEV and SHIP builds: git apply ../veyr/0001-veyr-winusb-ms-os-descriptors.patch
     the SHIP build only: git apply ../veyr/0002-veyr-ship-no-fastboot.patch
     rm -rf .git
  3. SOURCE_DATE_EPOCH=1726321380 TZ=UTC LC_ALL=C.UTF-8 make TOOLCHAIN_PREFIX=arm-none-eabi- \
       LK2ND_VERSION=<version> lk1st-msm8916 LK2ND_BUNDLE_DTB=msm8916-512mb-mtp.dtb LK2ND_COMPATIBLE=yiming,uz801-v3
     <version> is next-9929766-20240914-veyr-ship-1 for the SHIP build, next-9929766-20240914-veyr-winusb-2 for the DEV build,
     next-9929766-20240914-dirty for the STOCK build
  4. python3 ../qtestsign-0eef3b552b1a/qtestsign.py aboot build-lk1st-msm8916/emmc_appsboot.mbn -o aboot.mbn
  5. sha256sum aboot.mbn
     expected, SHIP build: afbe1c5dbc94ed611db41a53c82075475b875a864a74c5f8cc67b5f01ce5c925
     expected, DEV build:  674c7e9ffb397a8bf297216b6f3758c9e9a9279573b6a5dfce9fcc7271a694bb
     expected, STOCK build: 441d314b452d32ab461dd8b90e85a461c29ce5d4f71bb6c40d577f2a7a799436
veyr/build.sh does the same in a throwaway container from the pins (it expects the layout of its home repository; the
steps above are the same build by hand).

Written offer: this archive is published with every V.E.Y.R image that carries this bootloader. Ask the vendor through
the contact page of the V.E.Y.R website for a copy on a physical medium; the offer stands for three years after the
last image carrying it was shipped.
