1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-feeds.git synced 2025-02-15 03:51:51 +00:00
This commit is contained in:
suyuan 2024-04-13 15:31:29 +08:00 committed by GitHub
commit d794002eec
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 143 additions and 773 deletions

View file

@ -1,751 +1,99 @@
version: 2
jobs:
prepare:
machine:
image: ubuntu-1604:201903-01
working_directory: ~/
version: 2.1
commands:
set_environment_vars:
steps:
- run:
command: |
echo "export REPO_URL=https://github.com/ysurac/openmptcprouter" >> $BASH_ENV
jobs:
build:
environment:
REPO_URL: https://github.com/ysurac/openmptcprouter
SOURCE_NAME: ${{ steps.branch_name.outputs.SOURCE_NAME }}
GITHUB_WORKSPACE: ${{ steps.branch_name.outputs.WORKSPACE }}
OMR_FEED_URL: https://github.com/ysurac/openmptcprouter-feeds
OMR_TARGET: << parameters.OMR_TARGET >>
OMR_KERNEL: << parameters.OMR_KERNEL >>
OMR_HOST: ${{ secrets.OMR_HOST }}
OMR_PORT: ${{ secrets.OMR_PORT }}
SOURCE_BRANCH: ${{ steps.branch_name.outputs.SOURCE_BRANCH }}
SOURCE_TAG: ${{ steps.branch_name.outputs.SOURCE_TAG }}
ARGS: -av --delete-after
TARGET: deploy/release/${{steps.branch_name.outputs.SOURCE_TAG}}/${{matrix.OMR_TARGET}}
SOURCE: ${{ steps.branch_name.outputs.SOURCE_NAME }}
KEY: ${{ secrets.PRIVATE_KEY }}
USER: deploy
HOST: ${{ secrets.OMR_DEPLOY_HOST }}
PORT: ${{ secrets.OMR_DEPLOY_PORT }}
docker:
- image: dkrecruseastamazonawscom/circlecigolangpr:current
steps:
- checkout
- set_environment_vars
- run:
command: |
echo "SOURCE_NAME=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT
echo "SOURCE_BRANCH=${GITHUB_REF#refs/heads/}" >> $GITHUB_OUTPUT
echo "SOURCE_TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
echo "WORKSPACE=${GITHUB_WORKSPACE}" >> $GITHUB_OUTPUT
- run:
name: Prepare
command: |
sudo rm -rf /var/lib/apt/lists/lock
sudo apt-get update
sudo rm -rf /var/lib/apt/lists/lock
sudo apt-get install -yq build-essential git unzip ncurses-dev libz-dev libssl-dev python subversion gettext gawk wget curl rsync perl libelf-dev python3.5 libpython3.5-stdlib liblzma-dev
pyenv global 3.5.2
build_x86_64:
machine:
image: ubuntu-1604:201903-01
environment:
- OMR_VERSION: $CIRCLE_TAG
- OMR_TARGET: x86_64
- OMR_KERNEL: 5.4
working_directory: ~/
steps:
sudo apt-get install build-essential asciidoc binutils bzip2 gawk gettext
git libncurses5-dev libz-dev patch unzip zlib1g-dev lib32gcc-s1 libc6-dev-i386
subversion flex uglifyjs git-core gcc-multilib p7zip p7zip-full msmtp libssl-dev
texinfo libglib2.0-dev xmlto qemu-utils upx libelf-dev autoconf automake
libtool autopoint device-tree-compiler python3-pyelftools
- run:
name: cache
name: Free disk space
command: |
echo "cache 107 $OMR_KERNEL $OMR_TARGET" > /tmp/cache-target
echo "cache 108 $OMR_KERNEL $OMR_TARGET $OMR_VERSION" > /tmp/cache-version
- restore_cache:
keys:
- cache-{{ checksum "/tmp/cache-version" }}
- cache-{{ checksum "/tmp/cache-target" }}
df -h
sudo swapoff -a >/dev/null 2>&1 || true
sudo rm -f /swapfile >/dev/null 2>&1 || true
sudo apt-get autoremove -y >/dev/null 2>&1 || true
sudo apt-get autoclean -y >/dev/null 2>&1 || true
sudo rm -rf "/usr/local/share/boost" >/dev/null 2>&1 || true
sudo rm -rf "$AGENT_TOOLSDIRECTORY" >/dev/null 2>&1 || true
sudo rm -rf /usr/share/dotnet >/dev/null 2>&1 || true
sudo rm -rf /usr/local/lib/android >/dev/null 2>&1 || true
sudo rm -rf /opt/ghc >/dev/null 2>&1 || true
sudo docker rmi $(docker images -qf "dangling=true") >/dev/null 2>&1 ||
true
df -h
- run:
name: Build toolchain
no_output_timeout: 50m
command: |
git clone https://github.com/ysurac/openmptcprouter || true
cd openmptcprouter
git checkout ${CIRCLE_BRANCH:-$CIRCLE_TAG} || true
git pull || true
export OMR_PATH="$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME/${CIRCLE_BRANCH:-$CIRCLE_TAG}"
export OMR_FEED_URL="$CIRCLE_REPOSITORY_URL"
export OMR_FEED_SRC="${CIRCLE_BRANCH:-$CIRCLE_TAG}"
sudo apt-get update
sudo apt-get install -yq libelf-dev
pyenv global 3.5.2
sh build.sh prepare {tools,toolchain}/install -j2
echo -e "$OMR_PRIVKEY" > ~/openmptcprouter/$OMR_TARGET/source/key-build
echo -e "$OMR_PUBKEY" > ~/openmptcprouter/$OMR_TARGET/source/key-build.pub
- save_cache:
key: cache-{{ checksum "/tmp/cache-target" }}
paths:
- openmptcprouter
- run:
name: Build
no_output_timeout: 50m
command: make IGNORE_ERRORS=m -C ~/openmptcprouter/$OMR_TARGET/source package/{compile,install,index} target/install -j2
- run:
name: Deploy
command: |
ssh -p ${OMR_DEPLOY_PORT:-22} deploy@$OMR_DEPLOY_HOST mkdir -p deploy/${CIRCLE_BRANCH:-release}/${CIRCLE_TAG:-$OMR_KERNEL}/$OMR_TARGET
rsync -av --delete-after ~/openmptcprouter/$OMR_TARGET/source/bin/ -e "ssh -q -p ${OMR_DEPLOY_PORT:-22}" deploy@$OMR_DEPLOY_HOST:deploy/${CIRCLE_BRANCH:-release}/${CIRCLE_TAG:-$OMR_KERNEL}/$OMR_TARGET
rm -rf ~/openmptcprouter/$OMR_TARGET/source/bin
- save_cache:
key: cache-{{ checksum "/tmp/cache-version" }}
paths:
- openmptcprouter
build_x86:
machine:
image: ubuntu-1604:201903-01
environment:
- OMR_VERSION: $CIRCLE_TAG
- OMR_TARGET: x86
- OMR_KERNEL: 5.4
working_directory: ~/
steps:
- run:
name: cache
command: |
echo "cache 107 $OMR_KERNEL $OMR_TARGET" > /tmp/cache-target
echo "cache 108 $OMR_KERNEL $OMR_TARGET $OMR_VERSION" > /tmp/cache-version
- restore_cache:
keys:
- cache-{{ checksum "/tmp/cache-version" }}
- cache-{{ checksum "/tmp/cache-target" }}
- run:
name: Build toolchain
no_output_timeout: 40m
command: |
git clone https://github.com/ysurac/openmptcprouter || true
cd openmptcprouter
git checkout ${CIRCLE_BRANCH:-$CIRCLE_TAG} || true
git pull || true
export OMR_PATH="$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME/${CIRCLE_BRANCH:-$CIRCLE_TAG}"
export OMR_FEED_URL="$CIRCLE_REPOSITORY_URL"
export OMR_FEED_SRC="${CIRCLE_BRANCH:-$CIRCLE_TAG}"
pyenv global 3.5.2
sh build.sh prepare {tools,toolchain}/install -j2
echo -e "$OMR_PRIVKEY" > ~/openmptcprouter/$OMR_TARGET/source/key-build
echo -e "$OMR_PUBKEY" > ~/openmptcprouter/$OMR_TARGET/source/key-build.pub
- save_cache:
key: cache-{{ checksum "/tmp/cache-target" }}
paths:
- openmptcprouter
- run:
name: Build
no_output_timeout: 40m
command: make IGNORE_ERRORS=m -C ~/openmptcprouter/$OMR_TARGET/source package/{compile,install,index} target/install -j2
- run:
name: Deploy
command: |
ssh -p ${OMR_DEPLOY_PORT:-22} deploy@$OMR_DEPLOY_HOST mkdir -p deploy/${CIRCLE_BRANCH:-release}/${CIRCLE_TAG:-$OMR_KERNEL}/$OMR_TARGET
rsync -av --delete-after ~/openmptcprouter/$OMR_TARGET/source/bin/ -e "ssh -q -p ${OMR_DEPLOY_PORT:-22}" deploy@$OMR_DEPLOY_HOST:deploy/${CIRCLE_BRANCH:-release}/${CIRCLE_TAG:-$OMR_KERNEL}/$OMR_TARGET
rm -rf ~/openmptcprouter/$OMR_TARGET/source/bin
- save_cache:
key: cache-{{ checksum "/tmp/cache-version" }}
paths:
- openmptcprouter
build_rpi3:
machine:
image: ubuntu-1604:201903-01
environment:
- OMR_VERSION: $CIRCLE_TAG
- OMR_TARGET: rpi3
- OMR_KERNEL: 5.4
working_directory: ~/
steps:
- run:
name: cache
command: |
echo "cache 107 $OMR_KERNEL $OMR_TARGET" > /tmp/cache-target
echo "cache 108 $OMR_KERNEL $OMR_TARGET $OMR_VERSION" > /tmp/cache-version
- restore_cache:
keys:
- cache-{{ checksum "/tmp/cache-version" }}
- cache-{{ checksum "/tmp/cache-target" }}
- run:
name: Build toolchain
no_output_timeout: 40m
command: |
git clone https://github.com/ysurac/openmptcprouter || true
cd openmptcprouter
git checkout ${CIRCLE_BRANCH:-$CIRCLE_TAG} || true
git pull || true
export OMR_PATH="$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME/${CIRCLE_BRANCH:-$CIRCLE_TAG}"
export OMR_FEED_URL="$CIRCLE_REPOSITORY_URL"
export OMR_FEED_SRC="${CIRCLE_BRANCH:-$CIRCLE_TAG}"
pyenv global 3.5.2
sh build.sh prepare {tools,toolchain}/install -j2
echo -e "$OMR_PRIVKEY" > ~/openmptcprouter/$OMR_TARGET/source/key-build
echo -e "$OMR_PUBKEY" > ~/openmptcprouter/$OMR_TARGET/source/key-build.pub
- save_cache:
key: cache-{{ checksum "/tmp/cache-target" }}
paths:
- openmptcprouter
- run:
name: Build
no_output_timeout: 40m
command: make IGNORE_ERRORS=m -C ~/openmptcprouter/$OMR_TARGET/source package/{compile,install,index} target/compile -j2 package/compile -j2 target/install -j2
- run:
name: Deploy
command: |
ssh -p ${OMR_DEPLOY_PORT:-22} deploy@$OMR_DEPLOY_HOST mkdir -p deploy/${CIRCLE_BRANCH:-release}/${CIRCLE_TAG:-$OMR_KERNEL}/$OMR_TARGET
rsync -av --delete-after ~/openmptcprouter/$OMR_TARGET/source/bin/ -e "ssh -q -p ${OMR_DEPLOY_PORT:-22}" deploy@$OMR_DEPLOY_HOST:deploy/${CIRCLE_BRANCH:-release}/${CIRCLE_TAG:-$OMR_KERNEL}/$OMR_TARGET
rm -rf ~/openmptcprouter/$OMR_TARGET/source/bin
- save_cache:
key: cache-{{ checksum "/tmp/cache-version" }}
paths:
- openmptcprouter
build_espressobin:
machine:
image: ubuntu-1604:201903-01
environment:
- OMR_VERSION: $CIRCLE_TAG
- OMR_TARGET: espressobin
- OMR_KERNEL: 5.4
working_directory: ~/
steps:
- run:
name: cache
command: |
echo "cache 107 $OMR_KERNEL $OMR_TARGET" > /tmp/cache-target
echo "cache 108 $OMR_KERNEL $OMR_TARGET $OMR_VERSION" > /tmp/cache-version
- restore_cache:
keys:
- cache-{{ checksum "/tmp/cache-version" }}
- cache-{{ checksum "/tmp/cache-target" }}
- run:
name: Build toolchain
no_output_timeout: 40m
command: |
git clone https://github.com/ysurac/openmptcprouter || true
cd openmptcprouter
git checkout ${CIRCLE_BRANCH:-$CIRCLE_TAG} || true
git pull || true
export OMR_PATH="$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME/${CIRCLE_BRANCH:-$CIRCLE_TAG}"
export OMR_FEED_URL="$CIRCLE_REPOSITORY_URL"
export OMR_FEED_SRC="${CIRCLE_BRANCH:-$CIRCLE_TAG}"
pyenv global 3.5.2
sh build.sh prepare {tools,toolchain}/install -j2
echo -e "$OMR_PRIVKEY" > ~/openmptcprouter/$OMR_TARGET/source/key-build
echo -e "$OMR_PUBKEY" > ~/openmptcprouter/$OMR_TARGET/source/key-build.pub
- save_cache:
key: cache-{{ checksum "/tmp/cache-target" }}
paths:
- openmptcprouter
- run:
name: Build
no_output_timeout: 40m
command: make IGNORE_ERRORS=m -C ~/openmptcprouter/$OMR_TARGET/source package/{compile,install,index} target/compile -j2 package/compile -j2 target/install -j2
- run:
name: Deploy
command: |
ssh -p ${OMR_DEPLOY_PORT:-22} deploy@$OMR_DEPLOY_HOST mkdir -p deploy/${CIRCLE_BRANCH:-release}/${CIRCLE_TAG:-$OMR_KERNEL}/$OMR_TARGET
rsync -av --delete-after ~/openmptcprouter/$OMR_TARGET/source/bin/ -e "ssh -q -p ${OMR_DEPLOY_PORT:-22}" deploy@$OMR_DEPLOY_HOST:deploy/${CIRCLE_BRANCH:-release}/${CIRCLE_TAG:-$OMR_KERNEL}/$OMR_TARGET
rm -rf ~/openmptcprouter/$OMR_TARGET/source/bin
- save_cache:
key: cache-{{ checksum "/tmp/cache-version" }}
paths:
- openmptcprouter
build_r2s:
machine:
image: ubuntu-1604:201903-01
environment:
- OMR_VERSION: $CIRCLE_TAG
- OMR_TARGET: r2s
- OMR_KERNEL: 5.4
working_directory: ~/
steps:
- run:
name: cache
command: |
echo "cache 107 $OMR_KERNEL $OMR_TARGET" > /tmp/cache-target
echo "cache 108 $OMR_KERNEL $OMR_TARGET $OMR_VERSION" > /tmp/cache-version
- restore_cache:
keys:
- cache-{{ checksum "/tmp/cache-version" }}
- cache-{{ checksum "/tmp/cache-target" }}
- run:
name: Build toolchain
no_output_timeout: 40m
command: |
git clone https://github.com/ysurac/openmptcprouter || true
cd openmptcprouter
git checkout ${CIRCLE_BRANCH:-$CIRCLE_TAG} || true
git pull || true
export OMR_PATH="$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME/${CIRCLE_BRANCH:-$CIRCLE_TAG}"
export OMR_FEED_URL="$CIRCLE_REPOSITORY_URL"
export OMR_FEED_SRC="${CIRCLE_BRANCH:-$CIRCLE_TAG}"
pyenv global 3.5.2
sh build.sh prepare {tools,toolchain}/install -j2
echo -e "$OMR_PRIVKEY" > ~/openmptcprouter/$OMR_TARGET/source/key-build
echo -e "$OMR_PUBKEY" > ~/openmptcprouter/$OMR_TARGET/source/key-build.pub
- save_cache:
key: cache-{{ checksum "/tmp/cache-target" }}
paths:
- openmptcprouter
- run:
name: Build
no_output_timeout: 40m
command: make IGNORE_ERRORS=m -C ~/openmptcprouter/$OMR_TARGET/source package/{compile,install,index} target/compile -j2 package/compile -j2 target/install -j2
- run:
name: Deploy
command: |
ssh -p ${OMR_DEPLOY_PORT:-22} deploy@$OMR_DEPLOY_HOST mkdir -p deploy/${CIRCLE_BRANCH:-release}/${CIRCLE_TAG:-$OMR_KERNEL}/$OMR_TARGET
rsync -av --delete-after ~/openmptcprouter/$OMR_TARGET/source/bin/ -e "ssh -q -p ${OMR_DEPLOY_PORT:-22}" deploy@$OMR_DEPLOY_HOST:deploy/${CIRCLE_BRANCH:-release}/${CIRCLE_TAG:-$OMR_KERNEL}/$OMR_TARGET
rm -rf ~/openmptcprouter/$OMR_TARGET/source/bin
- save_cache:
key: cache-{{ checksum "/tmp/cache-version" }}
paths:
- openmptcprouter
build_rpi4:
machine:
image: ubuntu-1604:201903-01
environment:
- OMR_VERSION: $CIRCLE_TAG
- OMR_TARGET: rpi4
- OMR_KERNEL: 5.4
working_directory: ~/
steps:
- run:
name: cache
command: |
echo "cache 107 $OMR_KERNEL $OMR_TARGET" > /tmp/cache-target
echo "cache 108 $OMR_KERNEL $OMR_TARGET $OMR_VERSION" > /tmp/cache-version
- restore_cache:
keys:
- cache-{{ checksum "/tmp/cache-version" }}
- cache-{{ checksum "/tmp/cache-target" }}
- run:
name: Build toolchain
no_output_timeout: 40m
command: |
git clone https://github.com/ysurac/openmptcprouter || true
cd openmptcprouter
git checkout ${CIRCLE_BRANCH:-$CIRCLE_TAG} || true
git pull || true
export OMR_PATH="$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME/${CIRCLE_BRANCH:-$CIRCLE_TAG}"
export OMR_FEED_URL="$CIRCLE_REPOSITORY_URL"
export OMR_FEED_SRC="${CIRCLE_BRANCH:-$CIRCLE_TAG}"
pyenv global 3.5.2
sh build.sh prepare {tools,toolchain}/install -j2
echo -e "$OMR_PRIVKEY" > ~/openmptcprouter/$OMR_TARGET/source/key-build
echo -e "$OMR_PUBKEY" > ~/openmptcprouter/$OMR_TARGET/source/key-build.pub
- save_cache:
key: cache-{{ checksum "/tmp/cache-target" }}
paths:
- openmptcprouter
- run:
name: Build
no_output_timeout: 40m
command: make IGNORE_ERRORS=m -C ~/openmptcprouter/$OMR_TARGET/source package/{compile,install,index} target/compile -j2 package/compile -j2 target/install -j2
- run:
name: Deploy
command: |
ssh -p ${OMR_DEPLOY_PORT:-22} deploy@$OMR_DEPLOY_HOST mkdir -p deploy/${CIRCLE_BRANCH:-release}/${CIRCLE_TAG:-$OMR_KERNEL}/$OMR_TARGET
rsync -av --delete-after ~/openmptcprouter/$OMR_TARGET/source/bin/ -e "ssh -q -p ${OMR_DEPLOY_PORT:-22}" deploy@$OMR_DEPLOY_HOST:deploy/${CIRCLE_BRANCH:-release}/${CIRCLE_TAG:-$OMR_KERNEL}/$OMR_TARGET
rm -rf ~/openmptcprouter/$OMR_TARGET/source/bin
- save_cache:
key: cache-{{ checksum "/tmp/cache-version" }}
paths:
- openmptcprouter
build_rpi2:
machine:
image: ubuntu-1604:201903-01
environment:
- OMR_VERSION: $CIRCLE_TAG
- OMR_TARGET: rpi2
- OMR_KERNEL: 5.4
working_directory: ~/
steps:
- run:
name: cache
command: |
echo "cache 107 $OMR_KERNEL $OMR_TARGET" > /tmp/cache-target
echo "cache 108 $OMR_KERNEL $OMR_TARGET $OMR_VERSION" > /tmp/cache-version
- restore_cache:
keys:
- cache-{{ checksum "/tmp/cache-version" }}
- cache-{{ checksum "/tmp/cache-target" }}
- run:
name: Build toolchain
no_output_timeout: 40m
command: |
git clone https://github.com/ysurac/openmptcprouter || true
cd openmptcprouter
git checkout ${CIRCLE_BRANCH:-$CIRCLE_TAG} || true
git pull || true
export OMR_PATH="$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME/${CIRCLE_BRANCH:-$CIRCLE_TAG}"
export OMR_FEED_URL="$CIRCLE_REPOSITORY_URL"
export OMR_FEED_SRC="${CIRCLE_BRANCH:-$CIRCLE_TAG}"
pyenv global 3.5.2
sh build.sh prepare {tools,toolchain}/install -j2
echo -e "$OMR_PRIVKEY" > ~/openmptcprouter/$OMR_TARGET/source/key-build
echo -e "$OMR_PUBKEY" > ~/openmptcprouter/$OMR_TARGET/source/key-build.pub
- save_cache:
key: cache-{{ checksum "/tmp/cache-target" }}
paths:
- openmptcprouter
- run:
name: Build
no_output_timeout: 40m
command: make IGNORE_ERRORS=m -C ~/openmptcprouter/$OMR_TARGET/source package/{compile,install,index} target/compile package/compile target/install -j2
- run:
name: Deploy
command: |
ssh -p ${OMR_DEPLOY_PORT:-22} deploy@$OMR_DEPLOY_HOST mkdir -p deploy/${CIRCLE_BRANCH:-release}/${CIRCLE_TAG:-$OMR_KERNEL}/$OMR_TARGET
rsync -av --delete-after ~/openmptcprouter/$OMR_TARGET/source/bin/ -e "ssh -q -p ${OMR_DEPLOY_PORT:-22}" deploy@$OMR_DEPLOY_HOST:deploy/${CIRCLE_BRANCH:-release}/${CIRCLE_TAG:-$OMR_KERNEL}/$OMR_TARGET
rm -rf ~/openmptcprouter/$OMR_TARGET/source/bin
- save_cache:
key: cache-{{ checksum "/tmp/cache-version" }}
paths:
- openmptcprouter
build_bpi-r2:
machine:
image: ubuntu-1604:201903-01
environment:
- OMR_VERSION: $CIRCLE_TAG
- OMR_TARGET: bpi-r2
- OMR_KERNEL: 5.4
working_directory: ~/
steps:
- run:
name: cache
command: |
echo "cache 107 $OMR_KERNEL $OMR_TARGET" > /tmp/cache-target
echo "cache 108 $OMR_KERNEL $OMR_TARGET $OMR_VERSION" > /tmp/cache-version
- restore_cache:
keys:
- cache-{{ checksum "/tmp/cache-version" }}
- cache-{{ checksum "/tmp/cache-target" }}
- run:
name: Build toolchain
no_output_timeout: 40m
command: |
git clone https://github.com/ysurac/openmptcprouter || true
cd openmptcprouter
git checkout ${CIRCLE_BRANCH:-$CIRCLE_TAG} || true
git pull || true
export OMR_PATH="$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME/${CIRCLE_BRANCH:-$CIRCLE_TAG}"
export OMR_FEED_URL="$CIRCLE_REPOSITORY_URL"
export OMR_FEED_SRC="${CIRCLE_BRANCH:-$CIRCLE_TAG}"
pyenv global 3.5.2
sh build.sh prepare {tools,toolchain}/install -j2
echo -e "$OMR_PRIVKEY" > ~/openmptcprouter/$OMR_TARGET/source/key-build
echo -e "$OMR_PUBKEY" > ~/openmptcprouter/$OMR_TARGET/source/key-build.pub
- save_cache:
key: cache-{{ checksum "/tmp/cache-target" }}
paths:
- openmptcprouter
- run:
name: Build
no_output_timeout: 40m
command: |
sudo apt-get update
sudo apt-get -yq install swig2.0
make IGNORE_ERRORS=m -C ~/openmptcprouter/$OMR_TARGET/source package/{compile,install,index} target/compile -j2 package/compile -j2 target/install -j2
- run:
name: Deploy
command: |
ssh -p ${OMR_DEPLOY_PORT:-22} deploy@$OMR_DEPLOY_HOST mkdir -p deploy/${CIRCLE_BRANCH:-release}/${CIRCLE_TAG:-$OMR_KERNEL}/$OMR_TARGET
rsync -av --delete-after ~/openmptcprouter/$OMR_TARGET/source/bin/ -e "ssh -q -p ${OMR_DEPLOY_PORT:-22}" deploy@$OMR_DEPLOY_HOST:deploy/${CIRCLE_BRANCH:-release}/${CIRCLE_TAG:-$OMR_KERNEL}/$OMR_TARGET
rm -rf ~/openmptcprouter/$OMR_TARGET/source/bin
- save_cache:
key: cache-{{ checksum "/tmp/cache-version" }}
paths:
- openmptcprouter
build_wrt3200acm:
machine:
image: ubuntu-1604:201903-01
environment:
- OMR_VERSION: $CIRCLE_TAG
- OMR_TARGET: wrt3200acm
- OMR_KERNEL: 5.4
working_directory: ~/
steps:
- run:
name: cache
command: |
echo "cache 107 $OMR_KERNEL $OMR_TARGET" > /tmp/cache-target
echo "cache 108 $OMR_KERNEL $OMR_TARGET $OMR_VERSION" > /tmp/cache-version
- restore_cache:
keys:
- cache-{{ checksum "/tmp/cache-version" }}
- cache-{{ checksum "/tmp/cache-target" }}
- run:
name: Build toolchain
no_output_timeout: 40m
command: |
git clone https://github.com/ysurac/openmptcprouter || true
cd openmptcprouter
git checkout ${CIRCLE_BRANCH:-$CIRCLE_TAG} || true
git pull || true
export OMR_PATH="$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME/${CIRCLE_BRANCH:-$CIRCLE_TAG}"
export OMR_FEED_URL="$CIRCLE_REPOSITORY_URL"
export OMR_FEED_SRC="${CIRCLE_BRANCH:-$CIRCLE_TAG}"
pyenv global 3.5.2
sh build.sh prepare {tools,toolchain}/install -j2
echo -e "$OMR_PRIVKEY" > ~/openmptcprouter/$OMR_TARGET/source/key-build
echo -e "$OMR_PUBKEY" > ~/openmptcprouter/$OMR_TARGET/source/key-build.pub
- save_cache:
key: cache-{{ checksum "/tmp/cache-target" }}
paths:
- openmptcprouter
- run:
name: Build
no_output_timeout: 40m
command: make IGNORE_ERRORS=m -C ~/openmptcprouter/$OMR_TARGET/source package/{compile,install,index} target/compile -j2 package/compile -j2 target/install -j2
- run:
name: Deploy
command: |
ssh -p ${OMR_DEPLOY_PORT:-22} deploy@$OMR_DEPLOY_HOST mkdir -p deploy/${CIRCLE_BRANCH:-release}/${CIRCLE_TAG:-$OMR_KERNEL}/$OMR_TARGET
rsync -av --delete-after ~/openmptcprouter/$OMR_TARGET/source/bin/ -e "ssh -q -p ${OMR_DEPLOY_PORT:-22}" deploy@$OMR_DEPLOY_HOST:deploy/${CIRCLE_BRANCH:-release}/${CIRCLE_TAG:-$OMR_KERNEL}/$OMR_TARGET
rm -rf ~/openmptcprouter/$OMR_TARGET/source/bin
- save_cache:
key: cache-{{ checksum "/tmp/cache-version" }}
paths:
- openmptcprouter
build_wrt32:
machine:
image: ubuntu-1604:201903-01
environment:
- OMR_VERSION: $CIRCLE_TAG
- OMR_KERNEL: 5.4
working_directory: ~/
steps:
- run:
name: cache
command: |
echo "cache 107 $OMR_KERNEL $OMR_TARGET" > /tmp/cache-target
echo "cache 108 $OMR_KERNEL $OMR_TARGET $OMR_VERSION" > /tmp/cache-version
- restore_cache:
keys:
- cache-{{ checksum "/tmp/cache-version" }}
- cache-{{ checksum "/tmp/cache-target" }}
- run:
name: Build toolchain wrt3200acm
no_output_timeout: 40m
command: |
git clone https://github.com/ysurac/openmptcprouter || true
cd openmptcprouter
git checkout ${CIRCLE_BRANCH:-$CIRCLE_TAG} || true
git pull || true
export OMR_PATH="$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME/${CIRCLE_BRANCH:-$CIRCLE_TAG}"
export OMR_FEED_URL="$CIRCLE_REPOSITORY_URL"
export OMR_FEED_SRC="${CIRCLE_BRANCH:-$CIRCLE_TAG}"
export OMR_TARGET="wrt3200acm"
pyenv global 3.5.2
sh build.sh prepare {tools,toolchain}/install -j2
echo -e "$OMR_PRIVKEY" > ~/openmptcprouter/wrt3200acm/source/key-build
echo -e "$OMR_PUBKEY" > ~/openmptcprouter/wrt3200acm/source/key-build.pub
- save_cache:
key: cache-{{ checksum "/tmp/cache-target" }}
paths:
- openmptcprouter
- run:
name: Build wrt3200acm
no_output_timeout: 40m
command: make IGNORE_ERRORS=m -C ~/openmptcprouter/wrt3200acm/source package/{compile,install,index} target/compile -j2 package/compile -j2 target/install -j2
- run:
name: Deploy wrt3200acm
command: |
ssh -p ${OMR_DEPLOY_PORT:-22} deploy@$OMR_DEPLOY_HOST mkdir -p deploy/${CIRCLE_BRANCH:-release}/${CIRCLE_TAG:-$OMR_KERNEL}/$OMR_TARGET
rsync -av --delete-after ~/openmptcprouter/wrt3200acm/source/bin/ -e "ssh -q -p ${OMR_DEPLOY_PORT:-22}" deploy@$OMR_DEPLOY_HOST:deploy/${CIRCLE_BRANCH:-release}/${CIRCLE_TAG:-$OMR_KERNEL}/wrt3200acm
rm -rf ~/openmptcprouter/wrt3200acm/source/bin
- save_cache:
key: cache-{{ checksum "/tmp/cache-version" }}
paths:
- openmptcprouter
- run:
name: Build toolchain wrt32x
no_output_timeout: 40m
command: |
cd ~/openmptcprouter/
export OMR_PATH="$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME/${CIRCLE_BRANCH:-$CIRCLE_TAG}"
export OMR_FEED_URL="$CIRCLE_REPOSITORY_URL"
export OMR_FEED_SRC="${CIRCLE_BRANCH:-$CIRCLE_TAG}"
export OMR_TARGET="wrt32x"
ln -s wrt3200acm wrt32x
pyenv global 3.5.2
sh build.sh prepare {tools,toolchain}/install -j2
echo -e "$OMR_PRIVKEY" > ~/openmptcprouter/wrt32x/source/key-build
echo -e "$OMR_PUBKEY" > ~/openmptcprouter/wrt32x/source/key-build.pub
- run:
name: Build wrt32x
no_output_timeout: 40m
command: make IGNORE_ERRORS=m -C ~/openmptcprouter/wrt32x/source package/{compile,install,index} target/compile -j2 package/compile -j2 target/install -j2
- run:
name: Deploy wrt32x
command: |
ssh -p ${OMR_DEPLOY_PORT:-22} deploy@$OMR_DEPLOY_HOST mkdir -p deploy/${CIRCLE_BRANCH:-release}/${CIRCLE_TAG:-$OMR_KERNEL}/$OMR_TARGET
rsync -av --delete-after ~/openmptcprouter/wrt32x/source/bin/ -e "ssh -q -p ${OMR_DEPLOY_PORT:-22}" deploy@$OMR_DEPLOY_HOST:deploy/${CIRCLE_BRANCH:-release}/${CIRCLE_TAG:-$OMR_KERNEL}/wrt32x
git clone $REPO_URL omr
if [ "$SOURCE_NAME" != "develop" ]; then
cd omr
pwd
git fetch
git checkout master
else
cd omr
git checkout develop
fi
git pull
pwd
OMR_KERNEL="${OMR_KERNEL}" OMR_FEED_SRC="${SOURCE_NAME}" sh build.sh prepare
{tools,toolchain}/install -j$(nproc) || OMR_KERNEL="${OMR_KERNEL}" OMR_FEED_SRC="${SOURCE_NAME}"
sh build.sh prepare {tools,toolchain}/install -j1 V=s
make IGNORE_ERRORS=m -C $OMR_TARGET/$OMR_KERNEL/source package/{compile,install,index}
-j$(nproc) || make IGNORE_ERRORS=m -C $OMR_TARGET/$OMR_KERNEL/source package/{compile,install,index}
-j1 V=s
make IGNORE_ERRORS=m -C $OMR_TARGET/$OMR_KERNEL/source target/install -j$(nproc)
|| make IGNORE_ERRORS=m -C $OMR_TARGET/$OMR_KERNEL/source target/install
-j1 V=s
mv ${OMR_TARGET}/${OMR_KERNEL}/source/bin ${GITHUB_WORKSPACE}/
- store_artifacts:
path: /home/runner/work/omr/${{ matrix.OMR_TARGET }}/${{ matrix.OMR_KERNEL
}}/source/bin
workflows:
version: 2
main:
openmptcprouter:
jobs:
- prepare:
filters:
tags:
only: /.*/
branches:
only:
- develop
- build_x86_64:
requires:
- prepare
filters:
tags:
only: /.*/
branches:
only:
- develop
- build_x86:
requires:
- prepare
filters:
tags:
only: /.*/
branches:
only:
- develop
- build_rpi4:
requires:
- prepare
filters:
tags:
only: /.*/
branches:
only:
- develop
- build_rpi3:
requires:
- prepare
filters:
tags:
only: /.*/
branches:
only:
- develop
- build_espressobin:
requires:
- prepare
filters:
tags:
only: /.*/
branches:
only:
- develop
- build_r2s:
requires:
- prepare
filters:
tags:
only: /.*/
branches:
only:
- develop
- build_rpi2:
requires:
- prepare
filters:
tags:
only: /.*/
branches:
only:
- develop
- build_bpi-r2:
requires:
- prepare
filters:
tags:
only: /.*/
branches:
only:
- develop
- build_wrt32:
requires:
- prepare
filters:
tags:
only: /.*/
branches:
only:
- develop
- build:
matrix:
parameters:
OMR_TARGET: ["bpi-r1","bpi-r2","bpi-r64","rpi2","rpi4","wrt32x","espressobin","r2s","rpi3","wrt3200acm","x86","x86_64","ubnt-erx","r4s","r7800","rutx12","rutx50","r5s","qnap-301w","rpi5","z8102ax_128m"]
OMR_KERNEL: ["5.4","6.1","6.6"]

View file

@ -8,7 +8,7 @@ jobs:
build:
strategy:
matrix:
OMR_TARGET: [bpi-r1, bpi-r2, bpi-r64, rpi2, rpi4, wrt32x, espressobin, r2s, rpi3, wrt3200acm, x86, x86_64, ubnt-erx, r4s, r7800, rutx12, rutx50, r5s, qnap-301w, rpi5, z8102ax_128m]
OMR_TARGET: [bpi-r1, bpi-r2, bpi-r64, rpi2, rpi4, wrt32x, espressobin, r2s, rpi3, wrt3200acm, x86, x86_64, ubnt-erx, r4s, r7800, rutx12, rutx50, r5s, qnap-301w, rpi5, z8102ax_128m, z8102ax_64m]
OMR_KERNEL: [5.4, 6.1, 6.6]
runs-on: ubuntu-latest
continue-on-error: true

View file

@ -64,6 +64,7 @@ function setup() {
ubus_call("rpc-sys", "packagelist", {}, "packages");
ubus_call("system", "board", {}, "release");
ubus_call("system", "board", {}, "board_name");
ubus_call("system", "board", {}, "kernel");
ubus_call("system", "info", {}, "memory");
ubus_call("openmptcprouter", "getrootfs", {}, "format");
ubus_call("openmptcprouter", "getefi", {}, "efi_enabled");
@ -231,6 +232,7 @@ function upgrade_request() {
// add board info to let server determine profile
request_dict.target = data.release.target
request_dict.profile = data.board_name
request_dict.kernel = data.kernel
request_dict.rootfs = data.format
request_dict.efi = data.efi_enabled

View file

@ -727,6 +727,7 @@ interface_autostart=$(ifstatus "$OMR_TRACKER_INTERFACE" 2>/dev/null | jsonfilter
interface_up=$(ifstatus "$OMR_TRACKER_INTERFACE" 2>/dev/null | jsonfilter -q -e '@["up"]')
interface_available=$(ifstatus "$OMR_TRACKER_INTERFACE" 2>/dev/null | jsonfilter -q -e '@["available"]')
interface_pending=$(ifstatus "$OMR_TRACKER_INTERFACE" 2>/dev/null | jsonfilter -q -e '@["pending"]')
interface_error=$(ifstatus "$OMR_TRACKER_INTERFACE" 2>/dev/null | jsonfilter -q -e '@["errors"][0].code')
initcwrwnd=""
@ -734,7 +735,7 @@ initcwrwnd=""
if [ "$OMR_TRACKER_STATUS" = "ERROR" ] || ([ "$OMR_TRACKER_INTERFACE" != "omrvpn" ] && [ "$interface_up" != "true" ]); then
#if [ "$interface_up" = "true" ] && [ -n "$OMR_TRACKER_INTERFACE" ] && ([ "$(uci -q get network.$OMR_TRACKER_INTERFACE.proto)" = "modemmanager" ] || [ "$(uci -q get network.$OMR_TRACKER_INTERFACE.proto)" = "wireguard" ]); then
#if [ "$interface_available" = "true" ] && ([ "$interface_pending" = "true" ] || [ "$interface_up" = "true" ]) && [ -n "$OMR_TRACKER_INTERFACE" ] && ([ "$(uci -q get network.$OMR_TRACKER_INTERFACE.proto)" = "modemmanager" ] || [ "$(uci -q get network.$OMR_TRACKER_INTERFACE.proto)" = "wireguard" ]); then
if [ "$interface_available" = "true" ] && [ -n "$OMR_TRACKER_INTERFACE" ] && ([ "$(uci -q get network.$OMR_TRACKER_INTERFACE.proto)" = "modemmanager" ] || [ "$(uci -q get network.$OMR_TRACKER_INTERFACE.proto)" = "wireguard" ]); then
if [ "$interface_available" = "true" ] && [ -n "$OMR_TRACKER_INTERFACE" ] && ([ "$(uci -q get network.$OMR_TRACKER_INTERFACE.proto)" = "modemmanager" ] || [ "$(uci -q get network.$OMR_TRACKER_INTERFACE.proto)" = "wireguard" ]) && [ "$interface_error" != "MM_PINCODE_REQUIRED" ]; then
_log "No answer from $OMR_TRACKER_INTERFACE ($OMR_TRACKER_DEVICE), restart interface"
_log "Set $OMR_TRACKER_INTERFACE down"
ifdown $OMR_TRACKER_INTERFACE
@ -746,7 +747,8 @@ if [ "$OMR_TRACKER_STATUS" = "ERROR" ] || ([ "$OMR_TRACKER_INTERFACE" != "omrvpn
modemfind="0"
for modem in $(timeout 3 mmcli -L | awk -F/ '{ print $6}' | awk '{print $1}'); do
modeminfo="$(timeout 2 mmcli -m $modem -K)"
if [ -n "$(echo $modeminfo | grep $OMR_TRACKER_DEVICE)" ]; then
device="$(uci -q get network.$OMR_TRACKER_INTERFACE.device)"
if [ -n "$(echo $modeminfo | grep $device)" ]; then
modemfind="1"
if [ -n "$(echo $modeminfo | grep 'modem.generic.state ' | grep failed)" ] && [ -n "$(echo $modeminfo | grep 'modem.generic.state-failed-reason' | grep 'unknown-capabilities')" ]; then
_log "Interface $OMR_TRACKER_INTERFACE in failed state in ModemManager, reset modem..."

View file

@ -461,7 +461,7 @@ if [ "$board" = "z8102ax-128m" ] || [ "$board" = "z8102ax-64m" ] || [ "$board" =
set network.modem1.iptype='ipv4v6'
set network.modem1.addlatency='0'
set network.modem1.force_link='1'
set network.modem1.device='/sys/devices/platform/11200000.usb/usb1/1-1/1-1.1'
set network.modem1.device='/sys/devices/platform/soc/11200000.usb/usb1/1-1/1-1.1'
set network.modem1.peerdns='0'
set network.modem1.delegate='0'
set network.modem1.multipath='on'
@ -473,7 +473,7 @@ if [ "$board" = "z8102ax-128m" ] || [ "$board" = "z8102ax-64m" ] || [ "$board" =
set network.modem2.iptype='ipv4v6'
set network.modem2.addlatency='0'
set network.modem2.force_link='1'
set network.modem2.device='/sys/devices/platform/11200000.usb/usb1/1-1/1-1.2'
set network.modem2.device='/sys/devices/platform/soc/11200000.usb/usb1/1-1/1-1.2'
set network.modem2.peerdns='0'
set network.modem2.delegate='0'
set network.modem2.multipath='on'

View file

@ -2,16 +2,15 @@
# Copyright (C) 2013 OpenWrt.org
# Copyright (C) 2023 Yannick Chabanois (Ycarus) for OpenMPTCProuter
START=10
START=58
USE_PROCD=1
log() {
logger -t "z8102" "$@"
}
start_service()
modem1()
{
log "Enable SIMs and reboot modems..."
# sim 1
#i=461
#echo $i > /sys/class/gpio/export
@ -22,16 +21,6 @@ start_service()
else
gpioset `gpiofind "sim1"`=0
fi
# sim 2
#i=462
#echo $i > /sys/class/gpio/export
#echo "out" > /sys/class/gpio/gpio${i}/direction
#echo "0" > /sys/class/gpio/gpio${i}/value
if [ -e /sys/class/gpio/sim2/value ]; then
echo "0" > /sys/class/gpio/sim2/value
else
gpioset `gpiofind "sim2"`=0
fi
# stop modem 1
#i=459
@ -44,6 +33,29 @@ start_service()
gpioset `gpiofind "modem1"`=0
fi
sleep 1
# run modem 1
#i=459
#echo "1" > /sys/class/gpio/gpio${i}/value
if [ -e /sys/class/gpio/modem1/value ]; then
echo "1" > /sys/class/gpio/modem1/value
else
gpioset `gpiofind "modem1"`=1
fi
}
modem2()
{
# sim 2
#i=462
#echo $i > /sys/class/gpio/export
#echo "out" > /sys/class/gpio/gpio${i}/direction
#echo "0" > /sys/class/gpio/gpio${i}/value
if [ -e /sys/class/gpio/sim2/value ]; then
echo "0" > /sys/class/gpio/sim2/value
else
gpioset `gpiofind "sim2"`=0
fi
# stop modem 2
#i=460
#echo $i > /sys/class/gpio/export
@ -56,15 +68,6 @@ start_service()
fi
sleep 1
# run modem 1
#i=459
#echo "1" > /sys/class/gpio/gpio${i}/value
if [ -e /sys/class/gpio/modem1/value ]; then
echo "1" > /sys/class/gpio/modem1/value
else
gpioset `gpiofind "modem1"`=1
fi
sleep 3
# run modem 2
#i=460
#echo "1" > /sys/class/gpio/gpio${i}/value
@ -74,3 +77,18 @@ start_service()
gpioset `gpiofind "modem2"`=1
fi
}
start_service()
{
modem="$1"
if [ -z "$modem" ]; then
log "Enable SIMs and reboot modems..."
modem1
modem2
elif [ "$modem" = "modem1" ]; then
log "Enable SIM1 and reboot modem1..."
modem1
elif [ "$modem" = "modem2" ]; then
log "Enable SIM2 and reboot modem2..."
modem2
fi
}