Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions runbuild
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Comment on lines +55 to +72
Copy link
Contributor

@Viscous106 Viscous106 Mar 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The entire usign block and SIGNED_PACKAGES= can be removed once
the CONFIG_SIGNED_PACKAGES fix (that was mentioned in the next one comment by me) is applied.
Also adding defensive checks as suggested by CodeRabbit:

Suggested change
# 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"
# Generate package index with checksums (unsigned)
make package/index V=s
# Filter Packages file to include only openwisp packages
PACKAGES_FILE="$BUILD_DIR/openwrt/bin/packages/$COMPILE_TARGET/Packages"
if [ ! -f "$PACKAGES_FILE" ]; then
echo "ERROR: Packages file not found at $PACKAGES_FILE"
exit 1
fi
mkdir -p "$BUILD_DIR/openwrt/bin/packages/$COMPILE_TARGET/openwisp"
CHECKSUM_FILE="$BUILD_DIR/openwrt/bin/packages/$COMPILE_TARGET/openwisp/Packages.sha256.checksum"
awk '
/^Package: openwisp-/ {flag=1}
flag {print}
/^$/ {flag=0}
' "$PACKAGES_FILE" > "$CHECKSUM_FILE"
if [ ! -s "$CHECKSUM_FILE" ]; then
echo "ERROR: No openwisp packages found in Packages file"
exit 1
fi


mv "$BUILD_DIR"/openwrt/bin/packages/"$COMPILE_TARGET"/openwisp "$VERSIONED_DIR"

rm "$LATEST_LINK" || true
Expand Down
Loading