- ci/build-sdk.sh: run openwrt/sdk image with a CLEAN single-package feed; compile xrayctl (Go) + shater-core (in-tree, files only, no dep rebuild) - ci/pack-luci.sh: luci-app-shater as data .ipk via tar (no luci-base compile) - ci/make-index.sh: opkg Packages index + SHA256 (+ usign sign if KEY_BUILD set) - workflow: docker-run the SDK per arch (x86_64, aarch64_cortex-a53), upload feed This mirrors the recipe verified locally that produced all 3 installable .ipk.
25 lines
1019 B
Bash
25 lines
1019 B
Bash
#!/bin/bash
|
|
# Build the opkg feed index (Packages + Packages.gz) with SHA256 for a dir of
|
|
# .ipk files. Optionally sign with usign if $KEY_BUILD (secret) + usign present.
|
|
# Arg $1 = feed dir.
|
|
set -e
|
|
OUT="${1:?feed dir required}"; cd "$OUT"
|
|
: > Packages
|
|
for ipk in *.ipk; do
|
|
[ -e "$ipk" ] || continue
|
|
ctrl=$(tar -xzOf "$ipk" ./control.tar.gz | tar -xzO ./control)
|
|
sz=$(wc -c < "$ipk"); sha=$(sha256sum "$ipk" | cut -d' ' -f1)
|
|
printf '%s\n' "$ctrl" | sed '/^[[:space:]]*$/d' >> Packages
|
|
printf 'Filename: %s\nSize: %s\nSHA256sum: %s\n\n' "$ipk" "$sz" "$sha" >> Packages
|
|
done
|
|
gzip -kf Packages
|
|
|
|
if [ -n "${KEY_BUILD:-}" ] && command -v usign >/dev/null 2>&1; then
|
|
printf '%s\n' "$KEY_BUILD" > /tmp/usign.sec
|
|
usign -S -m Packages -s /tmp/usign.sec && echo "[index] signed -> Packages.sig" || echo "[index] sign failed (continuing unsigned)"
|
|
rm -f /tmp/usign.sec
|
|
else
|
|
echo "[index] no KEY_BUILD/usign -> UNSIGNED feed (opkg needs check_signature off, or add the secret)"
|
|
fi
|
|
echo "[index] contents:"; ls -l
|