Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use new openwrt image #64

Merged
merged 7 commits into from
Jul 14, 2023
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions .github/workflows/build-openwrt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ jobs:
cache-to: type=gha,mode=max,scope=$GITHUB_REF_NAME-${{ inputs.architecture }}
build-args: |
TAG=${{ inputs.architecture }}
ulimit: nofile=1024:524288
build:
runs-on: ubuntu-latest
needs: build-env
Expand Down
27 changes: 14 additions & 13 deletions docker/openwrt-build-env/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
ARG TAG=mvebu-cortexa9-22.03.3
FROM openwrtorg/sdk:$TAG
FROM openwrt/sdk:$TAG

RUN mkdir -p /home/build/openwrt/package/prometheus/src/
COPY MakefilePrometheus /home/build/openwrt/package/prometheus/Makefile
COPY build-wimoved.sh /home/build/
RUN ./scripts/feeds update -a && \
make defconfig

RUN ./scripts/feeds update && \
make defconfig && \
./scripts/feeds install libnl && \
make -j$(nproc) package/libnl/compile && \
wget https://github.com/jupp0r/prometheus-cpp/releases/download/v1.1.0/prometheus-cpp-with-submodules.tar.gz && \
tar -xzf prometheus-cpp-with-submodules.tar.gz -C /home/build/openwrt/package/prometheus/src/ --strip-components=1 && \
make -j$(nproc) package/prometheus/compile && \
rm -rf feeds
COPY --chown=buildbot:buildbot MakefilePrometheus /builder/wimove_feed/libs/prometheuscpp/Makefile
RUN echo "src-link wimove_feed /builder/wimove_feed" >> /builder/feeds.conf.default && \
./scripts/feeds update wimove_feed

CMD bash /home/build/build-wimoved.sh
RUN ./scripts/feeds install prometheuscpp && \
make V=s package/feeds/wimove_feed/prometheuscpp/compile -j "$(nproc)"

RUN ./scripts/feeds install libnl && \
make V=s package/libnl/compile -j "$(nproc)"

COPY build-wimoved.sh /builder/
CMD bash /builder/build-wimoved.sh
6 changes: 6 additions & 0 deletions docker/openwrt-build-env/MakefilePrometheus
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,14 @@
include $(TOPDIR)/rules.mk

PKG_NAME:=prometheus-client-cpp
PKG_VERSION:=1.1.0
PKG_RELEASE:=1

PKG_SOURCE_URL:=https://github.com/jupp0r/prometheus-cpp
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=v1.1.0
PKG_MIRROR_HASH:=522b6a57f474c89098fcdf198bd63796c65ee2e07b85b1d118be8e8b47148188

PKG_FLAGS:=nonshared
PKG_LICENSE:=MIT
PKG_MAINTAINER:=BPHK2022
Expand Down
8 changes: 4 additions & 4 deletions docker/openwrt-build-env/build-wimoved.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/sh
#!/bin/bash
set -ex
shopt -s globstar
cd /home/build/openwrt
make "-j$(nproc)" V=sc prereq
make "-j$(nproc)" V=sc package/network/services/wimoved/compile
./scripts/feeds update wimove_feed
./scripts/feeds install wimoved
make "-j$(nproc)" V=sc package/wimoved/compile
cp bin/targets/**/packages/wimoved*.ipk out
12 changes: 6 additions & 6 deletions openwrt/build-openwrt.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#!/bin/bash
mkdir -p out || true
chmod -R ogu+rw out
docker run --rm \
docker run --rm --ulimit nofile=1024:524288 \
-e PKG_VERSION="$VERSION" \
-v "$(pwd)"/openwrt/package:/home/build/openwrt/package/network/services/wimoved \
-v "$(pwd)"/CMakeLists.txt:/home/build/openwrt/package/network/services/wimoved/src/CMakeLists.txt \
-v "$(pwd)"/vendor:/home/build/openwrt/package/network/services/wimoved/src/vendor \
-v "$(pwd)"/src:/home/build/openwrt/package/network/services/wimoved/src/src \
-v "$(pwd)"/out:/home/build/openwrt/out \
-v "$(pwd)"/openwrt/package:/builder/wimove_feed/network/services/wimoved \
-v "$(pwd)"/CMakeLists.txt:/builder/wimove_feed/network/services/wimoved/src/CMakeLists.txt \
-v "$(pwd)"/vendor:/builder/wimove_feed/network/services/wimoved/src/vendor \
-v "$(pwd)"/src:/builder/wimove_feed/network/services/wimoved/src/src \
-v "$(pwd)"/out:/builder/out \
"$IMAGE"