diff --git a/runbuild b/runbuild index 196c8f5..a59120a 100755 --- a/runbuild +++ b/runbuild @@ -52,6 +52,25 @@ fi make -j"$CORES" package/openwisp-config/compile || make -j1 V=s package/openwisp-config/compile || exit 1 +# Ensure usign tool is available (required for package index generation) +# Even when generating unsigned indexes, OpenWRT's Makefile needs usign for SHA-512 padding workaround +if [ ! -f staging_dir/host/bin/usign ]; then + echo "usign not found, building tools..." + make -j"$CORES" tools/install || make -j1 V=s tools/install +fi + +# Generate package index with checksums (unsigned - no usign needed) +make package/index SIGNED_PACKAGES= V=s + +# Filter Packages file to include only openwisp packages and save as checksum file +mkdir -p "$BUILD_DIR/openwrt/bin/packages/$COMPILE_TARGET/openwisp" +awk ' + /^Package: openwisp-/ {flag=1} + flag {print} + /^$/ {flag=0} +' "$BUILD_DIR/openwrt/bin/packages/$COMPILE_TARGET/Packages" \ + >"$BUILD_DIR/openwrt/bin/packages/$COMPILE_TARGET/openwisp/Packages.sha256.checksum" + mv "$BUILD_DIR"/openwrt/bin/packages/"$COMPILE_TARGET"/openwisp "$VERSIONED_DIR" rm "$LATEST_LINK" || true