1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-feeds.git synced 2025-03-09 15:40:03 +00:00

Merge branch 'test' into ipq60xx

This commit is contained in:
suyuan 2024-09-14 03:37:57 +08:00
commit a0df8db4c4
382 changed files with 33116 additions and 8493 deletions

828
.circleci/config.yml Executable file → Normal file
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/suyuan168/3grouter || 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/suyuan168/3grouter || 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/suyuan168/3grouter || 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/suyuan168/3grouter || 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/suyuan168/3grouter || 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/suyuan168/3grouter || 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/suyuan168/3grouter || 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/suyuan168/3grouter || 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/suyuan168/3grouter || 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/suyuan168/3grouter || 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,8 +8,8 @@ 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]
OMR_KERNEL: [5.4, 6.1]
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.6]
runs-on: ubuntu-latest
continue-on-error: true
@ -24,7 +24,11 @@ jobs:
- name: Prepare
run: |
sudo apt-get update
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
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 llvm clang
- if: matrix.OMR_KERNEL == '6.6'
name: Install LLVM
run: |
sudo apt-get install llvm clang
- name: Free disk space
run: |
df -h
@ -86,10 +90,11 @@ jobs:
run: |
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
- name: Upload artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.OMR_TARGET }}
path: /home/runner/work/omr/${{ matrix.OMR_TARGET }}/${{ matrix.OMR_KERNEL }}/source/bin
overwrite: true
- if: steps.branch_name.outputs.SOURCE_BRANCH == ''
name: Deploy - Create directory
uses: ysurac/ssh-action@master

View file

@ -1,12 +1,13 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=bcm27xx-eeprom
PKG_VERSION:=v2022.04.26-138a1
PKG_RELEASE:=$(AUTORELEASE)
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/raspberrypi/rpi-eeprom/tar.gz/$(PKG_VERSION)?
PKG_HASH:=7c54839e68f226c5853fb63c8a1539b729d84b2e6bac311a51766c601d10a413
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/raspberrypi/rpi-eeprom
PKG_SOURCE_DATE:=2024-06-05
PKG_SOURCE_VERSION:=e430a41e7323a1e28fb42b53cf79e5ba9b5ee975
PKG_MIRROR_HASH:=6c9a45d4ea0f33a9dc18f11b6cdeb425f0682dc41099df3a1f350939aecce353
PKG_LICENSE:=BSD-3-Clause Custom
PKG_LICENSE_FILES:=LICENSE
@ -18,15 +19,39 @@ include $(INCLUDE_DIR)/package.mk
TAR_OPTIONS:=--strip-components 1 $(TAR_OPTIONS)
TAR_CMD=$(HOST_TAR) -C $(1) $(TAR_OPTIONS)
define Package/bcm27xx-eeprom
define Package/bcm27xx-eeprom/Default
SECTION:=utils
CATEGORY:=Utilities
DEPENDS:=bcm27xx-userland +blkid +coreutils +coreutils-od +pciutils +python3-light
endef
define Package/bcm27xx-eeprom
$(call Package/bcm27xx-eeprom/Default)
TITLE:=BCM27xx EEPROM tools
DEPENDS:=bcm27xx-utils +blkid +coreutils +coreutils-od +mount-utils +pciutils +python3-light
endef
define Package/bcm2711-eeprom
$(call Package/bcm27xx-eeprom/Default)
TITLE:=BCM2711 EEPROM tools
DEPENDS:=+bcm27xx-eeprom
endef
define Package/bcm2712-eeprom
$(call Package/bcm27xx-eeprom/Default)
TITLE:=BCM2712 EEPROM tools
DEPENDS:=+bcm27xx-eeprom
endef
define Package/bcm27xx-eeprom/description
BCM27xx EEPROM tools.
BCM27xx EEPROM config and update tools.
endef
define Package/bcm2711-eeprom/description
BCM2711 EEPROM config and update tools.
endef
define Package/bcm2712-eeprom/description
BCM2712 EEPROM config and update tools.
endef
define Build/Compile
@ -45,15 +70,27 @@ define Package/bcm27xx-eeprom/install
$(INSTALL_BIN) $(PKG_BUILD_DIR)/rpi-eeprom-config $(1)/usr/bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/rpi-eeprom-digest $(1)/usr/bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/rpi-eeprom-update $(1)/usr/bin
endef
$(INSTALL_DIR) $(1)/lib/firmware/raspberrypi/bootloader
$(CP) $(PKG_BUILD_DIR)/firmware/release-notes.md $(1)/lib/firmware/raspberrypi/bootloader
define Package/bcm2711-eeprom/install
$(INSTALL_DIR) $(1)/lib/firmware/raspberrypi/bootloader-2711
$(INSTALL_DIR) $(1)/lib/firmware/raspberrypi/bootloader-2711/default
$(INSTALL_DIR) $(1)/lib/firmware/raspberrypi/bootloader/critical
$(CP) $(PKG_BUILD_DIR)/firmware/critical/ $(1)/lib/firmware/raspberrypi/bootloader/
$(CP) $(PKG_BUILD_DIR)/firmware-2711/release-notes.md $(1)/lib/firmware/raspberrypi/bootloader-2711
$(CP) $(PKG_BUILD_DIR)/firmware-2711/default/pieeprom-2024-04-15.bin $(1)/lib/firmware/raspberrypi/bootloader-2711/default
$(CP) $(PKG_BUILD_DIR)/firmware-2711/default/recovery.bin $(1)/lib/firmware/raspberrypi/bootloader-2711/default
$(CP) $(PKG_BUILD_DIR)/firmware-2711/default/vl805-000138c0.bin $(1)/lib/firmware/raspberrypi/bootloader-2711/default
endef
$(INSTALL_DIR) $(1)/lib/firmware/raspberrypi/bootloader/stable
$(CP) $(PKG_BUILD_DIR)/firmware/stable/ $(1)/lib/firmware/raspberrypi/bootloader/
define Package/bcm2712-eeprom/install
$(INSTALL_DIR) $(1)/lib/firmware/raspberrypi/bootloader-2712
$(INSTALL_DIR) $(1)/lib/firmware/raspberrypi/bootloader-2712/default
$(CP) $(PKG_BUILD_DIR)/firmware-2712/release-notes.md $(1)/lib/firmware/raspberrypi/bootloader-2712
$(CP) $(PKG_BUILD_DIR)/firmware-2712/default/pieeprom-2024-04-20.bin $(1)/lib/firmware/raspberrypi/bootloader-2712/default
$(CP) $(PKG_BUILD_DIR)/firmware-2712/default/recovery.bin $(1)/lib/firmware/raspberrypi/bootloader-2712/default
endef
$(eval $(call BuildPackage,bcm27xx-eeprom))
$(eval $(call BuildPackage,bcm2711-eeprom))
$(eval $(call BuildPackage,bcm2712-eeprom))

View file

@ -1,4 +1,4 @@
From da37f7b051fe6833e25e78184cc9217dd4379187 Mon Sep 17 00:00:00 2001
From a7c4e8f246dc58b4c83293b11f6443528065dc70 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= <noltari@gmail.com>
Date: Mon, 23 Mar 2020 10:10:55 +0100
Subject: [PATCH] rpi-eeprom-update: OpenWrt defaults
@ -8,38 +8,29 @@ Content-Transfer-Encoding: 8bit
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
---
rpi-eeprom-update | 6 +++---
rpi-eeprom-update-default | 5 +++--
2 files changed, 6 insertions(+), 5 deletions(-)
rpi-eeprom-update | 4 ++--
rpi-eeprom-update-default | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
--- a/rpi-eeprom-update
+++ b/rpi-eeprom-update
@@ -24,12 +24,12 @@ else
fi
@@ -25,7 +25,7 @@ fi
# Selects the release sub-directory
-FIRMWARE_RELEASE_STATUS=${FIRMWARE_RELEASE_STATUS:-default}
+FIRMWARE_RELEASE_STATUS=${FIRMWARE_RELEASE_STATUS:-stable}
FIRMWARE_IMAGE_DIR=${FIRMWARE_IMAGE_DIR:-${FIRMWARE_ROOT}/${FIRMWARE_RELEASE_STATUS}}
FIRMWARE_RELEASE_STATUS=${FIRMWARE_RELEASE_STATUS:-default}
-FIRMWARE_BACKUP_DIR=${FIRMWARE_BACKUP_DIR:-/var/lib/raspberrypi/bootloader/backup}
+FIRMWARE_BACKUP_DIR=${FIRMWARE_BACKUP_DIR:-${FIRMWARE_ROOT}/backup}
ENABLE_VL805_UPDATES=${ENABLE_VL805_UPDATES:-1}
RECOVERY_BIN=${RECOVERY_BIN:-${FIRMWARE_ROOT}/${FIRMWARE_RELEASE_STATUS}/recovery.bin}
BOOTFS=${BOOTFS:-/boot}
CM4_ENABLE_RPI_EEPROM_UPDATE=${CM4_ENABLE_RPI_EEPROM_UPDATE:-0}
RPI_EEPROM_UPDATE_CONFIG_TOOL="${RPI_EEPROM_UPDATE_CONFIG_TOOL:-raspi-config}"
--- a/rpi-eeprom-update-default
+++ b/rpi-eeprom-update-default
@@ -1,8 +1,9 @@
@@ -1,7 +1,7 @@
FIRMWARE_ROOT=/lib/firmware/raspberrypi/bootloader
-FIRMWARE_RELEASE_STATUS="critical"
+FIRMWARE_RELEASE_STATUS="stable"
FIRMWARE_IMAGE_DIR="${FIRMWARE_ROOT}/${FIRMWARE_RELEASE_STATUS}"
FIRMWARE_RELEASE_STATUS="default"
-FIRMWARE_BACKUP_DIR="/var/lib/raspberrypi/bootloader/backup"
+FIRMWARE_BACKUP_DIR="${FIRMWARE_ROOT}/backup"
BOOTFS=/boot
USE_FLASHROM=0
EEPROM_CONFIG_HOOK=
+VCMAILBOX=/usr/bin/vcmailbox
# BOOTFS can be set here to override auto-detection in rpi-eeprom-update

View file

@ -0,0 +1,62 @@
From fc552b1e5c503c530763e40d2b83df55c5c2e9a3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= <noltari@gmail.com>
Date: Wed, 25 Mar 2020 20:58:35 +0100
Subject: [PATCH] rpi-eeprom-update: change default include path
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
---
rpi-eeprom-update | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
--- a/rpi-eeprom-update
+++ b/rpi-eeprom-update
@@ -6,8 +6,8 @@ set -e
script_dir=$(cd "$(dirname "$0")" && pwd)
-if [ -f /etc/default/rpi-eeprom-update ]; then
- . /etc/default/rpi-eeprom-update
+if [ -f /etc/bcm27xx-eeprom.conf ]; then
+ . /etc/bcm27xx-eeprom.conf
fi
LOCAL_MODE=0
@@ -423,7 +423,7 @@ checkDependencies() {
echo "Run with -h for more information."
echo
echo "To enable flashrom programming of the EEPROM"
- echo "Add these the following entries to /etc/default/rpi-eeprom-update"
+ echo "Add these the following entries to /etc/bcm27xx-eeprom.conf"
echo "RPI_EEPROM_USE_FLASHROM=1"
echo "CM4_ENABLE_RPI_EEPROM_UPDATE=1"
echo
@@ -514,7 +514,7 @@ The system should then boot normally.
If /boot does not correspond to the boot partition and this
is not a NOOBS system, then the mount point for BOOTFS should be defined
-in /etc/default/rpi-eeprom-update by defining the BOOTFS variable.
+in /etc/bcm27xx-eeprom.conf by defining the BOOTFS variable.
A backup of the current EEPROM config file is written to ${FIRMWARE_BACKUP_DIR}
before applying the update.
@@ -546,7 +546,7 @@ Options:
-u Install the specified VL805 (USB EEPROM) image file.
Environment:
-Environment variables should be defined in /etc/default/rpi-eeprom-update
+Environment variables should be defined in /etc/bcm27xx-eeprom.conf
EEPROM_CONFIG_HOOK
@@ -618,7 +618,7 @@ must first be enabled by removing ENABLE
via usbboot.
After enabling self-update set the CM4_ENABLE_RPI_EEPROM_UPDATE=1 environment
-variable or define it in /etc/default/rpi-eeprom-update.
+variable or define it in /etc/bcm27xx-eeprom.conf.
N.B. If there is a power failure during SELF_UPDATE the EEPROM write may fail and
usbboot must be used to flash the bootloader EEPROM. SELF_UPDATE is not recommended

View file

@ -1,26 +0,0 @@
From 6674d49dea0104031b3f54df4c7a356dc4307bb2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= <noltari@gmail.com>
Date: Wed, 25 Mar 2020 20:58:35 +0100
Subject: [PATCH] rpi-eeprom-update: change default include path
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
---
rpi-eeprom-update | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
--- a/rpi-eeprom-update
+++ b/rpi-eeprom-update
@@ -6,8 +6,8 @@ set -e
script_dir=$(cd "$(dirname "$0")" && pwd)
-if [ -f /etc/default/rpi-eeprom-update ]; then
- . /etc/default/rpi-eeprom-update
+if [ -f /etc/bcm27xx-eeprom.conf ]; then
+ . /etc/bcm27xx-eeprom.conf
fi
LOCAL_MODE=0

View file

@ -1,4 +1,4 @@
From 8376ac74390af0ad736c88615e128b82a75eebc0 Mon Sep 17 00:00:00 2001
From 62ec3384358bda60269c131d3880795bc8cdc3ce Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= <noltari@gmail.com>
Date: Fri, 19 Feb 2021 10:54:23 +0100
Subject: [PATCH] rpi-eeprom-update: chmod silent (-f) is not supported
@ -13,7 +13,7 @@ Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
--- a/rpi-eeprom-update
+++ b/rpi-eeprom-update
@@ -200,7 +200,7 @@ applyRecoveryUpdate()
@@ -216,7 +216,7 @@ applyRecoveryUpdate()
|| die "Failed to copy ${TMP_EEPROM_IMAGE} to ${BOOTFS}"
# For NFS mounts ensure that the files are readable to the TFTP user
@ -22,7 +22,7 @@ Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
|| die "Failed to set permissions on eeprom update files"
fi
@@ -211,7 +211,7 @@ applyRecoveryUpdate()
@@ -227,7 +227,7 @@ applyRecoveryUpdate()
|| die "Failed to copy ${VL805_UPDATE_IMAGE} to ${BOOTFS}/vl805.bin"
# For NFS mounts ensure that the files are readable to the TFTP user

View file

@ -1,6 +1,19 @@
From 8d1e47c956ae10d1146114f7fcd4eb0d33187d08 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= <noltari@gmail.com>
Date: Tue, 16 Jan 2024 16:25:40 +0100
Subject: [PATCH] rpi-eeprom-config: replace nano with vi as default editor
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
---
rpi-eeprom-config | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
--- a/rpi-eeprom-config
+++ b/rpi-eeprom-config
@@ -166,8 +166,8 @@ def edit_config(eeprom=None):
@@ -184,8 +184,8 @@ def edit_config(eeprom=None):
"""
Implements something like 'git commit' for editing EEPROM configs.
"""
@ -11,7 +24,7 @@
if 'EDITOR' in os.environ:
editor = os.environ['EDITOR']
@@ -428,7 +428,7 @@ Operating modes:
@@ -484,7 +484,7 @@ Operating modes:
To cancel the pending update run 'sudo rpi-eeprom-update -r'

64
bcm27xx-utils/Makefile Normal file
View file

@ -0,0 +1,64 @@
# SPDX-License-Identifier: GPL-2.0-only
include $(TOPDIR)/rules.mk
PKG_NAME:=bcm27xx-utils
PKG_VERSION:=2024-04-24
PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/raspberrypi/utils.git
PKG_SOURCE_VERSION:=451b9881b72cb994c102724b5a7d9b93f97dc315
PKG_MIRROR_HASH:=b453976171187e0ffe7cacfdcab36cec6b5d02db8b6d978cb9afbbcafcfcff9d
PKG_FLAGS:=nonshared
PKG_BUILD_FLAGS:=no-lto
PKG_LICENSE:=BSD-3-Clause
PKG_LICENSE_FILES:=LICENCE
CMAKE_INSTALL:=1
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/cmake.mk
define Package/bcm27xx-utils
SECTION:=utils
CATEGORY:=Utilities
DEPENDS:=@TARGET_bcm27xx +libfdt
TITLE:=BCM27xx scripts and simple applications
PROVIDES:=bcm27xx-userland
endef
define Package/bcm27xx-utils/description
BCM27xx scripts and simple applications.
Replaces bcm27xx-userland scripts and applications.
endef
define Package/bcm27xx-utils/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/dtmerge $(1)/usr/bin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/dtoverlay $(1)/usr/bin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/dtparam $(1)/usr/bin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/eepdump $(1)/usr/bin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/eepflash.sh $(1)/usr/bin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/eepmake $(1)/usr/bin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/otpset $(1)/usr/bin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/overlaycheck $(1)/usr/bin
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/bin/overlaycheck_exclusions.txt $(1)/usr/bin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ovmerge $(1)/usr/bin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/pinctrl $(1)/usr/bin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/raspinfo $(1)/usr/bin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/vcgencmd $(1)/usr/bin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/vclog $(1)/usr/bin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/vcmailbox $(1)/usr/bin
endef
$(eval $(call BuildPackage,bcm27xx-utils))

View file

@ -0,0 +1,255 @@
From 0db3fb3119eda8c2360454c2a01f84602a879c38 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= <noltari@gmail.com>
Date: Tue, 16 Jan 2024 15:32:12 +0100
Subject: [PATCH] raspinfo: adapt to OpenWrt
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
---
raspinfo/raspinfo | 186 ++++------------------------------------------
1 file changed, 13 insertions(+), 173 deletions(-)
--- a/raspinfo/raspinfo
+++ b/raspinfo/raspinfo
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
# Some of the regex's used in sed
# Catch basic IP6 address "s/\([0-9a-fA-F]\{1,4\}:\)\{7,7\}[0-9a-fA-F]\{1,4\}/y.y.y.y.y.y.y.y/g"
@@ -6,147 +6,6 @@
# IP4 d.d.d.d decimal "s/\([0-9]\{1,3\}\.\)\{3,3\}[0-9]\{1,3\}/x.x.x.x/g"
# mac address "s/\([0-9a-fA-F]\{2,2\}\:\)\{5,5\}[0-9a-fA-F]\{2,2\}/m.m.m.m/g"
-
-display_info_drm() {
- # If running X then can use xrandr, otherwise
- # dump the /sys/class entries for the displays
- if command -v xrandr > /dev/null &&
- DISPLAY=${DISPLAY:-:0} xrandr --listmonitors &>/dev/null;
- then
- echo "Running (F)KMS and X"
- echo
-
- DISPLAY=${DISPLAY:-:0} xrandr --verbose
- else
- echo "Running (F)KMS, console"
- echo
-
- for card in /sys/class/drm/card[0-9]-*;
- do
- echo $card
-
- # if kmsprint isn't installed print basic mode info
- if ! command -v kmsprint > /dev/null; then
- if [ -f $card/modes ];
- then
- cat $card/modes
- else
- echo "No modes found"
- fi
- fi
-
- if [ -f $card/edid ];
- then
- base64 $card/edid
- else
- echo "No EDID found"
- fi
- echo
- done
- fi
-
- # kmsprint is more useful, but not always installed
- echo
- if command -v kmsprint > /dev/null; then
- kmsprint
- echo
- kmsprint -m
- else
- echo "kmsprint is not installed. Install with: sudo apt install kms++-utils"
- fi
-
- echo
-
- # dump the /sys/class entries for the displays
- cardfound=0
- for card in `seq 0 9`;
- do
- if sudo test -f "/sys/kernel/debug/dri/${card}/state";
- then
- for hdmi in 0 1;
- do
- if sudo test -f "/sys/kernel/debug/dri/${card}/hdmi${hdmi}_regs";
- then
- echo "HDMI${hdmi}: $(sudo cat /sys/kernel/debug/dri/$card/hdmi${hdmi}_regs | grep HOTPLUG)"
- fi
- done
- echo
- echo "/sys/kernel/debug/dri/$card/state:"
- sudo cat "/sys/kernel/debug/dri/$card/state"
- echo
- cardfound=1
- fi
- done
- if [ "$cardfound" == "0" ];
- then
- echo "kms state not found"
- fi
- echo
-
-}
-
-display_info_legacy() {
- # Legacy mode
- echo "Running Legacy framebuffer"
- echo
-
- for card in `seq 0 9`;
- do
- F="/dev/fb${card}"
- if test -e $F;
- then
- echo Framebuffer: $F
- fbset -s -fb $F
- fi
- done
-
- disps=`tvservice -l | awk '/Display Number/{print substr($3,1,1)}'`
-
- tmp=$(mktemp)
-
- for display in $disps
- do
- echo
- echo "Display: " $display
-
- tvservice -v $display -s
- tvservice -v $display -n
- tvservice -v $display -m CEA
- tvservice -v $display -m DMT
-
- echo
- tvservice -v $display -d $tmp > /dev/null
- base64 $tmp
- done
-
- rm $tmp
-}
-
-display_info() {
- # Check if we are running a KMS/DRM system
-
- if [ -d "/dev/dri" ];
- then
- display_info_drm
- else
- display_info_legacy
- fi
-}
-
-audio_info() {
- aplay -l
- echo
- aplay -L
- echo
- systemctl --user status pipewire.socket pipewire.service pulseaudio.service pulseaudio.socket
- echo
- if command -v pactl > /dev/null; then
- pactl info
- else
- echo pactl not installed
- fi
-}
-
OUT=raspinfo.txt
rm -f $OUT
@@ -163,8 +22,6 @@ echo
cat /etc/os-release | head -4
echo
-cat /etc/rpi-issue
-echo
uname -a
cat /proc/cpuinfo | tail -3
@@ -190,17 +47,6 @@ echo
cat /proc/swaps
echo
-echo "Package version information"
-echo "---------------------------"
-
-apt-cache policy raspberrypi-ui-mods | head -2
-apt-cache policy raspberrypi-sys-mods | head -2
-apt-cache policy openbox | head -2
-apt-cache policy lxpanel | head -2
-apt-cache policy pcmanfm | head -2
-apt-cache policy rpd-plym-splash | head -2
-
-echo
echo "Networking Information"
echo "----------------------"
echo
@@ -212,21 +58,11 @@ echo "USB Information"
echo "---------------"
echo
-lsusb -t
-
-echo
-echo "Display Information"
-echo "-------------------"
-echo
-
-display_info
-
-echo
-echo "Audio Information"
-echo "-------------------"
-echo
-
-audio_info
+if command -v lsusb > /dev/null; then
+ lsusb -t
+else
+ echo usbutils not installed
+fi
echo
echo "config.txt"
@@ -250,7 +86,7 @@ echo "-----------------"
echo
if command -v pinctrl > /dev/null; then
- sudo pinctrl 2>&1
+ pinctrl 2>&1
elif command -v raspi-gpio > /dev/null; then
raspi-gpio get 2>&1
else
@@ -263,9 +99,9 @@ echo "------------------"
echo
if command -v vcdbg > /dev/null; then
- sudo vcdbg log msg 2>&1
+ vcdbg log msg 2>&1
elif command -v vclog > /dev/null; then
- sudo vclog --msg 2>&1
+ vclog --msg 2>&1
else
echo "vcdbg not found"
fi
@@ -284,5 +120,9 @@ echo
echo "EEPROM"
echo "------"
echo
-sudo rpi-eeprom-update
+if command -v rpi-eeprom-update > /dev/null; then
+ rpi-eeprom-update
+else
+ echo bcm27xx-eeprom not installed
+fi
fi

View file

@ -0,0 +1,11 @@
--- a/pinctrl/pinctrl.c 2024-07-02 14:14:31.113459219 +0200
+++ b/pinctrl/pinctrl.c 2024-07-02 14:14:44.533241981 +0200
@@ -220,7 +220,7 @@
if (!gpio_num_is_valid(gpio))
return 1;
- poll_gpios = reallocarray(poll_gpios, num_poll_gpios + 1,
+ poll_gpios = realloc(poll_gpios, num_poll_gpios + 1 *
sizeof(*poll_gpios));
new_gpio = &poll_gpios[num_poll_gpios];
new_gpio->num = num;

9
contributors/bdaylik.md Normal file
View file

@ -0,0 +1,9 @@
2024-03-22
I hereby agree to the terms of the "OpenMPTCProuter Individual Contributor License Agreement", with MD5 checksum bc827a07eb93611d793ddb7c75083c00.
I furthermore declare that I am authorized and able to make this agreement and sign this declaration.
Signed,
Baris Daylik https://github.com/bdaylik

0
fast-classifier/src/Makefile Executable file → Normal file
View file

0
fast-classifier/src/fast-classifier.c Executable file → Normal file
View file

0
fast-classifier/src/fast-classifier.h Executable file → Normal file
View file

0
fast-classifier/src/nl_classifier_test.c Executable file → Normal file
View file

0
fast-classifier/src/userspace_example.c Executable file → Normal file
View file

View file

@ -28,7 +28,7 @@ define Package/iptables-mod-fullconenat
SECTION:=net
CATEGORY:=Network
TITLE:=FULLCONENAT iptables extension
DEPENDS:=+iptables +kmod-ipt-fullconenat
DEPENDS:=+iptables +kmod-ipt-fullconenat @LINUX_5_4
endef
define Package/iptables-mod-fullconenat/install
@ -39,7 +39,7 @@ endef
define KernelPackage/ipt-fullconenat
SUBMENU:=Netfilter Extensions
TITLE:=FULLCONENAT netfilter module
DEPENDS:=+kmod-nf-ipt +kmod-nf-nat
DEPENDS:=+kmod-nf-ipt +kmod-nf-nat @LINUX_5_4
KCONFIG:= \
CONFIG_NF_CONNTRACK_EVENTS=y \
CONFIG_NF_CONNTRACK_CHAIN_EVENTS=y

View file

@ -215,7 +215,7 @@ GO_PKG_BUILD_VARS= \
GOPATH="$(GO_PKG_BUILD_DIR)" \
GOCACHE="$(GO_BUILD_CACHE_DIR)" \
GOMODCACHE="$(GO_MOD_CACHE_DIR)" \
GOENV=off GOPROXY="direct" \
GOENV=off \
GOTOOLCHAIN=local
GO_PKG_VARS= \

View file

@ -31,7 +31,6 @@ unexport \
GOROOT \
GOTOOLCHAIN \
GOTMPDIR \
GOPROXY \
GOWORK
# Unmodified:
# GOINSECURE

View file

@ -7,8 +7,8 @@
include $(TOPDIR)/rules.mk
GO_VERSION_MAJOR_MINOR:=1.21
GO_VERSION_PATCH:=4
GO_VERSION_MAJOR_MINOR:=1.22
GO_VERSION_PATCH:=0
PKG_NAME:=golang
PKG_VERSION:=$(GO_VERSION_MAJOR_MINOR)$(if $(GO_VERSION_PATCH),.$(GO_VERSION_PATCH))
@ -20,7 +20,7 @@ GO_SOURCE_URLS:=https://dl.google.com/go/ \
PKG_SOURCE:=go$(PKG_VERSION).src.tar.gz
PKG_SOURCE_URL:=$(GO_SOURCE_URLS)
PKG_HASH:=47b26a83d2b65a3c1c1bcace273b69bee49a7a7b5168a7604ded3d26a37bd787
PKG_HASH:=4d196c3d41a0d6c1dfc64d04e3cc1f608b0c436bd87b7060ce3e23234e1f4d5c
PKG_MAINTAINER:=Jeffery To <jeffery.to@gmail.com>
PKG_LICENSE:=BSD-3-Clause
@ -95,6 +95,12 @@ BOOTSTRAP_1_17_HASH:=a1a48b23afb206f95e7bbaa9b898d965f90826f6f1d1fc0c1d784ada0cd
BOOTSTRAP_1_17_BUILD_DIR:=$(HOST_BUILD_DIR)/.go_bootstrap_1.17
BOOTSTRAP_1_20_SOURCE:=go1.20.6.src.tar.gz
BOOTSTRAP_1_20_SOURCE_URL:=$(GO_SOURCE_URLS)
BOOTSTRAP_1_20_HASH:=62ee5bc6fb55b8bae8f705e0cb8df86d6453626b4ecf93279e2867092e0b7f70
BOOTSTRAP_1_20_BUILD_DIR:=$(HOST_BUILD_DIR)/.go_bootstrap_1.20
include $(INCLUDE_DIR)/host-build.mk
include $(INCLUDE_DIR)/package.mk
include ../golang-compiler.mk
@ -104,6 +110,7 @@ PKG_UNPACK:=$(HOST_TAR) -C "$(PKG_BUILD_DIR)" --strip-components=1 -xzf "$(DL_DI
HOST_UNPACK:=$(HOST_TAR) -C "$(HOST_BUILD_DIR)" --strip-components=1 -xzf "$(DL_DIR)/$(PKG_SOURCE)"
BOOTSTRAP_UNPACK:=$(HOST_TAR) -C "$(BOOTSTRAP_BUILD_DIR)" --strip-components=1 -xzf "$(DL_DIR)/$(BOOTSTRAP_SOURCE)"
BOOTSTRAP_1_17_UNPACK:=$(HOST_TAR) -C "$(BOOTSTRAP_1_17_BUILD_DIR)" --strip-components=1 -xzf "$(DL_DIR)/$(BOOTSTRAP_1_17_SOURCE)"
BOOTSTRAP_1_20_UNPACK:=$(HOST_TAR) -C "$(BOOTSTRAP_1_20_BUILD_DIR)" --strip-components=1 -xzf "$(DL_DIR)/$(BOOTSTRAP_1_20_SOURCE)"
# don't strip ELF executables in test data
RSTRIP:=:
@ -215,6 +222,22 @@ Hooks/HostPrepare/Post+=Bootstrap-1.17/Prepare
$(eval $(call GoCompiler/AddProfile,Bootstrap-1.17,$(BOOTSTRAP_1_17_BUILD_DIR),,bootstrap-1.17,$(GO_HOST_OS_ARCH)))
# Bootstrap 1.20
define Download/golang-bootstrap-1.20
FILE:=$(BOOTSTRAP_1_20_SOURCE)
URL:=$(BOOTSTRAP_1_20_SOURCE_URL)
HASH:=$(BOOTSTRAP_1_20_HASH)
endef
$(eval $(call Download,golang-bootstrap-1.20))
define Bootstrap-1.20/Prepare
mkdir -p "$(BOOTSTRAP_1_20_BUILD_DIR)" && $(BOOTSTRAP_1_20_UNPACK) ;
endef
Hooks/HostPrepare/Post+=Bootstrap-1.20/Prepare
$(eval $(call GoCompiler/AddProfile,Bootstrap-1.20,$(BOOTSTRAP_1_20_BUILD_DIR),,bootstrap-1.20,$(GO_HOST_OS_ARCH)))
# Host
@ -251,8 +274,13 @@ define Host/Compile
$(HOST_GO_VARS) \
)
$(call GoCompiler/Host/Make, \
$(call GoCompiler/Bootstrap-1.20/Make, \
GOROOT_BOOTSTRAP="$(BOOTSTRAP_1_17_BUILD_DIR)" \
$(HOST_GO_VARS) \
)
$(call GoCompiler/Host/Make, \
GOROOT_BOOTSTRAP="$(BOOTSTRAP_1_20_BUILD_DIR)" \
$(if $(HOST_GO_ENABLE_PIE),GO_LDFLAGS="-buildmode pie") \
$(HOST_GO_VARS) \
)

View file

@ -8,12 +8,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=iperf
PKG_VERSION:=3.14
PKG_RELEASE:=10
PKG_VERSION:=3.17.1
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://github.com/esnet/iperf/archive/refs/tags/
PKG_HASH:=bbafa2c9687f0f7fe00947dc779b83c91663911e22460005c0ad4623797b3dbd
PKG_HASH:=105b4fe7fbce31c9b94a3fec10c46e3b4b298adc076e1e3af52b990e1faf2db9
PKG_MAINTAINER:=Yannick Chabanois <ycarus@zugaina.org>
PKG_LICENSE:=BSD-3-Clause

View file

@ -1,67 +1,86 @@
From 26b066b9d4e92442d55950689dbd9fd101b429a7 Mon Sep 17 00:00:00 2001
From: Paolo Abeni <pabeni@redhat.com>
Date: Mon, 14 Jun 2021 16:13:02 +0200
Subject: [PATCH] Add MPTCP support with the --multipath flag
From 5f71968be8e8809e4e7b876ff04b4ef3f22eb141 Mon Sep 17 00:00:00 2001
From: Geliang Tang <geliang@kernel.org>
Date: Wed, 6 Mar 2024 11:23:33 +0800
Subject: [PATCH] add MPTCPv1 support
Also available with the short option '-m'.
The MPTCP protocol is really a TCP variant, so this change
does not implement a new 'struct protocol'. Instead it just
extend the TCP support to optionally enable multipath.
The Multipath TCP (MPTCP) protocol (v1 / RFC 8684) has been added in
the upstream Linux kernel since v5.6.
The only required dependency is IPPROTO_MPTCP definition,
which should be provided by the netinet/in.h header.
To keep things simple, just conditionally provide the required
protocol, if the system header does not have it yet
MPTCP is strongly tied to TCP, and the kernel APIs are almost the same.
The only required dependency is the 'IPPROTO_MPTCP' protocol number
definition, which should be provided by the netinet/in.h header if it
is recent enough.
This patch adds a new flag '-m' or '--mptcp' to support MPTCPv1. It can
be used like this:
> iperf3 -m -s
> iperf3 -m -c 127.0.0.1
There is no need to check for IPPROTO_MPTCP support in configure.ac
at build time, it is at runtime we will see if the kernel being use
supports or not MPTCP.
If IPPROTO_MPTCP is not supported by the kernel being tested, it is
normal to fail because the feature is not available and the user
explicitly asked to use MPTCP.
Closes: https://github.com/esnet/iperf/pull/1659
Co-developed-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Geliang Tang <geliang@kernel.org>
---
src/iperf.h | 1 +
src/iperf3.1 | 4 ++++
src/iperf_api.c | 11 ++++++++++-
src/iperf_locale.c | 1 +
src/iperf_tcp.c | 18 +++++++++++++++---
5 files changed, 31 insertions(+), 4 deletions(-)
src/iperf_api.c | 19 ++++++++++++++++++-
src/iperf_locale.c | 3 +++
src/iperf_tcp.c | 22 +++++++++++++++++++---
src/net.c | 10 +++++-----
src/net.h | 2 +-
7 files changed, 51 insertions(+), 10 deletions(-)
diff --git a/src/iperf.h b/src/iperf.h
index 3fc91d0c0..e753df944 100644
index dc3c0d1df..cb821e1f7 100644
--- a/src/iperf.h
+++ b/src/iperf.h
@@ -315,6 +315,7 @@ struct iperf_test
int udp_counters_64bit; /* --use-64-bit-udp-counters */
int forceflush; /* --forceflush - flushing output at every interval */
int multisend;
+ int multipath; /* -m option - multi-path variant */
@@ -342,6 +342,7 @@ struct iperf_test
int repeating_payload; /* --repeating-payload */
int timestamps; /* --timestamps */
char *timestamp_format;
+ int mptcp; /* -m, --mptcp */
char *json_output_string; /* rendered JSON output if json_output is set */
/* Select related parameters */
diff --git a/src/iperf3.1 b/src/iperf3.1
index f5eef6eb3..205a8337e 100644
index 2efd53dea..ebc603408 100644
--- a/src/iperf3.1
+++ b/src/iperf3.1
@@ -228,6 +228,10 @@ run in client mode, connecting to the specified server.
By default, a test consists of sending data from the client to the
server, unless the \-R flag is specified.
@@ -193,6 +193,10 @@ parameter is specified in ms, and defaults to the system settings.
This functionality depends on the TCP_USER_TIMEOUT socket option, and
will not work on systems that do not support it.
.TP
+.BR -m ", " --multipath " "
+use multipath variant for the current protocol. This only applies to
+.BR -m ", " --mptcp " "
+use mptcp variant for the current protocol. This only applies to
+TCP and enables MPTCP usage.
+.TP
.BR --sctp
use SCTP rather than TCP (FreeBSD and Linux)
.TP
.BR -d ", " --debug " "
emit debugging output.
Primarily (perhaps exclusively) of use to developers.
diff --git a/src/iperf_api.c b/src/iperf_api.c
index f8f2321ec..bea53e397 100644
index 1dcfaabf5..f7f1fbfb8 100644
--- a/src/iperf_api.c
+++ b/src/iperf_api.c
@@ -1007,7 +1007,8 @@ iperf_parse_arguments(struct iperf_test *test, int argc, char **argv)
{"connect-timeout", required_argument, NULL, OPT_CONNECT_TIMEOUT},
@@ -1144,6 +1144,9 @@ iperf_parse_arguments(struct iperf_test *test, int argc, char **argv)
{"idle-timeout", required_argument, NULL, OPT_IDLE_TIMEOUT},
{"rcv-timeout", required_argument, NULL, OPT_RCV_TIMEOUT},
{"snd-timeout", required_argument, NULL, OPT_SND_TIMEOUT},
+ {"multipath", no_argument, NULL, 'm'},
+#if defined(linux)
+ {"mptcp", no_argument, NULL, 'm'},
+#endif
{"debug", optional_argument, NULL, 'd'},
{"help", no_argument, NULL, 'h'},
{NULL, 0, NULL, 0}
@@ -1030,7 +1031,7 @@ iperf_parse_arguments(struct iperf_test *test, int argc, char **argv)
char *client_username = NULL, *client_rsa_public_key = NULL, *server_rsa_private_key = NULL;
@@ -1169,7 +1172,7 @@ iperf_parse_arguments(struct iperf_test *test, int argc, char **argv)
FILE *ptr_file;
#endif /* HAVE_SSL */
- while ((flag = getopt_long(argc, argv, "p:f:i:D1VJvsc:ub:t:n:k:l:P:Rw:B:M:N46S:L:ZO:F:A:T:C:dI:hX:", longopts, NULL)) != -1) {
@ -69,49 +88,59 @@ index f8f2321ec..bea53e397 100644
switch (flag) {
case 'p':
portno = atoi(optarg);
@@ -1103,6 +1104,10 @@ iperf_parse_arguments(struct iperf_test *test, int argc, char **argv)
iperf_set_test_role(test, 'c');
iperf_set_test_server_hostname(test, optarg);
@@ -1639,6 +1642,12 @@ iperf_parse_arguments(struct iperf_test *test, int argc, char **argv)
test->settings->connect_timeout = unit_atoi(optarg);
client_flag = 1;
break;
+#if defined(linux)
+ case 'm':
+ set_protocol(test, Ptcp);
+ test->multipath = 1;
+ test->mptcp = 1;
+ break;
case 'u':
set_protocol(test, Pudp);
client_flag = 1;
@@ -2000,6 +2005,8 @@ send_parameters(struct iperf_test *test)
+#endif
case 'h':
usage_long(stdout);
exit(0);
@@ -2216,6 +2225,10 @@ send_parameters(struct iperf_test *test)
cJSON_AddTrueToObject(j, "reverse");
if (test->bidirectional)
cJSON_AddTrueToObject(j, "bidirectional");
+ if (test->multipath)
+ cJSON_AddTrueToObject(j, "multipath");
+#if defined(linux)
+ if (test->mptcp)
+ cJSON_AddTrueToObject(j, "mptcp");
+#endif
if (test->settings->socket_bufsize)
cJSON_AddNumberToObject(j, "window", test->settings->socket_bufsize);
if (test->settings->blksize)
@@ -2112,6 +2119,8 @@ get_parameters(struct iperf_test *test)
@@ -2332,6 +2345,10 @@ get_parameters(struct iperf_test *test)
iperf_set_test_reverse(test, 1);
if ((j_p = cJSON_GetObjectItem(j, "bidirectional")) != NULL)
iperf_set_test_bidirectional(test, 1);
+ if ((j_p = cJSON_GetObjectItem(j, "multipath")) != NULL)
+ test->multipath = 1;
+#if defined(linux)
+ if ((j_p = cJSON_GetObjectItem(j, "mptcp")) != NULL)
+ test->mptcp = 1;
+#endif
if ((j_p = cJSON_GetObjectItem(j, "window")) != NULL)
test->settings->socket_bufsize = j_p->valueint;
if ((j_p = cJSON_GetObjectItem(j, "len")) != NULL)
diff --git a/src/iperf_locale.c b/src/iperf_locale.c
index e1e9dc5b6..a70bd73b9 100644
index ae0f63a41..d454af4f0 100644
--- a/src/iperf_locale.c
+++ b/src/iperf_locale.c
@@ -146,6 +146,7 @@ const char usage_longstr[] = "Usage: iperf3 [-s|-c host] [options]\n"
" --nstreams # number of SCTP streams\n"
#endif /* HAVE_SCTP_H */
" -u, --udp use UDP rather than TCP\n"
+ " -m, --multipath use MPTCP rather than plain TCP\n"
" --connect-timeout # timeout for control connection setup (ms)\n"
" -b, --bitrate #[KMG][/#] target bitrate in bits/sec (0 for unlimited)\n"
" (default %d Mbit/sec for UDP, unlimited for TCP)\n"
--- a/src/iperf_tcp.c 2023-07-07 23:47:41.000000000 +0200
+++ b/src/iperf_tcp.c 2023-08-01 14:53:57.832072168 +0200
@@ -128,6 +128,9 @@ const char usage_longstr[] = "Usage: iperf3 [-s|-c host] [options]\n"
" --snd-timeout # timeout for unacknowledged TCP data\n"
" (in ms, default is system settings)\n"
#endif /* HAVE_TCP_USER_TIMEOUT */
+#if defined(linux)
+ " -m, --mptcp use MPTCP rather than plain TCP\n"
+#endif
" -d, --debug[=#] emit debugging output\n"
" (optional optional \"=\" and debug level: 1-4. Default is 4 - all messages)\n"
" -v, --version show version information and quit\n"
diff --git a/src/iperf_tcp.c b/src/iperf_tcp.c
index 184a1955e..a10322b75 100644
--- a/src/iperf_tcp.c
+++ b/src/iperf_tcp.c
@@ -44,6 +44,10 @@
#include "net.h"
#include "cjson.h"
@ -123,86 +152,106 @@ index e1e9dc5b6..a70bd73b9 100644
#if defined(HAVE_FLOWLABEL)
#include "flowlabel.h"
#endif /* HAVE_FLOWLABEL */
@@ -154,6 +158,7 @@
socklen_t optlen;
int saved_errno;
int rcvbuf_actual, sndbuf_actual;
+ int protocol = 0;
s = test->listener;
@@ -166,7 +171,7 @@
@@ -182,9 +186,10 @@ iperf_tcp_listen(struct iperf_test *test)
*
* It's not clear whether this is a requirement or a convenience.
*/
- if (test->no_delay || test->settings->mss || test->settings->socket_bufsize) {
+ if (test->multipath || test->no_delay || test->settings->mss || test->settings->socket_bufsize) {
+ if (test->no_delay || test->mptcp || test->settings->mss || test->settings->socket_bufsize) {
struct addrinfo hints, *res;
char portstr[6];
+ int proto = 0;
@@ -194,7 +199,10 @@
FD_CLR(s, &test->read_set);
close(s);
@@ -210,7 +215,12 @@ iperf_tcp_listen(struct iperf_test *test)
return -1;
}
- if ((s = socket(res->ai_family, SOCK_STREAM, 0)) < 0) {
+ if (test->multipath)
+ protocol = IPPROTO_MPTCP;
+#if defined(linux)
+ if (test->mptcp)
+ proto = IPPROTO_MPTCP;
+#endif
+
+ if ((s = socket(res->ai_family, SOCK_STREAM, protocol)) < 0) {
+ if ((s = socket(res->ai_family, SOCK_STREAM, proto)) < 0) {
freeaddrinfo(res);
i_errno = IESTREAMLISTEN;
return -1;
@@ -374,8 +382,12 @@
@@ -375,8 +385,14 @@ iperf_tcp_connect(struct iperf_test *test)
socklen_t optlen;
int saved_errno;
int rcvbuf_actual, sndbuf_actual;
+ int protocol = 0;
+ int proto = 0;
+
+ if (test->multipath)
+ protocol = IPPROTO_MPTCP;
+#if defined(linux)
+ if (test->mptcp)
+ proto = IPPROTO_MPTCP;
+#endif
- s = create_socket(test->settings->domain, SOCK_STREAM, test->bind_address, test->bind_dev, test->bind_port, test->server_hostname, test->server_port, &server_res);
+ s = create_socket(test->settings->domain, SOCK_STREAM, test->bind_address, test->bind_dev, test->bind_port, test->server_hostname, test->server_port, &server_res, protocol);
+ s = create_socket(test->settings->domain, SOCK_STREAM, proto, test->bind_address, test->bind_dev, test->bind_port, test->server_hostname, test->server_port, &server_res);
if (s < 0) {
i_errno = IESTREAMCONNECT;
return -1;
--- a/src/net.c 2023-08-01 14:54:14.175802546 +0200
+++ b/src/net.c 2023-08-01 14:54:40.831362812 +0200
@@ -121,7 +121,7 @@
diff --git a/src/net.c b/src/net.c
index c82caff1b..849e919f2 100644
--- a/src/net.c
+++ b/src/net.c
@@ -124,7 +124,7 @@ timeout_connect(int s, const struct sockaddr *name, socklen_t namelen,
/* create a socket */
int
-create_socket(int domain, int proto, const char *local, const char *bind_dev, int local_port, const char *server, int port, struct addrinfo **server_res_out)
+create_socket(int domain, int proto, const char *local, const char *bind_dev, int local_port, const char *server, int port, struct addrinfo **server_res_out, int protocol)
+create_socket(int domain, int type, int proto, const char *local, const char *bind_dev, int local_port, const char *server, int port, struct addrinfo **server_res_out)
{
struct addrinfo hints, *local_res = NULL, *server_res = NULL;
int s, saved_errno;
@@ -145,7 +145,7 @@
@@ -133,14 +133,14 @@ create_socket(int domain, int proto, const char *local, const char *bind_dev, in
if (local) {
memset(&hints, 0, sizeof(hints));
hints.ai_family = domain;
- hints.ai_socktype = proto;
+ hints.ai_socktype = type;
if ((gerror = getaddrinfo(local, NULL, &hints, &local_res)) != 0)
return -1;
}
memset(&hints, 0, sizeof(hints));
hints.ai_family = domain;
- hints.ai_socktype = proto;
+ hints.ai_socktype = type;
snprintf(portstr, sizeof(portstr), "%d", port);
if ((gerror = getaddrinfo(server, portstr, &hints, &server_res)) != 0) {
if (local)
@@ -148,7 +148,7 @@ create_socket(int domain, int proto, const char *local, const char *bind_dev, in
return -1;
}
- s = socket(server_res->ai_family, proto, 0);
+ s = socket(server_res->ai_family, proto, protocol);
+ s = socket(server_res->ai_family, type, proto);
if (s < 0) {
if (local)
freeaddrinfo(local_res);
@@ -235,7 +235,7 @@
@@ -238,7 +238,7 @@ netdial(int domain, int proto, const char *local, const char *bind_dev, int loca
struct addrinfo *server_res = NULL;
int s, saved_errno;
- s = create_socket(domain, proto, local, bind_dev, local_port, server, port, &server_res);
+ s = create_socket(domain, proto, local, bind_dev, local_port, server, port, &server_res, 0);
+ s = create_socket(domain, proto, 0, local, bind_dev, local_port, server, port, &server_res);
if (s < 0) {
return -1;
}
--- a/src/net.h 2023-08-01 15:01:58.208159540 +0200
+++ b/src/net.h 2023-08-01 15:00:46.521337885 +0200
diff --git a/src/net.h b/src/net.h
index f0e1b4f98..1f5cc4d34 100644
--- a/src/net.h
+++ b/src/net.h
@@ -28,7 +28,7 @@
#define __NET_H
int timeout_connect(int s, const struct sockaddr *name, socklen_t namelen, int timeout);
-int create_socket(int domain, int proto, const char *local, const char *bind_dev, int local_port, const char *server, int port, struct addrinfo **server_res_out);
+int create_socket(int domain, int proto, const char *local, const char *bind_dev, int local_port, const char *server, int port, struct addrinfo **server_res_out, int protocol);
+int create_socket(int domain, int type, int proto, const char *local, const char *bind_dev, int local_port, const char *server, int port, struct addrinfo **server_res_out);
int netdial(int domain, int proto, const char *local, const char *bind_dev, int local_port, const char *server, int port, int timeout);
int netannounce(int domain, int proto, const char *local, const char *bind_dev, int port);
int Nread(int fd, char *buf, size_t count, int prot);

View file

@ -8,12 +8,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=iproute2
PKG_VERSION:=6.6.0
PKG_VERSION:=6.9.0
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=@KERNEL/linux/utils/net/iproute2
PKG_HASH:=8738c804afd09f0bf756937f0c3de23117832a98d8cbbf50386cf5005cd613ce
PKG_HASH:=2f643d09ea11a4a2a043c92e2b469b5f73228cbf241ae806760296ed0ec413d0
PKG_BUILD_PARALLEL:=1
PKG_BUILD_DEPENDS:=iptables
PKG_LICENSE:=GPL-2.0

View file

@ -1,12 +0,0 @@
--- a/configure
+++ b/configure
@@ -36,7 +36,8 @@ int main(int argc, char **argv) {
}
EOF
- if $CC -I$INCLUDE -o $TMPDIR/atmtest $TMPDIR/atmtest.c -latm >/dev/null 2>&1; then
+# OpenWrt: disable ATM support even if present on host system
+ if [ 1 -eq 0 ]; then
echo "TC_CONFIG_ATM:=y" >>$CONFIG
echo yes
else

View file

@ -1,108 +0,0 @@
--- a/ip/Makefile
+++ b/ip/Makefile
@@ -19,6 +19,13 @@ RTMONOBJ=rtmon.o
include ../config.mk
+STATIC_SYM_FILTER:=
+ifeq ($(IP_CONFIG_TINY),y)
+ STATIC_SYM_FILTER:=iplink_can.c iplink_ipoib.c iplink_vxlan.c
+ CFLAGS += -DIPROUTE2_TINY
+endif
+STATIC_SYM_SOURCES:=$(filter-out $(STATIC_SYM_FILTER),$(wildcard *.c))
+
ALLOBJ=$(IPOBJ) $(RTMONOBJ)
SCRIPTS=routel
TARGETS=ip rtmon
@@ -48,7 +55,7 @@ else
ip: static-syms.o
static-syms.o: static-syms.h
-static-syms.h: $(wildcard *.c)
+static-syms.h: $(STATIC_SYM_SOURCES)
files="$^" ; \
for s in `grep -B 3 '\<dlsym' $$files | sed -n '/snprintf/{s:.*"\([^"]*\)".*:\1:;s:%s::;p}'` ; do \
sed -n '/'$$s'[^ ]* =/{s:.* \([^ ]*'$$s'[^ ]*\) .*:extern char \1[] __attribute__((weak)); if (!strcmp(sym, "\1")) return \1;:;p}' $$files ; \
--- a/ip/ip.c
+++ b/ip/ip.c
@@ -61,11 +61,17 @@ static void usage(void)
fprintf(stderr,
"Usage: ip [ OPTIONS ] OBJECT { COMMAND | help }\n"
" ip [ -force ] -batch filename\n"
+#ifndef IPROUTE2_TINY
"where OBJECT := { address | addrlabel | amt | fou | help | ila | ioam | l2tp |\n"
" link | macsec | maddress | monitor | mptcp | mroute | mrule |\n"
" neighbor | neighbour | netconf | netns | nexthop | ntable |\n"
" ntbl | route | rule | sr | tap | tcpmetrics |\n"
" token | tunnel | tuntap | vrf | xfrm }\n"
+#else
+ "where OBJECT := { address | link | maddress | monitor |\n"
+ " neighbor | neighbour | netns | route |\n"
+ " rule | token | tunnel }\n"
+#endif
" OPTIONS := { -V[ersion] | -s[tatistics] | -d[etails] | -r[esolve] |\n"
" -h[uman-readable] | -iec | -j[son] | -p[retty] |\n"
" -f[amily] { inet | inet6 | mpls | bridge | link } |\n"
@@ -88,37 +94,49 @@ static const struct cmd {
int (*func)(int argc, char **argv);
} cmds[] = {
{ "address", do_ipaddr },
+#ifndef IPROUTE2_TINY
{ "addrlabel", do_ipaddrlabel },
+#endif
{ "maddress", do_multiaddr },
{ "route", do_iproute },
{ "rule", do_iprule },
{ "neighbor", do_ipneigh },
{ "neighbour", do_ipneigh },
+#ifndef IPROUTE2_TINY
{ "ntable", do_ipntable },
{ "ntbl", do_ipntable },
+#endif
{ "link", do_iplink },
+#ifndef IPROUTE2_TINY
{ "l2tp", do_ipl2tp },
{ "fou", do_ipfou },
{ "ila", do_ipila },
{ "macsec", do_ipmacsec },
+#endif
{ "tunnel", do_iptunnel },
{ "tunl", do_iptunnel },
+#ifndef IPROUTE2_TINY
{ "tuntap", do_iptuntap },
{ "tap", do_iptuntap },
{ "token", do_iptoken },
{ "tcpmetrics", do_tcp_metrics },
{ "tcp_metrics", do_tcp_metrics },
+#endif
{ "monitor", do_ipmonitor },
+#ifndef IPROUTE2_TINY
{ "xfrm", do_xfrm },
{ "mroute", do_multiroute },
{ "mrule", do_multirule },
+#endif
{ "netns", do_netns },
+#ifndef IPROUTE2_TINY
{ "netconf", do_ipnetconf },
{ "vrf", do_ipvrf},
{ "sr", do_seg6 },
{ "nexthop", do_ipnh },
{ "mptcp", do_mptcp },
{ "ioam", do_ioam6 },
+#endif
{ "help", do_help },
{ "stats", do_ipstats },
{ 0 }
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -3,6 +3,10 @@ include ../config.mk
CFLAGS += $(FPIC)
+ifeq ($(IP_CONFIG_TINY),y)
+ CFLAGS += -DIPROUTE2_TINY
+endif
+
UTILOBJ = utils.o utils_math.o rt_names.o ll_map.o ll_types.o ll_proto.o ll_addr.o \
inet_proto.o namespace.o json_writer.o json_print.o json_print_math.o \
names.o color.o bpf_legacy.o bpf_glue.o exec.o fs.o cg_map.o ppp_proto.o

View file

@ -1,19 +0,0 @@
--- a/configure
+++ b/configure
@@ -455,14 +455,8 @@ EOF
if $CC -I$INCLUDE -o $TMPDIR/strtest $TMPDIR/strtest.c >/dev/null 2>&1; then
echo "no"
else
- if ${PKG_CONFIG} libbsd --exists; then
- echo 'CFLAGS += -DHAVE_LIBBSD' `${PKG_CONFIG} libbsd --cflags` >>$CONFIG
- echo 'LDLIBS +=' `${PKG_CONFIG} libbsd --libs` >> $CONFIG
- echo "no"
- else
- echo 'CFLAGS += -DNEED_STRLCPY' >>$CONFIG
- echo "yes"
- fi
+ echo 'CFLAGS += -DNEED_STRLCPY' >>$CONFIG
+ echo "yes"
fi
rm -f $TMPDIR/strtest.c $TMPDIR/strtest
}

125
libgpiod/Makefile Normal file
View file

@ -0,0 +1,125 @@
#
# Copyright (C) 2018-2019 Michael Heimpold <mhei@heimpold.de>
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=libgpiod
PKG_VERSION:=2.1.1
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=@KERNEL/software/libs/libgpiod/
PKG_HASH:=b21913f469d3135680d5516f00fdf9f81d5e564e19ffb690927ea7f1d7e312cb
PKG_MAINTAINER:=Michael Heimpold <mhei@heimpold.de>
PKG_LICENSE:=LGPL-2.1-or-later
PKG_LICENSE_FILES:=COPYING
PKG_INSTALL:=1
PKG_BUILD_PARALLEL:=1
PYTHON3_PKG_BUILD:=0
include $(INCLUDE_DIR)/package.mk
include $(TOPDIR)/feeds/packages/lang/python/python3-package.mk
ifneq ($(CONFIG_PACKAGE_gpiod-tools),)
CONFIGURE_ARGS += --enable-tools
endif
PYTHON3_PKG_SETUP_DIR:=bindings/python
TARGET_CPPFLAGS+=-I$(PKG_BUILD_DIR)/include
TARGET_LDFLAGS+=-L$(PKG_BUILD_DIR)/lib/.libs
define Package/libgpiod
SECTION:=libs
CATEGORY:=Libraries
URL:=https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git
TITLE:=Library for interacting with Linux's GPIO character device
KCONFIG:= \
CONFIG_GPIO_CDEV=y
DEPENDS:=@GPIO_SUPPORT
endef
define Package/libgpiod/description
C library for interacting with the linux GPIO character device
(gpiod stands for GPIO device).
endef
define Package/gpiod-tools
SECTION:=utils
CATEGORY:=Utilities
TITLE:=Tools for interacting with GPIO pins
DEPENDS:=+libgpiod
endef
define Package/gpiod-tools/description
Tools for interacting with the linux GPIO character device
(gpiod stands for GPIO device).
endef
define Package/python3-gpiod
SECTION:=lang
CATEGORY:=Languages
SUBMENU:=Python
TITLE:=Python bindings for libgpiod
URL:=https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git
DEPENDS:=+python3-light +libgpiod
endef
define Package/python3-gpiod/description
This package contains the Python bindings for libgpiod.
endef
define Build/Configure
$(call Build/Configure/Default)
ifneq ($(CONFIG_PACKAGE_python3-gpiod),)
$(call Py3Build/Configure)
endif
endef
define Build/Compile
$(call Build/Compile/Default)
ifneq ($(CONFIG_PACKAGE_python3-gpiod),)
$(call Py3Build/Compile)
endif
endef
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/include
$(CP) $(PKG_INSTALL_DIR)/usr/include/gpiod.h $(1)/usr/include/
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libgpiod.{so*,a} $(1)/usr/lib/
$(INSTALL_DIR) $(1)/usr/lib/pkgconfig
$(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libgpiod.pc $(1)/usr/lib/pkgconfig/
ifneq ($(CONFIG_PACKAGE_python3-gpiod),)
$(INSTALL_DIR) $(1)$(PYTHON3_PKG_DIR)
$(CP) $(PKG_INSTALL_DIR)$(PYTHON3_PKG_DIR)/* $(1)$(PYTHON3_PKG_DIR)
endif
endef
define Package/libgpiod/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libgpiod.so.* $(1)/usr/lib/
endef
define Package/gpiod-tools/install
$(INSTALL_DIR) $(1)/usr/bin
$(CP) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/
endef
define Py3Package/python3-gpiod/install
# this empty define prevent installing tools from /usr/bin
endef
$(eval $(call BuildPackage,libgpiod))
$(eval $(call BuildPackage,gpiod-tools))
$(eval $(call Py3Package,python3-gpiod))
$(eval $(call BuildPackage,python3-gpiod))
$(eval $(call BuildPackage,python3-gpiod-src))

View file

@ -8,12 +8,13 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=libmbim
PKG_SOURCE_VERSION:=1.30.0
PKG_SOURCE_VERSION:=1.31.6-dev
#PKG_SOURCE_VERSION:=1866ed53c05916c66c5d52682778a6078e5221d3
PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://gitlab.freedesktop.org/mobile-broadband/libmbim.git
PKG_MIRROR_HASH:=8fc4e2d78d6a1003bf89303d3ce779283b176d74e84a241ba8efb0d468605268
#libmPKG_MIRROR_HASH:=8fc4e2d78d6a1003bf89303d3ce779283b176d74e84a241ba8efb0d468605268
PKG_BUILD_FLAGS:=gc-sections

View file

@ -8,12 +8,13 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=libqmi
PKG_SOURCE_VERSION:=1.34.0
#PKG_SOURCE_VERSION:=1.34.0
PKG_SOURCE_VERSION:=1.35.6-dev
PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://gitlab.freedesktop.org/mobile-broadband/libqmi.git
PKG_MIRROR_HASH:=af3dc760d0c40ef8af1f8b424435daa12bff698ed45b1cc9a9e38ea62ed047f0
#PKG_MIRROR_HASH:=af3dc760d0c40ef8af1f8b424435daa12bff698ed45b1cc9a9e38ea62ed047f0
PKG_BUILD_FLAGS:=gc-sections

View file

@ -281,8 +281,8 @@ return view.extend({
fwtool.addLimitOption(s);
fwtool.addLimitBurstOption(s);
o = s.taboption('advanced', form.Flag, 'v2ray', _('Use V2Ray'),
_('Forward a port (not a range) from server using V2Ray proxy (if enabled) instead of VPN'));
o = s.taboption('advanced', form.Flag, 'v2ray', _('Use V2Ray/XRay'),
_('Forward a port (not a range) from server using V2Ray/XRay proxy (if enabled) instead of VPN'));
o.modalonly = true;
o.editable = true;
o.depends({ src: 'vpn', '!contains': true });

View file

@ -0,0 +1,235 @@
'use strict';
'require rpc';
'require form';
'require fs';
'require uci';
'require tools.widgets as widgets';
/*
* Copyright (C) 2024 Ycarus (Yannick Chabanois) <contact@openmptcprouter.com> for OpenMPTCProuter
* This is free software, licensed under the GNU General Public License v3.
* See /LICENSE for more information
*/
var callSystemBoard = rpc.declare({
object: 'system',
method: 'board'
});
return L.view.extend({
load: function() {
return Promise.all([
L.resolveDefault(callSystemBoard(), {})
]);
},
render: function(res) {
var m, s, o;
var boardinfo = res[0];
m = new form.Map('network', _('MPTCP'),_('Networks MPTCP settings.'));
s = m.section(form.TypedSection, 'globals');
o = s.option(form.ListValue, 'multipath', _('Multipath TCP'));
o.value("enable", _("enable"));
o.value("disable", _("disable"));
o.readonly = true;
o = s.option(form.ListValue, "mptcp_checksum", _("Multipath TCP checksum"));
o.value(1, _("enable"));
o.value(0, _("disable"));
if (boardinfo.kernel.substring(1,4) != "5.15" && boardinfo.kernel.substring(1,1) != "6") {
o = s.option(form.ListValue, "mptcp_debug", _("Multipath Debug"));
o.value(1, _("enable"));
o.value(0, _("disable"));
}
o = s.option(form.ListValue, "mptcp_path_manager", _("Multipath TCP path-manager"), _("Default is fullmesh"));
o.value("default", _("default"));
o.value("fullmesh", "fullmesh");
if (parseFloat(boardinfo.kernel.substring(0,4)) < 6) {
o.value("ndiffports", "ndiffports");
o.value("binder", "binder");
o.value("netlink", _("Netlink"));
}
o = s.option(form.ListValue, "mptcp_scheduler", _("Multipath TCP scheduler"));
o.value("default", _("default"));
if (parseFloat(boardinfo.kernel.substring(0,4)) < 6) {
o.value("roundrobin", "round-robin");
o.value("redundant", "redundant");
o.value("blest", "BLEST");
o.value("ecf", "ECF");
}
if (parseFloat(boardinfo.kernel.substring(0,3)) >= "6.6") {
o.load = function(section_id) {
return L.resolveDefault(fs.list('/usr/share/bpf/scheduler'), []).then(L.bind(function(entries) {
for (var i = 0; i < entries.length; i++)
if (entries[i].type == 'file' && entries[i].name.match(/\.o$/))
this.value(entries[i].name);
return this.super('load', [section_id]);
}, this));
};
// bpf_burst => same as the default scheduler
// bpf_red => sends all packets redundantly on all available subflows
// bpf_first => always picks the first subflow to send data
// bpf_rr => always picks the next available subflow to send data (round-robin)
}
if (parseFloat(boardinfo.kernel.substring(0,4)) < 6) {
o = s.option(form.Value, "mptcp_syn_retries", _("Multipath TCP SYN retries"));
o.datatype = "uinteger";
o.rmempty = false;
}
if (parseFloat(boardinfo.kernel.substring(0,4)) < 6) {
o = s.option(form.ListValue, "mptcp_version", _("Multipath TCP version"));
o.value(0, _("0"));
o.value(1, _("1"));
o.default = 0;
}
o = s.option(form.ListValue, "congestion", _("Congestion Control"),_("Default is cubic"));
o.load = function(section_id) {
return fs.exec_direct('/sbin/sysctl', ['-n', 'net.ipv4.tcp_available_congestion_control']).then(L.bind(function(entries) {
var congestioncontrol = entries.toString().split(' ');
for (var d in congestioncontrol) {
this.value(congestioncontrol[d]);
};
return this.super('load', [section_id]);
}, this));
};
if (parseFloat(boardinfo.kernel.substring(0,4)) >= 6) {
if (boardinfo.kernel.substring(0,1) == "6") {
// Only available since 5.19
o = s.option(form.ListValue, "mptcp_pm_type", _("Path Manager type"));
o.value(0, _("In-kernel path manager"));
o.value(1, _("Userspace path manager"));
o.default = 0;
}
o = s.option(form.ListValue, "mptcp_disable_initial_config", _("Initial MPTCP configuration"));
o.depends("mptcp_pm_type","1");
o.value("0", _("enable"));
o.value("1", _("disable"));
o.default = "0";
o = s.option(form.ListValue, "mptcp_force_multipath", _("Force Multipath configuration"));
o.depends("mptcp_pm_type","1");
o.value("1", _("enable"));
o.value("0", _("disable"));
o.default = "1";
o = s.option(form.ListValue, "mptcpd_enable", _("Enable MPTCPd"));
o.depends("mptcp_pm_type","1");
o.value("enable", _("enable"));
o.value("disable", _("disable"));
o.default = "disable";
o = s.option(form.DynamicList, "mptcpd_path_manager", _("MPTCPd path managers"));
o.load = function(section_id) {
return L.resolveDefault(fs.list('/usr/lib/mptcpd'), []).then(L.bind(function(entries) {
for (var i = 0; i < entries.length; i++)
if (entries[i].type == 'file' && entries[i].name.match(/\.so$/))
this.value(entries[i].name);
return this.super('load', [section_id]);
}, this));
};
o.depends("mptcp_pm_type","1");
o = s.option(form.DynamicList, "mptcpd_plugins", _("MPTCPd plugins"));
o.load = function(section_id) {
return L.resolveDefault(fs.list('/usr/lib/mptcpd'), []).then(L.bind(function(entries) {
for (var i = 0; i < entries.length; i++)
if (entries[i].type == 'file' && entries[i].name.match(/\.so$/))
this.value(entries[i].name);
return this.super('load', [section_id]);
}, this));
};
o.depends("mptcp_pm_type","1");
o = s.option(form.DynamicList, "mptcpd_addr_flags", _("MPTCPd Address annoucement flags"));
o.value("subflow","subflow");
o.value("signal","signal");
o.value("backup","backup");
o.value("fullmesh","fullmesh");
o.depends("mptcp_pm_type","1");
o = s.option(form.DynamicList, "mptcpd_notify_flags", _("MPTCPd Address notification flags"));
o.value("existing","existing");
o.value("skip_link_local","skip_link_local");
o.value("skip_loopback","skip_loopback");
o.depends("mptcp_pm_type","1");
o = s.option(form.Value, "mptcp_subflows", _("Max subflows"),_("specifies the maximum number of additional subflows allowed for each MPTCP connection"));
o.datatype = "uinteger";
o.rmempty = false;
o.default = 3;
o = s.option(form.Value, "mptcp_stale_loss_cnt", _("Retranmission intervals"),_("The number of MPTCP-level retransmission intervals with no traffic and pending outstanding data on a given subflow required to declare it stale. A low stale_loss_cnt value allows for fast active-backup switch-over, an high value maximize links utilization on edge scenarios e.g. lossy link with high BER or peer pausing the data processing."));
o.datatype = "uinteger";
o.rmempty = false;
o.default = 4;
o = s.option(form.Value, "mptcp_add_addr_accepted", _("Max add address"),_("specifies the maximum number of ADD_ADDR (add address) suboptions accepted for each MPTCP connection"));
o.datatype = "uinteger";
o.rmempty = false;
o.default = 1;
o = s.option(form.Value, "mptcp_add_addr_timeout", _("Control message timeout"),_("Set the timeout after which an ADD_ADDR (add address) control message will be resent to an MPTCP peer that has not acknowledged a previous ADD_ADDR message."));
o.datatype = "uinteger";
o.rmempty = false;
o.default = 120;
} else {
o = s.option(form.Value, "mptcp_fullmesh_num_subflows", _("Fullmesh subflows for each pair of IP addresses"));
o.datatype = "uinteger";
o.rmempty = false;
o.default = 1;
//o.depends("mptcp_path_manager","fullmesh")
o = s.option(form.ListValue, "mptcp_fullmesh_create_on_err", _("Re-create fullmesh subflows after a timeout"));
o.value(1, _("enable"));
o.value(0, _("disable"));
//o.depends("mptcp_path_manager","fullmesh");
o = s.option(form.Value, "mptcp_ndiffports_num_subflows", _("ndiffports subflows number"));
o.datatype = "uinteger";
o.rmempty = false;
o.default = 1;
//o.depends("mptcp_path_manager","ndiffports")
o = s.option(form.ListValue, "mptcp_rr_cwnd_limited", _("Fill the congestion window on all subflows for round robin"));
o.value("Y", _("enable"));
o.value("N", _("disable"));
o.default = "Y";
//o.depends("mptcp_scheduler","roundrobin")
o = s.option(form.Value, "mptcp_rr_num_segments", _("Consecutive segments that should be sent for round robin"));
o.datatype = "uinteger";
o.rmempty = false;
o.default = 1;
//o.depends("mptcp_scheduler","roundrobin")
}
s = m.section(form.TypedSection, "interface", _("Interfaces Settings"));
s.filter = function(section) {
return (!section.match("^oip.*") && !section.match("^lo.*") && section != "omrvpn" && section != "omr6in4");
}
o = s.option(form.ListValue, "multipath", _("Multipath TCP"), _("One interface must be set as master"));
o.value("on", _("enabled"));
o.value("off", _("disabled"));
o.value("master", _("master"));
o.value("backup", _("backup"));
//o.value("handover", _("handover"));
o.default = "off";
return m.render();
}
});

View file

@ -9,7 +9,11 @@ module("luci.controller.mptcp", package.seeall)
function index()
local uname = nixio.uname()
entry({"admin", "network", "mptcp"}, alias("admin", "network", "mptcp", "settings"), _("MPTCP"))
if uname ~= nil and uname.release:sub(1,1) == "5" then
entry({"admin", "network", "mptcp", "settings"}, cbi("mptcp"), _("Settings"),2).leaf = true
else
entry({"admin", "network", "mptcp", "settings"}, view("mptcp/mptcp"), _("Settings"),2).leaf = true
end
entry({"admin", "network", "mptcp", "bandwidth"}, template("mptcp/multipath"), _("Bandwidth"), 3).leaf = true
entry({"admin", "network", "mptcp", "multipath_bandwidth"}, call("multipath_bandwidth")).leaf = true
entry({"admin", "network", "mptcp", "interface_bandwidth"}, call("interface_bandwidth")).leaf = true

View file

@ -4,7 +4,7 @@ local ifaces = sys.net:devices()
local m, s, o
local uname = nixio.uname()
m = Map("network", translate("MPTCP"), translate("Networks MPTCP settings. Visit <a href='http://multipath-tcp.org/pmwiki.php/Users/ConfigureMPTCP'>http://multipath-tcp.org/pmwiki.php/Users/ConfigureMPTCP</a> for help."))
m = Map("network", translate("MPTCP"), translate("Networks MPTCP settings."))
local unameinfo = nixio.uname() or { }
@ -44,6 +44,16 @@ if uname.release:sub(1,4) ~= "5.15" and uname.release:sub(1,1) ~= "6" then
o:value("ecf", "ECF")
end
end
if uname.release:sub(1,3) == "6.6" then
for dir in io.popen([[cd /usr/share/bpf/scheduler && ls -1 *.o | sed -e 's/.o//g' -e 's/mptcp_//g']]):lines() do
o:value(dir, dir)
end
-- bpf_burst => same as the default scheduler
-- bpf_red => sends all packets redundantly on all available subflows
-- bpf_first => always picks the first subflow to send data
-- bpf_rr => always picks the next available subflow to send data (round-robin)
end
-- if tonumber(uname.release:sub(1,4)) <= 5.15 then
if uname.release:sub(1,4) ~= "5.15" and uname.release:sub(1,1) ~= "6" then
o = s:option(Value, "mptcp_syn_retries", translate("Multipath TCP SYN retries"))

View file

@ -2,7 +2,16 @@
"luci-app-mptcp": {
"description": "Grant UCI access for luci-app-mptcp",
"read": {
"uci": [ "openmptcprouter", "network" ]
"uci": [ "openmptcprouter", "network" ],
"file": {
"/usr/lib/mptcpd": [ "list" ],
"/usr/share/bpf/scheduler": [ "list" ],
"/sbin/sysctl -n net.ipv4.tcp_available_congestion_control": [ "exec" ]
},
"ubus": {
"file": [ "list", "exec" ],
"system": [ "board" ]
}
},
"write": {
"uci": [ "openmptcprouter", "network" ]

View file

@ -282,7 +282,7 @@ return L.view.extend({
o = s.option(form.ListValue, 'family', _('Restrict to address family'));
o.value('ipv4ipv6', _('IPv4 and IPv6'));
o.value('ipv4', _('IPv4 only'));
o.value('ipv4', _('IPv6 only'));
o.value('ipv6', _('IPv6 only'));
o.default = 'ipv4ipv6';
o.modalonly = true

View file

@ -35,6 +35,13 @@ return view.extend({
.map(function(s) { return s['.name']; });
};
s.handleAdd = function(ev) {
this.sectiontype = 'interface';
var promise = form.GridSection.prototype.handleAdd.apply(this, arguments);
this.sectiontype = undefined;
return promise;
};
o = s.option(form.Flag, 'enabled', _('Enabled'));
o.default = false;
@ -54,19 +61,19 @@ return view.extend({
o = s.option(form.DynamicList, 'hosts', _('Tracking hostname or IP address'),
_('This hostname or IP address will be pinged to determine if the link is up or down. Leave blank to use defaults settings.'));
o.datatype = 'hosts';
//o.datatype = 'hosts';
o.modalonly = true;
o.rmempty = false;
o = s.option(form.DynamicList, 'hosts6', _('Tracking hostname or IP address for IPv6'),
_('This hostname or IP address will be pinged to determine if the link is up or down. Leave blank to use defaults settings.'));
o.datatype = 'hosts';
//o.datatype = 'hosts';
o.modalonly = true;
o.depends('family', 'ipv4ipv6');
o.depends('family', 'ipv6');
o.rmempty = false;
o = s.option(form.ListValue, 'type', _('Tracking method'));
o = s.option(form.ListValue, 'type', _('Tracking method'),_('Always ping gateway, then test connection by ping, httping or dns. None mode only ping gateway.'));
o.default = 'ping';
o.value('none');
o.value('ping');
@ -104,11 +111,12 @@ return view.extend({
o.rmempty = false;
o.modalonly = true;
*/
/*
o = s.option(form.Value, 'reliability', _('Tracking reliability'),
_('Acceptable values: 1-100. This many Tracking IP addresses must respond for the link to be deemed up'));
o.datatype = 'range(1, 100)';
o.default = '1';
*/
o = s.option(form.ListValue, 'count', _('Ping count'));
o.default = '1';
@ -198,14 +206,15 @@ return view.extend({
o.value('25');
o.modalonly = true;
o = s.option(form.ListValue, "timeout", _("Ping timeout"));
o = s.option(form.Value, "timeout", _("Ping timeout"));
o.default = '4';
o.value('1', _('%d second').format('1'));
for (var i = 2; i <= 10; i++)
o.value(String(i), _('%d seconds').format(i));
o.rmempty = false;
o.modalonly = true;
o = s.option(form.ListValue, 'interval', _('Ping interval'));
o = s.option(form.Value, 'interval', _('Ping interval'));
o.default = '10';
o.value('1', _('%d second').format('1'));
o.value('3', _('%d seconds').format('3'));
@ -219,6 +228,8 @@ return view.extend({
o.value('900', _('%d minutes').format('15'));
o.value('1800', _('%d minutes').format('30'));
o.value('3600', _('%d hour').format('1'));
o.modalonly = true;
o.rmempty = false;
o = s.option(form.Value, 'failure_interval', _('Failure interval'),
_('Ping interval during failure detection'));

View file

@ -44,6 +44,13 @@ return view.extend({
o.value('offline', _('Offline'));
o.modalonly = true;
o = s.option(form.ListValue, 'type', _('Tracking method'),_('Check if VPS api answer or/and ping server IPs.'));
o.default = 'apiping';
o.value('apiping',_('API & Ping'));
o.value('api',_('API'));
o.value('ping',_('Ping'));
o.value('none',_('None'));
o = s.option(form.Flag, 'mail_alert', _('Mail alert'),
_('Send a mail when connection status change. You need to configure e-mail settings here.'));
o.rmempty = false;

View file

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 8.3 KiB

After

Width:  |  Height:  |  Size: 8.3 KiB

Before After
Before After

View file

@ -1,6 +1,6 @@
.container {
/* container for entire page. fixes bootstrap theme's ridiculously small page width */
max-width: 1044px;
max-width: 1500px;
}
#interface_field {
padding: 12px 20px 20px 20px;
@ -31,12 +31,9 @@
text-align: center;
}
/* Mwan3 ligthed CSS */
.container {
/* container for entire page. fixes bootstrap theme's ridiculously small page width */
max-width: 1044px;
}
#interface_field {
padding: 0px;
max-width: 1200px;
}
#interface_field td {
padding: 0px;

View file

Before

Width:  |  Height:  |  Size: 8.7 KiB

After

Width:  |  Height:  |  Size: 8.7 KiB

Before After
Before After

View file

@ -257,6 +257,11 @@ function wizard_add()
end
end
-- Enable/disable IPv6
local disableipv6 = luci.http.formvalue("enableipv6") or "1"
ucic:set("openmptcprouter","settings","disable_ipv6",disableipv6)
-- Set interfaces settings
local downloadmax = 0
local uploadmax = 0
@ -393,6 +398,10 @@ function wizard_add()
ucic:set("network",intf,"ip6addr",ip6addr:gsub("%s+", ""))
ucic:set("network",intf,"ip6gw",ip6gw:gsub("%s+", ""))
ucic:set("network",intf,"ipv6","1")
elseif proto ~= "static" and proto ~= "dhcp" and disableipv6 ~= "1" then
ucic:set("network",intf,"ip6addr","")
ucic:set("network",intf,"ip6gw","")
ucic:set("network",intf,"ipv6","1")
else
ucic:set("network",intf,"ip6addr","")
ucic:set("network",intf,"ip6gw","")
@ -419,7 +428,8 @@ function wizard_add()
local uploadspeed = luci.http.formvalue("cbid.sqm.%s.upload" % intf) or "0"
local testspeed = luci.http.formvalue("cbid.sqm.%s.testspeed" % intf) or "0"
if not ucic:get("qos",intf) ~= "" then
local qos_settings = ucic:get("qos",intf) or ""
if qos_settings == "" then
ucic:set("qos",intf,"interface")
ucic:set("qos",intf,"classgroup","Default")
ucic:set("qos",intf,"enabled","0")
@ -427,7 +437,8 @@ function wizard_add()
ucic:set("qos",intf,"download","100000")
end
if not ucic:get("sqm",intf) ~= "" then
local sqm_settings = ucic:get("sqm",intf) or ""
if sqm_settings == "" then
local defif = get_device(intf)
if defif == "" then
defif = ucic:get("network",intf,"device") or ""
@ -521,9 +532,6 @@ function wizard_add()
ucic:save("network")
ucic:commit("network")
-- Enable/disable IPv6
local disableipv6 = luci.http.formvalue("enableipv6") or "1"
ucic:set("openmptcprouter","settings","disable_ipv6",disableipv6)
--local ut = require "luci.util"
--local result = ut.ubus("openmptcprouter", "set_ipv6_state", { disable_ipv6 = disableipv6 })
local ula = luci.http.formvalue("ula") or ""
@ -570,7 +578,7 @@ function wizard_add()
-- ucic:set("sqm","omrvpn","enabled","0")
--end
ucic:set("sqm","omrvpn","enabled","1")
ucic:set("sqm","omrvpn","enabled","0")
ucic:set("sqm","omrvpn","download","0")
ucic:set("sqm","omrvpn","upload","0")
@ -668,7 +676,7 @@ function wizard_add()
ucic:commit("unbound")
-- Get Proxy set by default
local default_proxy = luci.http.formvalue("default_proxy") or "shadowsocks"
local default_proxy = luci.http.formvalue("default_proxy") or "shadowsocks-rust"
if default_proxy == "shadowsocks" and serversnb > 0 and serversnb > disablednb then
--ucic:set("shadowsocks-libev","sss0","disabled","0")
ucic:set("v2ray","main","enabled","0")
@ -759,6 +767,7 @@ function wizard_add()
ucic:set("openmptcprouter","settings","proxy",default_proxy)
ucic:save("openmptcprouter")
ucic:save("shadowsocks-libev")
ucic:save("shadowsocks-rust")
ucic:save("v2ray")
ucic:save("xray")
@ -770,6 +779,14 @@ function wizard_add()
ucic:delete("openmptcprouter","omr","ss_" .. sectionname)
end
end)
ucic:foreach("shadowsocks-rust","server", function(s)
local sectionname = s[".name"]
if sectionname:match("^sss.*") then
ucic:delete("shadowsocks-rust",sectionname,"ip")
ucic:set("shadowsocks-rust",sectionname,"disabled","1")
ucic:delete("openmptcprouter","omr","ss_" .. sectionname)
end
end)
local ss_servers_nginx = {}
local ss_servers_ha = {}
@ -818,15 +835,21 @@ function wizard_add()
if default_proxy == "shadowsocks" and serversnb > disablednb and ssip ~= "" then
ucic:set("shadowsocks-libev","sss" .. nbip,"disabled","0")
end
ucic:set("shadowsocks-rust","sss" .. nbip,"server",ssip)
if default_proxy == "shadowsocks-rust" and serversnb > disablednb and ssip ~= "" then
ucic:set("shadowsocks-rust","sss" .. nbip,"disabled","0")
end
nbip = nbip + 1
if disableipv6 == "1" and nbip > 0 then
ucic:set("shadowsocks-libev","sss" .. nbip,"disabled","1")
ucic:set("shadowsocks-rust","sss" .. nbip,"disabled","1")
break
end
end
if nbip == 1 then
--ucic:set("shadowsocks-libev","sss" .. nbip,"server",server_ip)
ucic:set("shadowsocks-libev","sss" .. nbip,"disabled","1")
ucic:set("shadowsocks-rust","sss" .. nbip,"disabled","1")
end
end
k = k + 1
@ -864,6 +887,10 @@ function wizard_add()
if default_proxy == "shadowsocks" and serversnb > disablednb and ssip ~= "" then
ucic:set("shadowsocks-libev","sss" .. nbip,"disabled","0")
end
ucic:set("shadowsocks-rust","sss" .. nbip,"server",ssip)
if default_proxy == "shadowsocks-rust" and serversnb > disablednb and ssip ~= "" then
ucic:set("shadowsocks-rust","sss" .. nbip,"disabled","0")
end
nbip = nbip + 1
if disableipv6 == "1" and nbip > 0 then
break
@ -872,6 +899,7 @@ function wizard_add()
if nbip == 1 then
-- ucic:set("shadowsocks-libev","sss" .. nbip,"server",server_ip)
ucic:set("shadowsocks-libev","sss" .. nbip,"disabled","1")
ucic:set("shadowsocks-rust","sss" .. nbip,"disabled","1")
end
end
end
@ -894,6 +922,7 @@ function wizard_add()
ucic:save("glorytun-udp")
--ucic:commit("glorytun")
ucic:save("shadowsocks-libev")
ucic:save("shadowsocks-rust")
--ucic:commit("shadowsocks-libev")
@ -974,8 +1003,8 @@ function wizard_add()
ucic:set("xray","omrout","s_vless_reality_user_security","chacha20-poly1305")
ucic:set("xray","omrout","s_trojan_user_security","chacha20-poly1305")
ucic:set("xray","omrout","s_socks_user_security","chacha20-poly1305")
ucic:set("xray","omrout","s_shadowsocks_method","2022-blake3-chacha20-poly1305")
--ucic:set("xray","omrout","s_shadowsocks_method","2022-blake3-aes-256-gcm")
--ucic:set("xray","omrout","s_shadowsocks_method","2022-blake3-chacha20-poly1305")
ucic:set("xray","omrout","s_shadowsocks_method","2022-blake3-aes-256-gcm")
--ucic:set("shadowsocks-rust","sss0","method","2022-blake3-chacha20-poly1305")
--ucic:set("shadowsocks-rust","sss1","method","2022-blake3-chacha20-poly1305")
ucic:set("shadowsocks-rust","sss0","method","2022-blake3-aes-256-gcm")
@ -1034,8 +1063,8 @@ function wizard_add()
ucic:set("shadowsocks-rust","sss0","disabled","1")
ucic:set("shadowsocks-rust","sss1","disabled","1")
end
ucic:set("shadowsocks-rust","sss0","key","")
ucic:set("shadowsocks-rust","sss1","key","")
ucic:set("shadowsocks-rust","sss0","password","")
ucic:set("shadowsocks-rust","sss1","password","")
ucic:set("xray","omrout","s_shadowsocks_password","")
ucic:save("shadowsocks-rust")
ucic:commit("shadowsocks-rust")
@ -1059,6 +1088,8 @@ function wizard_add()
ucic:commit("xray")
ucic:save("shadowsocks-libev")
ucic:commit("shadowsocks-libev")
ucic:save("shadowsocks-rust")
ucic:commit("shadowsocks-rust")
-- Set Glorytun settings
@ -1218,6 +1249,7 @@ function wizard_add()
-- luci.sys.call("sleep 2")
--end
luci.sys.call("/etc/init.d/shadowsocks-libev restart >/dev/null 2>/dev/null")
luci.sys.call("/etc/init.d/shadowsocks-rust restart >/dev/null 2>/dev/null")
luci.sys.call("/etc/init.d/glorytun restart >/dev/null 2>/dev/null")
luci.sys.call("/etc/init.d/glorytun-udp restart >/dev/null 2>/dev/null")
luci.sys.call("/etc/init.d/mlvpn restart >/dev/null 2>/dev/null")
@ -1232,6 +1264,7 @@ function wizard_add()
luci.sys.call("/etc/init.d/v2ray restart >/dev/null 2>/dev/null")
luci.sys.call("/etc/init.d/xray restart >/dev/null 2>/dev/null")
luci.sys.call("/etc/init.d/sqm restart >/dev/null 2>/dev/null")
luci.sys.call("/etc/init.d/omr-bypass restart >/dev/null 2>/dev/null")
luci.sys.call("/etc/init.d/sqm-autorate restart >/dev/null 2>/dev/null")
luci.sys.call("/etc/init.d/sysntpd restart >/dev/null 2>/dev/null")
luci.http.redirect(luci.dispatcher.build_url("admin/system/" .. menuentry:lower() .. "/status"))
@ -1299,10 +1332,19 @@ function settings_add()
ucic:set("openmptcprouter","settings","disable_ipv6",disable_ipv6)
--local dump = require("luci.util").ubus("openmptcprouter", "disableipv6", { disable_ipv6 = tonumber(disable_ipv6)})
-- Disable 6in4
local disable_6in4 = luci.http.formvalue("enable6in4") or "1"
ucic:set("openmptcprouter","settings","disable_6in4",disable_6in4)
-- Enable/disable external check
local externalcheck = luci.http.formvalue("externalcheck") or "1"
ucic:set("openmptcprouter","settings","external_check",externalcheck)
-- Enable/disable restrict proxy to LAN
local restricttolan = luci.http.formvalue("restricttolan") or "0"
ucic:set("openmptcprouter","settings","restrict_to_lan",restricttolan)
-- Enable/disable debug
local debug = luci.http.formvalue("debug") or "0"
ucic:set("openmptcprouter","settings","debug",debug)
@ -1448,6 +1490,7 @@ function settings_add()
-- Apply all settings
luci.sys.call("/etc/init.d/openmptcprouter restart >/dev/null 2>/dev/null")
luci.sys.call("/etc/init.d/openmptcprouter-vps set_vps_firewall >/dev/null 2>/dev/null")
luci.sys.call("/etc/init.d/omr-6in4 restart >/dev/null 2>/dev/null")
-- Done, redirect

View file

@ -189,6 +189,12 @@
<input type="checkbox" name="enableipv6" class="cbi-input-checkbox" value="0" <% if luci.model.uci.cursor():get("openmptcprouter","settings","disable_ipv6") == "0" then %>checked<% end %>>
</div>
</div>
<div class="cbi-value">
<label class="cbi-value-title"><%:Enable 6in4%></label>
<div class="cbi-value-field">
<input type="checkbox" name="enable6in4" class="cbi-input-checkbox" value="0" <% if luci.model.uci.cursor():get("openmptcprouter","settings","disable_6in4") == "0" then %>checked<% end %>>
</div>
</div>
<div class="cbi-value">
<label class="cbi-value-title"><%:Disable external check%></label>
<div class="cbi-value-field">
@ -331,6 +337,16 @@
</div>
</div>
</div>
<div class="cbi-value">
<label class="cbi-value-title"><%:Restrict proxy to LAN zone%></label>
<div class="cbi-value-field">
<input type="checkbox" name="restricttolan" class="cbi-input-checkbox" value="1" <% if luci.model.uci.cursor():get("openmptcprouter","settings","restrict_to_lan") == "1" then %>checked<% end %>>
<br />
<div class="cbi-value-description">
<%:Authorize access to proxy only from LAN firewall zone%>
</div>
</div>
</div>
<div class="cbi-value">
<label class="cbi-value-title"><%:Disable route loop detection%></label>
<div class="cbi-value-field">

View file

@ -132,7 +132,12 @@ local statuslogo = ucic:get("openmptcprouter","settings","statuslogo") or "openm
}
if (mArray.openmptcprouter.core_temp)
{
if (mArray.openmptcprouter.core_temp > 100000)
{
content += '<%:Core temp:%>' + " " + (mArray.openmptcprouter.core_temp / 10000).toFixed(1) + " &#176;";
} else {
content += '<%:Core temp:%>' + " " + (mArray.openmptcprouter.core_temp / 1000).toFixed(1) + " &#176;";
}
content += "<br />";
}
if (mArray.openmptcprouter.uptime)
@ -227,7 +232,7 @@ local statuslogo = ucic:get("openmptcprouter","settings","statuslogo") or "openm
if (mArray.openmptcprouter.tun6_state == "DOWN")
{
statusMessage += '<%:IPv6 tunnel DOWN%>' + '<br/>';
} else if (mArray.openmptcprouter.wan_addr6 == '')
} else if (mArray.openmptcprouter.wan_addr6 == '' && mArray.openmptcprouter.dns_filter_aaaa == false)
{
statusMessage += '<%:No IPv6 access%>' + '<br/>';
}
@ -260,9 +265,12 @@ local statuslogo = ucic:get("openmptcprouter","settings","statuslogo") or "openm
} else if (mArray.openmptcprouter.wan_addr6 != "" && mArray.openmptcprouter.service_addr == "127.0.0.1")
{
var title = String.format("%s (%s)", mArray.openmptcprouter.vps_hostname, mArray.openmptcprouter.wan_addr6);
} else if (mArray.openmptcprouter.direct_output == false)
} else if (mArray.openmptcprouter.wan_addr6 != "" && mArray.openmptcprouter.direct_output == false)
{
var title = String.format("%s (%s)", mArray.openmptcprouter.vps_hostname, mArray.openmptcprouter.wan_addr6);
} else if (mArray.openmptcprouter.wan_addr != "" && mArray.openmptcprouter.direct_output == false)
{
var title = String.format("%s (%s)", mArray.openmptcprouter.vps_hostname, mArray.openmptcprouter.wan_addr);
} else if (mArray.openmptcprouter.wan_addr != "" && mArray.openmptcprouter.direct_output == true)
{
var title = String.format("%s (%s)", _('Direct output'), mArray.openmptcprouter.wan_addr);
@ -432,12 +440,18 @@ local statuslogo = ucic:get("openmptcprouter","settings","statuslogo") or "openm
statusMessageClass = "error";
statusMessage = "";
break;
case 'WARNING':
stat = 'Warning';
cssc = 'rgb(144, 240, 144)';
statusIcon = "<%=resource%>/openmptcprouter/images/statusWarning.png";
statusMessageClass = "warning";
statusMessage = "Some connectivity tests failed";
default:
stat = 'Unknown';
cssc = 'rgb(144, 240, 144)';
statusIcon = "<%=resource%>/openmptcprouter/images/statusWarning.png";
statusMessageClass = "warning";
statusMessage = "";
statusMessage = "Unknown status";
}
// Populate info
var wanip = mArray.wans[i].wanip;

View file

@ -46,6 +46,7 @@
alltty = {}
iftty = luci.sys.exec("timeout 1 /usr/bin/mmcli -L")
if iftty ~= nil then
for listtty in iftty:gmatch("([^\r\n]*)[\r\n]") do
modemid = luci.util.trim(luci.sys.exec("echo '" .. listtty .. "' | awk -F' ' '{print $1}' | awk -F/ '{print $6}'"))
if modemid ~= '' then
@ -54,6 +55,7 @@
table.insert(alltty, tty)
end
end
end
%>
@ -79,6 +81,9 @@
uci:foreach("openmptcprouter","server", function(s)
nbserver=nbserver+1
end)
if nbserver == 0 then
uci:set("openmptcprouter","vps","server")
end
uci:foreach("openmptcprouter","server", function(s)
servername = s[".name"]
%>

View file

@ -14,10 +14,15 @@ uci show | \
-e "/openvpn\.omr\.remote=/s/......$/xxxxxx'/" \
-e "/shadowsocks-libev\.sss.*\.server=/s/......$/xxxxxx'/" \
-e "/shadowsocks-libev\.sss.*\.key=/s/......$/xxxxxx'/" \
-e "/shadowsocks-rust\.sss.*\.server=/s/......$/xxxxxx'/" \
-e "/shadowsocks-rust\.sss.*\.password=/s/......$/xxxxxx'/" \
-e "/external_ip=/s/......$/xxxxxx'/" \
-e "/obfs_host=/s/..........$/xxxxxx'/" \
-e "/vmess_address=/s/......$/xxxxxx'/" \
-e "/vless_address=/s/......$/xxxxxx'/" \
-e "/trojan_address=/s/......$/xxxxxx'/" \
-e "/socks_address=/s/......$/xxxxxx'/" \
-e "/vless_reality_address=/s/......$/xxxxxx'/" \
-e "/vpn\.key=/s/......$/xxxxxx'/" \
-e "/vps\.key=/s/......$/xxxxxx'/" \
-e "/wgkey=/s/......$/xxxxxx'/" \

View file

@ -15,6 +15,7 @@ omr_intf_del() {
omr_intf_check() {
[ "$(uci -q get network.$1)" = "" ] && omr_intf_del $1
uci -q delete openmptcprouter.$1.publicip
}
omr_intf_set() {
@ -79,6 +80,8 @@ omr_set_settings() {
config_get disable_ipv6 settings disable_ipv6 "0"
if [ "$disable_ipv6" = "1" ]; then
uci -q set network.$1.ipv6=0
else
uci -q set network.$1.ipv6=1
fi
[ -z "$addlatency" ] && addlatency=0
@ -101,13 +104,13 @@ omr_set_settings() {
fi
if [ "$addlatency" = "0" ] && [ "$(tc qdisc show dev $ifname | grep delay)" != "" ]; then
tc qdisc del dev ${ifname} root netem 2>&1 >/dev/null
tc qdisc del dev ${ifname} root netem >/dev/null 2>&1
fi
if [ "$addlatency" != "0" ]; then
if [ "$(tc qdisc show dev $ifname | grep delay)" = "" ]; then
tc qdisc add dev ${ifname} root netem delay ${addlatency}ms 2>&1 >/dev/null
tc qdisc add dev ${ifname} root netem delay ${addlatency}ms >/dev/null 2>&1
elif [ "$(tc qdisc show dev $ifname | awk '/delay/ { print $10 }' | sed 's/ms//')" != "$addlatency" ]; then
tc qdisc replace dev ${ifname} root netem delay ${addlatency}ms 2>&1 >/dev/null
tc qdisc replace dev ${ifname} root netem delay ${addlatency}ms >/dev/null 2>&1
fi
fi
fi
@ -121,6 +124,7 @@ start_service() {
config_load network
config_foreach omr_set_settings interface
uci -q commit network
uci -q del openmptcprouter.omr.vpn
uci -q commit openmptcprouter
[ -d /sys/devices/system/cpu/cpufreq/policy0 ] && {
@ -165,7 +169,7 @@ start_service() {
fi
if [ "$(uci -q get openmptcprouter.settings.sfe_enabled)" = "1" ]; then
[ -z "$(lsmod | grep fast_classifier)" ] && modprobe -q fast_classifier 2>&1 >/dev/null
[ -z "$(lsmod | grep fast_classifier)" ] && modprobe -q fast_classifier >/dev/null 2>&1
if [ "$(uci -q get openmptcprouter.settings.sfe_bridge)" = "1" ]; then
echo 1 >/sys/fast_classifier/skip_to_bridge_ingress
else
@ -173,12 +177,12 @@ start_service() {
fi
if [ "$(uci -q get openmptcprouter.settings.disable_ipv6)" = "0" ]; then
sfe_ipv6=$(cat /sys/sfe_ipv6/debug_dev)
[ ! -f /dev/sfe_ipv6 ] && mknod /dev/sfe_ipv6 c $sfe_ipv6 0 2>&1 >/dev/null
[ ! -f /dev/sfe_ipv6 ] && mknod /dev/sfe_ipv6 c $sfe_ipv6 0 >/dev/null 2>&1
else
rm -f /dev/sfe_ipv6
fi
elif [ -d "/sys/module/fast_classifier" ]; then
rmmod fast_classifier 2>&1 >/dev/null
rmmod fast_classifier >/dev/null 2>&1
fi
if [ "$(uci -q get openmptcprouter.settings.sipalg)" = "0" ]; then
@ -188,9 +192,9 @@ start_service() {
set firewall.zone_vpn.auto_helper='0'
commit firewall
EOF
[ -n "$(lsmod | grep nf_nat_sip)" ] && rmmod nf_nat_sip 2>&1 >/dev/null
[ -n "$(lsmod | grep nf_nat_sip)" ] && rmmod nf_nat_sip >/dev/null 2>&1
sleep 2
[ -n "$(lsmod | grep nf_conntrack_sip)" ] && rmmod nf_conntrack_sip 2>&1 >/dev/null
[ -n "$(lsmod | grep nf_conntrack_sip)" ] && rmmod nf_conntrack_sip >/dev/null 2>&1
else
uci -q batch <<-EOF >/dev/null
set firewall.zone_lan.auto_helper='1'
@ -198,9 +202,9 @@ start_service() {
set firewall.zone_vpn.auto_helper='1'
commit firewall
EOF
modprobe -q nf_conntrack_sip 2>&1 >/dev/null
modprobe -q nf_conntrack_sip >/dev/null 2>&1
sleep 2
modprobe -q nf_nat_sip 2>&1 >/dev/null
modprobe -q nf_nat_sip >/dev/null 2>&1
fi
if [ "$(uci -q get rpcd.@rpcd[0].socket)" != "/var/run/ubus/ubus.sock" ]; then
@ -208,7 +212,7 @@ start_service() {
set rpcd.@rpcd[0].socket='/var/run/ubus/ubus.sock'
commit rpcd
EOF
/etc/init.d/rpcd restart 2>&1 >/dev/null
/etc/init.d/rpcd restart >/dev/null 2>&1
fi
if [ "$(pgrep ModemManager)" = "" ] && [ -f /etc/init.d/modemmanager ] && [ -n "$(uci -q show network | grep modemmanager)" ] && [ "$(uci -q openmptcprouter.settings.modemmanager)" != "0" ]; then
_log "Can't find ModemManager, start it..."
@ -229,5 +233,5 @@ reload_service() {
}
service_triggers() {
procd_add_reload_trigger "openmptcprouter" "network"
procd_add_reload_trigger "network"
}

View file

@ -86,9 +86,9 @@ if [ "$(uci -q get openmptcprouter.settings.check_ipv6_website)" = "" ]; then
commit openmptcprouter
EOF
fi
if [ "$(uci -q get openmptcprouter.settings.status_vps_timeout)" = "" ]; then
if [ "$(uci -q get openmptcprouter.settings.status_vps_timeout)" = "" ] || [ "$(uci -q get openmptcprouter.settings.status_vps_timeout)" = "1" ]; then
uci -q batch <<-EOF >/dev/null
set openmptcprouter.settings.status_vps_timeout=1
set openmptcprouter.settings.status_vps_timeout=3
commit openmptcprouter
EOF
fi

View file

@ -1,22 +0,0 @@
<script type="text/javascript">//<![CDATA[
XHR.poll(3, '<%=url([[admin]], [[services]], [[oled]], [[status]])%>', null,
function(x, data) {
var tb = document.getElementById('oled_status');
if (data && tb) {
if (data.running) {
var links = '<em><b><font color=green>OLED <%:RUNNING%></font></b></em>';
tb.innerHTML = links;
} else {
tb.innerHTML = '<em><b><font color=red>OLED <%:NOT RUNNING%></font></b></em>';
}
}
}
);
//]]>
</script>
<style>.mar-10 {margin-left: 50px; margin-right: 10px;}</style>
<fieldset class="cbi-section">
<p id="oled_status">
<em><%:Collecting data...%></em>
</p>
</fieldset>

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

@ -1,7 +1,7 @@
{
"admin/dashboard": {
"title": "Dashboard",
"order": 1,
"order": 5,
"action": {
"type": "view",
"path": "dashboard/index"

View file

@ -245,6 +245,25 @@ function has_peerdns(proto) {
return false;
}
function has_sourcefilter(proto) {
switch (proto) {
case '3g':
case 'dhcpv6':
case 'directip':
case 'mbim':
case 'modemmanager':
case 'ncm':
case 'ppp':
case 'pppoa':
case 'pppoe':
case 'pptp':
case 'qmi':
return true;
}
return false;
}
var cbiRichListValue = form.ListValue.extend({
renderWidget: function(section_id, option_index, cfgvalue) {
var choices = this.transformChoices();
@ -537,6 +556,11 @@ return view.extend({
tdEl.lastChild.childNodes[3].disabled = true;
}
if (dynamic) {
//disable the 'Edit' button on dynamic interfaces
tdEl.lastChild.childNodes[2].disabled = true;
}
return tdEl;
};
@ -588,6 +612,10 @@ return view.extend({
o.nobridges = false;
o.optional = false;
o.network = ifc.getName();
o.exclude = '@' + ifc.getName();
o = s.taboption('general', form.Flag, 'disabled', _('Disable this interface'));
o.modalonly = true;
o = s.taboption('general', form.Flag, 'auto', _('Bring up on boot'));
o.modalonly = true;
@ -1043,7 +1071,7 @@ return view.extend({
for (var i = 0; i < rtTables.length; i++)
o.value(rtTables[i][1], '%s (%d)'.format(rtTables[i][1], rtTables[i][0]));
if (protoval == 'dhcpv6') {
if (has_sourcefilter(protoval)) {
o = nettools.replaceOption(s, 'advanced', form.Flag, 'sourcefilter', _('IPv6 source routing'), _('Automatically handle multiple uplink interfaces using source-based policy routing.'));
o.default = o.enabled;
}
@ -1550,9 +1578,24 @@ return view.extend({
o = s.option(form.Value, 'ula_prefix', _('IPv6 ULA-Prefix'), _('Unique Local Address - in the range <code>fc00::/7</code>. Typically only within the &#8216;local&#8217; half <code>fd00::/8</code>. ULA for IPv6 is analogous to IPv4 private network addressing. This prefix is randomly generated at first install.'));
o.datatype = 'cidr6';
o = s.option(form.Flag, 'packet_steering', _('Packet Steering'), _('Enable packet steering across all CPUs. May help or hinder network speed.'));
o = s.option(form.ListValue, 'packet_steering', _('Packet Steering'), _('Enable packet steering across CPUs. May help or hinder network speed.'));
o.value('', _('Disabled'));
o.value('1',_('Enabled'));
o.value('2',_('Enabled (all CPUs)'));
o.optional = true;
var steer_flow = uci.get('network', 'globals', 'steering_flows');
o = s.option(form.Value, 'steering_flows', _('Steering flows (<abbr title="Receive Packet Steering">RPS</abbr>)'),
_('Directs packet flows to specific CPUs where the local socket owner listens (the local service).') + ' ' +
_('Note: this setting is for local services on the device only (not for forwarding).'));
o.value('', _('Standard: none'));
o.value('128', _('Suggested: 128'));
o.value('256', _('256'));
o.depends('packet_steering', '1');
o.depends('packet_steering', '2');
o.datatype = 'uinteger';
o.default = steer_flow;
if (dslModemType != null) {
s = m.section(form.TypedSection, 'dsl', _('DSL'));

View file

@ -1237,6 +1237,9 @@ return view.extend({
o.depends('encryption', 'psk-mixed');
o.value('auto', _('auto'));
o.value('ccmp', _('Force CCMP (AES)'));
o.value('ccmp256', _('Force CCMP-256 (AES)'));
o.value('gcmp', _('Force GCMP (AES)'));
o.value('gcmp256', _('Force GCMP-256 (AES)'));
o.value('tkip', _('Force TKIP'));
o.value('tkip+ccmp', _('Force TKIP and CCMP (AES)'));
o.write = ss.children.filter(function(o) { return o.option == 'encryption' })[0].write;
@ -1806,6 +1809,27 @@ return view.extend({
o.placeholder = '201';
o.rmempty = true;
if (L.hasSystemFeature('hostapd', 'ocv') || L.hasSystemFeature('wpasupplicant', 'ocv')) {
o = ss.taboption('encryption', form.ListValue, 'ocv', _('Operating Channel Validation'), _("Note: Workaround mode allows a STA that claims OCV capability to connect even if the STA doesn't send OCI or negotiate PMF."));
o.value('0', _('Disabled'));
o.value('1', _('Enabled'));
o.value('2', _('Enabled (workaround mode)'));
o.default = '0';
o.depends('ieee80211w', '1');
o.depends('ieee80211w', '2');
o.validate = function(section_id, value) {
var modeopt = this.section.children.filter(function(o) { return o.option == 'mode' })[0],
modeval = modeopt.formvalue(section_id);
if ((value == '2') && ((modeval == 'sta') || (modeval == 'sta-wds'))) {
return _('Workaround mode can only be used when acting as an access point.');
}
return true;
}
}
o = ss.taboption('encryption', form.Flag, 'wpa_disable_eapol_key_retries', _('Enable key reinstallation (KRACK) countermeasures'), _('Complicates key reinstallation attacks on the client side by disabling retransmission of EAPOL-Key frames that are used to install keys. This workaround might cause interoperability issues and reduced robustness of key negotiation especially in environments with heavy traffic load.'));
add_dependency_permutations(o, { mode: ['ap', 'ap-wds'], encryption: ['psk2', 'psk-mixed', 'sae', 'sae-mixed', 'wpa2', 'wpa3', 'wpa3-mixed'] });

View file

@ -0,0 +1,16 @@
#
# Copyright (C) 2008-2014 The LuCI Team <luci@lists.subsignal.org>
#
# This is free software, licensed under the Apache License, Version 2.0 .
#
include $(TOPDIR)/rules.mk
LUCI_TITLE:=Support for ModemManager
LUCI_DEPENDS:=+modemmanager
PKG_LICENSE:=Apache-2.0
include $(TOPDIR)/feeds/luci/luci.mk
# call BuildPackage - OpenWrt buildroot signature

View file

@ -0,0 +1,101 @@
'use strict';
'require baseclass';
'require fs';
return baseclass.extend({
_mmcliBin: '/usr/bin/mmcli',
_emptyStringValue: '--',
_parseIndex: function (dbusPath) {
var index = dbusPath.split('/').slice(-1);
return parseInt(index);
},
_parseOutput: function (output) {
try {
return this._removeEmptyStrings(JSON.parse(output));
} catch (err) {
return null;
}
},
_removeEmptyStrings: function (obj) {
if (obj == null) {
return obj;
}
if (typeof obj == 'string') {
if (obj == this._emptyStringValue) {
obj = null;
}
} else if (Array.isArray()) {
obj = obj.map(L.bind(function (it) {
return this._removeEmptyStrings(it);
}, this));
} else {
var keys = Object.keys(obj);
keys.forEach(L.bind(function (key) {
obj[key] = this._removeEmptyStrings(obj[key]);
}, this));
}
return obj;
},
getModems: function () {
return fs.exec_direct(this._mmcliBin, [ '-L', '-J' ]).then(L.bind(function (res) {
var json = this._parseOutput(res);
if (json == null) {
return [];
}
var modems = json['modem-list'];
var tasks = [];
modems.forEach(L.bind(function (modem) {
var index = this._parseIndex(modem);
if (!isNaN(index)) {
tasks.push(this.getModem(index));
}
}, this));
return Promise.all(tasks);
}, this));
},
getModem: function (index) {
return fs.exec_direct(this._mmcliBin, [ '-m', index, '-J' ]).then(L.bind(function (modem) {
return this._parseOutput(modem);
}, this));
},
getModemSims: function (modem) {
var tasks = [];
var simSlots = modem.generic['sim-slots'];
var sim = modem.generic.sim;
if (sim != null && !simSlots.includes(sim)) {
simSlots.push(sim);
}
simSlots.forEach(L.bind(function (modem) {
var index = this._parseIndex(modem);
if (!isNaN(index)) {
tasks.push(this.getSim(index));
}
}, this));
return Promise.all(tasks);
},
getSim: function (index) {
return fs.exec_direct(this._mmcliBin, [ '-i', index, '-J' ]).then(L.bind(function (sim) {
return this._parseOutput(sim);
}, this));
},
getModemLocation: function (modem) {
var index = this._parseIndex(modem['dbus-path']);
return fs.exec_direct(this._mmcliBin, [ '-m', index, '--location-get', '-J' ]).then(L.bind(function (location) {
return this._parseOutput(location);
}, this));
}
});

View file

@ -0,0 +1,170 @@
'use strict';
'require fs';
'require form';
'require network';
'require modemmanager_helper as helper';
network.registerPatternVirtual(/^mobiledata-.+$/);
network.registerErrorCode('MM_CONNECT_FAILED', _('Connection attempt failed.'));
network.registerErrorCode('MM_CONNECT_IN_PROGRESS', _('Modem connection in progress. Please wait. This process will timeout after 2 minutes.'));
network.registerErrorCode('DEVICE_NOT_MANAGED', _('Device not managed by ModemManager.'));
network.registerErrorCode('INVALID_BEARER_LIST', _('Invalid bearer list. Possibly too many bearers created. This protocol supports one and only one bearer.'));
network.registerErrorCode('UNKNOWN_METHOD', _('Unknown and unsupported connection method.'));
network.registerErrorCode('DISCONNECT_FAILED', _('Disconnection attempt failed.'));
network.registerErrorCode('MM_INVALID_ALLOWED_MODES_LIST', _('Unable to set allowed mode list.'));
network.registerErrorCode('MM_NO_PREFERRED_MODE_CONFIGURED', _('No preferred mode configuration found.'));
network.registerErrorCode('MM_NO_ALLOWED_MODE_CONFIGURED', _('No allowed mode configuration found.'));
network.registerErrorCode('MM_FAILED_SETTING_PREFERRED_MODE', _('Unable to set preferred mode.'));
return network.registerProtocol('modemmanager', {
getI18n: function() {
return _('ModemManager');
},
getIfname: function() {
return this._ubus('l3_device') || 'modemmanager-%s'.format(this.sid);
},
getOpkgPackage: function() {
return 'modemmanager';
},
isFloating: function() {
return true;
},
isVirtual: function() {
return true;
},
getDevices: function() {
return null;
},
containsDevice: function(ifname) {
return (network.getIfnameOf(ifname) == this.getIfname());
},
renderFormOptions: function(s) {
var dev = this.getL3Device() || this.getDevice(), o;
o = s.taboption('general', form.ListValue, '_modem_device', _('Modem device'));
o.ucioption = 'device';
o.rmempty = false;
o.load = function(section_id) {
return helper.getModems().then(L.bind(function(devices) {
for (var i = 0; i < devices.length; i++) {
var generic = devices[i].modem.generic;
this.value(generic.device,
'%s - %s (%s)'.format(generic.manufacturer, generic.model, generic.device));
}
return form.Value.prototype.load.apply(this, [section_id]);
}, this));
};
o = s.taboption('general', form.Value, 'apn', _('APN'));
o.validate = function(section_id, value) {
if (value == null || value == '')
return true;
if (!/^[a-zA-Z0-9\-.]*[a-zA-Z0-9]$/.test(value))
return _('Invalid APN provided');
return true;
};
o = s.taboption('general', form.Value, 'pincode', _('PIN'));
o.datatype = 'and(uinteger,minlength(4),maxlength(8))';
o = s.taboption('general', form.Value, 'pukcode', _('PUK'));
o.datatype = "uinteger";
o = s.taboption('general', form.Value, 'plmn', _('PLMN'));
o.datatype = "uinteger";
o = s.taboption('general', form.DynamicList, 'allowedauth', _('Authentication Type'));
o.value('both', _('PAP/CHAP (both)'));
o.value('pap', 'PAP');
o.value('chap', 'CHAP');
o.value('mschap', 'MSCHAP');
o.value('mschapv2', 'MSCHAPv2');
o.value('eap', 'EAP');
o.value('', _('None'));
o.default = '';
o = s.taboption('general', form.ListValue, 'allowedmode', _('Allowed network technology'),
_('Setting the allowed network technology.'));
o.value('2g');
o.value('3g');
o.value('3g|2g');
o.value('4g');
o.value('4g|2g');
o.value('4g|3g');
o.value('4g|3g|2g');
o.value('5g');
o.value('5g|2g');
o.value('5g|3g');
o.value('5g|3g|2g');
o.value('5g|4g');
o.value('5g|4g|2g');
o.value('5g|4g|3g');
o.value('5g|4g|3g|2g');
o.value('',_('any'));
o.default = '';
o = s.taboption('general', form.ListValue, 'preferredmode', _('Preferred network technology'),
_('Setting the preferred network technology.'));
o.value('2g');
o.value('3g');
o.value('4g');
o.value('5g');
o.value('none', _('None'));
o.depends('allowedmode','3g|2g');
o.depends('allowedmode','4g|2g');
o.depends('allowedmode','4g|3g');
o.depends('allowedmode','4g|3g|2g');
o.depends('allowedmode','5g|2g');
o.depends('allowedmode','5g|3g');
o.depends('allowedmode','5g|3g|2g');
o.depends('allowedmode','5g|4g');
o.depends('allowedmode','5g|4g|2g');
o.depends('allowedmode','5g|4g|3g');
o.depends('allowedmode','5g|4g|3g|2g');
o = s.taboption('general', form.Value, 'username', _('PAP/CHAP username'));
o.depends('auth', 'pap');
o.depends('auth', 'chap');
o.depends('auth', 'both');
o = s.taboption('general', form.Value, 'password', _('PAP/CHAP password'));
o.depends('auth', 'pap');
o.depends('auth', 'chap');
o.depends('auth', 'both');
o.password = true;
o = s.taboption('general', form.ListValue, 'iptype', _('IP Type'));
o.value('ipv4v6', _('IPv4/IPv6 (both - defaults to IPv4)'))
o.value('ipv4', _('IPv4 only'));
o.value('ipv6', _('IPv6 only'));
o.default = 'ipv4v6';
o = s.taboption('advanced', form.Value, 'mtu', _('Override MTU'));
o.placeholder = dev ? (dev.getMTU() || '1500') : '1500';
o.datatype = 'max(9200)';
o = s.taboption('general', form.Value, 'signalrate', _('Signal Refresh Rate'), _("In seconds"));
o.datatype = 'uinteger';
s.taboption('general', form.Value, 'metric', _('Gateway metric'));
s.taboption('advanced', form.Flag, 'debugmode', _('Enable Debugmode'));
o = s.taboption('advanced', form.ListValue, 'loglevel', _('Log output level'));
o.value('ERR', _('Error'))
o.value('WARN', _('Warning'));
o.value('INFO', _('Info'));
o.value('DEBUG', _('Debug'));
o.default = 'ERR';
}
});

View file

@ -0,0 +1,181 @@
'use strict';
'require ui';
'require view';
'require poll';
'require dom';
'require modemmanager_helper as helper';
return view.extend({
load: function() {
return helper.getModems().then(function (modems) {
return Promise.all(modems.filter(function (modem){
return modem != null;
}).map(function (modem) {
return helper.getModemSims(modem.modem).then(function (sims) {
modem.sims = sims.filter(function (sim) {
return sim != null;
});
return helper.getModemLocation(modem.modem).then(function (location) {
modem.location = location;
return modem;
});
});
}));
});
},
pollData: function (container) {
poll.add(L.bind(function () {
return this.load().then(L.bind(function (modems) {
dom.content(container, this.renderContent(modems));
}, this));
}, this));
},
renderSections: function (name, sections) {
if (sections.length == 0) {
sections.push(E('div', { 'class': 'cbi-section' }, [
E('span', {}, _('Section %s is empty.').format(name))
]));
}
return E('div', { 'class': 'cbi-section' }, [
E('h1', {}, name),
...sections
]);
},
renderSection: function (name, table) {
var rowNodes = table.filter(function (row) {
return row[1] != null;
}).map(function (row) {
return E('tr', { 'class': 'tr' }, [
E('td', { 'class': 'td', 'width': '33%' }, E('strong', {}, [row[0]])),
E('td', { 'class': 'td' }, [row[1]])
]);
});
var tableNode;
if (rowNodes.length == 0) {
tableNode = E('div', { 'class': 'cbi-section' }, [
E('span', {}, _('Section %s is empty.').format(name))
])
} else {
tableNode = E('table', { 'class': 'table', }, rowNodes);
}
return E('div', { 'class': 'cbi-section' }, [
E('h2', {}, [name]),
tableNode
]);
},
renderContent: function (modems) {
var node = E('div', {}, E('div'));
modems.forEach(L.bind(function (modem) {
var generic = modem.modem.generic;
var modem3gpp = modem.modem['3gpp'];
var modemSection = this.renderSection(_('Modem Info'), [
[_('Manufacturer'), generic.manufacturer],
[_('Model'), generic.model],
[_('Revision'), generic.revision],
[E('abbr', { 'title': _('International Mobile Station Equipment Identity') }, [
_('IMEI')
]), modem3gpp.imei],
[_('Device Identifier'), generic['device-identifier']],
[_('Power State'), generic['power-state']],
[_('State'), generic.state],
[_('Failed Reason'), generic['state-failed-reason']]
]);
var ownNumbersStr = generic['own-numbers'].join(', ');
var accessTechnologiesStr = generic['access-technologies'].join(', ');
var signalQualityValue = parseInt(generic['signal-quality'].value);
var networkSection = this.renderSection(_('Network Registration'), [
[_('Own Numbers'), ownNumbersStr],
[_('Access Technologies'), accessTechnologiesStr],
[_('Operator') , modem3gpp['operator-name']],
[_('Operator Code'), modem3gpp['operator-code']],
[_('Registration State'), modem3gpp['registration-state']],
[_('Packet Service State'), modem3gpp['packet-service-state']],
[_('Signal Quality'), E('div', { 'class': 'cbi-progressbar', 'title': '%d %'.format(signalQualityValue) }, [
E('div', { 'style': 'width: %d%%'.format(signalQualityValue) })
])]
]);
var location3gpp = {};
if (modem.location != null) {
location3gpp = modem.location.modem.location['3gpp'];
}
var locationSection = this.renderSection(_('Cell Location'), [
[E('abbr', { 'title': _('Cell ID') }, [
'CID'
]), location3gpp.cid],
[E('abbr', { 'title': _('Location Area Code') }, [
'LAC'
]), location3gpp.lac],
[E('abbr', { 'title': _('Mobile Country Code') }, [
'MCC'
]), location3gpp.mcc],
[E('abbr', { 'title': _('Mobile Network Code') }, [
'MNC'
]), location3gpp.mnc],
[E('abbr', { 'title': _('Tracking Area Code') }, [
'TAC'
]), location3gpp.tac]
]);
var simTables = modem.sims.map(function (sim) {
var properties = sim.sim.properties;
return [
[_('Active'), properties.active],
[_('Operator Name'), properties['operator-name']],
[E('abbr', { 'title': _('Integrated Circuit Card Identifier') }, [
'ICCID'
]), properties.iccid],
[E('abbr', { 'title': _('International Mobile Subscriber Identity') }, [
'IMSI'
]), properties.imsi]
];
});
var simSubSections = simTables.map(L.bind(function (table, index) {
return this.renderSection(_('SIM %d').format(index + 1), table)
}, this));
var simSection = this.renderSections(_('SIMs'), simSubSections);
var sections = [
E('div', { 'class': 'cbi-map-descr'}, []),
modemSection,
networkSection,
locationSection,
simSection
].filter(function (section) {
return section != null;
});
node.firstElementChild.appendChild(E('div', { 'data-tab': generic.device, 'data-tab-title': generic.device }, sections));
}, this));
ui.tabs.initTabGroup(node.firstElementChild.childNodes);
return node;
},
render: function (modems) {
var content = E([], [
E('h2', {}, [_('Cellular Network')]),
E('div')
]);
var container = content.lastElementChild;
dom.content(container, this.renderContent(modems));
this.pollData(container);
return content;
},
handleSaveApply: null,
handleSave: null,
handleReset: null
});

View file

@ -0,0 +1,13 @@
{
"admin/status/modemmanager": {
"title": "Cellular Network",
"order": 10,
"action": {
"type": "view",
"path": "modemmanager/status"
},
"depends": {
"acl": [ "luci-proto-modemmanager" ]
}
}
}

View file

@ -0,0 +1,14 @@
{
"luci-proto-modemmanager": {
"description": "Grant access to mmcli",
"read": {
"cgi-io": [ "exec" ],
"file": {
"/usr/bin/mmcli -L -J": [ "exec" ],
"/usr/bin/mmcli -m [0-9]* -J": [ "exec" ],
"/usr/bin/mmcli -i [0-9]* -J": [ "exec" ],
"/usr/bin/mmcli -m [0-9]* --location-get -J": [ "exec" ]
}
}
}
}

201
luci-theme-alpha/LICENSE Normal file
View file

@ -0,0 +1,201 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

54
luci-theme-alpha/Makefile Normal file
View file

@ -0,0 +1,54 @@
# LuCI Alpha Theme
# Copyright 2024 derisamedia <yuimizuno86@gmail.com>
#
# Licensed under the Apache License v2.0
# http://www.apache.org/licenses/LICENSE-2.0
include $(TOPDIR)/rules.mk
THEME_NAME:=alpha
THEME_TITLE:=Alpha
PKG_NAME:=luci-theme-$(THEME_NAME)
PKG_VERSION:=3.9.4-beta
PKG_RELEASE:=9
include $(INCLUDE_DIR)/package.mk
define Package/luci-theme-$(THEME_NAME)
SECTION:=luci
CATEGORY:=LuCI
SUBMENU:=9. Themes
DEPENDS:=+libc
TITLE:=LuCi Theme For OpenWrt And Alpha OS ONLY - $(THEME_TITLE)
URL:=http://facebook.com/derisamedia/
PKGARCH:=all
endef
define Build/Configure
endef
define Build/Compile
endef
define Package/luci-theme-$(THEME_NAME)/install
$(INSTALL_DIR) $(1)/etc/uci-defaults
echo "uci set luci.themes.$(THEME_TITLE)=/luci-static/$(THEME_NAME); uci commit luci" > $(1)/etc/uci-defaults/30-luci-theme-$(THEME_NAME)
$(INSTALL_DIR) $(1)/www/luci-static/$(THEME_NAME)
$(CP) -a ./luasrc/* $(1)/www/luci-static/$(THEME_NAME)/ 2>/dev/null || true
$(INSTALL_DIR) $(1)/usr/lib/lua/luci/view/themes/$(THEME_NAME)
$(CP) -a ./template/* $(1)/usr/lib/lua/luci/view/themes/$(THEME_NAME)/ 2>/dev/null || true
$(INSTALL_DIR) $(1)/www/luci-static/resources
$(CP) -a ./js/* $(1)/www/luci-static/resources/ 2>/dev/null || true
$(INSTALL_DIR) $(1)/etc/config
$(CP) -a ./root/etc/config/* $(1)/etc/config/ 2>/dev/null || true
endef
define Package/luci-theme-$(THEME_NAME)/postinst
#!/bin/sh
[ -n "$${IPKG_INSTROOT}" ] || {
( . /etc/uci-defaults/30-luci-theme-$(THEME_NAME) ) && rm -f /etc/uci-defaults/30-luci-theme-$(THEME_NAME)
}
endef
$(eval $(call BuildPackage,luci-theme-$(THEME_NAME)))

View file

@ -0,0 +1,53 @@
[issues]: https://github.com/derisamedia/luci-theme-alpha/issues
[issues-badge]: https://img.shields.io/badge/Issues-welcome-brightgreen.svg?style=flat-square
[release]: https://github.com/derisamedia/luci-theme-alpha/releases
[release-badge]: https://img.shields.io/badge/download-check_releases-blue
[group]: https://facebook.com/groups/indowrt
[group-badge]: https://img.shields.io/badge/visit_Facebook-Comunity-cyan
[discord]: https://discord.gg/gdZwmDQGUm
[discord-badge]: https://img.shields.io/badge/visit_Discord-Comunity-blue
# luci-theme-alpha (BETA)
<div align="center">
<img src="https://raw.githubusercontent.com/derisamedia/luci-theme-alpha/master/luasrc/brand.png">
[![issues][issues-badge]][issues]
[![release][release-badge]][release]
[![group][group-badge]][group]
[![discord][discord-badge]][discord]
Luci theme for Official Openwrt and Alpha OS build ,based on bootstrap and material luCi theme refferences,
<summary>Preview Screenshoot</summary>
<p>
![image](https://raw.githubusercontent.com/derisamedia/luci-theme-alpha/master/ss1.png)
![image](https://raw.githubusercontent.com/derisamedia/luci-theme-alpha/master/ss2.png)
![image](https://raw.githubusercontent.com/derisamedia/luci-theme-alpha/master/ss3.png)
![image](https://raw.githubusercontent.com/derisamedia/luci-theme-alpha/master/mobileview1.png)
![image](https://raw.githubusercontent.com/derisamedia/luci-theme-alpha/master/mobileview2.png)
![image](https://raw.githubusercontent.com/derisamedia/luci-theme-alpha/master/mobileview3.png)
</p>
### FYI
alpha os is my idea which wants to develop the OpenWrt community in Indonesia, even the world, thanks to friends who have supported this alpha-os theme, hopefully given health to all of us.
(old text) Mr. Sibondt once they said 'jalan ditempat komunitas indo', that's what moved my heart to make an innovation that I named alpha os (alpha = initial version, because it hasn't been perfect until now 😁)
donate
buy me a padang rice or coffee
https://saweria.co/derisamedia

View file

@ -0,0 +1,179 @@
"use strict";
"require baseclass";
"require ui";
return baseclass.extend({
__init__: function () {
ui.menu.load().then(L.bind(this.render, this));
},
render: function (tree) {
var node = tree,
url = "";
this.renderModeMenu(node);
if (L.env.dispatchpath.length >= 3) {
for (var i = 0; i < 3 && node; i++) {
node = node.children[L.env.dispatchpath[i]];
url = url + (url ? "/" : "") + L.env.dispatchpath[i];
}
if (node) this.renderTabMenu(node, url);
}
document
.querySelector(".showSide")
.addEventListener(
"click",
ui.createHandlerFn(this, "handleSidebarToggle")
);
document
.querySelector(".darkMask")
.addEventListener(
"click",
ui.createHandlerFn(this, "handleSidebarToggle")
);
document.querySelector(".main > .loading").style.opacity = "0";
document.querySelector(".main > .loading").style.visibility = "hidden";
if (window.innerWidth <= 1152)
document.querySelector(".main-left").style.width = "0";
window.addEventListener("resize", this.handleSidebarToggle, true);
},
handleMenuExpand: function (ev) {
var a = ev.target,
ul1 = a.parentNode,
ul2 = a.nextElementSibling;
document.querySelectorAll("li.slide.active").forEach(function (li) {
if (li !== a.parentNode || li == ul1) {
li.classList.remove("active");
li.childNodes[0].classList.remove("active");
}
if (li == ul1) return;
});
if (!ul2) return;
if (
ul2.parentNode.offsetLeft + ul2.offsetWidth <=
ul1.offsetLeft + ul1.offsetWidth
)
ul2.classList.add("align-left");
ul1.classList.add("active");
a.classList.add("active");
a.blur();
ev.preventDefault();
ev.stopPropagation();
},
renderMainMenu: function (tree, url, level) {
var l = (level || 0) + 1,
ul = E("ul", { class: level ? "slide-menu" : "nav" }),
children = ui.menu.getChildren(tree);
if (children.length == 0 || l > 2) return E([]);
for (var i = 0; i < children.length; i++) {
var isActive = L.env.dispatchpath[l] == children[i].name,
submenu = this.renderMainMenu(
children[i],
url + "/" + children[i].name,
l
),
hasChildren = submenu.children.length;
ul.appendChild(
E(
"li",
{
class: hasChildren
? "slide" + (isActive ? " active" : "")
: isActive
? " active"
: "",
},
[
E(
"a",
{
href: hasChildren ? "#" : L.url(url, children[i].name),
class: hasChildren
? "menu" + (isActive ? " active" : "")
: null,
click: hasChildren
? ui.createHandlerFn(this, "handleMenuExpand")
: null,
"data-title": hasChildren
? children[i].title
: _(children[i].title),
},
[_(children[i].title)]
),
submenu,
]
)
);
}
if (l == 1) {
var container = document.querySelector("#mainmenu");
container.appendChild(ul);
container.style.display = "";
}
return ul;
},
renderModeMenu: function (tree) {
var ul = document.querySelector("#modemenu"),
children = ui.menu.getChildren(tree);
for (var i = 0; i < children.length; i++) {
var isActive = L.env.requestpath.length
? children[i].name == L.env.requestpath[0]
: i == 0;
ul.appendChild(
E("li", {}, [
E(
"a",
{
href: L.url(children[i].name),
class: isActive ? "active" : null,
},
[_(children[i].title)]
),
])
);
if (isActive) this.renderMainMenu(children[i], children[i].name);
if (i > 0 && i < children.length)
ul.appendChild(E("li", { class: "divider" }, [E("span")]));
}
if (children.length > 1) ul.parentElement.style.display = "";
},
renderTabMenu: function (tree, url, level) {
var container = document.querySelector("#tabmenu"),
l = (level || 0) + 1,
ul = E("ul", { class: "tabs" }),
children = ui.menu.getChildren(tree),
activeNode = null;
if (children.length == 0) return E([]);
for (var i = 0; i < children.length; i++) {
var isActive = L.env.dispatchpath[l + 2] == children[i].name,
activeClass = isActive ? " active" : "",
className = "tabmenu-item-%s %s".format(children[i].name, activeClass);
ul.appendChild(
E("li", { class: className }, [
E("a", { href: L.url(url, children[i].name) }, [
_(children[i].title),
]),
])
);
if (isActive) activeNode = children[i];
}
container.appendChild(ul);
container.style.display = "";
if (activeNode)
container.appendChild(
this.renderTabMenu(activeNode, url + "/" + activeNode.name, l)
);
return ul;
},
handleSidebarToggle: function (ev) {
var width = window.innerWidth,
darkMask = document.querySelector(".darkMask"),
mainRight = document.querySelector(".main-right"),
mainLeft = document.querySelector(".main-left"),
open = mainLeft.style.width == "";
if (width > 1152 || ev.type == "resize") open = true;
darkMask.style.visibility = open ? "" : "visible";
darkMask.style.opacity = open ? "" : 1;
if (width <= 1152) mainLeft.style.width = open ? "0" : "";
else mainLeft.style.width = "";
mainLeft.style.visibility = open ? "" : "visible";
mainRight.style["overflow-y"] = open ? "visible" : "hidden";
},
});

View file

@ -0,0 +1,35 @@
(function () {
// your page initialization code here
// the DOM will be available here
const toggler = document.querySelector(".toggler");
console.log(toggler);
toggler.addEventListener(
"click",
function (e) {
const element = document.querySelector(".navbar");
element.classList.toggle("active");
},
false
);
// const isDark = localStorage.getItem("isDark");
// if (isDark == 1) {
// const element = document.querySelector("body");
// element.classList.add("dark");
// }
// const themetoggler = document.querySelector(".themetoggler");
// themetoggler.addEventListener(
// "click",
// function (e) {
// e.preventDefault();
// const element = document.querySelector("body");
// element.classList.toggle("dark");
// const isDark = localStorage.getItem("isDark");
// localStorage.setItem("isDark", isDark == 1 ? 0 : 1);
// },
// false
// );
})();

Binary file not shown.

After

Width:  |  Height:  |  Size: 666 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 666 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 535 B

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -0,0 +1,71 @@
@font-face {
font-family: 'Inter';
src: url('Inter-Thin.woff2') format('woff2');
font-weight: 100;
font-style: normal;
font-display: swap;
}
@font-face {
font-family: 'Inter';
src: url('Inter-ExtraLight.woff2') format('woff2');
font-weight: 200;
font-style: normal;
font-display: swap;
}
@font-face {
font-family: 'Inter';
src: url('Inter-Light.woff2') format('woff2');
font-weight: 300;
font-style: normal;
font-display: swap;
}
@font-face {
font-family: 'Inter';
src: url('Inter-Regular.woff2') format('woff2');
font-weight: 400;
font-style: normal;
font-display: swap;
}
@font-face {
font-family: 'Inter';
src: url('Inter-Medium.woff2') format('woff2');
font-weight: 500;
font-style: normal;
font-display: swap;
}
@font-face {
font-family: 'Inter';
src: url('Inter-SemiBold.woff2') format('woff2');
font-weight: 600;
font-style: normal;
font-display: swap;
}
@font-face {
font-family: 'Inter';
src: url('Inter-Bold.woff2') format('woff2');
font-weight: 700;
font-style: normal;
font-display: swap;
}
@font-face {
font-family: 'Inter';
src: url('Inter-ExtraBold.woff2') format('woff2');
font-weight: 800;
font-style: normal;
font-display: swap;
}
@font-face {
font-family: 'Inter';
src: url('Inter-Black.woff2') format('woff2');
font-weight: 900;
font-style: normal;
font-display: swap;
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="#202124" d="m8,10.033663l-6.898535,-6.013274l-1.060688,0.972974l7.959223,6.986249l7.959223,-6.986249l-1.060688,-0.972974l-6.898535,6.013274z"/></svg>

After

Width:  |  Height:  |  Size: 221 B

View file

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Creator: CorelDRAW -->
<svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" width="50mm" height="50mm" version="1.1" style="shape-rendering:geometricPrecision; text-rendering:geometricPrecision; image-rendering:optimizeQuality; fill-rule:evenodd; clip-rule:evenodd"
viewBox="0 0 5000 5000"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xodm="http://www.corel.com/coreldraw/odm/2003">
<defs>
<style type="text/css">
<![CDATA[
.str0 {stroke:#FEFEFE;stroke-width:400;stroke-linecap:round;stroke-miterlimit:22.9256}
.fil0 {fill:none}
]]>
</style>
</defs>
<g id="Layer_x0020_1">
<metadata id="CorelCorpID_0Corel-Layer"/>
<rect class="fil0" x="-7.13" y="0.53" width="5000" height="5000"/>
<path class="fil0 str0" d="M2492.87 4100.53c-883.65,0 -1600,-716.35 -1600,-1600 0,-883.65 716.35,-1600 1600,-1600 883.65,0 1600,716.35 1600,1600"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1 KiB

View file

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Creator: CorelDRAW -->
<svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" width="50mm" height="50mm" version="1.1" style="shape-rendering:geometricPrecision; text-rendering:geometricPrecision; image-rendering:optimizeQuality; fill-rule:evenodd; clip-rule:evenodd"
viewBox="0 0 5000 5000"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xodm="http://www.corel.com/coreldraw/odm/2003">
<defs>
<style type="text/css">
<![CDATA[
.fil0 {fill:none}
.fil1 {fill:#FEFEFE}
]]>
</style>
</defs>
<g id="Layer_x0020_1">
<metadata id="CorelCorpID_0Corel-Layer"/>
<rect class="fil0" x="-7.13" y="0.53" width="5000" height="5000"/>
<rect class="fil0" x="359.2" y="425.8" width="4200" height="4200"/>
<g id="_2493129219008">
<path class="fil1" d="M2639.89 3073.32c-33.05,-5.18 -419.69,-17.75 -441.84,7.43 -45.77,94.27 33.29,716.21 -32.4,782.38 -41.39,41.7 -686.71,21.45 -795.14,21.46 -294.56,0.02 -254.1,78.93 -254.1,-564.09l-0.25 -2032.92c-0.86,-178.18 19.8,-155.37 254.35,-155.35 108.97,0.01 751.24,-15.73 791.92,17.78 57.88,47.69 15.74,662.9 30.33,786.79 53.57,21.97 378.93,15.5 451.01,7.01 24.16,-147.07 5.59,-467.5 5.92,-633.12 0.84,-429.07 -214.17,-640.01 -636.02,-639.17 -214.37,0.43 -428.79,0.06 -643.16,0.05 -222.49,-0.02 -358.31,-1.03 -506.93,120.72 -120.28,98.54 -201.41,225.51 -204.38,437.54 -5.95,423.35 -0.03,851.39 -0.03,1275.26 0,423.95 -5.41,851.37 0.02,1274.87 2.65,206.81 78.8,335.94 193.65,437.05 134.26,118.2 297.6,123.72 517.67,123.72 210.55,0 421.1,-0.12 631.65,0.01 233.6,0.14 358.7,-30.08 486.34,-154.86 106.03,-103.65 161.57,-270.06 161.2,-474.9 -0.2,-111.41 14.9,-566.2 -9.81,-637.66z"/>
<path class="fil1" d="M3123.97 1747.1l60.12 69.87c77.16,80.88 433.37,420.74 443.48,452.41l-74.97 3.15c-344.37,7.15 -1673.15,-17.05 -1877.83,5.77l-0.16 449.95 1952.94 11.18c-12.46,45.34 -468.94,448.06 -502.79,523.65 29.83,42.67 291.94,305.63 324.03,318.58 162.63,-145.69 328.12,-328.33 486.32,-487.32 180.27,-181.17 399.42,-344.77 396.04,-588.86 -3.53,-255.78 -206.18,-394.59 -392.9,-581.28 -70.76,-70.73 -453.9,-465.22 -500.51,-491.45l-313.77 314.35z"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.2 KiB

View file

@ -0,0 +1 @@
<?xml version="1.0" ?><!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'><svg height="32px" id="Layer_1" style="enable-background:new 0 0 32 32;" version="1.1" viewBox="0 0 32 32" width="32px" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><path fill="#3eb0bc" d="M4,10h24c1.104,0,2-0.896,2-2s-0.896-2-2-2H4C2.896,6,2,6.896,2,8S2.896,10,4,10z M28,14H4c-1.104,0-2,0.896-2,2 s0.896,2,2,2h24c1.104,0,2-0.896,2-2S29.104,14,28,14z M28,22H4c-1.104,0-2,0.896-2,2s0.896,2,2,2h24c1.104,0,2-0.896,2-2 S29.104,22,28,22z"/></svg>

After

Width:  |  Height:  |  Size: 620 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

View file

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Creator: CorelDRAW -->
<svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" width="50mm" height="50mm" version="1.1" style="shape-rendering:geometricPrecision; text-rendering:geometricPrecision; image-rendering:optimizeQuality; fill-rule:evenodd; clip-rule:evenodd"
viewBox="0 0 5000 5000"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xodm="http://www.corel.com/coreldraw/odm/2003">
<defs>
<style type="text/css">
<![CDATA[
.str0 {stroke:#FEFEFE;stroke-width:400;stroke-linecap:round;stroke-miterlimit:22.9256}
.str1 {stroke:#FEFEFE;stroke-width:150;stroke-linecap:round;stroke-miterlimit:22.9256}
.fil0 {fill:none}
.fil1 {fill:#FEFEFE;fill-rule:nonzero}
]]>
</style>
</defs>
<g id="Layer_x0020_1">
<metadata id="CorelCorpID_0Corel-Layer"/>
<rect class="fil0" x="-7.13" y="0.53" width="5000" height="5000"/>
<path class="fil0 str0" d="M2492.87 4100.53c-883.65,0 -1600,-716.35 -1600,-1600 0,-883.65 716.35,-1600 1600,-1600 883.65,0 1600,716.35 1600,1600"/>
<path class="fil1 str1" d="M2023.38 3023.88l0 -1035.47 137.38 0 0 1035.47 -137.38 0zm803.6 0l0 -1035.47 137.38 0 0 1035.47 -137.38 0z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.3 KiB

View file

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Creator: CorelDRAW -->
<svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" width="50mm" height="50mm" version="1.1" style="shape-rendering:geometricPrecision; text-rendering:geometricPrecision; image-rendering:optimizeQuality; fill-rule:evenodd; clip-rule:evenodd"
viewBox="0 0 5000 5000"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xodm="http://www.corel.com/coreldraw/odm/2003">
<defs>
<style type="text/css">
<![CDATA[
.fil0 {fill:none}
.fil1 {fill:#FEFEFE}
]]>
</style>
</defs>
<g id="Layer_x0020_1">
<metadata id="CorelCorpID_0Corel-Layer"/>
<rect class="fil0" x="-7.13" y="0.53" width="5000" height="5000"/>
<path class="fil1" d="M3141.29 1066.8c45.57,-5.15 261.46,245.08 292.77,277.66 295.91,307.95 135.54,185.2 188.19,399.61 43.03,175.21 297.07,157.98 310.95,-38.71 27.19,-385.12 -175.3,-478.54 -429.97,-741.83 -378.47,-391.28 -324.99,-372.91 -802.31,-372.91 -199.87,0 -399.74,0 -599.61,0 -342.86,0 -805.52,-46.33 -1087.81,87.4 -122.07,57.83 -244.39,178.04 -307.92,279.39 -86.36,137.76 -126.88,277.21 -126.86,472.59 0.02,391.75 0.04,783.49 0.04,1175.24 0,556.64 -81.08,1015.32 493.15,1281.24 150.34,69.63 346.13,65.19 525.78,65.18 337.08,-0.01 270.14,-214.48 210.27,-273.71 -149.64,-148.04 -659.7,111.59 -858.96,-316.01 -72.45,-155.46 -52.18,-354.35 -52.18,-540.84 0,-395.75 0,-791.48 0,-1187.23 0,-305.43 -25.09,-479.2 230.61,-650.05 39.85,-26.62 170.83,-88.25 227.52,-67.88 47.98,17.24 24.79,201.34 24.79,262.23 0,160.27 -22.12,438.71 51.69,549.97 36.8,55.46 94.13,105.27 170.39,129.77 110.26,35.42 968.27,14.69 1159.13,14.74 530.57,0.15 335.51,-541.5 380.34,-805.85zm73.29 1124.14c-275.55,27.09 -585.34,156.73 -751.98,367.78 -186.84,236.65 -314.3,487.54 -280.93,830.47 27.58,283.38 151.89,578.79 366.38,748 244.31,192.74 471.55,316.4 833.1,288.22 279.88,-21.81 578.78,-170.82 746.71,-369.03 163.42,-192.9 313.2,-472.35 280.54,-832.28 -31.63,-348.55 -182.52,-576.28 -364.37,-750.64 -164.85,-158.07 -499.37,-314.97 -829.45,-282.52zm-30.23 326.85c-406.08,58.46 -750.71,426 -679.49,907.7 59.33,401.31 435.65,744.51 913.02,673.06 386.43,-57.84 744.9,-438.84 667.11,-909.99 -65.69,-397.88 -425.71,-739.13 -900.64,-670.77zm-1488.07 -1531.49l0 491.68c0,80.93 2.07,71.99 81.24,71.99l971.37 0c75.85,0 66.15,0.16 66.15,-71.99l0 -491.68c0,-73.13 11.76,-73.75 -66.15,-73.75l-968.37 0c-84.36,0 -84.24,-8.56 -84.24,73.75zm1579.83 2158.56c-192.53,27.78 -610.98,-86.42 -617.57,155.74 -6.62,243.58 297.99,143.1 620.02,169.12 -42.11,85.57 -171.14,125.68 -136.95,266.85 27.85,114.96 173.94,148.56 266.05,67.3 78.15,-68.94 142.87,-140.65 218.73,-213.07 59.3,-56.6 150.52,-146.89 148.6,-276.26 -2.06,-139.29 -81.13,-223.32 -143.41,-284.83 -73.66,-72.75 -140.76,-147.23 -216.34,-215.38 -90.49,-81.58 -237.25,-61.85 -270.47,54.74 -43.93,154.19 88.6,191.64 131.34,275.79zm-1125.92 -939.16c-528.03,109.53 -576.09,829.59 -255.44,780.49 233.59,-35.76 15.8,-347.53 265.25,-454.45 45.2,-19.37 182.93,-31.55 176.58,-177.67 -4.25,-97.67 -85.43,-169.31 -186.39,-148.37z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 3.1 KiB

View file

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Creator: CorelDRAW -->
<svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" width="50mm" height="50mm" version="1.1" style="shape-rendering:geometricPrecision; text-rendering:geometricPrecision; image-rendering:optimizeQuality; fill-rule:evenodd; clip-rule:evenodd"
viewBox="0 0 5000 5000"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xodm="http://www.corel.com/coreldraw/odm/2003">
<defs>
<style type="text/css">
<![CDATA[
.fil0 {fill:none}
.fil1 {fill:#FEFEFE}
]]>
</style>
</defs>
<g id="Layer_x0020_1">
<metadata id="CorelCorpID_0Corel-Layer"/>
<rect class="fil0" x="-7.13" y="0.53" width="5000" height="5000"/>
<rect class="fil0" x="359.2" y="425.8" width="4200" height="4200"/>
<path class="fil1" d="M372.92 4454l4238.44 3.03c28.14,-72.14 13.22,-2706.66 13.22,-3016.28 0,-228.27 27.38,-488.13 -94.46,-651.17 -116.74,-156.2 -234.99,-234.88 -518,-234.36l-3023.09 0.01c-266.38,-0.34 -410.58,64.81 -527.8,224.75 -133.89,182.7 -97.52,410.12 -97.52,660.77 0,309.69 -13.86,2947.53 9.21,3013.25zm355.48 -356.69c61.89,20.09 3469.12,20.09 3531.01,0 22.39,-68.35 18.75,-1889.59 -3.31,-1941.53l-3520.09 -3.89c-26.37,55.83 -30,1877.07 -7.61,1945.42zm121.18 -3176.67c-171.36,45.81 -130.14,226.8 -130.14,426.89 0,462.8 -47.24,452.94 109.11,449.37 365.16,-8.34 739.81,-0.59 1106.02,-0.59 736.28,0 1490.69,-16.18 2224.68,0.59 153.53,3.51 109.11,27.31 109.11,-436.05 0,-568.17 58.83,-455.46 -1215.13,-455.46 -294.59,0 -2068.41,-20.9 -2203.65,15.25zm2893.74 181.19c-316.22,99.2 -194.88,612.39 167.4,503.19 317.76,-95.8 177.81,-611.49 -167.4,-503.19zm-1416.13 -2.59c-314.55,98.07 -203.59,610.44 159.42,507.36 122.51,-34.79 217.86,-172.32 170.27,-329.25 -38.94,-128.44 -169.02,-228.21 -329.69,-178.11zm701.99 5.38c-337.09,120.7 -152.31,624.05 184.2,496.22 307.58,-116.85 146.7,-614.7 -184.2,-496.22z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.9 KiB

Some files were not shown because too many files have changed in this diff Show more