mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-03-09 15:40:03 +00:00
Compare commits
No commits in common. "develop" and "v0.31" have entirely different histories.
1398 changed files with 144556 additions and 310529 deletions
|
|
@ -1,99 +1,259 @@
|
|||
version: 2.1
|
||||
commands:
|
||||
set_environment_vars:
|
||||
steps:
|
||||
- run:
|
||||
command: |
|
||||
echo "export REPO_URL=https://github.com/ysurac/openmptcprouter" >> $BASH_ENV
|
||||
version: 2
|
||||
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
|
||||
prepare:
|
||||
machine: true
|
||||
|
||||
working_directory: ~/
|
||||
|
||||
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 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
|
||||
- run:
|
||||
name: Free disk space
|
||||
command: |
|
||||
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:
|
||||
command: |
|
||||
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
|
||||
- run:
|
||||
name: Prepare
|
||||
command: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -yq build-essential git unzip ncurses-dev libz-dev libssl-dev python subversion gettext gawk wget curl rsync perl
|
||||
|
||||
build_x86_64:
|
||||
machine: true
|
||||
|
||||
environment:
|
||||
- OMR_VERSION: $CIRCLE_TAG
|
||||
- OMR_TARGET: x86_64
|
||||
|
||||
working_directory: ~/
|
||||
|
||||
steps:
|
||||
- run:
|
||||
name: cache
|
||||
command: |
|
||||
echo "cache 11 $OMR_TARGET" > /tmp/cache-target
|
||||
echo "cache 15 $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: 30m
|
||||
command: |
|
||||
git clone https://github.com/ysurac/openmptcprouter || true
|
||||
cd openmptcprouter
|
||||
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}"
|
||||
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: 30m
|
||||
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/release
|
||||
rsync -av --delete-after ~/openmptcprouter/$OMR_TARGET/source/bin/ -e "ssh -q -p ${OMR_DEPLOY_PORT:-22}" deploy@$OMR_DEPLOY_HOST:deploy/release/$OMR_TARGET
|
||||
rm -rf ~/openmptcprouter/$OMR_TARGET/source/bin
|
||||
|
||||
- save_cache:
|
||||
key: cache-{{ checksum "/tmp/cache-version" }}
|
||||
paths:
|
||||
- openmptcprouter
|
||||
|
||||
build_x86:
|
||||
machine: true
|
||||
|
||||
environment:
|
||||
- OMR_VERSION: $CIRCLE_TAG
|
||||
- OMR_TARGET: x86
|
||||
|
||||
working_directory: ~/
|
||||
|
||||
steps:
|
||||
- run:
|
||||
name: cache
|
||||
command: |
|
||||
echo "cache 10 $OMR_TARGET" > /tmp/cache-target
|
||||
echo "cache 14 $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: 30m
|
||||
command: |
|
||||
git clone https://github.com/ysurac/openmptcprouter || true
|
||||
cd openmptcprouter
|
||||
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}"
|
||||
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: 30m
|
||||
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/release
|
||||
rsync -av --delete-after ~/openmptcprouter/$OMR_TARGET/source/bin/ -e "ssh -q -p ${OMR_DEPLOY_PORT:-22}" deploy@$OMR_DEPLOY_HOST:deploy/release/$OMR_TARGET
|
||||
rm -rf ~/openmptcprouter/$OMR_TARGET/source/bin
|
||||
|
||||
- save_cache:
|
||||
key: cache-{{ checksum "/tmp/cache-version" }}
|
||||
paths:
|
||||
- openmptcprouter
|
||||
|
||||
build_rpi3:
|
||||
machine: true
|
||||
|
||||
environment:
|
||||
- OMR_VERSION: $CIRCLE_TAG
|
||||
- OMR_TARGET: rpi3
|
||||
|
||||
working_directory: ~/
|
||||
|
||||
steps:
|
||||
- run:
|
||||
name: cache
|
||||
command: |
|
||||
echo "cache 15 $OMR_TARGET" > /tmp/cache-target
|
||||
echo "cache 19 $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: 30m
|
||||
command: |
|
||||
git clone https://github.com/ysurac/openmptcprouter || true
|
||||
cd openmptcprouter
|
||||
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}"
|
||||
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: 30m
|
||||
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/release
|
||||
rsync -av --delete-after ~/openmptcprouter/$OMR_TARGET/source/bin/ -e "ssh -q -p ${OMR_DEPLOY_PORT:-22}" deploy@$OMR_DEPLOY_HOST:deploy/release/$OMR_TARGET
|
||||
rm -rf ~/openmptcprouter/$OMR_TARGET/source/bin
|
||||
|
||||
- save_cache:
|
||||
key: cache-{{ checksum "/tmp/cache-version" }}
|
||||
paths:
|
||||
- openmptcprouter
|
||||
|
||||
build_rpi2:
|
||||
machine: true
|
||||
|
||||
environment:
|
||||
- OMR_VERSION: $CIRCLE_TAG
|
||||
- OMR_TARGET: rpi2
|
||||
|
||||
working_directory: ~/
|
||||
|
||||
steps:
|
||||
- run:
|
||||
name: cache
|
||||
command: |
|
||||
echo "cache 15 $OMR_TARGET" > /tmp/cache-target
|
||||
echo "cache 19 $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: 30m
|
||||
command: |
|
||||
git clone https://github.com/ysurac/openmptcprouter || true
|
||||
cd openmptcprouter
|
||||
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}"
|
||||
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: 30m
|
||||
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/release
|
||||
rsync -av --delete-after ~/openmptcprouter/$OMR_TARGET/source/bin/ -e "ssh -q -p ${OMR_DEPLOY_PORT:-22}" deploy@$OMR_DEPLOY_HOST:deploy/release/$OMR_TARGET
|
||||
rm -rf ~/openmptcprouter/$OMR_TARGET/source/bin
|
||||
|
||||
- save_cache:
|
||||
key: cache-{{ checksum "/tmp/cache-version" }}
|
||||
paths:
|
||||
- openmptcprouter
|
||||
|
||||
workflows:
|
||||
openmptcprouter:
|
||||
version: 2
|
||||
main:
|
||||
jobs:
|
||||
- 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"]
|
||||
|
||||
- prepare
|
||||
- build_x86_64:
|
||||
requires:
|
||||
- prepare
|
||||
- build_x86:
|
||||
requires:
|
||||
- prepare
|
||||
- build_rpi3:
|
||||
requires:
|
||||
- prepare
|
||||
- build_rpi2:
|
||||
requires:
|
||||
- prepare
|
||||
|
|
|
|||
|
|
@ -1,9 +0,0 @@
|
|||
plugins:
|
||||
shellcheck:
|
||||
enabled: true
|
||||
engines:
|
||||
luacheck:
|
||||
enabled: true
|
||||
ratings:
|
||||
paths:
|
||||
- "**.lua"
|
||||
3
.github/FUNDING.yml
vendored
3
.github/FUNDING.yml
vendored
|
|
@ -1,3 +0,0 @@
|
|||
github: [Ysurac]
|
||||
patreon: Ycarus
|
||||
custom: https://www.paypal.me/ycarus
|
||||
166
.github/workflows/main.yml
vendored
166
.github/workflows/main.yml
vendored
|
|
@ -1,166 +0,0 @@
|
|||
name: openmptcprouter
|
||||
on: [push]
|
||||
|
||||
env:
|
||||
REPO_URL: 'https://github.com/ysurac/openmptcprouter'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
strategy:
|
||||
matrix:
|
||||
OMR_TARGET: [bpi-r1, bpi-r2, bpi-r3, bpi-r4, bpi-r4-poe, 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, z8102ax-emmc, gl-mt6000, gl-mt3000, gl-mt2500, r5c, z8109ax_128m]
|
||||
OMR_KERNEL: [6.6, 6.12]
|
||||
runs-on: ubuntu-latest
|
||||
continue-on-error: true
|
||||
|
||||
steps:
|
||||
- name: Branch name
|
||||
id: branch_name
|
||||
run: |
|
||||
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
|
||||
- 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 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
|
||||
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
|
||||
- name: Clone source code
|
||||
working-directory: ../../
|
||||
env:
|
||||
REPO_URL: https://github.com/ysurac/openmptcprouter
|
||||
SOURCE_NAME: ${{ steps.branch_name.outputs.SOURCE_NAME }}
|
||||
GITHUB_WORKSPACE: ${{ steps.branch_name.outputs.WORKSPACE }}
|
||||
run: |
|
||||
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
|
||||
- name: Build toolchain
|
||||
working-directory: ../../omr
|
||||
env:
|
||||
OMR_FEED_URL: https://github.com/ysurac/openmptcprouter-feeds
|
||||
SOURCE_NAME: ${{ steps.branch_name.outputs.SOURCE_NAME }}
|
||||
OMR_TARGET: ${{ matrix.OMR_TARGET }}
|
||||
OMR_KERNEL: ${{ matrix.OMR_KERNEL }}
|
||||
OMR_HOST: ${{ secrets.OMR_HOST }}
|
||||
OMR_PORT: ${{ secrets.OMR_PORT }}
|
||||
run: |
|
||||
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
|
||||
#echo -e "${{ secrets.OMR_PRIVKEY }}" > $OMR_TARGET/$OMR_KERNEL/source/key-build
|
||||
#echo -e "${{ secrets.OMR_PUBKEY }}" > $OMR_TARGET/$OMR_KERNEL/source/key-build.pub
|
||||
- name: Build packages
|
||||
working-directory: ../../omr
|
||||
env:
|
||||
OMR_TARGET: ${{ matrix.OMR_TARGET }}
|
||||
OMR_KERNEL: ${{ matrix.OMR_KERNEL }}
|
||||
run: |
|
||||
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
|
||||
- name: Build image
|
||||
working-directory: ../../omr
|
||||
env:
|
||||
OMR_TARGET: ${{ matrix.OMR_TARGET }}
|
||||
OMR_KERNEL: ${{ matrix.OMR_KERNEL }}
|
||||
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@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
|
||||
env:
|
||||
SOURCE_NAME: ${{ steps.branch_name.outputs.SOURCE_NAME }}
|
||||
SOURCE_BRANCH: ${{ steps.branch_name.outputs.SOURCE_BRANCH }}
|
||||
SOURCE_TAG: ${{ steps.branch_name.outputs.SOURCE_TAG }}
|
||||
with:
|
||||
command: |
|
||||
mkdir -p deploy/release/${{env.SOURCE_TAG}}/${{matrix.OMR_TARGET}}
|
||||
host: ${{ secrets.OMR_DEPLOY_HOST }}
|
||||
user: deploy
|
||||
port: ${{ secrets.OMR_DEPLOY_PORT }}
|
||||
key: ${{ secrets.PRIVATE_KEY }}
|
||||
args: -tt
|
||||
- if: steps.branch_name.outputs.SOURCE_BRANCH != ''
|
||||
name: Deploy - Create directory
|
||||
uses: ysurac/ssh-action@master
|
||||
env:
|
||||
SOURCE_NAME: ${{ steps.branch_name.outputs.SOURCE_NAME }}
|
||||
SOURCE_BRANCH: ${{ steps.branch_name.outputs.SOURCE_BRANCH }}
|
||||
SOURCE_TAG: ${{ steps.branch_name.outputs.SOURCE_TAG }}
|
||||
with:
|
||||
command: |
|
||||
mkdir -p deploy/${{env.SOURCE_BRANCH}}/${{matrix.OMR_KERNEL}}/${{matrix.OMR_TARGET}}
|
||||
host: ${{ secrets.OMR_DEPLOY_HOST }}
|
||||
user: deploy
|
||||
port: ${{ secrets.OMR_DEPLOY_PORT }}
|
||||
key: ${{ secrets.PRIVATE_KEY }}
|
||||
args: -tt
|
||||
- name: Move binaries for rsync
|
||||
working-directory: ../../omr
|
||||
env:
|
||||
OMR_TARGET: ${{ matrix.OMR_TARGET }}
|
||||
OMR_KERNEL: ${{ matrix.OMR_KERNEL }}
|
||||
GITHUB_WORKSPACE: ${{ steps.branch_name.outputs.WORKSPACE }}
|
||||
run: |
|
||||
mv ${OMR_TARGET}/${OMR_KERNEL}/source/bin ${GITHUB_WORKSPACE}/
|
||||
- if: steps.branch_name.outputs.SOURCE_BRANCH == ''
|
||||
name: Deploy - Upload via rsync
|
||||
uses: ysurac/action-rsync@master
|
||||
env:
|
||||
ARGS: -av --delete-after
|
||||
TARGET: deploy/release/${{steps.branch_name.outputs.SOURCE_TAG}}/${{matrix.OMR_TARGET}}
|
||||
SOURCE: ./bin/
|
||||
KEY: ${{ secrets.PRIVATE_KEY }}
|
||||
USER: deploy
|
||||
HOST: ${{ secrets.OMR_DEPLOY_HOST }}
|
||||
PORT: ${{ secrets.OMR_DEPLOY_PORT }}
|
||||
SOURCE_NAME: ${{ steps.branch_name.outputs.SOURCE_NAME }}
|
||||
SOURCE_BRANCH: ${{ steps.branch_name.outputs.SOURCE_BRANCH }}
|
||||
SOURCE_TAG: ${{ steps.branch_name.outputs.SOURCE_TAG }}
|
||||
GITHUB_WORKSPACE: ${{ steps.branch_name.outputs.WORKSPACE }}
|
||||
- if: steps.branch_name.outputs.SOURCE_BRANCH != ''
|
||||
name: Deploy - Upload via rsync
|
||||
uses: ysurac/action-rsync@master
|
||||
env:
|
||||
ARGS: -av --delete-after
|
||||
TARGET: deploy/${{ steps.branch_name.outputs.SOURCE_BRANCH }}/${{matrix.OMR_KERNEL}}/${{matrix.OMR_TARGET}}
|
||||
SOURCE: ./bin/
|
||||
KEY: ${{ secrets.PRIVATE_KEY }}
|
||||
USER: deploy
|
||||
HOST: ${{ secrets.OMR_DEPLOY_HOST }}
|
||||
PORT: ${{ secrets.OMR_DEPLOY_PORT }}
|
||||
SOURCE_NAME: ${{ steps.branch_name.outputs.SOURCE_NAME }}
|
||||
SOURCE_BRANCH: ${{ steps.branch_name.outputs.SOURCE_BRANCH }}
|
||||
SOURCE_TAG: ${{ steps.branch_name.outputs.SOURCE_TAG }}
|
||||
GITHUB_WORKSPACE: ${{ steps.branch_name.outputs.WORKSPACE }}
|
||||
|
||||
19
.github/workflows/stale.yml
vendored
19
.github/workflows/stale.yml
vendored
|
|
@ -1,19 +0,0 @@
|
|||
name: Mark stale issues and pull requests
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: "30 1 * * *"
|
||||
|
||||
jobs:
|
||||
stale:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/stale@v3.0.10
|
||||
with:
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
stale-issue-message: "This issue is stale because it has been open 120 days with no activity. Remove stale label or comment or this will be closed in 5 days"
|
||||
stale-pr-message: 'It has been open 120 days with no activity. Remove stale label or comment or this will be closed in 5 days'
|
||||
days-before-stale: 120
|
||||
days-before-close: 5
|
||||
exempt-issue-labels: 'work-in-progress,enhancement'
|
||||
exempt-pr-labels: 'work-in-progress,enhancement'
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
#
|
||||
# Copyright (C) 2010-2015 OpenWrt.org
|
||||
# Copyright (C) 2018-2019 Ycarus (Yannick Chabanois) <ycarus@zugaina.org>
|
||||
# Copyright (C) 2018 Ycarus (Yannick Chabanois) <ycarus@zugaina.org>
|
||||
# - Added gateway setting
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
|
|
@ -11,7 +11,7 @@ include $(TOPDIR)/rules.mk
|
|||
|
||||
PKG_NAME:=6in4
|
||||
PKG_VERSION:=270
|
||||
PKG_RELEASE:=2
|
||||
PKG_RELEASE:=1
|
||||
PKG_LICENSE:=GPL-2.0
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
|
|
|||
62
README.md
62
README.md
|
|
@ -1,6 +1,5 @@
|
|||
# OpenWrt OpenMPTCProuter feed
|
||||
|
||||
|
||||
This is the OpenWrt OpenMPTCProuter feed containing all modified and necessary packages to build the OpenMPTCProuter image.
|
||||
|
||||
For More information, see [https://github.com/ysurac/openmptcprouter](https://github.com/ysurac/openmptcprouter) and [https://www.openmptcprouter.com](https://www.openmptcprouter.com/).
|
||||
|
|
@ -23,13 +22,6 @@ A LuCI interface was made to make it easier to use. It's used in OpenMPTCProuter
|
|||
|
||||
MPTCP support is added in LuCI interface and init scripts. IPv6 support added.
|
||||
|
||||
## Shadowsocks-v2ray-plugin-bin
|
||||
*Source:* [https://github.com/shadowsocks/v2ray-plugin](https://github.com/shadowsocks/v2ray-plugin)
|
||||
|
||||
*Description:* V2ray plugin for Shadowsocks
|
||||
|
||||
Support is added in ShadowSocks LuCI interface and init scripts.
|
||||
|
||||
|
||||
## Simple-obfs
|
||||
*Source:* [https://github.com/shadowsocks/simple-obfs](https://github.com/shadowsocks/simple-obfs)
|
||||
|
|
@ -81,20 +73,6 @@ Domains, IPs, networks and protocol (using DPI) added are bypassed when shadowso
|
|||
This is used for OpenMPTCProuter failover.
|
||||
|
||||
|
||||
## luci-omr-tracker
|
||||
*Source:* [https://github.com/Ysurac/openmptcprouter-feeds/tree/master/luci-app-omr-tracker](https://github.com/Ysurac/openmptcprouter-feeds/tree/master/luci-app-omr-tracker)
|
||||
|
||||
*Description:* Luci interface to omr-tracker
|
||||
|
||||
Interface to omr-tracker.
|
||||
|
||||
|
||||
## luci-app-iperf
|
||||
*Source:* [https://github.com/Ysurac/openmptcprouter-feeds/tree/master/luci-app-iperf](https://github.com/Ysurac/openmptcprouter-feeds/tree/master/luci-app-iperf)
|
||||
|
||||
*Description:* Luci interface to iPerf
|
||||
|
||||
|
||||
## omr-6in4
|
||||
*Source:* [https://github.com/Ysurac/openmptcprouter-feeds/tree/master/omr-6in4](https://github.com/Ysurac/openmptcprouter-feeds/tree/master/omr-6in4)
|
||||
|
||||
|
|
@ -107,6 +85,14 @@ Interface to omr-tracker.
|
|||
*Description:* Update old config with new settings.
|
||||
|
||||
|
||||
## luci-omr-tracker
|
||||
*Source:* [https://github.com/Ysurac/openmptcprouter-feeds/tree/master/luci-app-omr-tracker](https://github.com/Ysurac/openmptcprouter-feeds/tree/master/luci-app-omr-tracker)
|
||||
|
||||
*Description:* Luci interface to omr-tracker
|
||||
|
||||
Interface to omr-tracker.
|
||||
|
||||
|
||||
## luci-app-mptcp
|
||||
*Source:* [https://github.com/Ysurac/openmptcprouter-feeds/tree/master/luci-app-mptcp](https://github.com/Ysurac/openmptcprouter-feeds/tree/master/luci-app-mptcp)
|
||||
|
||||
|
|
@ -141,15 +127,7 @@ This is used to check if there is no other IPv6 route announced on the network
|
|||
This is an other way to aggregate same latency connections
|
||||
|
||||
|
||||
## dsvpn
|
||||
*Source:* [https://github.com/jedisct1/dsvpn][https://github.com/jedisct1/dsvpn]
|
||||
|
||||
*Description:* A Dead Simple VPN
|
||||
|
||||
A simple TCP VPN
|
||||
|
||||
|
||||
## ndpi-netfilter2
|
||||
## ndpi-filter
|
||||
*Source:* [https://github.com/vel21ripn/nDPI](https://github.com/vel21ripn/nDPI)
|
||||
|
||||
*Description:* Open Source Deep Packet Inspection Software Toolkit
|
||||
|
|
@ -162,25 +140,3 @@ This is used to bypass a protocol
|
|||
|
||||
*Description:* A middlebox detection tool
|
||||
|
||||
|
||||
## Shortcut-FE
|
||||
*Source:* [https://github.com/coolsnowwolf/lede/tree/master/package/lean/shortcut-fe](https://github.com/coolsnowwolf/lede/tree/master/package/lean/shortcut-fe)
|
||||
|
||||
*Description:* Shortcut is an in-Linux-kernel IP packet forwarding engine.
|
||||
|
||||
|
||||
## V2Ray
|
||||
*Source:* [https://github.com/v2fly/v2ray-core](https://github.com/v2fly/v2ray-core)
|
||||
|
||||
*Description:* A platform for building proxies to bypass network restrictions.
|
||||
|
||||
This is used as proxy, alternative to Shadowsocks
|
||||
|
||||
|
||||
|
||||
# License
|
||||
[](https://app.fossa.io/projects/git%2Bgithub.com%2FYsurac%2Fopenmptcprouter-feeds?ref=badge_large)
|
||||
|
||||
## Translation status
|
||||
|
||||
[](https://weblate.openmptcprouter.com/engage/omr/?utm_source=widget)
|
||||
|
|
|
|||
|
|
@ -1,57 +0,0 @@
|
|||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=atinout
|
||||
PKG_VERSION=0.9.1
|
||||
|
||||
PKG_MAINTAINER:=Konstantine Shevlakov <shevlakov@132lan.ru>
|
||||
PKG_LICENSE:=GPLv2
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://github.com/beralt/atinout.git
|
||||
PKG_SOURCE_VERSION:=4013e8db4cd140c1df24bb90f929efeb9b61b238
|
||||
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_SUBDIR)
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/$(PKG_NAME)
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
SUBMENU:=Telephony
|
||||
TITLE:=Send AT commands to a modem
|
||||
URL:=http://atinout.sourceforge.net/
|
||||
MAINTAINER:=Adrian Guenter <a@gntr.me>
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/description
|
||||
Atinout is a program that will execute AT commands in sequence and
|
||||
capture the response from the modem.
|
||||
endef
|
||||
|
||||
|
||||
CONFIGURE_VARS += \
|
||||
CC="$(TARGET_CC)" \
|
||||
CXX="$(TARGET_CC) +.c++" \
|
||||
CFLAGS="$(TARGET_CFLAGS) -Wall -DVERSION=\"\\\"$(PKG_VERSION)\\\"\"" \
|
||||
LDFLAGS="$(TARGET_LDFLAGS)"
|
||||
|
||||
define Build/Configure
|
||||
$(call Build/Configure/Default,--with-linux-headers=$(LINUX_DIR))
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
@echo -e "\n=== Build/Compile ==="
|
||||
$(CONFIGURE_VARS) $(MAKE) -C $(PKG_BUILD_DIR) \
|
||||
all \
|
||||
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/install
|
||||
$(INSTALL_DIR) $(1)/usr/bin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/$(PKG_NAME) $(1)/usr/bin/$(PKG_NAME)
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,$(PKG_NAME)))
|
||||
|
|
@ -1,96 +0,0 @@
|
|||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=bcm27xx-eeprom
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://github.com/raspberrypi/rpi-eeprom
|
||||
PKG_SOURCE_DATE:=2024-09-23
|
||||
PKG_SOURCE_VERSION:=c8fffcda5ae0f923857a73fedbeb07e81d2eb813
|
||||
PKG_MIRROR_HASH:=68d0eedd1aff573c2ea7071f89a5898292061ced96d7f98ea4a347dc16c8102c
|
||||
|
||||
PKG_LICENSE:=BSD-3-Clause Custom
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
PKG_MAINTAINER:=Álvaro Fernández Rojas <noltari@gmail.com>
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
TAR_OPTIONS:=--strip-components 1 $(TAR_OPTIONS)
|
||||
TAR_CMD=$(HOST_TAR) -C $(1) $(TAR_OPTIONS)
|
||||
|
||||
define Package/bcm27xx-eeprom/Default
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
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 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
|
||||
true
|
||||
endef
|
||||
|
||||
define Package/bcm27xx-eeprom/conffiles
|
||||
/etc/bcm27xx-eeprom.conf
|
||||
endef
|
||||
|
||||
define Package/bcm27xx-eeprom/install
|
||||
$(INSTALL_DIR) $(1)/etc
|
||||
$(INSTALL_CONF) $(PKG_BUILD_DIR)/rpi-eeprom-update-default $(1)/etc/bcm27xx-eeprom.conf
|
||||
|
||||
$(INSTALL_DIR) $(1)/usr/bin
|
||||
$(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
|
||||
|
||||
define Package/bcm2711-eeprom/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/raspberrypi/bootloader-2711
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/raspberrypi/bootloader-2711/latest
|
||||
|
||||
$(CP) $(PKG_BUILD_DIR)/firmware-2711/release-notes.md $(1)/lib/firmware/raspberrypi/bootloader-2711
|
||||
$(CP) $(PKG_BUILD_DIR)/firmware-2711/latest/pieeprom-2024-09-05.bin $(1)/lib/firmware/raspberrypi/bootloader-2711/latest
|
||||
$(CP) $(PKG_BUILD_DIR)/firmware-2711/latest/recovery.bin $(1)/lib/firmware/raspberrypi/bootloader-2711/latest
|
||||
$(CP) $(PKG_BUILD_DIR)/firmware-2711/latest/vl805-000138c0.bin $(1)/lib/firmware/raspberrypi/bootloader-2711/latest
|
||||
endef
|
||||
|
||||
define Package/bcm2712-eeprom/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/raspberrypi/bootloader-2712
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/raspberrypi/bootloader-2712/latest
|
||||
|
||||
$(CP) $(PKG_BUILD_DIR)/firmware-2712/release-notes.md $(1)/lib/firmware/raspberrypi/bootloader-2712
|
||||
$(CP) $(PKG_BUILD_DIR)/firmware-2712/latest/pieeprom-2024-09-23.bin $(1)/lib/firmware/raspberrypi/bootloader-2712/latest
|
||||
$(CP) $(PKG_BUILD_DIR)/firmware-2712/latest/recovery.bin $(1)/lib/firmware/raspberrypi/bootloader-2712/latest
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,bcm27xx-eeprom))
|
||||
$(eval $(call BuildPackage,bcm2711-eeprom))
|
||||
$(eval $(call BuildPackage,bcm2712-eeprom))
|
||||
|
|
@ -1,37 +0,0 @@
|
|||
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
|
||||
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 | 4 ++--
|
||||
rpi-eeprom-update-default | 4 ++--
|
||||
2 files changed, 4 insertions(+), 4 deletions(-)
|
||||
|
||||
--- a/rpi-eeprom-update
|
||||
+++ b/rpi-eeprom-update
|
||||
@@ -25,7 +25,7 @@ fi
|
||||
|
||||
# Selects the release sub-directory
|
||||
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}
|
||||
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,7 +1,7 @@
|
||||
|
||||
FIRMWARE_ROOT=/lib/firmware/raspberrypi/bootloader
|
||||
-FIRMWARE_RELEASE_STATUS="default"
|
||||
-FIRMWARE_BACKUP_DIR="/var/lib/raspberrypi/bootloader/backup"
|
||||
+FIRMWARE_RELEASE_STATUS="latest"
|
||||
+FIRMWARE_BACKUP_DIR="${FIRMWARE_ROOT}/backup"
|
||||
EEPROM_CONFIG_HOOK=
|
||||
|
||||
# BOOTFS can be set here to override auto-detection in rpi-eeprom-update
|
||||
|
|
@ -1,62 +0,0 @@
|
|||
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
|
||||
@@ -439,7 +439,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
|
||||
@@ -526,7 +526,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.
|
||||
@@ -558,7 +558,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
|
||||
|
||||
@@ -630,7 +630,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
|
||||
|
|
@ -1,33 +0,0 @@
|
|||
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
|
||||
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 | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
--- a/rpi-eeprom-update
|
||||
+++ b/rpi-eeprom-update
|
||||
@@ -220,7 +220,7 @@ applyRecoveryUpdate()
|
||||
|| die "Failed to copy ${TMP_EEPROM_IMAGE} to ${BOOTFS}"
|
||||
|
||||
# For NFS mounts ensure that the files are readable to the TFTP user
|
||||
- chmod -f go+r "${BOOTFS}/pieeprom.upd" "${BOOTFS}/pieeprom.sig" \
|
||||
+ chmod go+r "${BOOTFS}/pieeprom.upd" "${BOOTFS}/pieeprom.sig" \
|
||||
|| die "Failed to set permissions on eeprom update files"
|
||||
fi
|
||||
|
||||
@@ -231,7 +231,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
|
||||
- chmod -f go+r "${BOOTFS}/vl805.bin" "${BOOTFS}/vl805.sig" \
|
||||
+ chmod go+r "${BOOTFS}/vl805.bin" "${BOOTFS}/vl805.sig" \
|
||||
|| die "Failed to set permissions on eeprom update files"
|
||||
fi
|
||||
|
||||
|
|
@ -1,35 +0,0 @@
|
|||
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
|
||||
@@ -186,8 +186,8 @@ def edit_config(eeprom=None):
|
||||
"""
|
||||
Implements something like 'git commit' for editing EEPROM configs.
|
||||
"""
|
||||
- # Default to nano if $EDITOR is not defined.
|
||||
- editor = 'nano'
|
||||
+ # Default to vi if $EDITOR is not defined.
|
||||
+ editor = 'vi'
|
||||
if 'EDITOR' in os.environ:
|
||||
editor = os.environ['EDITOR']
|
||||
|
||||
@@ -517,7 +517,7 @@ Operating modes:
|
||||
|
||||
To cancel the pending update run 'sudo rpi-eeprom-update -r'
|
||||
|
||||
- The default text editor is nano and may be overridden by setting the 'EDITOR'
|
||||
+ The default text editor is vi and may be overridden by setting the 'EDITOR'
|
||||
environment variable and passing '-E' to 'sudo' to preserve the environment.
|
||||
|
||||
6. Signing the bootloader config file.
|
||||
|
|
@ -1,66 +0,0 @@
|
|||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=bcm27xx-utils
|
||||
PKG_VERSION:=2024.10.25
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://github.com/raspberrypi/utils.git
|
||||
PKG_SOURCE_VERSION:=6a2a6becebbc38fde34a94386457ac8210f9119b
|
||||
PKG_MIRROR_HASH:=a775c7ffb9fac2d798ec8e0a4c7707eb7133cbc9c4418a1cf9434f87c42c01bb
|
||||
|
||||
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/kdtc $(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))
|
||||
|
|
@ -1,255 +0,0 @@
|
|||
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
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
--- 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;
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
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
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
2020-11-10
|
||||
|
||||
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,
|
||||
|
||||
Paul Curry https://github.com/cr3ative
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
2022-05-20
|
||||
|
||||
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,
|
||||
|
||||
Florian Karuhtz https://github.com/flesser
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
2022-08-26
|
||||
|
||||
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,
|
||||
|
||||
ta264 https://github.com/ta264
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
2023-05-23
|
||||
|
||||
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,
|
||||
|
||||
Yoan Pintas https://github.com/yostyle
|
||||
|
|
@ -1,57 +0,0 @@
|
|||
#
|
||||
# Copyright (C) 2014 OpenWrt.org
|
||||
# Copyright (C) 2023 Yannick Chabanois (Ycarus) for OpenMPTCProuter
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
# $Id$
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
PKG_NAME:=cryptodev-linux
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://github.com/$(PKG_NAME)/$(PKG_NAME).git
|
||||
PKG_SOURCE_VERSION:=277d4574c10bb8e16ab6ab3f38b8e1cb6cd6c678
|
||||
PKG_VERSION:=1.14.20241010
|
||||
PKG_LICENSE:=GPL-2.0
|
||||
PKG_LICENSE_FILES:=COPYING
|
||||
|
||||
PKG_MAINTAINER:=Yannick Chabanois <contact@openmptcprouter.com>
|
||||
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define KernelPackage/cryptodev
|
||||
SUBMENU:=Cryptographic API modules
|
||||
TITLE:=Driver for cryptographic acceleration
|
||||
URL:=http://cryptodev-linux.org/
|
||||
DEPENDS:=+kmod-crypto-authenc +kmod-crypto-hash
|
||||
FILES:=$(PKG_BUILD_DIR)/cryptodev.$(LINUX_KMOD_SUFFIX)
|
||||
AUTOLOAD:=$(call AutoLoad,50,cryptodev)
|
||||
MODPARAMS.cryptodev:=cryptodev_verbosity=-1
|
||||
endef
|
||||
|
||||
define KernelPackage/cryptodev/description
|
||||
This is a driver for that allows to use the Linux kernel supported
|
||||
hardware ciphers by user-space applications.
|
||||
endef
|
||||
|
||||
define Build/Configure
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
$(MAKE) -C $(PKG_BUILD_DIR) \
|
||||
$(KERNEL_MAKE_FLAGS) \
|
||||
KERNEL_DIR="$(LINUX_DIR)"
|
||||
endef
|
||||
|
||||
define Build/InstallDev
|
||||
$(INSTALL_DIR) $(STAGING_DIR)/usr/include/crypto
|
||||
$(CP) $(PKG_BUILD_DIR)/crypto/cryptodev.h $(STAGING_DIR)/usr/include/crypto/
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,cryptodev))
|
||||
|
|
@ -1,47 +0,0 @@
|
|||
#
|
||||
# Copyright (C) 2019 Ycarus (Yannick Chabanois) <ycarus@zugaina.org> for OpenMPTCProuter project
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
#PKG_SOURCE_URL:=https://github.com/jedisct1/dsvpn.git
|
||||
PKG_SOURCE_URL:=https://github.com/Ysurac/dsvpn.git
|
||||
#PKG_SOURCE_VERSION:=3b99d2ef6c02b2ef68b5784bec8adfdd55b29b1a
|
||||
PKG_SOURCE_VERSION:=4333aa705efd9c86c76809614d20dc5ebf43da7f
|
||||
PKG_NAME:=dsvpn
|
||||
PKG_VERSION:=0.1.5
|
||||
PKG_RELEASE:=1
|
||||
PKG_LICENSE:=MIT
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/$(PKG_NAME)
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
DEPENDS:=+kmod-tun
|
||||
TITLE:=A Dead Simple VPN
|
||||
URL:=https://github.com/jedisct1/dsvpn
|
||||
SUBMENU:=VPN
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/conffiles
|
||||
/etc/config/dsvpn
|
||||
endef
|
||||
|
||||
TARGET_CFLAGS += -DNO_DEFAULT_ROUTES -DNO_DEFAULT_FIREWALL -DNO_DEFAULT_CONGESTION
|
||||
|
||||
define Package/$(PKG_NAME)/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/dsvpn $(1)/usr/sbin/$(PKG_NAME)
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_BIN) files/init $(1)/etc/init.d/$(PKG_NAME)
|
||||
$(INSTALL_DIR) $(1)/etc/config
|
||||
touch $(1)/etc/config/dsvpn
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,$(PKG_NAME)))
|
||||
106
dsvpn/files/init
106
dsvpn/files/init
|
|
@ -1,106 +0,0 @@
|
|||
#!/bin/sh /etc/rc.common
|
||||
# Copyright (C) 2019 Ycarus (Yannick Chabanois) <ycarus@zugaina.org> for OpenMPTCProuter project
|
||||
|
||||
START=90
|
||||
STOP=10
|
||||
|
||||
USE_PROCD=1
|
||||
PROG_NAME=dsvpn
|
||||
PROG=/usr/sbin/${PROG_NAME}
|
||||
|
||||
_log() {
|
||||
logger -p daemon.info -t ${PROG_NAME} "$@"
|
||||
}
|
||||
|
||||
_err() {
|
||||
logger -p daemon.err -t ${PROG_NAME} "$@"
|
||||
}
|
||||
|
||||
validate_section() {
|
||||
uci_validate_section dsvpn dsvpn "${1}" \
|
||||
'enable:bool:0' \
|
||||
'key:string' \
|
||||
'host:host' \
|
||||
'port:port' \
|
||||
'dev:string' \
|
||||
'localip:host' \
|
||||
'remoteip:host' \
|
||||
'mode:string:client' \
|
||||
'externalip:string:auto'
|
||||
}
|
||||
|
||||
version_over_5_4() {
|
||||
MAJOR_VERSION=$(uname -r | awk -F '.' '{print $1}')
|
||||
MINOR_VERSION=$(uname -r | awk -F '.' '{print $2}' | awk -F '-' '{print $1}')
|
||||
if [ $MAJOR_VERSION -ge 5 ] && [ $MINOR_VERSION -gt 13 ] || [ $MAJOR_VERSION -gt 5 ] ; then
|
||||
return 0
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
start_instance() {
|
||||
local enable key host port dev
|
||||
|
||||
validate_section "${1}" || {
|
||||
_err "validation failed"
|
||||
return 1
|
||||
}
|
||||
|
||||
[ "${enable}" = "1" ] || return 1
|
||||
|
||||
[ -n "${key}" ] || return 1
|
||||
[ "${key}" != "secretkey" ] || return 1
|
||||
[ -z "${host}" ] && host="auto"
|
||||
[ -z "${port}" ] && port="auto"
|
||||
[ -n "${dev}" ] || return 1
|
||||
|
||||
echo "${key}" > /tmp/${PROG_NAME}-${1}.key
|
||||
key=""
|
||||
|
||||
if [ "$(uci -q get network.omrvpn)" != "" ] && [ "$(uci -q get network.omrvpn)" != "$dev" ]; then
|
||||
uci -q set network.omrvpn.device=$dev
|
||||
uci -q commit
|
||||
fi
|
||||
|
||||
ip addr flush $dev
|
||||
sleep 2
|
||||
|
||||
_log "starting ${PROG_NAME} ${1} instance $*"
|
||||
|
||||
if version_over_5_4; then
|
||||
PROG="mptcpize run ${PROG}"
|
||||
fi
|
||||
|
||||
procd_open_instance
|
||||
|
||||
procd_set_param command ${PROG} ${mode} \
|
||||
/tmp/${PROG_NAME}-${1}.key \
|
||||
$host \
|
||||
$port \
|
||||
$dev \
|
||||
${localip:+$localip} \
|
||||
${remoteip:+$remoteip}
|
||||
[ "$mode" = "client" ] && procd_append_param command $(ip r get $host | awk '{print $3}' | tr -d "\n")
|
||||
[ "$mode" = "server" ] && procd_append_param command externalip
|
||||
|
||||
|
||||
procd_set_param respawn 0 30 5
|
||||
procd_set_param file /tmp/${PROG_NAME}-${1}.key
|
||||
|
||||
procd_set_param stdout 1
|
||||
procd_set_param stderr 1
|
||||
|
||||
procd_close_instance
|
||||
|
||||
|
||||
}
|
||||
|
||||
start_service() {
|
||||
config_load dsvpn
|
||||
config_foreach start_instance dsvpn
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
procd_add_reload_trigger dsvpn network
|
||||
}
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
--- a/Makefile 2019-08-03 22:52:54.541484359 +0200
|
||||
+++ b/Makefile 2019-08-03 22:53:00.901364600 +0200
|
||||
@@ -5,7 +5,6 @@
|
||||
|
||||
dsvpn: $(CFLAGS_FILE) Makefile src/vpn.c src/charm.c src/os.c include/charm.h include/vpn.h include/os.h
|
||||
$(CC) $$(cat "$(CFLAGS_FILE)") $(OPTFLAGS) -Iinclude -o $@ src/vpn.c src/charm.c src/os.c
|
||||
- strip $@
|
||||
|
||||
install: dsvpn
|
||||
install -m 0755 dsvpn $(PREFIX)/sbin
|
||||
|
|
@ -1,109 +0,0 @@
|
|||
#
|
||||
# Copyright (c) 2013-2018 The Linux Foundation. All rights reserved.
|
||||
# Permission to use, copy, modify, and/or distribute this software for
|
||||
# any purpose with or without fee is hereby granted, provided that the
|
||||
# above copyright notice and this permission notice appear in all copies.
|
||||
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
|
||||
# OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
PKG_NAME:=fast-classifier
|
||||
PKG_RELEASE:=6
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define KernelPackage/fast-classifier/Default
|
||||
SECTION:=kernel
|
||||
CATEGORY:=Kernel modules
|
||||
SUBMENU:=Network Support
|
||||
DEPENDS:=@KERNEL_5_4 +kmod-ipt-conntrack +kmod-shortcut-fe
|
||||
TITLE:=Kernel driver for FAST Classifier
|
||||
FILES:=$(PKG_BUILD_DIR)/fast-classifier.ko
|
||||
KCONFIG:= \
|
||||
CONFIG_NF_CONNTRACK_EVENTS=y \
|
||||
CONFIG_NF_CONNTRACK_CHAIN_EVENTS=y \
|
||||
CONFIG_NF_CONNTRACK_MARK=y \
|
||||
CONFIG_XFRM=y
|
||||
CONFLICTS:=kmod-shortcut-fe-drv kmod-shortcut-fe-cm
|
||||
endef
|
||||
|
||||
define KernelPackage/fast-classifier
|
||||
$(call KernelPackage/fast-classifier/Default)
|
||||
endef
|
||||
|
||||
define KernelPackage/fast-classifier-noload
|
||||
$(call KernelPackage/fast-classifier/Default)
|
||||
endef
|
||||
|
||||
define KernelPackage/fast-classifier/Default/description
|
||||
FAST Classifier talks to SFE to make decisions about offloading connections
|
||||
endef
|
||||
|
||||
define KernelPackage/fast-classifier/description
|
||||
$(call KernelPackage/fast-classifier/Default/description)
|
||||
endef
|
||||
|
||||
define KernelPackage/fast-classifier-noload/description
|
||||
$(call KernelPackage/fast-classifier/Default/description)
|
||||
|
||||
This package does not load fast-classifier at boot by default
|
||||
endef
|
||||
|
||||
define Package/fast-classifier-example
|
||||
TITLE:=Example user space program for fast-classifier
|
||||
DEPENDS:=@KERNEL_5_4 +libnl +kmod-fast-classifier
|
||||
endef
|
||||
|
||||
define Package/fast-classifier-example/description
|
||||
Example user space program that communicates with fast
|
||||
classifier kernel module
|
||||
endef
|
||||
|
||||
HAVE_ECM:=$(CONFIG_PACKAGE_kmod-qca-nss-ecm-premium)$(CONFIG_PACKAGE_kmod-qca-nss-ecm-noload)$(CONFIG_PACKAGE_kmod-qca-nss-ecm-premium-noload)$(CONFIG_PACKAGE_kmod-qca-nss-ecm-standard)
|
||||
|
||||
define Build/Compile/kmod
|
||||
+$(MAKE) $(PKG_JOBS) -C "$(LINUX_DIR)" \
|
||||
$(KERNEL_MAKE_FLAGS) \
|
||||
$(PKG_MAKE_FLAGS) \
|
||||
M="$(PKG_BUILD_DIR)" \
|
||||
CONFIG_FAST_CLASSIFIER=m \
|
||||
EXTRA_CFLAGS+="-DSFE_SUPPORT_IPV6" \
|
||||
$(if $(HAVE_ECM),EXTRA_CFLAGS+="-DCONFIG_SFE_ECM" CONFIG_SFE_ECM=y,) \
|
||||
modules
|
||||
endef
|
||||
|
||||
define Build/Compile/example
|
||||
$(TARGET_CC) -o $(PKG_BUILD_DIR)/userspace_fast_classifier \
|
||||
-I $(PKG_BUILD_DIR) \
|
||||
-I$(STAGING_DIR)/usr/include/libnl \
|
||||
-I$(STAGING_DIR)/usr/include/libnl3 \
|
||||
-lnl-genl-3 -lnl-3 \
|
||||
$(PKG_BUILD_DIR)/nl_classifier_test.c
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
$(Build/Compile/kmod)
|
||||
$(if $(CONFIG_PACKAGE_fast-classifier-example),$(Build/Compile/example))
|
||||
endef
|
||||
|
||||
define Build/InstallDev
|
||||
$(INSTALL_DIR) $(1)/usr/include
|
||||
$(CP) $(PKG_BUILD_DIR)/fast-classifier.h $(1)/usr/include/
|
||||
endef
|
||||
|
||||
define Package/fast-classifier-example/install
|
||||
$(INSTALL_DIR) $(1)/sbin
|
||||
$(CP) $(PKG_BUILD_DIR)/userspace_fast_classifier $(1)/sbin/
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,fast-classifier))
|
||||
#$(eval $(call KernelPackage,fast-classifier-noload))
|
||||
#$(eval $(call BuildPackage,fast-classifier-example))
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
obj-$(CONFIG_FAST_CLASSIFIER) += fast-classifier.o
|
||||
|
||||
ifeq ($(SFE_SUPPORT_IPV6),)
|
||||
SFE_SUPPORT_IPV6=y
|
||||
endif
|
||||
ccflags-$(SFE_SUPPORT_IPV6) += -DSFE_SUPPORT_IPV6
|
||||
|
||||
ccflags-y += -I$(obj)/../shortcut-fe
|
||||
|
||||
obj ?= .
|
||||
File diff suppressed because it is too large
Load diff
|
|
@ -1,57 +0,0 @@
|
|||
/*
|
||||
* User space header to send message to the fast classifier
|
||||
*
|
||||
* Copyright (c) 2013,2016 The Linux Foundation. All rights reserved.
|
||||
* Permission to use, copy, modify, and/or distribute this software for
|
||||
* any purpose with or without fee is hereby granted, provided that the
|
||||
* above copyright notice and this permission notice appear in all copies.
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
|
||||
* OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#include <linux/if_ether.h>
|
||||
|
||||
#define FAST_CLASSIFIER_GENL_VERSION (1)
|
||||
#define FAST_CLASSIFIER_GENL_NAME "FC"
|
||||
#define FAST_CLASSIFIER_GENL_MCGRP "FC_MCGRP"
|
||||
#define FAST_CLASSIFIER_GENL_HDRSIZE (0)
|
||||
|
||||
enum {
|
||||
FAST_CLASSIFIER_A_UNSPEC,
|
||||
FAST_CLASSIFIER_A_TUPLE,
|
||||
__FAST_CLASSIFIER_A_MAX,
|
||||
};
|
||||
|
||||
#define FAST_CLASSIFIER_A_MAX (__FAST_CLASSIFIER_A_MAX - 1)
|
||||
|
||||
enum {
|
||||
FAST_CLASSIFIER_C_UNSPEC,
|
||||
FAST_CLASSIFIER_C_OFFLOAD,
|
||||
FAST_CLASSIFIER_C_OFFLOADED,
|
||||
FAST_CLASSIFIER_C_DONE,
|
||||
__FAST_CLASSIFIER_C_MAX,
|
||||
};
|
||||
|
||||
#define FAST_CLASSIFIER_C_MAX (__FAST_CLASSIFIER_C_MAX - 1)
|
||||
|
||||
struct fast_classifier_tuple {
|
||||
unsigned short ethertype;
|
||||
unsigned char proto;
|
||||
union {
|
||||
struct in_addr in;
|
||||
struct in6_addr in6;
|
||||
} src_saddr;
|
||||
union {
|
||||
struct in_addr in;
|
||||
struct in6_addr in6;
|
||||
} dst_saddr;
|
||||
unsigned short sport;
|
||||
unsigned short dport;
|
||||
unsigned char smac[ETH_ALEN];
|
||||
unsigned char dmac[ETH_ALEN];
|
||||
};
|
||||
|
|
@ -1,281 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2016 The Linux Foundation. All rights reserved.
|
||||
* Permission to use, copy, modify, and/or distribute this software for
|
||||
* any purpose with or without fee is hereby granted, provided that the
|
||||
* above copyright notice and this permission notice appear in all copies.
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
|
||||
* OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#include <netlink/genl/genl.h>
|
||||
#include <netlink/genl/ctrl.h>
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
#include <signal.h>
|
||||
#include <arpa/inet.h>
|
||||
|
||||
#define NL_CLASSIFIER_GENL_VERSION 1
|
||||
#define NL_CLASSIFIER_GENL_FAMILY "FC"
|
||||
#define NL_CLASSIFIER_GENL_GROUP "FC_MCGRP"
|
||||
#define NL_CLASSIFIER_GENL_HDRSIZE 0
|
||||
|
||||
enum NL_CLASSIFIER_CMD {
|
||||
NL_CLASSIFIER_CMD_UNSPEC,
|
||||
NL_CLASSIFIER_CMD_ACCEL,
|
||||
NL_CLASSIFIER_CMD_ACCEL_OK,
|
||||
NL_CLASSIFIER_CMD_CONNECTION_CLOSED,
|
||||
NL_CLASSIFIER_CMD_MAX,
|
||||
};
|
||||
|
||||
enum NL_CLASSIFIER_ATTR {
|
||||
NL_CLASSIFIER_ATTR_UNSPEC,
|
||||
NL_CLASSIFIER_ATTR_TUPLE,
|
||||
NL_CLASSIFIER_ATTR_MAX,
|
||||
};
|
||||
|
||||
union nl_classifier_tuple_ip {
|
||||
struct in_addr in;
|
||||
struct in6_addr in6;
|
||||
};
|
||||
|
||||
struct nl_classifier_tuple {
|
||||
unsigned short af;
|
||||
unsigned char proto;
|
||||
union nl_classifier_tuple_ip src_ip;
|
||||
union nl_classifier_tuple_ip dst_ip;
|
||||
unsigned short sport;
|
||||
unsigned short dport;
|
||||
unsigned char smac[6];
|
||||
unsigned char dmac[6];
|
||||
};
|
||||
|
||||
struct nl_classifier_instance {
|
||||
struct nl_sock *sock;
|
||||
int family_id;
|
||||
int group_id;
|
||||
int stop;
|
||||
};
|
||||
|
||||
struct nl_classifier_instance nl_cls_inst;
|
||||
|
||||
static struct nla_policy nl_classifier_genl_policy[(NL_CLASSIFIER_ATTR_MAX+1)] = {
|
||||
[NL_CLASSIFIER_ATTR_TUPLE] = { .type = NLA_UNSPEC },
|
||||
};
|
||||
|
||||
void nl_classifier_dump_nl_tuple(struct nl_classifier_tuple *tuple)
|
||||
{
|
||||
char ip_str[64];
|
||||
|
||||
printf("protocol = %s\n", (tuple->proto == IPPROTO_UDP) ? "udp" : ((tuple->proto == IPPROTO_TCP) ? "tcp" : "unknown"));
|
||||
printf("source ip = %s\n", inet_ntop(tuple->af, &tuple->src_ip, ip_str, sizeof(ip_str)));
|
||||
printf("destination ip = %s\n", inet_ntop(tuple->af, &tuple->dst_ip, ip_str, sizeof(ip_str)));
|
||||
printf("source port = %d\n", ntohs(tuple->sport));
|
||||
printf("destination port = %d\n", ntohs(tuple->dport));
|
||||
}
|
||||
|
||||
int nl_classifier_msg_recv(struct nl_msg *msg, void *arg)
|
||||
{
|
||||
struct nlmsghdr *nlh = nlmsg_hdr(msg);
|
||||
struct genlmsghdr *gnlh = nlmsg_data(nlh);
|
||||
struct nlattr *attrs[(NL_CLASSIFIER_ATTR_MAX+1)];
|
||||
|
||||
genlmsg_parse(nlh, NL_CLASSIFIER_GENL_HDRSIZE, attrs, NL_CLASSIFIER_ATTR_MAX, nl_classifier_genl_policy);
|
||||
|
||||
switch (gnlh->cmd) {
|
||||
case NL_CLASSIFIER_CMD_ACCEL_OK:
|
||||
printf("Acceleration successful:\n");
|
||||
nl_classifier_dump_nl_tuple(nla_data(attrs[NL_CLASSIFIER_ATTR_TUPLE]));
|
||||
return NL_OK;
|
||||
case NL_CLASSIFIER_CMD_CONNECTION_CLOSED:
|
||||
printf("Connection is closed:\n");
|
||||
nl_classifier_dump_nl_tuple(nla_data(attrs[NL_CLASSIFIER_ATTR_TUPLE]));
|
||||
return NL_OK;
|
||||
default:
|
||||
printf("nl classifier received unknow message %d\n", gnlh->cmd);
|
||||
}
|
||||
|
||||
return NL_SKIP;
|
||||
}
|
||||
|
||||
void nl_classifier_offload(struct nl_classifier_instance *inst,
|
||||
unsigned char proto, unsigned long *src_saddr,
|
||||
unsigned long *dst_saddr, unsigned short sport,
|
||||
unsigned short dport, int af)
|
||||
{
|
||||
struct nl_msg *msg;
|
||||
int ret;
|
||||
struct nl_classifier_tuple classifier_msg;
|
||||
|
||||
memset(&classifier_msg, 0, sizeof(classifier_msg));
|
||||
classifier_msg.af = af;
|
||||
classifier_msg.proto = proto;
|
||||
memcpy(&classifier_msg.src_ip, src_saddr, (af == AF_INET ? 4 : 16));
|
||||
memcpy(&classifier_msg.dst_ip, dst_saddr, (af == AF_INET ? 4 : 16));
|
||||
classifier_msg.sport = sport;
|
||||
classifier_msg.dport = dport;
|
||||
|
||||
msg = nlmsg_alloc();
|
||||
if (!msg) {
|
||||
printf("Unable to allocate message\n");
|
||||
return;
|
||||
}
|
||||
|
||||
genlmsg_put(msg, NL_AUTO_PID, NL_AUTO_SEQ, inst->family_id,
|
||||
NL_CLASSIFIER_GENL_HDRSIZE, NLM_F_REQUEST,
|
||||
NL_CLASSIFIER_CMD_ACCEL, NL_CLASSIFIER_GENL_VERSION);
|
||||
nla_put(msg, NL_CLASSIFIER_ATTR_TUPLE, sizeof(classifier_msg), &classifier_msg);
|
||||
|
||||
ret = nl_send_auto(inst->sock, msg);
|
||||
if (ret < 0) {
|
||||
printf("send netlink message failed.\n");
|
||||
nlmsg_free(msg);
|
||||
return;
|
||||
}
|
||||
|
||||
nlmsg_free(msg);
|
||||
printf("nl classifier offload connection successful\n");
|
||||
}
|
||||
|
||||
int nl_classifier_init(struct nl_classifier_instance *inst)
|
||||
{
|
||||
int ret;
|
||||
|
||||
inst->sock = nl_socket_alloc();
|
||||
if (!inst->sock) {
|
||||
printf("Unable to allocation socket.\n");
|
||||
return -1;
|
||||
}
|
||||
genl_connect(inst->sock);
|
||||
|
||||
inst->family_id = genl_ctrl_resolve(inst->sock, NL_CLASSIFIER_GENL_FAMILY);
|
||||
if (inst->family_id < 0) {
|
||||
printf("Unable to resolve family %s\n", NL_CLASSIFIER_GENL_FAMILY);
|
||||
goto init_failed;
|
||||
}
|
||||
|
||||
inst->group_id = genl_ctrl_resolve_grp(inst->sock, NL_CLASSIFIER_GENL_FAMILY, NL_CLASSIFIER_GENL_GROUP);
|
||||
if (inst->group_id < 0) {
|
||||
printf("Unable to resolve mcast group %s\n", NL_CLASSIFIER_GENL_GROUP);
|
||||
goto init_failed;
|
||||
}
|
||||
|
||||
ret = nl_socket_add_membership(inst->sock, inst->group_id);
|
||||
if (ret < 0) {
|
||||
printf("Unable to add membership\n");
|
||||
goto init_failed;
|
||||
}
|
||||
|
||||
nl_socket_disable_seq_check(inst->sock);
|
||||
nl_socket_modify_cb(inst->sock, NL_CB_VALID, NL_CB_CUSTOM, nl_classifier_msg_recv, NULL);
|
||||
|
||||
printf("nl classifier init successful\n");
|
||||
return 0;
|
||||
|
||||
init_failed:
|
||||
if (inst->sock) {
|
||||
nl_close(inst->sock);
|
||||
nl_socket_free(inst->sock);
|
||||
inst->sock = NULL;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
void nl_classifier_exit(struct nl_classifier_instance *inst)
|
||||
{
|
||||
if (inst->sock) {
|
||||
nl_close(inst->sock);
|
||||
nl_socket_free(inst->sock);
|
||||
inst->sock = NULL;
|
||||
}
|
||||
printf("nl classifier exit successful\n");
|
||||
}
|
||||
|
||||
int nl_classifier_parse_arg(int argc, char *argv[], unsigned char *proto, unsigned long *src_saddr,
|
||||
unsigned long *dst_saddr, unsigned short *sport, unsigned short *dport, int *af)
|
||||
{
|
||||
int ret;
|
||||
unsigned short port;
|
||||
|
||||
if (argc < 7) {
|
||||
printf("help: nl_classifier <v4|v6> <udp|tcp> <source ip> <destination ip> <source port> <destination port>\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (0 == strncmp(argv[1], "v4", 2)) {
|
||||
*af = AF_INET;
|
||||
} else if (0 == strncmp(argv[1], "v6", 2)) {
|
||||
*af = AF_INET6;
|
||||
} else {
|
||||
printf("Address family is not supported");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (0 == strncmp(argv[2], "udp", 3)) {
|
||||
*proto = IPPROTO_UDP;
|
||||
} else if (0 == strncmp(argv[2], "tcp", 3)) {
|
||||
*proto = IPPROTO_TCP;
|
||||
} else {
|
||||
printf("Protocol is not supported");
|
||||
return -1;
|
||||
}
|
||||
|
||||
ret = inet_pton(*af, argv[3], src_saddr);
|
||||
if (ret <= 0) {
|
||||
printf("source ip has wrong format\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
ret = inet_pton(*af, argv[4], dst_saddr);
|
||||
if (ret <= 0) {
|
||||
printf("destination ip has wrong format\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
port = strtol(argv[5], NULL, 0);
|
||||
*sport = htons(port);
|
||||
port = strtol(argv[6], NULL, 0);
|
||||
*dport = htons(port);
|
||||
|
||||
printf("nl classifier parse arguments successful\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
struct nl_classifier_instance *inst = &nl_cls_inst;
|
||||
unsigned char proto;
|
||||
unsigned long src_addr[4];
|
||||
unsigned long dst_addr[4];
|
||||
unsigned short sport;
|
||||
unsigned short dport;
|
||||
int af;
|
||||
int ret;
|
||||
|
||||
ret = nl_classifier_parse_arg(argc, argv, &proto, src_addr, dst_addr, &sport, &dport, &af);
|
||||
if (ret < 0) {
|
||||
printf("Failed to parse arguments\n");
|
||||
return ret;
|
||||
}
|
||||
|
||||
ret = nl_classifier_init(inst);
|
||||
if (ret < 0) {
|
||||
printf("Unable to init generic netlink\n");
|
||||
return ret;
|
||||
}
|
||||
|
||||
nl_classifier_offload(inst, proto, src_addr, dst_addr, sport, dport, af);
|
||||
|
||||
/* main loop to listen on message */
|
||||
while (!inst->stop) {
|
||||
nl_recvmsgs_default(inst->sock);
|
||||
}
|
||||
|
||||
nl_classifier_exit(inst);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -1,232 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2013,2016 The Linux Foundation. All rights reserved.
|
||||
* Permission to use, copy, modify, and/or distribute this software for
|
||||
* any purpose with or without fee is hereby granted, provided that the
|
||||
* above copyright notice and this permission notice appear in all copies.
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
|
||||
* OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#include <netlink/genl/genl.h>
|
||||
#include <netlink/genl/ctrl.h>
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
#include <arpa/inet.h>
|
||||
|
||||
#include <fast-classifier.h>
|
||||
|
||||
static struct nl_sock *sock;
|
||||
static struct nl_sock *sock_event;
|
||||
static int family;
|
||||
static int grp_id;
|
||||
|
||||
static struct nla_policy fast_classifier_genl_policy[FAST_CLASSIFIER_A_MAX + 1] = {
|
||||
[FAST_CLASSIFIER_A_TUPLE] = { .type = NLA_UNSPEC },
|
||||
};
|
||||
|
||||
void dump_fc_tuple(struct fast_classifier_tuple *fc_msg)
|
||||
{
|
||||
char src_str[INET_ADDRSTRLEN];
|
||||
char dst_str[INET_ADDRSTRLEN];
|
||||
|
||||
printf("TUPLE: %d, %s, %s, %d, %d"
|
||||
" SMAC=%02x:%02x:%02x:%02x:%02x:%02x",
|
||||
" DMAC=%02x:%02x:%02x:%02x:%02x:%02x\n",
|
||||
fc_msg->proto,
|
||||
inet_ntop(AF_INET,
|
||||
&fc_msg->src_saddr.in.s_addr,
|
||||
src_str,
|
||||
INET_ADDRSTRLEN),
|
||||
inet_ntop(AF_INET,
|
||||
&fc_msg->dst_saddr.in.s_addr,
|
||||
dst_str,
|
||||
INET_ADDRSTRLEN),
|
||||
fc_msg->sport, fc_msg->dport,
|
||||
fc_msg->smac[0], fc_msg->smac[1], fc_msg->smac[2],
|
||||
fc_msg->smac[3], fc_msg->smac[4], fc_msg->smac[5],
|
||||
fc_msg->dmac[0], fc_msg->dmac[1], fc_msg->dmac[2],
|
||||
fc_msg->dmac[3], fc_msg->dmac[4], fc_msg->dmac[5]);
|
||||
}
|
||||
|
||||
static int parse_cb(struct nl_msg *msg, void *arg)
|
||||
{
|
||||
struct nlmsghdr *nlh = nlmsg_hdr(msg);
|
||||
struct genlmsghdr *gnlh = nlmsg_data(nlh);
|
||||
struct nlattr *attrs[FAST_CLASSIFIER_A_MAX];
|
||||
|
||||
genlmsg_parse(nlh, 0, attrs, FAST_CLASSIFIER_A_MAX, fast_classifier_genl_policy);
|
||||
|
||||
switch (gnlh->cmd) {
|
||||
case FAST_CLASSIFIER_C_OFFLOADED:
|
||||
printf("Got a offloaded message\n");
|
||||
dump_fc_tuple(nla_data(attrs[FAST_CLASSIFIER_A_TUPLE]));
|
||||
return NL_OK;
|
||||
case FAST_CLASSIFIER_C_DONE:
|
||||
printf("Got a done message\n");
|
||||
dump_fc_tuple(nla_data(attrs[FAST_CLASSIFIER_A_TUPLE]));
|
||||
return NL_OK;
|
||||
}
|
||||
|
||||
return NL_SKIP;
|
||||
}
|
||||
|
||||
int fast_classifier_init(void)
|
||||
{
|
||||
int err;
|
||||
|
||||
sock = nl_socket_alloc();
|
||||
if (!sock) {
|
||||
printf("Unable to allocation socket.\n");
|
||||
return -1;
|
||||
}
|
||||
genl_connect(sock);
|
||||
|
||||
sock_event = nl_socket_alloc();
|
||||
if (!sock_event) {
|
||||
nl_close(sock);
|
||||
nl_socket_free(sock);
|
||||
printf("Unable to allocation socket.\n");
|
||||
return -1;
|
||||
}
|
||||
genl_connect(sock_event);
|
||||
|
||||
family = genl_ctrl_resolve(sock, FAST_CLASSIFIER_GENL_NAME);
|
||||
if (family < 0) {
|
||||
nl_close(sock_event);
|
||||
nl_close(sock);
|
||||
nl_socket_free(sock);
|
||||
nl_socket_free(sock_event);
|
||||
printf("Unable to resolve family\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
grp_id = genl_ctrl_resolve_grp(sock, FAST_CLASSIFIER_GENL_NAME,
|
||||
FAST_CLASSIFIER_GENL_MCGRP);
|
||||
if (grp_id < 0) {
|
||||
printf("Unable to resolve mcast group\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
err = nl_socket_add_membership(sock_event, grp_id);
|
||||
if (err < 0) {
|
||||
printf("Unable to add membership\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
nl_socket_disable_seq_check(sock_event);
|
||||
nl_socket_modify_cb(sock_event, NL_CB_VALID, NL_CB_CUSTOM, parse_cb, NULL);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void fast_classifier_close(void)
|
||||
{
|
||||
nl_close(sock_event);
|
||||
nl_close(sock);
|
||||
nl_socket_free(sock_event);
|
||||
nl_socket_free(sock);
|
||||
}
|
||||
|
||||
void fast_classifier_ipv4_offload(unsigned char proto, unsigned long src_saddr,
|
||||
unsigned long dst_saddr, unsigned short sport,
|
||||
unsigned short dport)
|
||||
{
|
||||
struct nl_msg *msg;
|
||||
int ret;
|
||||
#ifdef DEBUG
|
||||
char src_str[INET_ADDRSTRLEN];
|
||||
char dst_str[INET_ADDRSTRLEN];
|
||||
#endif
|
||||
struct fast_classifier_tuple fc_msg;
|
||||
|
||||
#ifdef DEBUG
|
||||
printf("DEBUG: would offload: %d, %s, %s, %d, %d\n", proto,
|
||||
inet_ntop(AF_INET, &src_saddr, src_str, INET_ADDRSTRLEN),
|
||||
inet_ntop(AF_INET, &dst_saddr, dst_str, INET_ADDRSTRLEN),
|
||||
sport, dport);
|
||||
#endif
|
||||
|
||||
fc_msg.proto = proto;
|
||||
fc_msg.src_saddr.in.s_addr = src_saddr;
|
||||
fc_msg.dst_saddr.in.s_addr = dst_saddr;
|
||||
fc_msg.sport = sport;
|
||||
fc_msg.dport = dport;
|
||||
fc_msg.smac[0] = 'a';
|
||||
fc_msg.smac[1] = 'b';
|
||||
fc_msg.smac[2] = 'c';
|
||||
fc_msg.smac[3] = 'd';
|
||||
fc_msg.smac[4] = 'e';
|
||||
fc_msg.smac[5] = 'f';
|
||||
fc_msg.dmac[0] = 'f';
|
||||
fc_msg.dmac[1] = 'e';
|
||||
fc_msg.dmac[2] = 'd';
|
||||
fc_msg.dmac[3] = 'c';
|
||||
fc_msg.dmac[4] = 'b';
|
||||
fc_msg.dmac[5] = 'a';
|
||||
|
||||
if (fast_classifier_init() < 0) {
|
||||
printf("Unable to init generic netlink\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
msg = nlmsg_alloc();
|
||||
if (!msg) {
|
||||
nl_socket_free(sock);
|
||||
printf("Unable to allocate message\n");
|
||||
return;
|
||||
}
|
||||
|
||||
genlmsg_put(msg, NL_AUTO_PID, NL_AUTO_SEQ, family,
|
||||
FAST_CLASSIFIER_GENL_HDRSIZE, NLM_F_REQUEST,
|
||||
FAST_CLASSIFIER_C_OFFLOAD, FAST_CLASSIFIER_GENL_VERSION);
|
||||
nla_put(msg, 1, sizeof(fc_msg), &fc_msg);
|
||||
|
||||
ret = nl_send_auto_complete(sock, msg);
|
||||
|
||||
nlmsg_free(msg);
|
||||
if (ret < 0) {
|
||||
printf("nlmsg_free failed");
|
||||
nl_close(sock);
|
||||
nl_socket_free(sock);
|
||||
return;
|
||||
}
|
||||
|
||||
ret = nl_wait_for_ack(sock);
|
||||
if (ret < 0) {
|
||||
printf("wait for ack failed");
|
||||
nl_close(sock);
|
||||
nl_socket_free(sock);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
void fast_classifier_listen_for_messages(void)
|
||||
{
|
||||
printf("waiting for netlink events\n");
|
||||
|
||||
while (1) {
|
||||
nl_recvmsgs_default(sock_event);
|
||||
}
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
if (fast_classifier_init() < 0) {
|
||||
printf("Unable to init generic netlink\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
fast_classifier_ipv4_offload('a', 0, 0, 0, 0);
|
||||
|
||||
/* this never returns */
|
||||
fast_classifier_listen_for_messages();
|
||||
|
||||
fast_classifier_close();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -1,62 +0,0 @@
|
|||
#
|
||||
# Copyright (C) 2022 Chion Tang <tech@chionlab.moe>
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=fullconenat
|
||||
PKG_RELEASE:=9
|
||||
|
||||
PKG_SOURCE_DATE:=2022-02-13
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://github.com/llccd/netfilter-full-cone-nat.git
|
||||
PKG_SOURCE_VERSION:=108a36cbdca17e68c9e6e7fd5e26156a88f738e8
|
||||
PKG_MIRROR_HASH:=00d749235271dee194dcd23c22e6e85207ea90192a62a110b2af0b4e4de1971f
|
||||
|
||||
PKG_LICENSE:=GPL-2.0
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
PKG_MAINTAINER:=Chion Tang <tech@chionlab.moe>
|
||||
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/iptables-mod-fullconenat
|
||||
SUBMENU:=Firewall
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
TITLE:=FULLCONENAT iptables extension
|
||||
DEPENDS:=+iptables +kmod-ipt-fullconenat @LINUX_5_4
|
||||
endef
|
||||
|
||||
define Package/iptables-mod-fullconenat/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib/iptables
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/libipt_FULLCONENAT.so $(1)/usr/lib/iptables
|
||||
endef
|
||||
|
||||
define KernelPackage/ipt-fullconenat
|
||||
SUBMENU:=Netfilter Extensions
|
||||
TITLE:=FULLCONENAT netfilter module
|
||||
DEPENDS:=+kmod-nf-ipt +kmod-nf-nat @LINUX_5_4
|
||||
KCONFIG:= \
|
||||
CONFIG_NF_CONNTRACK_EVENTS=y \
|
||||
CONFIG_NF_CONNTRACK_CHAIN_EVENTS=y
|
||||
FILES:=$(PKG_BUILD_DIR)/xt_FULLCONENAT.ko
|
||||
endef
|
||||
|
||||
include $(INCLUDE_DIR)/kernel-defaults.mk
|
||||
|
||||
define Build/Compile
|
||||
+$(MAKE) $(PKG_JOBS) -C "$(LINUX_DIR)" \
|
||||
CROSS_COMPILE="$(TARGET_CROSS)" \
|
||||
ARCH="$(LINUX_KARCH)" \
|
||||
M="$(PKG_BUILD_DIR)" \
|
||||
EXTRA_CFLAGS="$(BUILDFLAGS)" \
|
||||
modules
|
||||
$(call Build/Compile/Default)
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,ipt-fullconenat))
|
||||
$(eval $(call BuildPackage,iptables-mod-fullconenat))
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
--- a/libip6t_FULLCONENAT.c
|
||||
+++ b/libip6t_FULLCONENAT.c
|
||||
@@ -214,6 +214,7 @@ static struct xtables_target fullconenat_tg_reg = {
|
||||
.x6_options = FULLCONENAT_opts,
|
||||
};
|
||||
|
||||
+#define _init __attribute__((constructor)) _INIT
|
||||
void _init(void)
|
||||
{
|
||||
xtables_register_target(&fullconenat_tg_reg);
|
||||
--- a/libipt_FULLCONENAT.c
|
||||
+++ b/libipt_FULLCONENAT.c
|
||||
@@ -235,6 +235,7 @@ static struct xtables_target fullconenat_tg_reg = {
|
||||
.x6_options = FULLCONENAT_opts,
|
||||
};
|
||||
|
||||
+#define _init __attribute__((constructor)) _INIT
|
||||
void _init(void)
|
||||
{
|
||||
xtables_register_target(&fullconenat_tg_reg);
|
||||
|
|
@ -1,26 +0,0 @@
|
|||
--- a/xt_FULLCONENAT.c
|
||||
+++ b/xt_FULLCONENAT.c
|
||||
@@ -325,7 +325,11 @@
|
||||
/* for now we do the same thing for both --random and --random-fully */
|
||||
|
||||
/* select a random starting point */
|
||||
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0)
|
||||
+ start = (uint16_t)(get_random_u32() % (u32)range_size);
|
||||
+#else
|
||||
start = (uint16_t)(prandom_u32() % (u32)range_size);
|
||||
+#endif
|
||||
} else {
|
||||
|
||||
if ((original_port >= min && original_port <= min + range_size - 1)
|
||||
@@ -995,7 +999,11 @@
|
||||
/* for now we do the same thing for both --random and --random-fully */
|
||||
|
||||
/* select a random starting point */
|
||||
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0)
|
||||
+ start = (uint16_t)(get_random_u32() % (u32)range_size);
|
||||
+#else
|
||||
start = (uint16_t)(prandom_u32() % (u32)range_size);
|
||||
+#endif
|
||||
} else {
|
||||
|
||||
if ((original_port >= min && original_port <= min + range_size - 1)
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
libipt_FULLCONENAT.so: libipt_FULLCONENAT.o
|
||||
$(CC) -shared -lxtables -o $@ $^;
|
||||
libipt_FULLCONENAT.o: libipt_FULLCONENAT.c
|
||||
$(CC) ${CFLAGS} -fPIC -D_INIT=$*_init -c -o $@ $<;
|
||||
|
||||
obj-m += xt_FULLCONENAT.o
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
#
|
||||
# Copyright (C) 2015 OVH
|
||||
# Copyright (C) 2018-2020 Ycarus (Yannick Chabanois) <ycarus@zugaina.org> for OpenMPTCProuter project
|
||||
# Copyright (C) 2018 Ycarus (Yannick Chabanois) <ycarus@zugaina.org>
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
|
|
@ -10,12 +10,11 @@ include $(TOPDIR)/rules.mk
|
|||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://github.com/angt/glorytun.git
|
||||
PKG_SOURCE_VERSION:=32267e86a6da05b285bb3bf2b136c105dc0af4bb
|
||||
PKG_SOURCE_VERSION:=c15343f8f6fb275fe9bed56ca251bb801ea5d67b
|
||||
|
||||
PKG_NAME:=glorytun-udp
|
||||
PKG_VERSION:=0.3.4
|
||||
PKG_RELEASE:=24
|
||||
PKG_LICENSE:=BSD-2-Clause
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
PKG_VERSION:=0.0.99-mud
|
||||
PKG_RELEASE:=17
|
||||
|
||||
PKG_FIXUP:=autoreconf
|
||||
|
||||
|
|
@ -30,25 +29,19 @@ URL:=https://github.com/angt/glorytun
|
|||
SUBMENU:=VPN
|
||||
endef
|
||||
|
||||
#TARGET_CFLAGS += -std=c99 -D_GNU_SOURCE -DGT_RUNDIR=\"\\\"/tmp\"\\\"
|
||||
TARGET_CFLAGS += -DGT_RUNDIR=\"\\\"/tmp\"\\\"
|
||||
TARGET_CFLAGS += -std=c99 -D_GNU_SOURCE -DGT_RUNDIR=\"\\\"/tmp\"\\\"
|
||||
|
||||
define Package/$(PKG_NAME)/conffiles
|
||||
/etc/config/glorytun
|
||||
endef
|
||||
|
||||
define Build/Prepare
|
||||
$(call Build/Prepare/Default)
|
||||
echo "$(PKG_VERSION)" > $(PKG_BUILD_DIR)/VERSION
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/glorytun $(1)/usr/sbin/$(PKG_NAME)
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_BIN) init $(1)/etc/init.d/$(PKG_NAME)
|
||||
$(INSTALL_DIR) $(1)/etc/config
|
||||
$(INSTALL_DATA) glorytun-udp.config $(1)/etc/config/glorytun-udp
|
||||
touch $(1)/etc/config/glorytun
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,$(PKG_NAME)))
|
||||
|
|
|
|||
|
|
@ -1,14 +0,0 @@
|
|||
config glorytun-udp 'vpn'
|
||||
option enable '0'
|
||||
option host '127.0.0.1'
|
||||
option port '65001'
|
||||
option dev 'tun0'
|
||||
option key ''
|
||||
option chacha '1'
|
||||
option localip '10.255.254.2'
|
||||
option remoteip '10.255.254.1'
|
||||
option mode 'to'
|
||||
option kxtimeout '7d'
|
||||
option timetolerance '10m'
|
||||
option keepalive '25s'
|
||||
option rateauto '0'
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
#!/bin/sh /etc/rc.common
|
||||
# vim: set noexpandtab tabstop=4 shiftwidth=4 softtabstop=4 :
|
||||
# Copyright (C) 2015 ovh.com
|
||||
# Copyright (C) 2017-2020 Ycarus (Yannick Chabanois) <ycarus@zugaina.org>
|
||||
# Copyright (C) 2017 Ycarus (Yannick Chabanois) <ycarus@zugaina.org>
|
||||
|
||||
START=90
|
||||
STOP=10
|
||||
|
|
@ -19,19 +19,22 @@ _err() {
|
|||
}
|
||||
|
||||
validate_section() {
|
||||
uci_validate_section glorytun-udp glorytun-udp "${1}" \
|
||||
'enable:bool:0' \
|
||||
'mode:string' \
|
||||
'key:string' \
|
||||
'host:host' \
|
||||
'port:port' \
|
||||
'mtuauto:bool:0' \
|
||||
'chacha:bool:0' \
|
||||
uci_validate_section glorytun glorytun "${1}" \
|
||||
'enable:bool:0' \
|
||||
'key:string' \
|
||||
'host:host' \
|
||||
'port:port' \
|
||||
'proto:string' \
|
||||
'bind:string:0.0.0.0' \
|
||||
'bindport:port' \
|
||||
'mtu:uinteger:1450' \
|
||||
'mtuauto:bool:0' \
|
||||
'chacha20:bool:0' \
|
||||
'dev:string'
|
||||
}
|
||||
|
||||
start_instance() {
|
||||
local enable key host port listener proto mtuauto chacha dev mode
|
||||
local enable key host port listener proto bind bindport mtu mtuauto chacha20 dev
|
||||
|
||||
validate_section "${1}" || {
|
||||
_err "validation failed"
|
||||
|
|
@ -39,39 +42,35 @@ start_instance() {
|
|||
}
|
||||
|
||||
[ "${enable}" = "1" ] || return 1
|
||||
[ "${proto}" = "udp" ] || return 1
|
||||
|
||||
[ -n "${key}" ] || return 1
|
||||
[ "${key}" != "secretkey" ] || return 1
|
||||
[ -n "${port}" ] || return 1
|
||||
[ -n "${dev}" ] || return 1
|
||||
[ -n "${mode}" ] || return 1
|
||||
|
||||
echo "${key}" > /tmp/${PROG_NAME}-${1}.key
|
||||
key=""
|
||||
|
||||
if [ "$(uci -q get network.omrvpn)" != "" ]; then
|
||||
uci -q set network.omrvpn.device=$dev
|
||||
uci -q set network.omrvpn.ifname=$dev
|
||||
uci -q commit
|
||||
fi
|
||||
|
||||
_log "starting ${PROG_NAME} ${1} instance $*"
|
||||
|
||||
host=$(resolveip $host)
|
||||
|
||||
if [ "$mode" = "to" ]; then
|
||||
bind="bind from addr :: port 5000 to addr $host port $port"
|
||||
else
|
||||
bind="bind from addr $host port $port to addr :: port 5000"
|
||||
fi
|
||||
procd_open_instance
|
||||
|
||||
procd_set_param command ${PROG} \
|
||||
${bind} \
|
||||
${bind:+bind "$bind"} \
|
||||
${bindport:+ "$bindport"} \
|
||||
${host:+to "$host"} \
|
||||
${port:+ "$port"} \
|
||||
${dev:+dev "$dev"} \
|
||||
keyfile /tmp/${PROG_NAME}-${1}.key \
|
||||
persist
|
||||
|
||||
[ "${chacha}" = "1" ] && procd_append_param command chacha
|
||||
[ "${chacha20}" = "1" ] && procd_append_param command chacha
|
||||
|
||||
procd_set_param respawn 0 30 0
|
||||
procd_set_param file /tmp/${PROG_NAME}-${1}.key
|
||||
|
|
@ -81,9 +80,6 @@ start_instance() {
|
|||
|
||||
procd_close_instance
|
||||
|
||||
#tc qdisc replace dev ${dev} root cake
|
||||
|
||||
#ip link set $dev txqlen 100
|
||||
#config_load network
|
||||
#config_foreach add_glorytun_path interface
|
||||
|
||||
|
|
@ -105,8 +101,8 @@ add_glorytun_path() {
|
|||
|
||||
start_service() {
|
||||
local dev
|
||||
config_load glorytun-udp
|
||||
config_foreach start_instance glorytun-udp
|
||||
config_load glorytun
|
||||
config_foreach start_instance glorytun
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
|
|
@ -115,5 +111,5 @@ reload_service() {
|
|||
}
|
||||
|
||||
service_triggers() {
|
||||
procd_add_reload_trigger glorytun-udp network
|
||||
procd_add_reload_trigger glorytun network
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,11 +0,0 @@
|
|||
--- a/mud/aegis256/aegis256.c 2019-11-06 21:17:20.945036771 +0100
|
||||
+++ b/mud/aegis256/aegis256.c 2019-11-06 21:21:18.728943139 +0100
|
||||
@@ -43,7 +43,7 @@
|
||||
#ifndef __ARM_FEATURE_CRYPTO
|
||||
#define __ARM_FEATURE_CRYPTO 1
|
||||
#endif
|
||||
-#else
|
||||
+#elifdef __ARM_FEATURE_CRYPTO
|
||||
#pragma GCC target("+crypto")
|
||||
#endif
|
||||
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
#
|
||||
# Copyright (C) 2015 OVH
|
||||
# Copyright (C) 2017-2019 Ycarus (Yannick Chabanois) <ycarus@zugaina.org>
|
||||
# Copyright (C) 2017 Ycarus (Yannick Chabanois) <ycarus@zugaina.org>
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
|
|
@ -9,15 +9,11 @@
|
|||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=glorytun
|
||||
PKG_RELEASE:=8
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=8aebb3efb3b108b1276aa74679e200e003f298de
|
||||
PKG_SOURCE:=glorytun-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=https://github.com/Ysurac/glorytun.git
|
||||
PKG_VERSION:=0.0.35
|
||||
PKG_LICENSE:=BSD-2-Clause
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
PKG_FIXUP:=autoreconf
|
||||
PKG_RELEASE:=6
|
||||
PKG_SOURCE:=glorytun-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=https://github.com/angt/glorytun/releases/download/v$(PKG_VERSION)
|
||||
PKG_HASH:=49e4d8ea4ff2990300b37947b0bd0da3c8e0985bc6eddf29f4146306188fff64
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
|
|
|
|||
|
|
@ -8,8 +8,3 @@ config glorytun 'vpn'
|
|||
option proto 'tcp'
|
||||
option chacha20 '1'
|
||||
option mtuauto '1'
|
||||
option localip '10.255.255.2'
|
||||
option remoteip '10.255.255.1'
|
||||
option multiqueue '1'
|
||||
option label 'Default VPN'
|
||||
option timeout '10000'
|
||||
|
|
@ -22,18 +22,17 @@ validate_section() {
|
|||
uci_validate_section glorytun glorytun "${1}" \
|
||||
'enable:bool:0' \
|
||||
'mptcp:bool:0' \
|
||||
'mode:string' \
|
||||
'listener:bool:0' \
|
||||
'key:string' \
|
||||
'host:host' \
|
||||
'port:port' \
|
||||
'dev:string' \
|
||||
'timeout:uinteger:10000' \
|
||||
'chacha20:bool:0' \
|
||||
'proto:string'
|
||||
}
|
||||
|
||||
start_instance() {
|
||||
local enable key host port dev mptcp proto chacha20 mode multiqueue timeout
|
||||
local enable key host port dev listener mptcp proto chacha20
|
||||
|
||||
validate_section "${1}" || {
|
||||
_err "validation failed"
|
||||
|
|
@ -42,27 +41,18 @@ start_instance() {
|
|||
|
||||
[ "${enable}" = "1" ] || return 1
|
||||
[ "${proto}" = "tcp" ] || return 1
|
||||
[ -n "${key}" ] || {
|
||||
_err "Key empty"
|
||||
return 1
|
||||
}
|
||||
[ -n "${key}" ] || return 1
|
||||
[ "${key}" != "secretkey" ] || return 1
|
||||
[ -n "${port}" ] || return 1
|
||||
[ -n "${dev}" ] || return 1
|
||||
[ -n "${host}" ] || return 1
|
||||
|
||||
echo "${key}" > /tmp/${PROG_NAME}-${1}.key
|
||||
[ -f "/tmp/${PROG_NAME}-${1}.key" ] || {
|
||||
_err "can't create key file"
|
||||
return 1
|
||||
}
|
||||
key=""
|
||||
|
||||
if [ "$(uci -q get network.omrvpn)" != "" ]; then
|
||||
uci -q set network.omrvpn.device=${dev}
|
||||
uci -q set network.omrvpn.ifname=${dev}
|
||||
uci -q commit network
|
||||
fi
|
||||
|
||||
_log "starting ${PROG_NAME} ${1} instance $*"
|
||||
|
||||
procd_open_instance
|
||||
|
|
@ -73,16 +63,14 @@ start_instance() {
|
|||
${host:+host "$host"} \
|
||||
${dev:+dev "$dev"}
|
||||
|
||||
[ "${mode}" = "listener" ] && procd_append_param command listener
|
||||
[ "${listener}" = "1" ] && procd_append_param command listener
|
||||
[ "${mptcp}" = "1" ] && procd_append_param command mptcp
|
||||
[ "${chacha20}" = "1" ] && procd_append_param command chacha20
|
||||
[ "${multiqueue}" = "1" ] && procd_append_param command multiqueue
|
||||
|
||||
procd_append_param command \
|
||||
retry count -1 const 5000000 \
|
||||
timeout ${timeout} \
|
||||
keepalive count 5 idle 20 interval 2 \
|
||||
buffer-size 65536
|
||||
timeout 40000 \
|
||||
keepalive count 5 idle 60 interval 2
|
||||
|
||||
procd_set_param respawn 0 30 0
|
||||
procd_set_param file /tmp/${PROG_NAME}-${1}.key
|
||||
|
|
|
|||
|
|
@ -1,43 +0,0 @@
|
|||
#
|
||||
# Copyright (C) 2019-2023 Ycarus (Yannick Chabanois) <ycarus@zugaina.org>
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=golang-protobuf
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://github.com/golang/protobuf.git
|
||||
PKG_SOURCE_VERSION:=5d5e8c018a13017f9d5b8bf4fad64aaa42a87308
|
||||
PKG_SOURCE_DATE:=20210916
|
||||
|
||||
PKG_LICENSE:=BSD-3-Clause
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
PKG_BUILD_DEPENDS:=golang/host
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
|
||||
GO_PKG:=github.com/golang/protobuf
|
||||
GO_PKG_SOURCE_ONLY:=1
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include ../golang/golang-package.mk
|
||||
|
||||
define Package/golang-protobuf-dev
|
||||
$(call GoPackage/GoSubMenu)
|
||||
TITLE:=Go support for Google protocol buffers
|
||||
URL:=https://github.com/golang/protobuf
|
||||
DEPENDS:=$(GO_ARCH_DEPENDS) +protobuf
|
||||
PKGARCH:=all
|
||||
endef
|
||||
|
||||
define Package/golang-protobuf-dev/description
|
||||
Go support for Google protocol buffers
|
||||
endef
|
||||
|
||||
$(eval $(call GoSrcPackage,golang-protobuf-dev))
|
||||
$(eval $(call BuildPackage,golang-protobuf-dev))
|
||||
|
|
@ -1,210 +0,0 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# Copyright (C) 2020, 2022 Jeffery To
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
nl="
|
||||
"
|
||||
|
||||
log() {
|
||||
# shellcheck disable=SC2039
|
||||
local IFS=" "
|
||||
printf '%s\n' "$*"
|
||||
}
|
||||
|
||||
log_error() {
|
||||
# shellcheck disable=SC2039
|
||||
local IFS=" "
|
||||
printf 'Error: %s\n' "$*" >&2
|
||||
}
|
||||
|
||||
link_contents() {
|
||||
# shellcheck disable=SC2039
|
||||
local src="$1" dest="$2" IFS="$nl" dirs dir base
|
||||
|
||||
if [ -n "$(find "$src" -mindepth 1 -maxdepth 1 -name "*.go" -not -type d)" ]; then
|
||||
log_error "$src is already a Go library"
|
||||
return 1
|
||||
fi
|
||||
|
||||
dirs="$(find "$src" -mindepth 1 -maxdepth 1 -type d)"
|
||||
for dir in $dirs; do
|
||||
base="${dir##*/}"
|
||||
if [ -d "$dest/$base" ]; then
|
||||
case "$dir" in
|
||||
*$GO_BUILD_DEPENDS_SRC/$GO_PKG)
|
||||
log "$GO_PKG is already installed. Please check for circular dependencies."
|
||||
;;
|
||||
*)
|
||||
link_contents "$src/$base" "$dest/$base"
|
||||
;;
|
||||
esac
|
||||
else
|
||||
log "...${src#$GO_BUILD_DEPENDS_SRC}/$base"
|
||||
ln -sf "$src/$base" "$dest/$base"
|
||||
fi
|
||||
done
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
configure() {
|
||||
# shellcheck disable=SC2039
|
||||
local files code testdata gomod pattern extra IFS file dest
|
||||
|
||||
cd "$BUILD_DIR" || return 1
|
||||
|
||||
files="$(find ./ -path "*/.*" -prune -o -not -type d -print)"
|
||||
|
||||
if [ "$GO_INSTALL_ALL" != 1 ]; then
|
||||
code="$(printf '%s\n' "$files" | grep '\.\(c\|cc\|cpp\|go\|h\|hh\|hpp\|proto\|s\)$')"
|
||||
testdata="$(printf '%s\n' "$files" | grep '/testdata/')"
|
||||
gomod="$(printf '%s\n' "$files" | grep '/go\.\(mod\|sum\|work\)$')"
|
||||
|
||||
for pattern in $GO_INSTALL_EXTRA; do
|
||||
extra="$(printf '%s\n' "$extra"; printf '%s\n' "$files" | grep -e "$pattern")"
|
||||
done
|
||||
|
||||
files="$(printf '%s\n%s\n%s\n%s\n' "$code" "$testdata" "$gomod" "$extra" | grep -v '^[[:space:]]*$' | sort -u)"
|
||||
fi
|
||||
|
||||
IFS="$nl"
|
||||
|
||||
log "Copying files from $BUILD_DIR into $GO_BUILD_DIR/src/$GO_PKG"
|
||||
mkdir -p "$GO_BUILD_DIR/src"
|
||||
for file in $files; do
|
||||
log "${file#./}"
|
||||
dest="$GO_BUILD_DIR/src/$GO_PKG/${file#./}"
|
||||
mkdir -p "${dest%/*}"
|
||||
cp -fpR "$file" "$dest"
|
||||
done
|
||||
log
|
||||
|
||||
if [ "$GO_SOURCE_ONLY" != 1 ]; then
|
||||
if [ -d "$GO_BUILD_DEPENDS_SRC" ]; then
|
||||
log "Symlinking directories from $GO_BUILD_DEPENDS_SRC into $GO_BUILD_DIR/src"
|
||||
link_contents "$GO_BUILD_DEPENDS_SRC" "$GO_BUILD_DIR/src"
|
||||
else
|
||||
log "$GO_BUILD_DEPENDS_SRC does not exist, skipping symlinks"
|
||||
fi
|
||||
else
|
||||
log "Not building binaries, skipping symlinks"
|
||||
fi
|
||||
log
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
build() {
|
||||
# shellcheck disable=SC2039
|
||||
local modargs pattern targets retval
|
||||
|
||||
cd "$GO_BUILD_DIR" || return 1
|
||||
|
||||
if [ -f "$BUILD_DIR/go.mod" ] ; then
|
||||
mkdir -p "$GO_MOD_CACHE_DIR"
|
||||
modargs="$GO_MOD_ARGS"
|
||||
fi
|
||||
|
||||
log "Finding targets"
|
||||
# shellcheck disable=SC2086
|
||||
targets="$(go list $modargs $GO_BUILD_PKG)"
|
||||
for pattern in $GO_EXCLUDES; do
|
||||
targets="$(printf '%s\n' "$targets" | grep -v "$pattern")"
|
||||
done
|
||||
log
|
||||
|
||||
if [ "$GO_GO_GENERATE" = 1 ]; then
|
||||
log "Calling go generate"
|
||||
# shellcheck disable=SC2086
|
||||
GOOS='' GOARCH='' GO386='' GOARM='' GOARM64='' GOMIPS='' GOMIPS64='' GORISCV64=''\
|
||||
go generate -v $targets
|
||||
log
|
||||
fi
|
||||
|
||||
if [ "$GO_SOURCE_ONLY" = 1 ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
log "Building targets"
|
||||
mkdir -p "$GO_BUILD_DIR/bin" "$GO_BUILD_CACHE_DIR"
|
||||
# shellcheck disable=SC2086
|
||||
go install $modargs "$@" $targets
|
||||
retval="$?"
|
||||
log
|
||||
|
||||
if [ "$retval" -eq 0 ] && [ -z "$(find "$GO_BUILD_BIN_DIR" -maxdepth 0 -type d -not -empty 2>/dev/null)" ]; then
|
||||
log_error "No binaries were built"
|
||||
retval=1
|
||||
fi
|
||||
|
||||
if [ "$retval" -ne 0 ]; then
|
||||
cache_cleanup
|
||||
fi
|
||||
|
||||
return "$retval"
|
||||
}
|
||||
|
||||
install_bin() {
|
||||
# shellcheck disable=SC2039
|
||||
local dest="$1"
|
||||
install -d -m0755 "$dest/$GO_INSTALL_BIN_PATH"
|
||||
install -m0755 "$GO_BUILD_BIN_DIR"/* "$dest/$GO_INSTALL_BIN_PATH/"
|
||||
}
|
||||
|
||||
install_src() {
|
||||
# shellcheck disable=SC2039
|
||||
local dest="$1" dir="${GO_PKG%/*}"
|
||||
install -d -m0755 "$dest/$GO_BUILD_DEPENDS_PATH/src/$dir"
|
||||
cp -fpR "$GO_BUILD_DIR/src/$GO_PKG" "$dest/$GO_BUILD_DEPENDS_PATH/src/$dir/"
|
||||
}
|
||||
|
||||
cache_cleanup() {
|
||||
if ! [ -d "$GO_MOD_CACHE_DIR" ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
# in case go is called without -modcacherw
|
||||
find "$GO_MOD_CACHE_DIR" -type d -not -perm -u+w -exec chmod u+w '{}' +
|
||||
|
||||
if [ -n "$CONFIG_GOLANG_MOD_CACHE_WORLD_READABLE" ]; then
|
||||
find "$GO_MOD_CACHE_DIR" -type d -not -perm -go+rx -exec chmod go+rx '{}' +
|
||||
find "$GO_MOD_CACHE_DIR" -not -type d -not -perm -go+r -exec chmod go+r '{}' +
|
||||
fi
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
|
||||
if [ "$#" -lt 1 ]; then
|
||||
log_error "Missing command"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
command="$1"
|
||||
shift 1
|
||||
|
||||
case "$command" in
|
||||
configure)
|
||||
configure
|
||||
;;
|
||||
build)
|
||||
build "$@"
|
||||
;;
|
||||
install_bin)
|
||||
install_bin "$@"
|
||||
;;
|
||||
install_src)
|
||||
install_src "$@"
|
||||
;;
|
||||
cache_cleanup)
|
||||
cache_cleanup
|
||||
;;
|
||||
*)
|
||||
log_error "Invalid command \"$command\""
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
|
@ -1,189 +0,0 @@
|
|||
#
|
||||
# Copyright (C) 2018, 2020-2021, 2023 Jeffery To
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
ifeq ($(origin GO_INCLUDE_DIR),undefined)
|
||||
GO_INCLUDE_DIR:=$(dir $(lastword $(MAKEFILE_LIST)))
|
||||
endif
|
||||
|
||||
include $(GO_INCLUDE_DIR)/golang-values.mk
|
||||
|
||||
|
||||
# $(1) valid GOOS_GOARCH combinations
|
||||
# $(2) go version id
|
||||
define GoCompiler/Default/CheckHost
|
||||
$(if $(filter $(GO_HOST_OS_ARCH),$(1)),,$(error go-$(2) cannot be installed on $(GO_HOST_OS)/$(GO_HOST_ARCH)))
|
||||
endef
|
||||
|
||||
# $(1) source go root
|
||||
# $(2) additional environment variables (optional)
|
||||
define GoCompiler/Default/Make
|
||||
( \
|
||||
cd "$(1)/src" ; \
|
||||
$(2) \
|
||||
$(BASH) make.bash \
|
||||
$(if $(findstring s,$(OPENWRT_VERBOSE)),-v) \
|
||||
--no-banner \
|
||||
; \
|
||||
)
|
||||
endef
|
||||
|
||||
# $(1) destination prefix
|
||||
# $(2) go version id
|
||||
define GoCompiler/Default/Install/make-dirs
|
||||
$(INSTALL_DIR) "$(1)/lib/go-$(2)"
|
||||
$(INSTALL_DIR) "$(1)/share/go-$(2)"
|
||||
endef
|
||||
|
||||
# $(1) source go root
|
||||
# $(2) destination prefix
|
||||
# $(3) go version id
|
||||
# $(4) file/directory name
|
||||
define GoCompiler/Default/Install/install-share-data
|
||||
$(CP) "$(1)/$(4)" "$(2)/share/go-$(3)/"
|
||||
$(LN) "../../share/go-$(3)/$(4)" "$(2)/lib/go-$(3)/"
|
||||
endef
|
||||
|
||||
# $(1) source go root
|
||||
# $(2) destination prefix
|
||||
# $(3) go version id
|
||||
# $(4) GOOS_GOARCH
|
||||
# $(5) install suffix (optional)
|
||||
define GoCompiler/Default/Install/Bin
|
||||
$(call GoCompiler/Default/Install/make-dirs,$(2),$(3))
|
||||
|
||||
$(call GoCompiler/Default/Install/install-share-data,$(1),$(2),$(3),api)
|
||||
|
||||
$(INSTALL_DATA) -p "$(1)/go.env" "$(2)/lib/go-$(3)/"
|
||||
$(INSTALL_DATA) -p "$(1)/VERSION" "$(2)/lib/go-$(3)/"
|
||||
|
||||
for file in CONTRIBUTING.md LICENSE PATENTS README.md SECURITY.md; do \
|
||||
if [ -f "$(1)/$$$$file" ]; then \
|
||||
$(INSTALL_DATA) -p "$(1)/$$$$file" "$(2)/share/go-$(3)/" ; \
|
||||
fi ; \
|
||||
done
|
||||
|
||||
$(INSTALL_DIR) "$(2)/lib/go-$(3)/bin"
|
||||
|
||||
ifeq ($(4),$(GO_HOST_OS_ARCH))
|
||||
$(INSTALL_BIN) -p "$(1)/bin"/* "$(2)/lib/go-$(3)/bin/"
|
||||
else
|
||||
$(INSTALL_BIN) -p "$(1)/bin/$(4)"/* "$(2)/lib/go-$(3)/bin/"
|
||||
endif
|
||||
|
||||
if [ -d "$(1)/pkg/$(4)$(if $(5),_$(5))" ]; then \
|
||||
$(INSTALL_DIR) "$(2)/lib/go-$(3)/pkg" ; \
|
||||
$(CP) "$(1)/pkg/$(4)$(if $(5),_$(5))" "$(2)/lib/go-$(3)/pkg/" ; \
|
||||
fi
|
||||
|
||||
$(INSTALL_DIR) "$(2)/lib/go-$(3)/pkg/tool/$(4)"
|
||||
$(INSTALL_BIN) -p "$(1)/pkg/tool/$(4)"/* "$(2)/lib/go-$(3)/pkg/tool/$(4)/"
|
||||
endef
|
||||
|
||||
# $(1) destination prefix
|
||||
# $(2) go version id
|
||||
define GoCompiler/Default/Install/BinLinks
|
||||
$(INSTALL_DIR) "$(1)/bin"
|
||||
$(LN) "../lib/go-$(2)/bin/go" "$(1)/bin/go"
|
||||
$(LN) "../lib/go-$(2)/bin/gofmt" "$(1)/bin/gofmt"
|
||||
endef
|
||||
|
||||
# $(1) source go root
|
||||
# $(2) destination prefix
|
||||
# $(3) go version id
|
||||
define GoCompiler/Default/Install/Doc
|
||||
$(call GoCompiler/Default/Install/make-dirs,$(2),$(3))
|
||||
|
||||
$(call GoCompiler/Default/Install/install-share-data,$(1),$(2),$(3),doc)
|
||||
endef
|
||||
|
||||
# $(1) source go root
|
||||
# $(2) destination prefix
|
||||
# $(3) go version id
|
||||
define GoCompiler/Default/Install/Src
|
||||
$(call GoCompiler/Default/Install/make-dirs,$(2),$(3))
|
||||
|
||||
$(call GoCompiler/Default/Install/install-share-data,$(1),$(2),$(3),lib)
|
||||
$(call GoCompiler/Default/Install/install-share-data,$(1),$(2),$(3),misc)
|
||||
$(call GoCompiler/Default/Install/install-share-data,$(1),$(2),$(3),src)
|
||||
$(call GoCompiler/Default/Install/install-share-data,$(1),$(2),$(3),test)
|
||||
|
||||
$(FIND) \
|
||||
"$(2)/share/go-$(3)/src/" \
|
||||
\! -type d -a \( -name "*.bat" -o -name "*.rc" \) \
|
||||
-delete
|
||||
|
||||
if [ -d "$(1)/pkg/include" ]; then \
|
||||
$(INSTALL_DIR) "$(2)/lib/go-$(3)/pkg" ; \
|
||||
$(INSTALL_DIR) "$(2)/share/go-$(3)/pkg" ; \
|
||||
$(CP) "$(1)/pkg/include" "$(2)/share/go-$(3)/pkg/" ; \
|
||||
$(LN) "../../../share/go-$(3)/pkg/include" "$(2)/lib/go-$(3)/pkg/" ; \
|
||||
fi
|
||||
endef
|
||||
|
||||
# $(1) destination prefix
|
||||
# $(2) go version id
|
||||
define GoCompiler/Default/Uninstall
|
||||
rm -rf "$(1)/lib/go-$(2)"
|
||||
rm -rf "$(1)/share/go-$(2)"
|
||||
endef
|
||||
|
||||
# $(1) destination prefix
|
||||
define GoCompiler/Default/Uninstall/BinLinks
|
||||
rm -f "$(1)/bin/go"
|
||||
rm -f "$(1)/bin/gofmt"
|
||||
endef
|
||||
|
||||
|
||||
# $(1) profile name
|
||||
# $(2) source go root
|
||||
# $(3) destination prefix
|
||||
# $(4) go version id
|
||||
# $(5) GOOS_GOARCH
|
||||
# $(6) install suffix (optional)
|
||||
define GoCompiler/AddProfile
|
||||
|
||||
# $$(1) valid GOOS_GOARCH combinations
|
||||
define GoCompiler/$(1)/CheckHost
|
||||
$$(call GoCompiler/Default/CheckHost,$$(1),$(4))
|
||||
endef
|
||||
|
||||
# $$(1) additional environment variables (optional)
|
||||
define GoCompiler/$(1)/Make
|
||||
$$(call GoCompiler/Default/Make,$(2),$$(1))
|
||||
endef
|
||||
|
||||
# $$(1) override install prefix (optional)
|
||||
define GoCompiler/$(1)/Install/Bin
|
||||
$$(call GoCompiler/Default/Install/Bin,$(2),$$(or $$(1),$(3)),$(4),$(5),$(6))
|
||||
endef
|
||||
|
||||
# $$(1) override install prefix (optional)
|
||||
define GoCompiler/$(1)/Install/BinLinks
|
||||
$$(call GoCompiler/Default/Install/BinLinks,$$(or $$(1),$(3)),$(4))
|
||||
endef
|
||||
|
||||
# $$(1) override install prefix (optional)
|
||||
define GoCompiler/$(1)/Install/Doc
|
||||
$$(call GoCompiler/Default/Install/Doc,$(2),$$(or $$(1),$(3)),$(4))
|
||||
endef
|
||||
|
||||
# $$(1) override install prefix (optional)
|
||||
define GoCompiler/$(1)/Install/Src
|
||||
$$(call GoCompiler/Default/Install/Src,$(2),$$(or $$(1),$(3)),$(4))
|
||||
endef
|
||||
|
||||
# $$(1) override install prefix (optional)
|
||||
define GoCompiler/$(1)/Uninstall
|
||||
$$(call GoCompiler/Default/Uninstall,$$(or $$(1),$(3)),$(4))
|
||||
endef
|
||||
|
||||
# $$(1) override install prefix (optional)
|
||||
define GoCompiler/$(1)/Uninstall/BinLinks
|
||||
$$(call GoCompiler/Default/Uninstall/BinLinks,$$(or $$(1),$(3)))
|
||||
endef
|
||||
|
||||
endef
|
||||
|
|
@ -1,220 +0,0 @@
|
|||
#
|
||||
# Copyright (C) 2020, 2022 Jeffery To
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
ifeq ($(origin GO_INCLUDE_DIR),undefined)
|
||||
GO_INCLUDE_DIR:=$(dir $(lastword $(MAKEFILE_LIST)))
|
||||
endif
|
||||
|
||||
include $(GO_INCLUDE_DIR)/golang-values.mk
|
||||
|
||||
|
||||
# these variables have the same meanings as in golang-package.mk
|
||||
GO_HOST_INSTALL_EXTRA?=$(GO_PKG_INSTALL_EXTRA)
|
||||
GO_HOST_INSTALL_ALL?=$(GO_PKG_INSTALL_ALL)
|
||||
GO_HOST_SOURCE_ONLY?=$(GO_PKG_SOURCE_ONLY)
|
||||
GO_HOST_BUILD_PKG?=$(GO_PKG_BUILD_PKG)
|
||||
GO_HOST_EXCLUDES?=$(GO_PKG_EXCLUDES)
|
||||
GO_HOST_GO_GENERATE?=$(GO_PKG_GO_GENERATE)
|
||||
GO_HOST_GCFLAGS?=$(GO_PKG_GCFLAGS)
|
||||
GO_HOST_LDFLAGS?=$(GO_PKG_LDFLAGS)
|
||||
GO_HOST_LDFLAGS_X?=$(GO_PKG_LDFLAGS_X)
|
||||
GO_HOST_TAGS?=$(GO_PKG_TAGS)
|
||||
GO_HOST_INSTALL_BIN_PATH?=/bin
|
||||
|
||||
|
||||
# need to repeat this here in case golang-package.mk is not included
|
||||
GO_PKG_BUILD_PKG?=$(strip $(GO_PKG))/...
|
||||
|
||||
GO_HOST_WORK_DIR_NAME:=.go_work
|
||||
GO_HOST_BUILD_DIR=$(HOST_BUILD_DIR)/$(GO_HOST_WORK_DIR_NAME)/build
|
||||
GO_HOST_BUILD_BIN_DIR=$(GO_HOST_BUILD_DIR)/bin
|
||||
|
||||
GO_HOST_BUILD_DEPENDS_PATH:=/share/gocode
|
||||
GO_HOST_BUILD_DEPENDS_SRC=$(STAGING_DIR_HOSTPKG)$(GO_HOST_BUILD_DEPENDS_PATH)/src
|
||||
|
||||
GO_HOST_DIR_NAME:=$(lastword $(subst /,$(space),$(CURDIR)))
|
||||
GO_HOST_STAGING_DIR:=$(TMP_DIR)/host-stage-$(GO_HOST_DIR_NAME)
|
||||
GO_HOST_STAGING_FILES_LIST_DIR:=$(HOST_BUILD_PREFIX)/stamp
|
||||
GO_HOST_BIN_STAGING_FILES_LIST:=$(GO_HOST_STAGING_FILES_LIST_DIR)/$(GO_HOST_DIR_NAME)-bin.list
|
||||
GO_HOST_SRC_STAGING_FILES_LIST:=$(GO_HOST_STAGING_FILES_LIST_DIR)/$(GO_HOST_DIR_NAME)-src.list
|
||||
|
||||
ifeq ($(GO_HOST_PIE_SUPPORTED),1)
|
||||
GO_HOST_ENABLE_PIE:=1
|
||||
endif
|
||||
|
||||
GO_HOST_BUILD_CONFIG_VARS= \
|
||||
GO_PKG="$(strip $(GO_PKG))" \
|
||||
GO_INSTALL_EXTRA="$(strip $(GO_HOST_INSTALL_EXTRA))" \
|
||||
GO_INSTALL_ALL="$(strip $(GO_HOST_INSTALL_ALL))" \
|
||||
GO_SOURCE_ONLY="$(strip $(GO_HOST_SOURCE_ONLY))" \
|
||||
GO_BUILD_PKG="$(strip $(GO_HOST_BUILD_PKG))" \
|
||||
GO_EXCLUDES="$(strip $(GO_HOST_EXCLUDES))" \
|
||||
GO_GO_GENERATE="$(strip $(GO_HOST_GO_GENERATE))" \
|
||||
GO_INSTALL_BIN_PATH="$(strip $(GO_HOST_INSTALL_BIN_PATH))" \
|
||||
BUILD_DIR="$(HOST_BUILD_DIR)" \
|
||||
GO_BUILD_DIR="$(GO_HOST_BUILD_DIR)" \
|
||||
GO_BUILD_BIN_DIR="$(GO_HOST_BUILD_BIN_DIR)" \
|
||||
GO_BUILD_DEPENDS_PATH="$(GO_HOST_BUILD_DEPENDS_PATH)" \
|
||||
GO_BUILD_DEPENDS_SRC="$(GO_HOST_BUILD_DEPENDS_SRC)"
|
||||
|
||||
GO_HOST_MORE_CFLAGS?= \
|
||||
-Wformat -Werror=format-security \
|
||||
-fstack-protector-strong \
|
||||
-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 \
|
||||
-Wl,-z,now -Wl,-z,relro \
|
||||
$(if $(GO_HOST_ENABLE_PIE),$(FPIC))
|
||||
|
||||
GO_HOST_MORE_LDFLAGS?= \
|
||||
-znow -zrelro \
|
||||
$(if $(GO_HOST_ENABLE_PIE),$(FPIC) -specs=$(INCLUDE_DIR)/hardened-ld-pie.specs)
|
||||
|
||||
GO_HOST_TARGET_VARS= \
|
||||
CGO_ENABLED=1 \
|
||||
CC=gcc \
|
||||
CXX=g++ \
|
||||
PKG_CONFIG=pkg-config \
|
||||
CGO_CFLAGS="$(HOST_CFLAGS) $(GO_HOST_MORE_CFLAGS)" \
|
||||
CGO_CPPFLAGS="$(HOST_CPPFLAGS) $(GO_HOST_MORE_CPPFLAGS)" \
|
||||
CGO_CXXFLAGS="$(HOST_CFLAGS) $(GO_HOST_MORE_CFLAGS)" \
|
||||
CGO_LDFLAGS="$(HOST_LDFLAGS) $(GO_HOST_MORE_LDFLAGS)" \
|
||||
GO_GCC_HELPER_CC="$(HOSTCC)" \
|
||||
GO_GCC_HELPER_CXX="$(HOSTCXX)" \
|
||||
GO_GCC_HELPER_PATH="$$$$PATH" \
|
||||
PATH="$(STAGING_DIR_HOSTPKG)/lib/go-cross/openwrt:$$$$PATH"
|
||||
|
||||
GO_HOST_BUILD_VARS= \
|
||||
GOPATH="$(GO_HOST_BUILD_DIR)" \
|
||||
GOCACHE="$(GO_BUILD_CACHE_DIR)" \
|
||||
GOMODCACHE="$(GO_MOD_CACHE_DIR)" \
|
||||
GOENV=off
|
||||
|
||||
GO_HOST_VARS= \
|
||||
$(GO_HOST_TARGET_VARS) \
|
||||
$(GO_HOST_BUILD_VARS)
|
||||
|
||||
GO_HOST_DEFAULT_LDFLAGS= \
|
||||
-linkmode external \
|
||||
-extldflags '$(patsubst -z%,-Wl$(comma)-z$(comma)%,$(HOST_LDFLAGS) $(GO_HOST_MORE_LDFLAGS))'
|
||||
|
||||
GO_HOST_CUSTOM_LDFLAGS= \
|
||||
$(GO_HOST_LDFLAGS) \
|
||||
$(patsubst %,-X %,$(GO_HOST_LDFLAGS_X))
|
||||
|
||||
GO_HOST_INSTALL_ARGS= \
|
||||
-v \
|
||||
-ldflags "all=$(GO_HOST_DEFAULT_LDFLAGS)" \
|
||||
$(if $(GO_HOST_ENABLE_PIE),-buildmode pie) \
|
||||
$(if $(strip $(GO_HOST_GCFLAGS)),-gcflags "$(GO_HOST_GCFLAGS)") \
|
||||
$(if $(strip $(GO_HOST_CUSTOM_LDFLAGS)),-ldflags "$(GO_HOST_CUSTOM_LDFLAGS) $(GO_HOST_DEFAULT_LDFLAGS)") \
|
||||
$(if $(strip $(GO_HOST_TAGS)),-tags "$(GO_HOST_TAGS)")
|
||||
|
||||
define GoHost/Host/Configure
|
||||
$(GO_GENERAL_BUILD_CONFIG_VARS) \
|
||||
$(GO_HOST_BUILD_CONFIG_VARS) \
|
||||
$(SHELL) $(GO_INCLUDE_DIR)/golang-build.sh configure
|
||||
endef
|
||||
|
||||
# $(1) additional arguments for go command line (optional)
|
||||
define GoHost/Host/Compile
|
||||
$(GO_GENERAL_BUILD_CONFIG_VARS) \
|
||||
$(GO_HOST_BUILD_CONFIG_VARS) \
|
||||
$(GO_HOST_VARS) \
|
||||
$(SHELL) $(GO_INCLUDE_DIR)/golang-build.sh build $(GO_HOST_INSTALL_ARGS) $(1)
|
||||
endef
|
||||
|
||||
define GoHost/Host/Install/Bin
|
||||
rm -rf "$(GO_HOST_STAGING_DIR)"
|
||||
mkdir -p "$(GO_HOST_STAGING_DIR)" "$(GO_HOST_STAGING_FILES_LIST_DIR)"
|
||||
|
||||
$(GO_GENERAL_BUILD_CONFIG_VARS) \
|
||||
$(GO_HOST_BUILD_CONFIG_VARS) \
|
||||
$(SHELL) $(GO_INCLUDE_DIR)/golang-build.sh install_bin "$(GO_HOST_STAGING_DIR)"
|
||||
|
||||
if [ -f "$(GO_HOST_BIN_STAGING_FILES_LIST)" ]; then \
|
||||
"$(SCRIPT_DIR)/clean-package.sh" \
|
||||
"$(GO_HOST_BIN_STAGING_FILES_LIST)" \
|
||||
"$(1)" ; \
|
||||
fi
|
||||
|
||||
cd "$(GO_HOST_STAGING_DIR)" && find ./ > "$(GO_HOST_STAGING_DIR).files"
|
||||
|
||||
$(call locked, \
|
||||
mv "$(GO_HOST_STAGING_DIR).files" "$(GO_HOST_BIN_STAGING_FILES_LIST)" && \
|
||||
$(CP) "$(GO_HOST_STAGING_DIR)"/* "$(1)/", \
|
||||
host-staging-dir \
|
||||
)
|
||||
|
||||
rm -rf "$(GO_HOST_STAGING_DIR)"
|
||||
endef
|
||||
|
||||
define GoHost/Host/Install/Src
|
||||
rm -rf "$(GO_HOST_STAGING_DIR)"
|
||||
mkdir -p "$(GO_HOST_STAGING_DIR)" "$(GO_HOST_STAGING_FILES_LIST_DIR)"
|
||||
|
||||
$(GO_GENERAL_BUILD_CONFIG_VARS) \
|
||||
$(GO_HOST_BUILD_CONFIG_VARS) \
|
||||
$(SHELL) $(GO_INCLUDE_DIR)/golang-build.sh install_src "$(GO_HOST_STAGING_DIR)"
|
||||
|
||||
if [ -f "$(GO_HOST_SRC_STAGING_FILES_LIST)" ]; then \
|
||||
"$(SCRIPT_DIR)/clean-package.sh" \
|
||||
"$(GO_HOST_SRC_STAGING_FILES_LIST)" \
|
||||
"$(1)" ; \
|
||||
fi
|
||||
|
||||
cd "$(GO_HOST_STAGING_DIR)" && find ./ > "$(GO_HOST_STAGING_DIR).files"
|
||||
|
||||
$(call locked, \
|
||||
mv "$(GO_HOST_STAGING_DIR).files" "$(GO_HOST_SRC_STAGING_FILES_LIST)" && \
|
||||
$(CP) "$(GO_HOST_STAGING_DIR)"/* "$(1)/", \
|
||||
host-staging-dir \
|
||||
)
|
||||
|
||||
rm -rf "$(GO_HOST_STAGING_DIR)"
|
||||
endef
|
||||
|
||||
define GoHost/Host/Install
|
||||
$(if $(filter $(GO_HOST_SOURCE_ONLY),1),, \
|
||||
$(call GoHost/Host/Install/Bin,$(1)) \
|
||||
)
|
||||
$(call GoHost/Host/Install/Src,$(1))
|
||||
endef
|
||||
|
||||
define GoHost/Host/Uninstall
|
||||
if [ -f "$(GO_HOST_BIN_STAGING_FILES_LIST)" ]; then \
|
||||
"$(SCRIPT_DIR)/clean-package.sh" \
|
||||
"$(GO_HOST_BIN_STAGING_FILES_LIST)" \
|
||||
"$(HOST_BUILD_PREFIX)" ; \
|
||||
rm -f "$(GO_HOST_BIN_STAGING_FILES_LIST)" ; \
|
||||
fi
|
||||
|
||||
if [ -f "$(GO_HOST_SRC_STAGING_FILES_LIST)" ]; then \
|
||||
"$(SCRIPT_DIR)/clean-package.sh" \
|
||||
"$(GO_HOST_SRC_STAGING_FILES_LIST)" \
|
||||
"$(HOST_BUILD_PREFIX)" ; \
|
||||
rm -f "$(GO_HOST_SRC_STAGING_FILES_LIST)" ; \
|
||||
fi
|
||||
endef
|
||||
|
||||
|
||||
ifneq ($(strip $(GO_PKG)),)
|
||||
Host/Configure=$(call GoHost/Host/Configure)
|
||||
Host/Compile=$(call GoHost/Host/Compile)
|
||||
Hooks/HostCompile/Post+=Go/CacheCleanup
|
||||
Host/Uninstall=$(call GoHost/Host/Uninstall,$(1))
|
||||
endif
|
||||
|
||||
define GoHostBuild
|
||||
Host/Install=$$(call GoHost/Host/Install,$$(1))
|
||||
endef
|
||||
|
||||
define GoBinHostBuild
|
||||
Host/Install=$$(call GoHost/Host/Install/Bin,$$(1))
|
||||
endef
|
||||
|
||||
define GoSrcHostBuild
|
||||
Host/Install=$$(call GoHost/Host/Install/Src,$$(1))
|
||||
endef
|
||||
|
|
@ -1,320 +0,0 @@
|
|||
#
|
||||
# Copyright (C) 2018-2022 Jeffery To
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
ifeq ($(origin GO_INCLUDE_DIR),undefined)
|
||||
GO_INCLUDE_DIR:=$(dir $(lastword $(MAKEFILE_LIST)))
|
||||
endif
|
||||
|
||||
include $(GO_INCLUDE_DIR)/golang-values.mk
|
||||
|
||||
|
||||
# Variables (all optional, except GO_PKG) to be set in package
|
||||
# Makefiles:
|
||||
#
|
||||
# GO_PKG (required) - name of Go package
|
||||
#
|
||||
# Go name of the package.
|
||||
#
|
||||
# e.g. GO_PKG:=golang.org/x/text
|
||||
#
|
||||
#
|
||||
# GO_PKG_INSTALL_EXTRA - list of regular expressions, default empty
|
||||
#
|
||||
# Additional files/directories to install. By default, only these
|
||||
# files are installed:
|
||||
#
|
||||
# * Files with one of these extensions:
|
||||
# .go, .c, .cc, .cpp, .h, .hh, .hpp, .proto, .s
|
||||
#
|
||||
# * Files in any 'testdata' directory
|
||||
#
|
||||
# * go.mod, go.sum and go.work, in any directory
|
||||
#
|
||||
# e.g. GO_PKG_INSTALL_EXTRA:=example.toml marshal_test.toml
|
||||
#
|
||||
#
|
||||
# GO_PKG_INSTALL_ALL - boolean (0 or 1), default false
|
||||
#
|
||||
# If true, install all files regardless of extension or directory.
|
||||
#
|
||||
# e.g. GO_PKG_INSTALL_ALL:=1
|
||||
#
|
||||
#
|
||||
# GO_PKG_SOURCE_ONLY - boolean (0 or 1), default false
|
||||
#
|
||||
# If true, 'go install' will not be called. If the package does not
|
||||
# (or should not) build any binaries, then specifying this option will
|
||||
# save build time.
|
||||
#
|
||||
# e.g. GO_PKG_SOURCE_ONLY:=1
|
||||
#
|
||||
#
|
||||
# GO_PKG_BUILD_PKG - list of build targets, default GO_PKG/...
|
||||
#
|
||||
# Build targets for compiling this Go package, i.e. arguments passed
|
||||
# to 'go install'.
|
||||
#
|
||||
# e.g. GO_PKG_BUILD_PKG:=github.com/debian/ratt/cmd/...
|
||||
#
|
||||
#
|
||||
# GO_PKG_EXCLUDES - list of regular expressions, default empty
|
||||
#
|
||||
# Patterns to exclude from the build targets expanded from
|
||||
# GO_PKG_BUILD_PKG.
|
||||
#
|
||||
# e.g. GO_PKG_EXCLUDES:=examples/
|
||||
#
|
||||
#
|
||||
# GO_PKG_GO_GENERATE - boolean (0 or 1), default false
|
||||
#
|
||||
# If true, 'go generate' will be called on all build targets (as
|
||||
# determined by GO_PKG_BUILD_PKG and GO_PKG_EXCLUDES). This is usually
|
||||
# not necessary.
|
||||
#
|
||||
# e.g. GO_PKG_GO_GENERATE:=1
|
||||
#
|
||||
#
|
||||
# GO_PKG_GCFLAGS - list of options, default empty
|
||||
#
|
||||
# Additional go tool compile options to use when building targets.
|
||||
#
|
||||
# e.g. GO_PKG_GCFLAGS:=-N -l
|
||||
#
|
||||
#
|
||||
# GO_PKG_LDFLAGS - list of options, default empty
|
||||
#
|
||||
# Additional go tool link options to use when building targets.
|
||||
#
|
||||
# Note that the OpenWrt build system has an option to strip binaries
|
||||
# (enabled by default), so -s (Omit the symbol table and debug
|
||||
# information) and -w (Omit the DWARF symbol table) flags are not
|
||||
# necessary.
|
||||
#
|
||||
# e.g. GO_PKG_LDFLAGS:=-r dir1:dir2 -u
|
||||
#
|
||||
#
|
||||
# GO_PKG_LDFLAGS_X - list of string variable definitions, default empty
|
||||
#
|
||||
# Each definition will be passed as the parameter to the -X go tool
|
||||
# link option, i.e. -ldflags "-X importpath.name=value".
|
||||
#
|
||||
# e.g. GO_PKG_LDFLAGS_X:=main.Version=$(PKG_VERSION) main.BuildStamp=$(SOURCE_DATE_EPOCH)
|
||||
#
|
||||
#
|
||||
# GO_PKG_TAGS - list of build tags, default empty
|
||||
#
|
||||
# Build tags to consider satisfied during the build, passed as the
|
||||
# parameter to the -tags option for 'go install'.
|
||||
#
|
||||
# e.g. GO_PKG_TAGS:=release,noupgrade
|
||||
#
|
||||
#
|
||||
# GO_PKG_INSTALL_BIN_PATH - target directory path, default /usr/bin
|
||||
#
|
||||
# Directory path under "dest_dir" where binaries will be installed by
|
||||
# '$(call GoPackage/Package/Install/Bin,dest_dir)'.
|
||||
#
|
||||
# e.g. GO_PKG_INSTALL_BIN_PATH:=/sbin
|
||||
|
||||
# Credit for this package build process (GoPackage/Build/Configure and
|
||||
# GoPackage/Build/Compile) belong to Debian's dh-golang completely.
|
||||
# https://salsa.debian.org/go-team/packages/dh-golang
|
||||
|
||||
|
||||
GO_PKG_BUILD_PKG?=$(strip $(GO_PKG))/...
|
||||
GO_PKG_INSTALL_BIN_PATH?=/usr/bin
|
||||
|
||||
GO_PKG_WORK_DIR_NAME:=.go_work
|
||||
GO_PKG_BUILD_DIR=$(PKG_BUILD_DIR)/$(GO_PKG_WORK_DIR_NAME)/build
|
||||
GO_PKG_BUILD_BIN_DIR=$(GO_PKG_BUILD_DIR)/bin$(if $(GO_HOST_TARGET_DIFFERENT),/$(GO_OS_ARCH))
|
||||
|
||||
GO_PKG_BUILD_DEPENDS_PATH:=/usr/share/gocode
|
||||
GO_PKG_BUILD_DEPENDS_SRC=$(STAGING_DIR)$(GO_PKG_BUILD_DEPENDS_PATH)/src
|
||||
|
||||
ifdef CONFIG_PKG_ASLR_PIE_ALL
|
||||
ifeq ($(strip $(PKG_ASLR_PIE)),1)
|
||||
ifeq ($(GO_TARGET_PIE_SUPPORTED),1)
|
||||
GO_PKG_ENABLE_PIE:=1
|
||||
else
|
||||
$(warning PIE buildmode is not supported for $(GO_OS)/$(GO_ARCH))
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
ifdef CONFIG_PKG_ASLR_PIE_REGULAR
|
||||
ifeq ($(strip $(PKG_ASLR_PIE_REGULAR)),1)
|
||||
ifeq ($(GO_TARGET_PIE_SUPPORTED),1)
|
||||
GO_PKG_ENABLE_PIE:=1
|
||||
else
|
||||
$(warning PIE buildmode is not supported for $(GO_OS)/$(GO_ARCH))
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
ifdef CONFIG_GOLANG_SPECTRE
|
||||
ifeq ($(GO_TARGET_SPECTRE_SUPPORTED),1)
|
||||
GO_PKG_ENABLE_SPECTRE:=1
|
||||
else
|
||||
$(warning Spectre mitigations are not supported for $(GO_ARCH))
|
||||
endif
|
||||
endif
|
||||
|
||||
# sstrip causes corrupted section header size
|
||||
ifneq ($(CONFIG_USE_SSTRIP),)
|
||||
ifneq ($(CONFIG_DEBUG),)
|
||||
GO_PKG_STRIP_ARGS:=--strip-unneeded --remove-section=.comment --remove-section=.note
|
||||
else
|
||||
GO_PKG_STRIP_ARGS:=--strip-all
|
||||
endif
|
||||
STRIP:=$(TARGET_CROSS)strip $(GO_PKG_STRIP_ARGS)
|
||||
endif
|
||||
|
||||
define GoPackage/GoSubMenu
|
||||
SUBMENU:=Go
|
||||
SECTION:=lang
|
||||
CATEGORY:=Languages
|
||||
endef
|
||||
|
||||
GO_PKG_BUILD_CONFIG_VARS= \
|
||||
GO_PKG="$(strip $(GO_PKG))" \
|
||||
GO_INSTALL_EXTRA="$(strip $(GO_PKG_INSTALL_EXTRA))" \
|
||||
GO_INSTALL_ALL="$(strip $(GO_PKG_INSTALL_ALL))" \
|
||||
GO_SOURCE_ONLY="$(strip $(GO_PKG_SOURCE_ONLY))" \
|
||||
GO_BUILD_PKG="$(strip $(GO_PKG_BUILD_PKG))" \
|
||||
GO_EXCLUDES="$(strip $(GO_PKG_EXCLUDES))" \
|
||||
GO_GO_GENERATE="$(strip $(GO_PKG_GO_GENERATE))" \
|
||||
GO_INSTALL_BIN_PATH="$(strip $(GO_PKG_INSTALL_BIN_PATH))" \
|
||||
BUILD_DIR="$(PKG_BUILD_DIR)" \
|
||||
GO_BUILD_DIR="$(GO_PKG_BUILD_DIR)" \
|
||||
GO_BUILD_BIN_DIR="$(GO_PKG_BUILD_BIN_DIR)" \
|
||||
GO_BUILD_DEPENDS_PATH="$(GO_PKG_BUILD_DEPENDS_PATH)" \
|
||||
GO_BUILD_DEPENDS_SRC="$(GO_PKG_BUILD_DEPENDS_SRC)"
|
||||
|
||||
GO_PKG_TARGET_VARS= \
|
||||
GOOS="$(GO_OS)" \
|
||||
GOARCH="$(GO_ARCH)" \
|
||||
GO386="$(GO_386)" \
|
||||
GOAMD64="$(GO_AMD64)" \
|
||||
GOARM="$(GO_ARM)" \
|
||||
GOMIPS="$(GO_MIPS)" \
|
||||
GOMIPS64="$(GO_MIPS64)" \
|
||||
GOPPC64="$(GO_PPC64)" \
|
||||
CGO_ENABLED=1 \
|
||||
CC="$(TARGET_CC)" \
|
||||
CXX="$(TARGET_CXX)" \
|
||||
CGO_CFLAGS="$(filter-out $(GO_CFLAGS_TO_REMOVE),$(TARGET_CFLAGS))" \
|
||||
CGO_CPPFLAGS="$(TARGET_CPPFLAGS)" \
|
||||
CGO_CXXFLAGS="$(filter-out $(GO_CFLAGS_TO_REMOVE),$(TARGET_CXXFLAGS))" \
|
||||
CGO_LDFLAGS="$(TARGET_LDFLAGS)"
|
||||
|
||||
GO_PKG_BUILD_VARS= \
|
||||
GOPATH="$(GO_PKG_BUILD_DIR)" \
|
||||
GOCACHE="$(GO_BUILD_CACHE_DIR)" \
|
||||
GOMODCACHE="$(GO_MOD_CACHE_DIR)" \
|
||||
GOENV=off \
|
||||
GOTOOLCHAIN=local
|
||||
|
||||
GO_PKG_VARS= \
|
||||
$(GO_PKG_TARGET_VARS) \
|
||||
$(GO_PKG_BUILD_VARS)
|
||||
|
||||
GO_PKG_DEFAULT_GCFLAGS= \
|
||||
$(if $(GO_PKG_ENABLE_SPECTRE),-spectre all)
|
||||
|
||||
GO_PKG_DEFAULT_ASMFLAGS= \
|
||||
$(if $(GO_PKG_ENABLE_SPECTRE),-spectre all)
|
||||
|
||||
GO_PKG_DEFAULT_LDFLAGS= \
|
||||
-buildid '$(SOURCE_DATE_EPOCH)' \
|
||||
-linkmode external \
|
||||
-extldflags '$(patsubst -z%,-Wl$(comma)-z$(comma)%,$(TARGET_LDFLAGS))'
|
||||
|
||||
GO_PKG_CUSTOM_LDFLAGS= \
|
||||
$(GO_PKG_LDFLAGS) \
|
||||
$(patsubst %,-X %,$(GO_PKG_LDFLAGS_X))
|
||||
|
||||
GO_PKG_INSTALL_ARGS= \
|
||||
-v \
|
||||
-buildvcs=false \
|
||||
-trimpath \
|
||||
-ldflags "all=$(GO_PKG_DEFAULT_LDFLAGS)" \
|
||||
$(if $(strip $(GO_PKG_DEFAULT_GCFLAGS)),-gcflags "all=$(GO_PKG_DEFAULT_GCFLAGS)") \
|
||||
$(if $(strip $(GO_PKG_DEFAULT_ASMFLAGS)),-asmflags "all=$(GO_PKG_DEFAULT_ASMFLAGS)") \
|
||||
$(if $(GO_PKG_ENABLE_PIE),-buildmode pie) \
|
||||
$(if $(filter $(GO_ARCH),arm),-installsuffix "v$(GO_ARM)") \
|
||||
$(if $(filter $(GO_ARCH),mips mipsle),-installsuffix "$(GO_MIPS)") \
|
||||
$(if $(filter $(GO_ARCH),mips64 mips64le),-installsuffix "$(GO_MIPS64)") \
|
||||
$(if $(strip $(GO_PKG_GCFLAGS)),-gcflags "$(GO_PKG_GCFLAGS) $(GO_PKG_DEFAULT_GCFLAGS)") \
|
||||
$(if $(strip $(GO_PKG_CUSTOM_LDFLAGS)),-ldflags "$(GO_PKG_CUSTOM_LDFLAGS) $(GO_PKG_DEFAULT_LDFLAGS)") \
|
||||
$(if $(strip $(GO_PKG_TAGS)),-tags "$(GO_PKG_TAGS)")
|
||||
|
||||
define GoPackage/Build/Configure
|
||||
$(GO_GENERAL_BUILD_CONFIG_VARS) \
|
||||
$(GO_PKG_BUILD_CONFIG_VARS) \
|
||||
$(SHELL) $(GO_INCLUDE_DIR)/golang-build.sh configure
|
||||
endef
|
||||
|
||||
# $(1) additional arguments for go command line (optional)
|
||||
define GoPackage/Build/Compile
|
||||
$(GO_GENERAL_BUILD_CONFIG_VARS) \
|
||||
$(GO_PKG_BUILD_CONFIG_VARS) \
|
||||
$(GO_PKG_VARS) \
|
||||
$(SHELL) $(GO_INCLUDE_DIR)/golang-build.sh build $(GO_PKG_INSTALL_ARGS) $(1)
|
||||
endef
|
||||
|
||||
define GoPackage/Build/InstallDev
|
||||
$(call GoPackage/Package/Install/Src,$(1))
|
||||
endef
|
||||
|
||||
define GoPackage/Package/Install/Bin
|
||||
$(GO_GENERAL_BUILD_CONFIG_VARS) \
|
||||
$(GO_PKG_BUILD_CONFIG_VARS) \
|
||||
$(SHELL) $(GO_INCLUDE_DIR)/golang-build.sh install_bin "$(1)"
|
||||
endef
|
||||
|
||||
define GoPackage/Package/Install/Src
|
||||
$(GO_GENERAL_BUILD_CONFIG_VARS) \
|
||||
$(GO_PKG_BUILD_CONFIG_VARS) \
|
||||
$(SHELL) $(GO_INCLUDE_DIR)/golang-build.sh install_src "$(1)"
|
||||
endef
|
||||
|
||||
define GoPackage/Package/Install
|
||||
$(if $(filter $(GO_PKG_SOURCE_ONLY),1),, \
|
||||
$(call GoPackage/Package/Install/Bin,$(1)) \
|
||||
)
|
||||
$(call GoPackage/Package/Install/Src,$(1))
|
||||
endef
|
||||
|
||||
|
||||
ifneq ($(strip $(GO_PKG)),)
|
||||
ifeq ($(GO_TARGET_SPECTRE_SUPPORTED),1)
|
||||
PKG_CONFIG_DEPENDS+=CONFIG_GOLANG_SPECTRE
|
||||
endif
|
||||
|
||||
Build/Configure=$(call GoPackage/Build/Configure)
|
||||
Build/Compile=$(call GoPackage/Build/Compile)
|
||||
Hooks/Compile/Post+=Go/CacheCleanup
|
||||
Build/InstallDev=$(call GoPackage/Build/InstallDev,$(1))
|
||||
endif
|
||||
|
||||
define GoPackage
|
||||
ifndef Package/$(1)/install
|
||||
Package/$(1)/install=$$(call GoPackage/Package/Install,$$(1))
|
||||
endif
|
||||
endef
|
||||
|
||||
define GoBinPackage
|
||||
ifndef Package/$(1)/install
|
||||
Package/$(1)/install=$$(call GoPackage/Package/Install/Bin,$$(1))
|
||||
endif
|
||||
endef
|
||||
|
||||
define GoSrcPackage
|
||||
ifndef Package/$(1)/install
|
||||
Package/$(1)/install=$$(call GoPackage/Package/Install/Src,$$(1))
|
||||
endif
|
||||
endef
|
||||
|
|
@ -1,271 +0,0 @@
|
|||
#
|
||||
# Copyright (C) 2018-2023 Jeffery To
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
ifeq ($(origin GO_INCLUDE_DIR),undefined)
|
||||
GO_INCLUDE_DIR:=$(dir $(lastword $(MAKEFILE_LIST)))
|
||||
endif
|
||||
|
||||
|
||||
# Unset environment variables
|
||||
# There are more magic variables to track down, but ain't nobody got time for that
|
||||
|
||||
# From https://pkg.go.dev/cmd/go#hdr-Environment_variables
|
||||
|
||||
# General-purpose environment variables:
|
||||
unexport \
|
||||
GO111MODULE \
|
||||
GCCGO \
|
||||
GOARCH \
|
||||
GOBIN \
|
||||
GOCACHE \
|
||||
GOMODCACHE \
|
||||
GODEBUG \
|
||||
GOENV \
|
||||
GOFLAGS \
|
||||
GOOS \
|
||||
GOPATH \
|
||||
GOROOT \
|
||||
GOTOOLCHAIN \
|
||||
GOTMPDIR \
|
||||
GOWORK
|
||||
# Unmodified:
|
||||
# GOINSECURE
|
||||
# GOPRIVATE
|
||||
# GOPROXY
|
||||
# GONOPROXY
|
||||
# GOSUMDB
|
||||
# GONOSUMDB
|
||||
# GOVCS
|
||||
|
||||
# Environment variables for use with cgo:
|
||||
unexport \
|
||||
AR \
|
||||
CC \
|
||||
CGO_ENABLED \
|
||||
CGO_CFLAGS CGO_CFLAGS_ALLOW CGO_CFLAGS_DISALLOW \
|
||||
CGO_CPPFLAGS CGO_CPPFLAGS_ALLOW CGO_CPPFLAGS_DISALLOW \
|
||||
CGO_CXXFLAGS CGO_CXXFLAGS_ALLOW CGO_CXXFLAGS_DISALLOW \
|
||||
CGO_FFLAGS CGO_FFLAGS_ALLOW CGO_FFLAGS_DISALLOW \
|
||||
CGO_LDFLAGS CGO_LDFLAGS_ALLOW CGO_LDFLAGS_DISALLOW \
|
||||
CXX \
|
||||
FC
|
||||
# Unmodified:
|
||||
# PKG_CONFIG
|
||||
|
||||
# Architecture-specific environment variables:
|
||||
unexport \
|
||||
GOARM \
|
||||
GOARM64 \
|
||||
GO386 \
|
||||
GOAMD64 \
|
||||
GOMIPS \
|
||||
GOMIPS64 \
|
||||
GOPPC64 \
|
||||
GORISCV64 \
|
||||
GOWASM
|
||||
|
||||
# Environment variables for use with code coverage:
|
||||
unexport \
|
||||
GOCOVERDIR
|
||||
|
||||
# Special-purpose environment variables:
|
||||
unexport \
|
||||
GCCGOTOOLDIR \
|
||||
GOEXPERIMENT \
|
||||
GOROOT_FINAL \
|
||||
GO_EXTLINK_ENABLED
|
||||
# Unmodified:
|
||||
# GIT_ALLOW_PROTOCOL
|
||||
|
||||
# From https://pkg.go.dev/runtime#hdr-Environment_Variables
|
||||
unexport \
|
||||
GOGC \
|
||||
GOMEMLIMIT \
|
||||
GOMAXPROCS \
|
||||
GORACE \
|
||||
GOTRACEBACK
|
||||
|
||||
# From https://pkg.go.dev/cmd/cgo#hdr-Using_cgo_with_the_go_command
|
||||
unexport \
|
||||
CC_FOR_TARGET \
|
||||
CXX_FOR_TARGET
|
||||
# Todo:
|
||||
# CC_FOR_${GOOS}_${GOARCH}
|
||||
# CXX_FOR_${GOOS}_${GOARCH}
|
||||
|
||||
# From https://go.dev/doc/install/source#environment
|
||||
unexport \
|
||||
GOHOSTOS \
|
||||
GOHOSTARCH
|
||||
|
||||
# From https://go.dev/src/make.bash
|
||||
unexport \
|
||||
GO_GCFLAGS \
|
||||
GO_LDFLAGS \
|
||||
GO_LDSO \
|
||||
GO_DISTFLAGS \
|
||||
GOBUILDTIMELOGFILE \
|
||||
GOROOT_BOOTSTRAP
|
||||
|
||||
# From https://go.dev/doc/go1.9#parallel-compile
|
||||
unexport \
|
||||
GO19CONCURRENTCOMPILATION
|
||||
|
||||
# From https://go.dev/src/cmd/dist/build.go
|
||||
unexport \
|
||||
BOOT_GO_GCFLAGS \
|
||||
BOOT_GO_LDFLAGS
|
||||
|
||||
# From https://go.dev/src/cmd/dist/buildtool.go
|
||||
unexport \
|
||||
GOBOOTSTRAP_TOOLEXEC
|
||||
|
||||
|
||||
# GOOS / GOARCH
|
||||
|
||||
go_arch=$(subst \
|
||||
aarch64,arm64,$(subst \
|
||||
i386,386,$(subst \
|
||||
mipsel,mipsle,$(subst \
|
||||
mips64el,mips64le,$(subst \
|
||||
powerpc64,ppc64,$(subst \
|
||||
x86_64,amd64,$(1)))))))
|
||||
|
||||
GO_OS:=linux
|
||||
GO_ARCH:=$(call go_arch,$(ARCH))
|
||||
GO_OS_ARCH:=$(GO_OS)_$(GO_ARCH)
|
||||
|
||||
GO_HOST_OS:=$(call tolower,$(HOST_OS))
|
||||
GO_HOST_ARCH:=$(call go_arch,$(subst \
|
||||
armv6l,arm,$(subst \
|
||||
armv7l,arm,$(subst \
|
||||
i686,i386,$(HOST_ARCH)))))
|
||||
GO_HOST_OS_ARCH:=$(GO_HOST_OS)_$(GO_HOST_ARCH)
|
||||
|
||||
ifeq ($(GO_OS_ARCH),$(GO_HOST_OS_ARCH))
|
||||
GO_HOST_TARGET_SAME:=1
|
||||
else
|
||||
GO_HOST_TARGET_DIFFERENT:=1
|
||||
endif
|
||||
|
||||
ifeq ($(GO_ARCH),386)
|
||||
ifeq ($(CONFIG_TARGET_x86_geode)$(CONFIG_TARGET_x86_legacy),y)
|
||||
GO_386:=softfloat
|
||||
else
|
||||
GO_386:=sse2
|
||||
endif
|
||||
|
||||
# -fno-plt: causes "unexpected GOT reloc for non-dynamic symbol" errors
|
||||
GO_CFLAGS_TO_REMOVE:=-fno-plt
|
||||
|
||||
else ifeq ($(GO_ARCH),amd64)
|
||||
GO_AMD64:=v1
|
||||
|
||||
else ifeq ($(GO_ARCH),arm)
|
||||
GO_TARGET_FPU:=$(word 2,$(subst +,$(space),$(call qstrip,$(CONFIG_CPU_TYPE))))
|
||||
|
||||
# FPU names from https://gcc.gnu.org/onlinedocs/gcc-8.4.0/gcc/ARM-Options.html#index-mfpu-1
|
||||
# see also https://github.com/gcc-mirror/gcc/blob/releases/gcc-8.4.0/gcc/config/arm/arm-cpus.in
|
||||
|
||||
ifeq ($(GO_TARGET_FPU),)
|
||||
GO_ARM:=5
|
||||
else ifneq ($(filter $(GO_TARGET_FPU),vfp vfpv2),)
|
||||
GO_ARM:=6
|
||||
else
|
||||
GO_ARM:=7
|
||||
endif
|
||||
|
||||
else ifneq ($(filter $(GO_ARCH),mips mipsle),)
|
||||
ifeq ($(CONFIG_HAS_FPU),y)
|
||||
GO_MIPS:=hardfloat
|
||||
else
|
||||
GO_MIPS:=softfloat
|
||||
endif
|
||||
|
||||
# -mips32r2: conflicts with -march=mips32 set by go
|
||||
GO_CFLAGS_TO_REMOVE:=-mips32r2
|
||||
|
||||
else ifneq ($(filter $(GO_ARCH),mips64 mips64le),)
|
||||
ifeq ($(CONFIG_HAS_FPU),y)
|
||||
GO_MIPS64:=hardfloat
|
||||
else
|
||||
GO_MIPS64:=softfloat
|
||||
endif
|
||||
|
||||
else ifeq ($(GO_ARCH),ppc64)
|
||||
GO_PPC64:=power8
|
||||
|
||||
endif
|
||||
|
||||
|
||||
# Target Go
|
||||
|
||||
GO_ARCH_DEPENDS:=@(aarch64||arm||i386||i686||mips||mips64||mips64el||mipsel||powerpc64||riscv64||x86_64)
|
||||
|
||||
|
||||
# ASLR/PIE
|
||||
|
||||
# From https://go.dev/src/internal/platform/supported.go
|
||||
GO_PIE_SUPPORTED_OS_ARCH:= \
|
||||
android_386 android_amd64 android_arm android_arm64 \
|
||||
linux_386 linux_amd64 linux_arm linux_arm64 \
|
||||
windows_386 windows_amd64 windows_arm windows_arm64 \
|
||||
\
|
||||
darwin_amd64 darwin_arm64 \
|
||||
ios_amd64 ios_arm64 \
|
||||
\
|
||||
freebsd_amd64 \
|
||||
\
|
||||
aix_ppc64 \
|
||||
\
|
||||
linux_loong64 linux_ppc64le linux_riscv64 linux_s390x
|
||||
|
||||
# From https://go.dev/src/cmd/go/internal/work/init.go
|
||||
go_pie_install_suffix=$(if $(filter $(1),aix_ppc64 windows_386 windows_amd64 windows_arm windows_arm64),,shared)
|
||||
|
||||
ifneq ($(filter $(GO_HOST_OS_ARCH),$(GO_PIE_SUPPORTED_OS_ARCH)),)
|
||||
GO_HOST_PIE_SUPPORTED:=1
|
||||
GO_HOST_PIE_INSTALL_SUFFIX:=$(call go_pie_install_suffix,$(GO_HOST_OS_ARCH))
|
||||
endif
|
||||
|
||||
ifneq ($(filter $(GO_OS_ARCH),$(GO_PIE_SUPPORTED_OS_ARCH)),)
|
||||
GO_TARGET_PIE_SUPPORTED:=1
|
||||
GO_TARGET_PIE_INSTALL_SUFFIX:=$(call go_pie_install_suffix,$(GO_OS_ARCH))
|
||||
endif
|
||||
|
||||
|
||||
# Spectre mitigations
|
||||
|
||||
GO_SPECTRE_SUPPORTED_ARCH:=amd64
|
||||
|
||||
ifneq ($(filter $(GO_HOST_ARCH),$(GO_SPECTRE_SUPPORTED_ARCH)),)
|
||||
GO_HOST_SPECTRE_SUPPORTED:=1
|
||||
endif
|
||||
|
||||
ifneq ($(filter $(GO_ARCH),$(GO_SPECTRE_SUPPORTED_ARCH)),)
|
||||
GO_TARGET_SPECTRE_SUPPORTED:=1
|
||||
endif
|
||||
|
||||
|
||||
# General build info
|
||||
|
||||
GO_BUILD_CACHE_DIR:=$(or $(call qstrip,$(CONFIG_GOLANG_BUILD_CACHE_DIR)),$(TMP_DIR)/go-build)
|
||||
GO_MOD_CACHE_DIR:=$(DL_DIR)/go-mod-cache
|
||||
|
||||
GO_MOD_ARGS= \
|
||||
-modcacherw
|
||||
|
||||
GO_GENERAL_BUILD_CONFIG_VARS= \
|
||||
CONFIG_GOLANG_MOD_CACHE_WORLD_READABLE="$(CONFIG_GOLANG_MOD_CACHE_WORLD_READABLE)" \
|
||||
GO_BUILD_CACHE_DIR="$(GO_BUILD_CACHE_DIR)" \
|
||||
GO_MOD_CACHE_DIR="$(GO_MOD_CACHE_DIR)" \
|
||||
GO_MOD_ARGS="$(GO_MOD_ARGS)"
|
||||
|
||||
define Go/CacheCleanup
|
||||
$(GO_GENERAL_BUILD_CONFIG_VARS) \
|
||||
$(SHELL) $(GO_INCLUDE_DIR)/golang-build.sh cache_cleanup
|
||||
endef
|
||||
|
|
@ -1,33 +0,0 @@
|
|||
menu "Configuration"
|
||||
|
||||
config GOLANG_EXTERNAL_BOOTSTRAP_ROOT
|
||||
string "External bootstrap Go root directory"
|
||||
default ""
|
||||
help
|
||||
Path to a working Go tree (>= Go 1.4), with bin, pkg, and src
|
||||
subdirectories and the Go compiler at bin/go.
|
||||
|
||||
If specified, the existing Go installation will be used to
|
||||
compile host (buildroot) Go.
|
||||
|
||||
Leave blank to compile the default bootstrap Go.
|
||||
|
||||
config GOLANG_BUILD_CACHE_DIR
|
||||
string "Go build cache directory"
|
||||
default ""
|
||||
help
|
||||
Store the Go build cache in this directory.
|
||||
If not set, uses '$(TMP_DIR)/go-build'.
|
||||
|
||||
config GOLANG_MOD_CACHE_WORLD_READABLE
|
||||
bool "Ensure Go module cache is world-readable"
|
||||
default n
|
||||
|
||||
config GOLANG_SPECTRE
|
||||
bool "Enable Spectre mitigations"
|
||||
default n
|
||||
depends on x86_64
|
||||
help
|
||||
Currently only available for x86-64 (amd64).
|
||||
|
||||
endmenu
|
||||
|
|
@ -1,432 +0,0 @@
|
|||
#
|
||||
# Copyright (C) 2018-2023 Jeffery To
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
GO_VERSION_MAJOR_MINOR:=1.23
|
||||
GO_VERSION_PATCH:=4
|
||||
|
||||
PKG_NAME:=golang
|
||||
PKG_VERSION:=$(GO_VERSION_MAJOR_MINOR)$(if $(GO_VERSION_PATCH),.$(GO_VERSION_PATCH))
|
||||
PKG_RELEASE:=1
|
||||
|
||||
GO_SOURCE_URLS:=https://dl.google.com/go/ \
|
||||
https://mirrors.ustc.edu.cn/golang/ \
|
||||
https://mirrors.nju.edu.cn/golang/
|
||||
|
||||
PKG_SOURCE:=go$(PKG_VERSION).src.tar.gz
|
||||
PKG_SOURCE_URL:=$(GO_SOURCE_URLS)
|
||||
PKG_HASH:=ad345ac421e90814293a9699cca19dd5238251c3f687980bbcae28495b263531
|
||||
|
||||
PKG_MAINTAINER:=Jeffery To <jeffery.to@gmail.com>
|
||||
PKG_LICENSE:=BSD-3-Clause
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
PKG_CPE_ID:=cpe:/a:golang:go
|
||||
|
||||
PKG_BUILD_DEPENDS:=golang/host
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/go-$(PKG_VERSION)
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
PKG_BUILD_FLAGS:=no-mips16
|
||||
|
||||
PKG_GO_PREFIX:=/usr
|
||||
PKG_GO_VERSION_ID:=$(GO_VERSION_MAJOR_MINOR)
|
||||
|
||||
HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/go-$(PKG_VERSION)
|
||||
HOST_BUILD_PARALLEL:=1
|
||||
|
||||
HOST_GO_PREFIX:=$(STAGING_DIR_HOSTPKG)
|
||||
HOST_GO_VERSION_ID:=cross
|
||||
HOST_GO_ROOT:=$(HOST_GO_PREFIX)/lib/go-$(HOST_GO_VERSION_ID)
|
||||
|
||||
HOST_GO_VALID_OS_ARCH:= \
|
||||
android_386 android_amd64 android_arm android_arm64 \
|
||||
freebsd_386 freebsd_amd64 freebsd_arm freebsd_arm64 \
|
||||
linux_386 linux_amd64 linux_arm linux_arm64 \
|
||||
openbsd_386 openbsd_amd64 openbsd_arm openbsd_arm64 \
|
||||
netbsd_386 netbsd_amd64 netbsd_arm netbsd_arm64 \
|
||||
windows_386 windows_amd64 windows_arm windows_arm64 \
|
||||
\
|
||||
plan9_386 plan9_amd64 plan9_arm \
|
||||
\
|
||||
darwin_amd64 darwin_arm64 \
|
||||
ios_amd64 ios_arm64 \
|
||||
\
|
||||
dragonfly_amd64 \
|
||||
illumos_amd64 \
|
||||
solaris_amd64 \
|
||||
\
|
||||
aix_ppc64 \
|
||||
js_wasm \
|
||||
wasip1_wasm \
|
||||
\
|
||||
freebsd_riscv64 \
|
||||
openbsd_riscv64 \
|
||||
\
|
||||
linux_ppc64 linux_ppc64le \
|
||||
linux_mips linux_mipsle linux_mips64 linux_mips64le \
|
||||
linux_loong64 linux_riscv64 linux_s390x \
|
||||
\
|
||||
openbsd_mips64
|
||||
|
||||
BOOTSTRAP_SOURCE:=go1.4-bootstrap-20171003.tar.gz
|
||||
BOOTSTRAP_SOURCE_URL:=$(GO_SOURCE_URLS)
|
||||
BOOTSTRAP_HASH:=f4ff5b5eb3a3cae1c993723f3eab519c5bae18866b5e5f96fe1102f0cb5c3e52
|
||||
|
||||
BOOTSTRAP_BUILD_DIR:=$(HOST_BUILD_DIR)/.go_bootstrap
|
||||
|
||||
BOOTSTRAP_GO_VALID_OS_ARCH:= \
|
||||
darwin_386 darwin_amd64 \
|
||||
dragonfly_386 dragonfly_amd64 \
|
||||
freebsd_386 freebsd_amd64 freebsd_arm \
|
||||
linux_386 linux_amd64 linux_arm \
|
||||
netbsd_386 netbsd_amd64 netbsd_arm \
|
||||
openbsd_386 openbsd_amd64 \
|
||||
plan9_386 plan9_amd64 \
|
||||
solaris_amd64 \
|
||||
windows_386 windows_amd64
|
||||
|
||||
BOOTSTRAP_1_17_SOURCE:=go1.17.13.src.tar.gz
|
||||
BOOTSTRAP_1_17_SOURCE_URL:=$(GO_SOURCE_URLS)
|
||||
BOOTSTRAP_1_17_HASH:=a1a48b23afb206f95e7bbaa9b898d965f90826f6f1d1fc0c1d784ada0cd300fd
|
||||
|
||||
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
|
||||
include ../golang-package.mk
|
||||
|
||||
PKG_UNPACK:=$(HOST_TAR) -C "$(PKG_BUILD_DIR)" --strip-components=1 -xzf "$(DL_DIR)/$(PKG_SOURCE)"
|
||||
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:=:
|
||||
STRIP:=:
|
||||
|
||||
ifeq ($(GO_TARGET_SPECTRE_SUPPORTED),1)
|
||||
PKG_CONFIG_DEPENDS+=CONFIG_GOLANG_SPECTRE
|
||||
endif
|
||||
|
||||
define Package/golang/Default
|
||||
$(call GoPackage/GoSubMenu)
|
||||
TITLE:=Go programming language
|
||||
URL:=https://go.dev/
|
||||
DEPENDS:=$(GO_ARCH_DEPENDS)
|
||||
endef
|
||||
|
||||
define Package/golang/Default/description
|
||||
The Go programming language is an open source project to make
|
||||
programmers more productive.
|
||||
|
||||
Go is expressive, concise, clean, and efficient. Its concurrency
|
||||
mechanisms make it easy to write programs that get the most out of
|
||||
multicore and networked machines, while its novel type system enables
|
||||
flexible and modular program construction. Go compiles quickly to
|
||||
machine code yet has the convenience of garbage collection and the power
|
||||
of run-time reflection. It's a fast, statically typed, compiled language
|
||||
that feels like a dynamically typed, interpreted language.
|
||||
endef
|
||||
|
||||
# go tool requires source present:
|
||||
# https://github.com/golang/go/issues/4635
|
||||
define Package/golang
|
||||
$(call Package/golang/Default)
|
||||
TITLE+= (compiler)
|
||||
DEPENDS+= +golang-src
|
||||
endef
|
||||
|
||||
define Package/golang/description
|
||||
$(call Package/golang/Default/description)
|
||||
|
||||
This package provides an assembler, compiler, linker, and compiled
|
||||
libraries for the Go programming language.
|
||||
endef
|
||||
|
||||
define Package/golang/config
|
||||
source "$(SOURCE)/Config.in"
|
||||
endef
|
||||
|
||||
define Package/golang-doc
|
||||
$(call Package/golang/Default)
|
||||
TITLE+= (documentation)
|
||||
endef
|
||||
|
||||
define Package/golang-doc/description
|
||||
$(call Package/golang/Default/description)
|
||||
|
||||
This package provides the documentation for the Go programming language.
|
||||
endef
|
||||
|
||||
define Package/golang-src
|
||||
$(call Package/golang/Default)
|
||||
TITLE+= (source files)
|
||||
endef
|
||||
|
||||
define Package/golang-src/description
|
||||
$(call Package/golang/Default/description)
|
||||
|
||||
This package provides the Go programming language source files needed
|
||||
for cross-compilation.
|
||||
endef
|
||||
|
||||
|
||||
# Bootstrap
|
||||
|
||||
BOOTSTRAP_ROOT_DIR:=$(call qstrip,$(CONFIG_GOLANG_EXTERNAL_BOOTSTRAP_ROOT))
|
||||
|
||||
ifeq ($(BOOTSTRAP_ROOT_DIR),)
|
||||
BOOTSTRAP_ROOT_DIR:=$(BOOTSTRAP_BUILD_DIR)
|
||||
|
||||
define Download/golang-bootstrap
|
||||
FILE:=$(BOOTSTRAP_SOURCE)
|
||||
URL:=$(BOOTSTRAP_SOURCE_URL)
|
||||
HASH:=$(BOOTSTRAP_HASH)
|
||||
endef
|
||||
$(eval $(call Download,golang-bootstrap))
|
||||
|
||||
define Bootstrap/Prepare
|
||||
mkdir -p "$(BOOTSTRAP_BUILD_DIR)" && $(BOOTSTRAP_UNPACK) ;
|
||||
endef
|
||||
Hooks/HostPrepare/Post+=Bootstrap/Prepare
|
||||
|
||||
$(eval $(call GoCompiler/AddProfile,Bootstrap,$(BOOTSTRAP_BUILD_DIR),,bootstrap,$(GO_HOST_OS_ARCH)))
|
||||
endif
|
||||
|
||||
|
||||
# Bootstrap 1.17
|
||||
|
||||
define Download/golang-bootstrap-1.17
|
||||
FILE:=$(BOOTSTRAP_1_17_SOURCE)
|
||||
URL:=$(BOOTSTRAP_1_17_SOURCE_URL)
|
||||
HASH:=$(BOOTSTRAP_1_17_HASH)
|
||||
endef
|
||||
$(eval $(call Download,golang-bootstrap-1.17))
|
||||
|
||||
define Bootstrap-1.17/Prepare
|
||||
mkdir -p "$(BOOTSTRAP_1_17_BUILD_DIR)" && $(BOOTSTRAP_1_17_UNPACK) ;
|
||||
endef
|
||||
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
|
||||
|
||||
ifeq ($(GO_HOST_PIE_SUPPORTED),1)
|
||||
HOST_GO_ENABLE_PIE:=1
|
||||
endif
|
||||
|
||||
# when using GO_LDFLAGS to set buildmode=pie, the PIE install suffix
|
||||
# does not apply (we also delete the std lib during Host/Install)
|
||||
|
||||
$(eval $(call GoCompiler/AddProfile,Host,$(HOST_BUILD_DIR),$(HOST_GO_PREFIX),$(HOST_GO_VERSION_ID),$(GO_HOST_OS_ARCH),$(HOST_GO_INSTALL_SUFFIX)))
|
||||
|
||||
HOST_GO_VARS= \
|
||||
GOHOSTARCH="$(GO_HOST_ARCH)" \
|
||||
GOCACHE="$(GO_BUILD_CACHE_DIR)" \
|
||||
GOENV=off \
|
||||
CC="$(HOSTCC_NOCACHE)" \
|
||||
CXX="$(HOSTCXX_NOCACHE)"
|
||||
|
||||
define Host/Configure
|
||||
$(call GoCompiler/Bootstrap/CheckHost,$(BOOTSTRAP_GO_VALID_OS_ARCH))
|
||||
$(call GoCompiler/Host/CheckHost,$(HOST_GO_VALID_OS_ARCH))
|
||||
|
||||
mkdir -p "$(GO_BUILD_CACHE_DIR)"
|
||||
endef
|
||||
|
||||
define Host/Compile
|
||||
$(call GoCompiler/Bootstrap/Make, \
|
||||
$(HOST_GO_VARS) \
|
||||
)
|
||||
|
||||
$(call GoCompiler/Bootstrap-1.17/Make, \
|
||||
GOROOT_BOOTSTRAP="$(BOOTSTRAP_ROOT_DIR)" \
|
||||
$(HOST_GO_VARS) \
|
||||
)
|
||||
|
||||
$(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) \
|
||||
)
|
||||
endef
|
||||
|
||||
# if host and target os/arch are the same,
|
||||
# when go compiles a program, it will use the host std lib
|
||||
# so remove it now and force go to rebuild std for target later
|
||||
define Host/Install
|
||||
$(call Host/Uninstall)
|
||||
|
||||
$(call GoCompiler/Host/Install/Bin,)
|
||||
$(call GoCompiler/Host/Install/Src,)
|
||||
|
||||
$(call GoCompiler/Host/Install/BinLinks,)
|
||||
|
||||
rm -rf "$(HOST_GO_ROOT)/pkg/$(GO_HOST_OS_ARCH)$(if $(HOST_GO_INSTALL_SUFFIX),_$(HOST_GO_INSTALL_SUFFIX))"
|
||||
|
||||
$(INSTALL_DIR) "$(HOST_GO_ROOT)/openwrt"
|
||||
$(INSTALL_BIN) ./files/go-gcc-helper "$(HOST_GO_ROOT)/openwrt/"
|
||||
$(LN) go-gcc-helper "$(HOST_GO_ROOT)/openwrt/gcc"
|
||||
$(LN) go-gcc-helper "$(HOST_GO_ROOT)/openwrt/g++"
|
||||
endef
|
||||
|
||||
define Host/Uninstall
|
||||
rm -rf "$(HOST_GO_ROOT)/openwrt"
|
||||
|
||||
$(call GoCompiler/Host/Uninstall/BinLinks,)
|
||||
|
||||
$(call GoCompiler/Host/Uninstall,)
|
||||
endef
|
||||
|
||||
|
||||
# Target
|
||||
|
||||
ifeq ($(GO_PKG_ENABLE_PIE),1)
|
||||
PKG_GO_INSTALL_SUFFIX:=$(GO_TARGET_PIE_INSTALL_SUFFIX)
|
||||
endif
|
||||
|
||||
$(eval $(call GoCompiler/AddProfile,Package,$(PKG_BUILD_DIR),$(PKG_GO_PREFIX),$(PKG_GO_VERSION_ID),$(GO_OS_ARCH),$(PKG_GO_INSTALL_SUFFIX)))
|
||||
|
||||
PKG_GO_ZBOOTSTRAP_MODS:= \
|
||||
s/defaultGO386 = `[^`]*`/defaultGO386 = `$(or $(GO_386),sse2)`/; \
|
||||
s/defaultGOAMD64 = `[^`]*`/defaultGOAMD64 = `$(or $(GO_AMD64),v1)`/; \
|
||||
s/defaultGOARM = `[^`]*`/defaultGOARM = `$(or $(GO_ARM),7)`/; \
|
||||
s/defaultGOMIPS = `[^`]*`/defaultGOMIPS = `$(or $(GO_MIPS),hardfloat)`/; \
|
||||
s/defaultGOMIPS64 = `[^`]*`/defaultGOMIPS64 = `$(or $(GO_MIPS64),hardfloat)`/; \
|
||||
s/defaultGOPPC64 = `[^`]*`/defaultGOPPC64 = `$(or $(GO_PPC64),power8)`/;
|
||||
|
||||
PKG_GO_ZBOOTSTRAP_PATH:=$(PKG_BUILD_DIR)/src/internal/buildcfg/zbootstrap.go
|
||||
|
||||
PKG_GO_VARS= \
|
||||
GOHOSTARCH="$(GO_HOST_ARCH)" \
|
||||
GOCACHE="$(GO_BUILD_CACHE_DIR)" \
|
||||
GOENV=off \
|
||||
GO_GCC_HELPER_PATH="$$$$PATH" \
|
||||
CC=gcc \
|
||||
CXX=g++ \
|
||||
PKG_CONFIG=pkg-config \
|
||||
PATH="$(HOST_GO_ROOT)/openwrt:$$$$PATH"
|
||||
|
||||
PKG_GO_GCFLAGS= \
|
||||
$(if $(GO_PKG_ENABLE_SPECTRE),-spectre all)
|
||||
|
||||
PKG_GO_ASMFLAGS= \
|
||||
$(if $(GO_PKG_ENABLE_SPECTRE),-spectre all)
|
||||
|
||||
PKG_GO_LDFLAGS= \
|
||||
-buildid '$(SOURCE_DATE_EPOCH)' \
|
||||
-linkmode external \
|
||||
-extldflags '$(patsubst -z%,-Wl$(comma)-z$(comma)%,$(TARGET_LDFLAGS))' \
|
||||
$(if $(CONFIG_NO_STRIP)$(CONFIG_DEBUG),,-s -w)
|
||||
|
||||
PKG_GO_INSTALL_ARGS= \
|
||||
-buildvcs=false \
|
||||
-trimpath \
|
||||
-ldflags "all=$(PKG_GO_LDFLAGS)" \
|
||||
$(if $(PKG_GO_GCFLAGS),-gcflags "all=$(PKG_GO_GCFLAGS)") \
|
||||
$(if $(PKG_GO_ASMFLAGS),-asmflags "all=$(PKG_GO_ASMFLAGS)") \
|
||||
$(if $(filter $(GO_PKG_ENABLE_PIE),1),-buildmode pie)
|
||||
|
||||
define Build/Configure
|
||||
mkdir -p "$(GO_BUILD_CACHE_DIR)"
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
@echo "Building target Go first stage"
|
||||
|
||||
$(call GoCompiler/Package/Make, \
|
||||
GOROOT_BOOTSTRAP="$(HOST_GO_ROOT)" \
|
||||
GO_GCC_HELPER_CC="$(HOSTCC)" \
|
||||
GO_GCC_HELPER_CXX="$(HOSTCXX)" \
|
||||
$(PKG_GO_VARS) \
|
||||
)
|
||||
|
||||
$(SED) '$(PKG_GO_ZBOOTSTRAP_MODS)' "$(PKG_GO_ZBOOTSTRAP_PATH)"
|
||||
|
||||
( \
|
||||
if echo 'int main() { return 0; }' | $(TARGET_CC) -o $(PKG_BUILD_DIR)/test-ldso -x c - > /dev/null 2>&1; then \
|
||||
LDSO=$$$$( \
|
||||
readelf -l $(PKG_BUILD_DIR)/test-ldso | \
|
||||
sed -n -e 's/^.*interpreter: \(.*\)[]]/\1/p' \
|
||||
) ; \
|
||||
fi ; \
|
||||
$(SED) "s,defaultGO_LDSO = \`[^\`]*\`,defaultGO_LDSO = \`$$$$LDSO\`," "$(PKG_GO_ZBOOTSTRAP_PATH)" ; \
|
||||
)
|
||||
|
||||
@echo "Building target Go second stage"
|
||||
|
||||
( \
|
||||
cd "$(PKG_BUILD_DIR)/bin" ; \
|
||||
export $(GO_PKG_TARGET_VARS) ; \
|
||||
$(CP) go go-host ; \
|
||||
GO_GCC_HELPER_CC="$(TARGET_CC)" \
|
||||
GO_GCC_HELPER_CXX="$(TARGET_CXX)" \
|
||||
$(PKG_GO_VARS) \
|
||||
./go-host install -a $(PKG_GO_INSTALL_ARGS) std cmd ; \
|
||||
retval="$$$$?" ; \
|
||||
rm -f go-host ; \
|
||||
exit "$$$$retval" ; \
|
||||
)
|
||||
endef
|
||||
|
||||
define Package/golang/install
|
||||
$(call GoCompiler/Package/Install/Bin,$(1)$(PKG_GO_PREFIX))
|
||||
$(call GoCompiler/Package/Install/BinLinks,$(1)$(PKG_GO_PREFIX))
|
||||
endef
|
||||
|
||||
define Package/golang-doc/install
|
||||
$(call GoCompiler/Package/Install/Doc,$(1)$(PKG_GO_PREFIX))
|
||||
endef
|
||||
|
||||
define Package/golang-src/install
|
||||
$(call GoCompiler/Package/Install/Src,$(1)$(PKG_GO_PREFIX))
|
||||
endef
|
||||
|
||||
# src/debug contains ELF executables as test data
|
||||
# and they reference these libraries
|
||||
# we need to call this in Package/$(1)/extra_provides
|
||||
# to pass CheckDependencies in include/package-ipkg.mk
|
||||
define Package/golang-src/extra_provides
|
||||
echo 'libc.so.6'
|
||||
endef
|
||||
|
||||
|
||||
$(eval $(call HostBuild))
|
||||
$(eval $(call BuildPackage,golang))
|
||||
$(eval $(call BuildPackage,golang-doc))
|
||||
$(eval $(call BuildPackage,golang-src))
|
||||
|
|
@ -1,47 +0,0 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# Copyright (C) 2018, 2020 Jeffery To
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
me=go-gcc-helper
|
||||
name="${0##*/}"
|
||||
|
||||
log() {
|
||||
# shellcheck disable=SC2039
|
||||
local IFS=" "
|
||||
printf '%s\n' "$me: $*"
|
||||
}
|
||||
|
||||
case "$name" in
|
||||
gcc)
|
||||
if [ -z "$GO_GCC_HELPER_CC" ]; then
|
||||
log "missing GO_GCC_HELPER_CC"
|
||||
exit 1
|
||||
fi
|
||||
cmd="$GO_GCC_HELPER_CC"
|
||||
;;
|
||||
g++)
|
||||
if [ -z "$GO_GCC_HELPER_CXX" ]; then
|
||||
log "missing GO_GCC_HELPER_CXX"
|
||||
exit 1
|
||||
fi
|
||||
cmd="$GO_GCC_HELPER_CXX"
|
||||
;;
|
||||
*)
|
||||
log "unknown command \"$name\""
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ -n "$GO_GCC_HELPER_PATH" ]; then
|
||||
export PATH="$GO_GCC_HELPER_PATH"
|
||||
else
|
||||
log "missing GO_GCC_HELPER_PATH"
|
||||
fi
|
||||
|
||||
log "running $cmd $*"
|
||||
|
||||
$cmd "$@"
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
[ "$1" = golang ] || exit 0
|
||||
|
||||
go version | grep -F " go$PKG_VERSION "
|
||||
|
|
@ -1,60 +0,0 @@
|
|||
#
|
||||
# Copyright (C) 2022 Ycarus (Yannick Chabanois) <ycarus@zugaina.org> for OpenMPTCProuter
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=grpcurl
|
||||
PKG_VERSION:=1.8.6
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE:=v$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=https://github.com/fullstorydev/grpcurl/archive/refs/tags/
|
||||
PKG_HASH:=18b457f644baabeef0de350596dd8d23563586ee94a3ed3cb290063e097ab934
|
||||
|
||||
PKG_LICENSE:=MIT
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
PKG_MAINTAINER:=Yannick Chabanois <ycarus@zugaina.org>
|
||||
|
||||
PKG_BUILD_DEPENDS:=golang/host
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
PKG_USE_MIPS16:=0
|
||||
|
||||
GO_PKG:=github.com/fullstorydev/grpcurl
|
||||
GO_PKG_BUILD_PKG:=github.com/fullstorydev/grpcurl/cmd/grpcurl
|
||||
GO_PKG_LDFLAGS_X:= \
|
||||
$(GO_PKG)/constant.Version=$(PKG_VERSION) \
|
||||
$(GO_PKG)/constant.Commit=v$(PKG_VERSION)
|
||||
GO_PKG_LDFLAGS:=-s -w
|
||||
GO_PKG_TAGS:=master
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(TOPDIR)/feeds/packages/lang/golang/golang-package.mk
|
||||
|
||||
define Package/grpcurl
|
||||
TITLE:=grpcurl is a command-line tool that lets you interact with gRPC servers
|
||||
URL:=https://github.com/fullstorydev/grpcurl
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
DEPENDS:=$(GO_ARCH_DEPENDS) +protobuf
|
||||
endef
|
||||
|
||||
define Package/grpcurl/description
|
||||
grpcurl is a command-line tool that lets you interact with gRPC servers. It's basically curl for gRPC servers.
|
||||
|
||||
The main purpose for this tool is to invoke RPC methods on a gRPC server from the command-line. gRPC servers use a binary encoding on the wire (protocol buffers, or "protobufs" for short). So they are basically impossible to interact with using regular curl (and older versions of curl that do not support HTTP/2 are of course non-starters). This program accepts messages using JSON encoding, which is much more friendly for both humans and scripts.
|
||||
endef
|
||||
|
||||
define Package/v2ray-core/install
|
||||
$(call GoPackage/Package/Install/Bin,$(PKG_INSTALL_DIR))
|
||||
|
||||
$(INSTALL_DIR) $(1)/usr/bin
|
||||
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/grpcurl $(1)/usr/bin
|
||||
endef
|
||||
|
||||
$(eval $(call GoBinPackage,grpcurl))
|
||||
$(eval $(call BuildPackage,grpcurl))
|
||||
|
|
@ -1,37 +0,0 @@
|
|||
#
|
||||
# Copyright (C) 2018-2023 Ycarus (Yannick Chabanois) <ycarus@zugaina.org>
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=ipcalc
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_URL:=https://gitlab.com/ipcalc/ipcalc.git
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=d8a2fe29a89f0f9f0d44a7b15e260c74f0e8388b
|
||||
PKG_MAINTAINER:=Ycarus (Yannick Chabanois) <ycarus@zugaina.org>
|
||||
PKG_LICENSE:=GPL-2.0
|
||||
PKG_LICENSE_FILE:=COPYING
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
MAKE_FLAGS += USE_GEOIP=no USE_MAXMIND=no
|
||||
|
||||
define Package/ipcalc
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
MAINTAINER:=Ycarus (Yannick Chabanois) <ycarus@zugaina.org>
|
||||
TITLE:=Modern tool to assist in network address calculations for IPv4 and IPv6.
|
||||
endef
|
||||
|
||||
define Package/ipcalc/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/ipcalc $(1)/usr/sbin/ipcalc
|
||||
endef
|
||||
|
||||
|
||||
$(eval $(call BuildPackage,$(PKG_NAME)))
|
||||
113
iperf3/Makefile
113
iperf3/Makefile
|
|
@ -1,113 +0,0 @@
|
|||
#
|
||||
# Copyright (C) 2007-2010 OpenWrt.org
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=iperf
|
||||
PKG_VERSION:=3.18
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=https://downloads.es.net/pub/iperf
|
||||
PKG_HASH:=c0618175514331e766522500e20c94bfb293b4424eb27d7207fb427b88d20bab
|
||||
|
||||
PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
|
||||
PKG_LICENSE:=BSD-3-Clause
|
||||
PKG_CPE_ID:=cpe:/a:es:iperf3
|
||||
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
PKG_INSTALL:=1
|
||||
|
||||
PKG_FIXUP:=autoreconf
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
DISABLE_NLS:=
|
||||
|
||||
define Package/iperf3/default
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
TITLE:=Internet Protocol bandwidth measuring tool
|
||||
URL:=https://github.com/esnet/iperf
|
||||
endef
|
||||
|
||||
define Package/iperf3
|
||||
$(call Package/iperf3/default)
|
||||
VARIANT:=nossl
|
||||
DEPENDS:=+libiperf3
|
||||
endef
|
||||
|
||||
define Package/iperf3-ssl
|
||||
$(call Package/iperf3/default)
|
||||
TITLE+= with iperf_auth support
|
||||
VARIANT:=ssl
|
||||
DEPENDS:=+libopenssl +libatomic
|
||||
CONFLICTS:=iperf3
|
||||
endef
|
||||
|
||||
define Package/libiperf3
|
||||
SECTION:=libs
|
||||
CATEGORY:=Libraries
|
||||
TITLE:=Internet Protocol bandwidth measuring library
|
||||
URL:=https://github.com/esnet/iperf
|
||||
DEPENDS+=+libatomic
|
||||
endef
|
||||
|
||||
TARGET_CFLAGS += -D_GNU_SOURCE
|
||||
TARGET_LDFLAGS += -latomic
|
||||
|
||||
ifeq ($(BUILD_VARIANT),ssl)
|
||||
CONFIGURE_ARGS += --with-openssl="$(STAGING_DIR)/usr" --disable-shared
|
||||
else
|
||||
CONFIGURE_ARGS += --without-openssl
|
||||
endif
|
||||
|
||||
CONFIGURE_ARGS += --without-sctp
|
||||
|
||||
MAKE_FLAGS += noinst_PROGRAMS=
|
||||
|
||||
define Package/iperf3/description
|
||||
Iperf is a modern alternative for measuring TCP and UDP bandwidth
|
||||
performance, allowing the tuning of various parameters and
|
||||
characteristics.
|
||||
endef
|
||||
|
||||
define Package/libiperf3/description
|
||||
Libiperf is a library providing an API for iperf3 functionality.
|
||||
endef
|
||||
|
||||
define Build/InstallDev
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(INSTALL_DIR) $(1)/usr/include
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libiperf.* $(1)/usr/lib/
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
|
||||
endef
|
||||
|
||||
# autoreconf fails if the README file isn't present
|
||||
define Build/Prepare
|
||||
$(call Build/Prepare/Default)
|
||||
touch $(PKG_BUILD_DIR)/README
|
||||
endef
|
||||
|
||||
define Package/iperf3/install
|
||||
$(INSTALL_DIR) $(1)/usr/bin
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/iperf3 $(1)/usr/bin/
|
||||
endef
|
||||
|
||||
define Package/iperf3-ssl/install
|
||||
$(INSTALL_DIR) $(1)/usr/bin
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/iperf3 $(1)/usr/bin/
|
||||
endef
|
||||
|
||||
define Package/libiperf3/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libiperf.so.* $(1)/usr/lib
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,iperf3))
|
||||
$(eval $(call BuildPackage,iperf3-ssl))
|
||||
$(eval $(call BuildPackage,libiperf3))
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
From fe09305eb6f907e4eb637b8edd0c8a986187d1dd Mon Sep 17 00:00:00 2001
|
||||
From: Rosen Penev <rosenp@gmail.com>
|
||||
Date: Sat, 8 Jun 2024 15:23:51 -0700
|
||||
Subject: [PATCH] fix crash under big endian musl
|
||||
|
||||
iperf_printf is using an int format here but an int64_t variable. The format only needs the first 3 digits. Cast to int to fix it.
|
||||
---
|
||||
src/iperf_api.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
--- a/src/iperf_api.c
|
||||
+++ b/src/iperf_api.c
|
||||
@@ -4137,7 +4137,7 @@ iperf_print_results(struct iperf_test *t
|
||||
iperf_printf(test, report_sender_not_available_summary_format, "SUM");
|
||||
}
|
||||
else {
|
||||
- iperf_printf(test, report_sum_bw_retrans_format, mbuf, start_time, sender_time, ubuf, nbuf, total_retransmits, report_sender);
|
||||
+ iperf_printf(test, report_sum_bw_retrans_format, mbuf, start_time, sender_time, ubuf, nbuf, (int)total_retransmits, report_sender);
|
||||
}
|
||||
} else {
|
||||
/* Summary sum, TCP without retransmits. */
|
||||
|
|
@ -1,266 +0,0 @@
|
|||
From cf75cf46785871330717a6d2c889abeb7bbd7bfd 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
|
||||
|
||||
The Multipath TCP (MPTCP) protocol (v1 / RFC 8684) has been added in
|
||||
the upstream Linux kernel since v5.6.
|
||||
|
||||
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
|
||||
|
||||
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>
|
||||
---
|
||||
configure.ac | 12 ++++++++++++
|
||||
src/iperf.h | 1 +
|
||||
src/iperf3.1 | 4 ++++
|
||||
src/iperf_api.c | 19 ++++++++++++++++++-
|
||||
src/iperf_locale.c | 3 +++
|
||||
src/iperf_tcp.c | 18 +++++++++++++++---
|
||||
src/net.c | 10 +++++-----
|
||||
src/net.h | 2 +-
|
||||
8 files changed, 59 insertions(+), 10 deletions(-)
|
||||
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index 66c1e97a5..22c2a95cf 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -337,6 +337,18 @@ if test "x$iperf3_cv_header_tcp_info_snd_wnd" = "xyes"; then
|
||||
AC_DEFINE([HAVE_TCP_INFO_SND_WND], [1], [Have tcpi_snd_wnd field in tcp_info.])
|
||||
fi
|
||||
|
||||
+# Check for IPPROTO_MPTCP (Linux)
|
||||
+AC_CACHE_CHECK([MPTCP protocol],
|
||||
+[iperf3_cv_header_ipproto_mptcp],
|
||||
+AC_COMPILE_IFELSE(
|
||||
+ [AC_LANG_PROGRAM([[#include <netinet/in.h>]],
|
||||
+ [[int foo = IPPROTO_MPTCP;]])],
|
||||
+ iperf3_cv_header_ipproto_mptcp=yes,
|
||||
+ iperf3_cv_header_ipproto_mptcp=no))
|
||||
+if test "x$iperf3_cv_header_ipproto_mptcp" = "xyes"; then
|
||||
+ AC_DEFINE([HAVE_IPPROTO_MPTCP], [1], [Have MPTCP protocol.])
|
||||
+fi
|
||||
+
|
||||
# Check if we need -lrt for clock_gettime
|
||||
AC_SEARCH_LIBS(clock_gettime, [rt posix4])
|
||||
# Check for clock_gettime support
|
||||
diff --git a/src/iperf.h b/src/iperf.h
|
||||
index 202d3016f..4043031b3 100644
|
||||
--- a/src/iperf.h
|
||||
+++ b/src/iperf.h
|
||||
@@ -353,6 +353,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 f8eff48d2..9e425cabc 100644
|
||||
--- a/src/iperf3.1
|
||||
+++ b/src/iperf3.1
|
||||
@@ -202,6 +202,10 @@ iperf-3.17, OAEP padding is used, however this is a breaking change
|
||||
that is not compatible with older iperf3 versions. Use this option to
|
||||
preserve the less secure, but more compatible, behavior.
|
||||
.TP
|
||||
+.BR -m ", " --mptcp " "
|
||||
+use mptcp variant for the current protocol. This only applies to
|
||||
+TCP and enables MPTCP usage.
|
||||
+.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 fa06dc830..419b48657 100644
|
||||
--- a/src/iperf_api.c
|
||||
+++ b/src/iperf_api.c
|
||||
@@ -1149,6 +1149,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},
|
||||
+#if defined(HAVE_IPPROTO_MPTCP)
|
||||
+ {"mptcp", no_argument, NULL, 'm'},
|
||||
+#endif
|
||||
{"debug", optional_argument, NULL, 'd'},
|
||||
{"help", no_argument, NULL, 'h'},
|
||||
{NULL, 0, NULL, 0}
|
||||
@@ -1174,7 +1177,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) {
|
||||
+ 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:mhX:", longopts, NULL)) != -1) {
|
||||
switch (flag) {
|
||||
case 'p':
|
||||
portno = atoi(optarg);
|
||||
@@ -1647,6 +1650,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(HAVE_IPPROTO_MPTCP)
|
||||
+ case 'm':
|
||||
+ set_protocol(test, Ptcp);
|
||||
+ test->mptcp = 1;
|
||||
+ break;
|
||||
+#endif
|
||||
case 'h':
|
||||
usage_long(stdout);
|
||||
exit(0);
|
||||
@@ -2259,6 +2268,10 @@ send_parameters(struct iperf_test *test)
|
||||
cJSON_AddTrueToObject(j, "reverse");
|
||||
if (test->bidirectional)
|
||||
cJSON_AddTrueToObject(j, "bidirectional");
|
||||
+#if defined(HAVE_IPPROTO_MPTCP)
|
||||
+ 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)
|
||||
@@ -2375,6 +2388,10 @@ get_parameters(struct iperf_test *test)
|
||||
iperf_set_test_reverse(test, 1);
|
||||
if ((j_p = iperf_cJSON_GetObjectItemType(j, "bidirectional", cJSON_True)) != NULL)
|
||||
iperf_set_test_bidirectional(test, 1);
|
||||
+#if defined(HAVE_IPPROTO_MPTCP)
|
||||
+ if ((j_p = iperf_cJSON_GetObjectItemType(j, "mptcp", cJSON_True)) != NULL)
|
||||
+ test->mptcp = 1;
|
||||
+#endif
|
||||
if ((j_p = iperf_cJSON_GetObjectItemType(j, "window", cJSON_Number)) != NULL)
|
||||
test->settings->socket_bufsize = j_p->valueint;
|
||||
if ((j_p = iperf_cJSON_GetObjectItemType(j, "len", cJSON_Number)) != NULL)
|
||||
diff --git a/src/iperf_locale.c b/src/iperf_locale.c
|
||||
index 32883da84..f1d89e298 100644
|
||||
--- a/src/iperf_locale.c
|
||||
+++ b/src/iperf_locale.c
|
||||
@@ -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(HAVE_IPPROTO_MPTCP)
|
||||
+ " -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 481c09dc8..2c10d7df5 100644
|
||||
--- a/src/iperf_tcp.c
|
||||
+++ b/src/iperf_tcp.c
|
||||
@@ -184,9 +184,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->no_delay || test->mptcp || test->settings->mss || test->settings->socket_bufsize) {
|
||||
struct addrinfo hints, *res;
|
||||
char portstr[6];
|
||||
+ int proto = 0;
|
||||
|
||||
FD_CLR(s, &test->read_set);
|
||||
close(s);
|
||||
@@ -212,7 +213,12 @@ iperf_tcp_listen(struct iperf_test *test)
|
||||
return -1;
|
||||
}
|
||||
|
||||
- if ((s = socket(res->ai_family, SOCK_STREAM, 0)) < 0) {
|
||||
+#if defined(HAVE_IPPROTO_MPTCP)
|
||||
+ if (test->mptcp)
|
||||
+ proto = IPPROTO_MPTCP;
|
||||
+#endif
|
||||
+
|
||||
+ if ((s = socket(res->ai_family, SOCK_STREAM, proto)) < 0) {
|
||||
freeaddrinfo(res);
|
||||
i_errno = IESTREAMLISTEN;
|
||||
return -1;
|
||||
@@ -380,8 +386,14 @@ iperf_tcp_connect(struct iperf_test *test)
|
||||
socklen_t optlen;
|
||||
int saved_errno;
|
||||
int rcvbuf_actual, sndbuf_actual;
|
||||
+ int proto = 0;
|
||||
+
|
||||
+#if defined(HAVE_IPPROTO_MPTCP)
|
||||
+ 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, 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;
|
||||
diff --git a/src/net.c b/src/net.c
|
||||
index b693ea7fb..febf20885 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 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;
|
||||
@@ -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, type, proto);
|
||||
if (s < 0) {
|
||||
if (local)
|
||||
freeaddrinfo(local_res);
|
||||
@@ -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, 0, local, bind_dev, local_port, server, port, &server_res);
|
||||
if (s < 0) {
|
||||
return -1;
|
||||
}
|
||||
diff --git a/src/net.h b/src/net.h
|
||||
index 859c52cef..fb78d289b 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 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);
|
||||
|
|
@ -1,552 +0,0 @@
|
|||
From 197d8ba733f0502985abb5b0a22bf9f71c2596a7 Mon Sep 17 00:00:00 2001
|
||||
From: David Bar-On <david.cdb004@gmail.com>
|
||||
Date: Mon, 25 Mar 2024 22:11:49 +0200
|
||||
Subject: [PATCH] Add SOCKS5 Proxy support for TCP
|
||||
|
||||
---
|
||||
src/iperf.h | 8 ++
|
||||
src/iperf_api.c | 250 ++++++++++++++++++++++++++++++++++++++++-
|
||||
src/iperf_api.h | 13 ++-
|
||||
src/iperf_client_api.c | 27 ++++-
|
||||
src/iperf_error.c | 10 ++
|
||||
src/iperf_locale.c | 2 +
|
||||
src/iperf_tcp.c | 22 +++-
|
||||
7 files changed, 323 insertions(+), 9 deletions(-)
|
||||
|
||||
diff --git a/src/iperf.h b/src/iperf.h
|
||||
index dc3c0d1df..9823dc180 100644
|
||||
--- a/src/iperf.h
|
||||
+++ b/src/iperf.h
|
||||
@@ -343,6 +343,14 @@ struct iperf_test
|
||||
int timestamps; /* --timestamps */
|
||||
char *timestamp_format;
|
||||
|
||||
+ char *socks5_host; /* --socks5 option */
|
||||
+ uint16_t socks5_port; /* --socks5 option optional value */
|
||||
+ char *socks5_username; /* --socks5 option optional value */
|
||||
+ char *socks5_password; /* --socks5 option optional value */
|
||||
+ char socks5_bind_atyp; /* from socks5 CONNECT response ATYP */
|
||||
+ char *socks5_bind_host; /* from socks5 CONNECT response BIND.ADDR*/
|
||||
+ uint16_t socks5_bind_port; /* from socks5 CONNECT response BIND.PORT */
|
||||
+
|
||||
char *json_output_string; /* rendered JSON output if json_output is set */
|
||||
/* Select related parameters */
|
||||
int max_fd;
|
||||
diff --git a/src/iperf_api.c b/src/iperf_api.c
|
||||
index 4765d4e97..ca47f708d 100644
|
||||
--- a/src/iperf_api.c
|
||||
+++ b/src/iperf_api.c
|
||||
@@ -115,7 +115,7 @@ usage()
|
||||
void
|
||||
usage_long(FILE *f)
|
||||
{
|
||||
- fprintf(f, usage_longstr, DEFAULT_NO_MSG_RCVD_TIMEOUT, UDP_RATE / (1024*1024), DEFAULT_PACING_TIMER, DURATION, DEFAULT_TCP_BLKSIZE / 1024, DEFAULT_UDP_BLKSIZE);
|
||||
+ fprintf(f, usage_longstr, DEFAULT_NO_MSG_RCVD_TIMEOUT, UDP_RATE / (1024*1024), DEFAULT_PACING_TIMER, DURATION, DEFAULT_TCP_BLKSIZE / 1024, DEFAULT_UDP_BLKSIZE, SOCKS5_DEFAULT_PORT);
|
||||
}
|
||||
|
||||
|
||||
@@ -1100,6 +1100,7 @@ iperf_parse_arguments(struct iperf_test *test, int argc, char **argv)
|
||||
{"version6", no_argument, NULL, '6'},
|
||||
{"tos", required_argument, NULL, 'S'},
|
||||
{"dscp", required_argument, NULL, OPT_DSCP},
|
||||
+ {"socks5", required_argument, NULL, OPT_SOCKS5},
|
||||
{"extra-data", required_argument, NULL, OPT_EXTRA_DATA},
|
||||
#if defined(HAVE_FLOWLABEL)
|
||||
{"flowlabel", required_argument, NULL, 'L'},
|
||||
@@ -1157,7 +1158,7 @@ iperf_parse_arguments(struct iperf_test *test, int argc, char **argv)
|
||||
char* comma;
|
||||
#endif /* HAVE_CPU_AFFINITY */
|
||||
char* slash;
|
||||
- char *p, *p1;
|
||||
+ char *p, *p1, *p2;
|
||||
struct xbind_entry *xbe;
|
||||
double farg;
|
||||
int rcv_timeout_in = 0;
|
||||
@@ -1433,6 +1434,47 @@ iperf_parse_arguments(struct iperf_test *test, int argc, char **argv)
|
||||
}
|
||||
client_flag = 1;
|
||||
break;
|
||||
+ case OPT_SOCKS5: // Format: "[username:password@]<host addr/fqdn>[:port]"
|
||||
+ if (strlen(optarg) <= 0) {
|
||||
+ i_errno = IESOCKS5HOST;
|
||||
+ return -1;
|
||||
+ }
|
||||
+ p1 = strtok(optarg, "@"); // p1 -> user:password
|
||||
+ if (p1 == NULL) {
|
||||
+ i_errno = IESOCKS5HOST;
|
||||
+ return -1;
|
||||
+ }
|
||||
+ p = strtok(NULL, "@"); // p -> host[:port]
|
||||
+ if (p == NULL) {
|
||||
+ p = p1;
|
||||
+ p1 = NULL;
|
||||
+ }
|
||||
+ p2 = strtok(p, ":"); // parse host[:port]
|
||||
+ if (strlen(p2) <= 0) {
|
||||
+ i_errno = IESOCKS5HOST;
|
||||
+ return -1;
|
||||
+ }
|
||||
+ test->socks5_host = strdup(p2);
|
||||
+ p2 = strtok(NULL, ":");
|
||||
+ if (p2 && strlen(p2) > 0) {
|
||||
+ test->socks5_port = atoi(p2);
|
||||
+ }
|
||||
+ if (p1) { // parse user:password
|
||||
+ p2 = strtok(p1, ":");
|
||||
+ if (strlen(p2) <= 0 || strlen(p2) > 255) {
|
||||
+ i_errno = IESOCKS5HOST;
|
||||
+ return -1;
|
||||
+ }
|
||||
+ test->socks5_username = strdup(p2);
|
||||
+ p2 = strtok(NULL, ":");
|
||||
+ if (!p2 || strlen(p2) <= 0 || strlen(p2) > 255) {
|
||||
+ i_errno = IESOCKS5HOST;
|
||||
+ return -1;
|
||||
+ }
|
||||
+ test->socks5_password = strdup(p2);
|
||||
+ }
|
||||
+ client_flag = 1;
|
||||
+ break;
|
||||
case OPT_EXTRA_DATA:
|
||||
test->extra_data = strdup(optarg);
|
||||
client_flag = 1;
|
||||
@@ -1740,6 +1782,12 @@ iperf_parse_arguments(struct iperf_test *test, int argc, char **argv)
|
||||
return -1;
|
||||
}
|
||||
|
||||
+ // SOCKS5 Proxy is supported only for TCP
|
||||
+ if(test->role == 'c' && test->socks5_host && test->protocol->id != Ptcp) {
|
||||
+ i_errno = IESOCKS5RTCPONLY;
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
if (blksize == 0) {
|
||||
if (test->protocol->id == Pudp)
|
||||
blksize = 0; /* try to dynamically determine from MSS */
|
||||
@@ -2943,6 +2991,12 @@ iperf_defaults(struct iperf_test *testp)
|
||||
testp->stats_interval = testp->reporter_interval = 1;
|
||||
testp->num_streams = 1;
|
||||
|
||||
+ testp->socks5_host = NULL;
|
||||
+ testp->socks5_port = SOCKS5_DEFAULT_PORT;
|
||||
+ testp->socks5_username = NULL;
|
||||
+ testp->socks5_password = NULL;
|
||||
+ testp->socks5_bind_host = NULL;
|
||||
+
|
||||
testp->settings->domain = AF_UNSPEC;
|
||||
testp->settings->unit_format = 'a';
|
||||
testp->settings->socket_bufsize = 0; /* use autotuning */
|
||||
@@ -3100,6 +3154,14 @@ iperf_free_test(struct iperf_test *test)
|
||||
free(test->remote_congestion_used);
|
||||
if (test->timestamp_format)
|
||||
free(test->timestamp_format);
|
||||
+ if (test->socks5_host)
|
||||
+ free(test->socks5_host);
|
||||
+ if (test->socks5_username)
|
||||
+ free(test->socks5_username);
|
||||
+ if (test->socks5_password)
|
||||
+ free(test->socks5_password);
|
||||
+ if (test->socks5_bind_host)
|
||||
+ free(test->socks5_bind_host);
|
||||
if (test->omit_timer != NULL)
|
||||
tmr_cancel(test->omit_timer);
|
||||
if (test->timer != NULL)
|
||||
@@ -3289,6 +3351,23 @@ iperf_reset_test(struct iperf_test *test)
|
||||
free(test->extra_data);
|
||||
test->extra_data = NULL;
|
||||
}
|
||||
+ if (test->socks5_host) {
|
||||
+ free(test->socks5_host);
|
||||
+ test->socks5_host = NULL;
|
||||
+ }
|
||||
+ test->socks5_port = SOCKS5_DEFAULT_PORT;
|
||||
+ if (test->socks5_username) {
|
||||
+ free(test->socks5_username);
|
||||
+ test->socks5_username = NULL;
|
||||
+ }
|
||||
+ if (test->socks5_password) {
|
||||
+ free(test->socks5_password);
|
||||
+ test->socks5_password = NULL;
|
||||
+ }
|
||||
+ if (test->socks5_bind_host) {
|
||||
+ free(test->socks5_bind_host);
|
||||
+ test->socks5_bind_host = NULL;
|
||||
+ }
|
||||
|
||||
/* Free output line buffers, if any (on the server only) */
|
||||
struct iperf_textline *t;
|
||||
@@ -4614,6 +4693,173 @@ iperf_add_stream(struct iperf_test *test, struct iperf_stream *sp)
|
||||
}
|
||||
}
|
||||
|
||||
+/**************************************************************************/
|
||||
+
|
||||
+/* iperf_socks5_handshake
|
||||
+ *
|
||||
+ * Handshake with a SOCKS5 Proxy per RFC1928, RFC1929
|
||||
+ */
|
||||
+int
|
||||
+iperf_socks5_handshake(struct iperf_test *test, int s) {
|
||||
+ char req[1024];
|
||||
+ char res[1024];
|
||||
+ char selected_mthod;
|
||||
+ char *p, *p1;
|
||||
+ size_t len;
|
||||
+ int ret;
|
||||
+ uint16_t net_order_short;
|
||||
+
|
||||
+ // Send method selection request [RFC1928]
|
||||
+ p = req;
|
||||
+ *p++ = 5; // VERSION
|
||||
+ if (test->socks5_username) // Number of METHODs supported
|
||||
+ *p++ = 2;
|
||||
+ else
|
||||
+ *p++ = 1;
|
||||
+ *p++ = 0; // NO AUTHENTICATION REQUIRED
|
||||
+ if (test->socks5_username) *p++ = 2; // USERNAME/PASSWORD
|
||||
+ if (Nwrite(s, req, p - req, Ptcp) < 0) {
|
||||
+ i_errno = IESOCKS5HANDSHAKE;
|
||||
+ iperf_err(test, "Writing SOCKS5 auth methods message failed\n");
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ // Receive selected method
|
||||
+ if (Nread(s, res, 2, Ptcp) != 2) {
|
||||
+ i_errno = IESOCKS5HANDSHAKE;
|
||||
+ iperf_err(test, "Reading selected SOCKS5 method message failed\n");
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ selected_mthod = res[1];
|
||||
+ if (res[0] != 5 || (selected_mthod != 0 && selected_mthod != 2)) {
|
||||
+ i_errno = IESOCKS5HANDSHAKE;
|
||||
+ iperf_err(test, "Ilegal SOCKS5 method selection response: version=%d, auth method=%d\n", res[0], selected_mthod);
|
||||
+ return -1;
|
||||
+ }
|
||||
+ if (test->debug) {
|
||||
+ iperf_printf(test, "SOCKS5 server selected authentication method %d\n", selected_mthod);
|
||||
+ }
|
||||
+
|
||||
+ // Send Username/Password request and receive the auth response [RFC1929]
|
||||
+ if (selected_mthod == 2) {
|
||||
+ p = req;
|
||||
+ *p++ = 1; // VERSION
|
||||
+ len = strlen(test->socks5_username);
|
||||
+ *p++ = len;
|
||||
+ memcpy(p, test->socks5_username, len); // USERNAME
|
||||
+ p += len;
|
||||
+ len = strlen(test->socks5_password);
|
||||
+ *p++ = len;
|
||||
+ memcpy(p, test->socks5_password, len); // PASSWORD
|
||||
+ p += len;
|
||||
+
|
||||
+ if (Nwrite(s, req, p - req, Ptcp) < 0) {
|
||||
+ i_errno = IESOCKS5HANDSHAKE;
|
||||
+ iperf_err(test, "Writing SOCKS5 Username/Password request message failed\n");
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ if ((ret = Nread(s, res, 2, Ptcp)) != 2) {
|
||||
+ i_errno = IESOCKS5HANDSHAKE;
|
||||
+ iperf_err(test, "Reading SOCKS5 Username/Password response failed; Returned %d\n", ret);
|
||||
+ return -1;
|
||||
+ }
|
||||
+ if (res[1] != 0) {
|
||||
+ i_errno = IESOCKS5HANDSHAKE;
|
||||
+ iperf_err(test, "SOCKS5 Username/Password failed with error %d\n", res[1]);
|
||||
+ return -1;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ // Send CONNECT request [RFC1928]
|
||||
+ p = req;
|
||||
+ *p++ = 5; // VERSION
|
||||
+ *p++ = 1; // CMD = CONNECT
|
||||
+ *p++ = 0; // RESERVED
|
||||
+ *p++ = 3; // ATYPE = DOMAINNAME:
|
||||
+ len = strlen(test->server_hostname);
|
||||
+ if (len > 255) {
|
||||
+ i_errno = IESOCKS5HANDSHAKE;
|
||||
+ iperf_err(test, "iperf3 host option length is limited to 255 chars when SOCKS5 is used\n");
|
||||
+ return -1;
|
||||
+ }
|
||||
+ *p++ = len;
|
||||
+ memcpy(p, test->server_hostname, len); // ADDR
|
||||
+ p += len;
|
||||
+ net_order_short = htons(test->server_port);
|
||||
+ p1 = (char *)&net_order_short;
|
||||
+ *p++ = *p1++; // PORT
|
||||
+ *p++ = *p1;
|
||||
+ if (Nwrite(s, req, p - req, Ptcp) < 0) {
|
||||
+ i_errno = IESOCKS5HANDSHAKE;
|
||||
+ iperf_err(test, "Writing SOCKS5 CONNECT message failed\n");
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ // Read CONNECT response [RFC1928]
|
||||
+ if ((ret = Nread(s, res, 4, Ptcp)) != 4) {
|
||||
+ i_errno = IESOCKS5HANDSHAKE;
|
||||
+ iperf_err(test, "Reading SOCKS5 CONNECT response failed; Returned %d\n", ret);
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ if (res[0] != 5 || res[1] != 0 || res[2] != 0) {
|
||||
+ i_errno = IESOCKS5HANDSHAKE;
|
||||
+ iperf_err(test, "SOCKS5 CONNECT failed with error %d\n", res[1]);
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ // Get BND.ADDR length
|
||||
+ test->socks5_bind_atyp = res[3]; // ATYP
|
||||
+ switch (test->socks5_bind_atyp) {
|
||||
+ case 1: // IP V4 address
|
||||
+ len = 4;
|
||||
+ break;
|
||||
+ case 3: // DOMAINNAME:
|
||||
+ if ((ret = read(s, res, 1)) != 1) {
|
||||
+ i_errno = IESOCKS5HANDSHAKE;
|
||||
+ iperf_err(test, "Failed to read SOCKS5 CONNECT response BND.ADDR length; Returned %d\n", ret);
|
||||
+ return -1;
|
||||
+ }
|
||||
+ len = (unsigned char)res[0];
|
||||
+ break;
|
||||
+ case 4: // IP V6 address
|
||||
+ len = 16;
|
||||
+ break;
|
||||
+ default:
|
||||
+ i_errno = IESOCKS5HANDSHAKE;
|
||||
+ iperf_err(test, "Illegal SOCKS5 CONNECT response ATYP %d\n", res[3]);
|
||||
+ return -1;
|
||||
+ }
|
||||
+ // Read BND.ADDR
|
||||
+ if ((ret = Nread(s, res, len, Ptcp)) != len) {
|
||||
+ i_errno = IESOCKS5HANDSHAKE;
|
||||
+ iperf_err(test, "Failed to read SOCKS5 detailes BND.ADDR; Returned %d\n", ret);
|
||||
+ return -1;
|
||||
+ }
|
||||
+ res[len] = '\0';
|
||||
+ test->socks5_bind_host = strdup(res);
|
||||
+ // Read BND.PORT
|
||||
+ if ((ret = Nread(s, res, 2, Ptcp)) != 2) {
|
||||
+ i_errno = IESOCKS5HANDSHAKE;
|
||||
+ iperf_err(test, "Failed to read SOCKS5 detailes BND.PORT; Returned %d\n", ret);
|
||||
+ return -1;
|
||||
+ }
|
||||
+ p1 = (char *)&net_order_short;
|
||||
+ *p1++ = res[0];
|
||||
+ *p1 = res[1];
|
||||
+ test->socks5_bind_port = ntohs(net_order_short);
|
||||
+ if (test->debug) {
|
||||
+ iperf_printf(test, "SOCKS5 server BIND ADDR type=%d, PORT=%d\n", test->socks5_bind_atyp, test->socks5_bind_port);
|
||||
+ }
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+/**************************************************************************/
|
||||
+
|
||||
+
|
||||
/* This pair of routines gets inserted into the snd/rcv function pointers
|
||||
** when there's a -F flag. They handle the file stuff and call the real
|
||||
** snd/rcv functions, which have been saved in snd2/rcv2.
|
||||
diff --git a/src/iperf_api.h b/src/iperf_api.h
|
||||
index d2bbdfe96..01d63bf5e 100644
|
||||
--- a/src/iperf_api.h
|
||||
+++ b/src/iperf_api.h
|
||||
@@ -68,6 +68,7 @@ typedef atomic_uint_fast64_t atomic_iperf_size_t;
|
||||
#define DEFAULT_PACING_TIMER 1000
|
||||
#define DEFAULT_NO_MSG_RCVD_TIMEOUT 120000
|
||||
#define MIN_NO_MSG_RCVD_TIMEOUT 100
|
||||
+#define SOCKS5_DEFAULT_PORT 1080
|
||||
|
||||
#define WARN_STR_LEN 128
|
||||
|
||||
@@ -100,7 +101,8 @@ typedef atomic_uint_fast64_t atomic_iperf_size_t;
|
||||
#define OPT_RCV_TIMEOUT 27
|
||||
#define OPT_JSON_STREAM 28
|
||||
#define OPT_SND_TIMEOUT 29
|
||||
#define OPT_USE_PKCS1_PADDING 30
|
||||
+#define OPT_SOCKS5 31
|
||||
|
||||
/* states */
|
||||
#define TEST_START 1
|
||||
@@ -308,6 +310,12 @@ void iperf_free_stream(struct iperf_stream * sp);
|
||||
*/
|
||||
int iperf_common_sockopts(struct iperf_test *, int s);
|
||||
|
||||
+/**
|
||||
+ * iperf_socks5_handshake - handshake with a SOCKS5 Proxy per RFC1928, RFC1929
|
||||
+ *
|
||||
+ */
|
||||
+int iperf_socks5_handshake(struct iperf_test *test, int s);
|
||||
+
|
||||
int has_tcpinfo(void);
|
||||
int has_tcpinfo_retransmits(void);
|
||||
void save_tcpinfo(struct iperf_stream *sp, struct iperf_interval_results *irp);
|
||||
@@ -419,6 +427,8 @@ enum {
|
||||
IESNDTIMEOUT = 33, // Illegal message send timeout
|
||||
IEUDPFILETRANSFER = 34, // Cannot transfer file using UDP
|
||||
IESERVERAUTHUSERS = 35, // Cannot access authorized users file
|
||||
+ IESOCKS5HOST = 36, // Illegal SOCKS5 host / creadentials
|
||||
+ IESOCKS5RTCPONLY = 37, // SOCKS5 Proxy is supported only for TCP
|
||||
/* Test errors */
|
||||
IENEWTEST = 100, // Unable to create a new test (check perror)
|
||||
IEINITTEST = 101, // Test initialization failed (check perror)
|
||||
@@ -473,8 +483,9 @@ enum {
|
||||
IEPTHREADCANCEL=151, // Unable to cancel thread (check perror)
|
||||
IEPTHREADJOIN=152, // Unable to join thread (check perror)
|
||||
IEPTHREADATTRINIT=153, // Unable to initialize thread attribute (check perror)
|
||||
IEPTHREADATTRDESTROY=154, // Unable to destroy thread attribute (check perror)
|
||||
IEPTHREADSIGMASK=155, // Unable to initialize sub thread signal mask (check perror)
|
||||
+ IESOCKS5HANDSHAKE = 156, // SOCKS5 Handshake with the server failed
|
||||
/* Stream errors */
|
||||
IECREATESTREAM = 200, // Unable to create a new stream (check herror/perror)
|
||||
IEINITSTREAM = 201, // Unable to initialize stream (check herror/perror)
|
||||
diff --git a/src/iperf_client_api.c b/src/iperf_client_api.c
|
||||
index 7ad4c939b..670e3521d 100644
|
||||
--- a/src/iperf_client_api.c
|
||||
+++ b/src/iperf_client_api.c
|
||||
@@ -385,6 +385,8 @@ iperf_connect(struct iperf_test *test)
|
||||
{
|
||||
int opt;
|
||||
socklen_t len;
|
||||
+ const char *connect_server;
|
||||
+ int connect_port;
|
||||
|
||||
if (NULL == test)
|
||||
{
|
||||
@@ -397,12 +399,20 @@ iperf_connect(struct iperf_test *test)
|
||||
make_cookie(test->cookie);
|
||||
|
||||
/* Create and connect the control channel */
|
||||
- if (test->ctrl_sck < 0)
|
||||
- // Create the control channel using an ephemeral port
|
||||
- test->ctrl_sck = netdial(test->settings->domain, Ptcp, test->bind_address, test->bind_dev, 0, test->server_hostname, test->server_port, test->settings->connect_timeout);
|
||||
if (test->ctrl_sck < 0) {
|
||||
- i_errno = IECONNECT;
|
||||
- return -1;
|
||||
+ if (test->socks5_host) {
|
||||
+ connect_server = test->socks5_host;
|
||||
+ connect_port = test->socks5_port;
|
||||
+ } else {
|
||||
+ connect_server = test->server_hostname;
|
||||
+ connect_port = test->server_port;
|
||||
+ }
|
||||
+ // Create the control channel using an ephemeral port
|
||||
+ test->ctrl_sck = netdial(test->settings->domain, Ptcp, test->bind_address, test->bind_dev, 0, connect_server, connect_port, test->settings->connect_timeout);
|
||||
+ if (test->ctrl_sck < 0) {
|
||||
+ i_errno = IECONNECT;
|
||||
+ return -1;
|
||||
+ }
|
||||
}
|
||||
|
||||
// set TCP_NODELAY for lower latency on control messages
|
||||
@@ -421,6 +431,13 @@ iperf_connect(struct iperf_test *test)
|
||||
}
|
||||
#endif /* HAVE_TCP_USER_TIMEOUT */
|
||||
|
||||
+ /* socks5 proxy handshake */
|
||||
+ if (test->socks5_host) {
|
||||
+ if (0 != iperf_socks5_handshake(test, test->ctrl_sck)) {
|
||||
+ return -1;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
if (Nwrite(test->ctrl_sck, test->cookie, COOKIE_SIZE, Ptcp) < 0) {
|
||||
i_errno = IESENDCOOKIE;
|
||||
return -1;
|
||||
diff --git a/src/iperf_error.c b/src/iperf_error.c
|
||||
index 6426554cf..a0bbb6844 100644
|
||||
--- a/src/iperf_error.c
|
||||
+++ b/src/iperf_error.c
|
||||
@@ -216,6 +216,9 @@ iperf_strerror(int int_errno)
|
||||
case IEUNIMP:
|
||||
snprintf(errstr, len, "an option you are trying to set is not implemented yet");
|
||||
break;
|
||||
+ case IESOCKS5HOST:
|
||||
+ snprintf(errstr, len, "ilegal SOCKS5 host / creadentials");
|
||||
+ break;
|
||||
case IEFILE:
|
||||
snprintf(errstr, len, "unable to open -F file");
|
||||
perr = 1;
|
||||
@@ -375,6 +378,9 @@ iperf_strerror(int int_errno)
|
||||
case IEUDPFILETRANSFER:
|
||||
snprintf(errstr, len, "cannot transfer file using UDP");
|
||||
break;
|
||||
+ case IESOCKS5RTCPONLY:
|
||||
+ snprintf(errstr, len, "SOCKS5 Proxy is supported only for TCP");
|
||||
+ break;
|
||||
case IERVRSONLYRCVTIMEOUT:
|
||||
snprintf(errstr, len, "client receive timeout is valid only in receiving mode");
|
||||
perr = 1;
|
||||
@@ -507,6 +513,10 @@ iperf_strerror(int int_errno)
|
||||
snprintf(errstr, len, "unable to destroy thread attributes");
|
||||
perr = 1;
|
||||
break;
|
||||
+ case IESOCKS5HANDSHAKE:
|
||||
+ snprintf(errstr, len, "socks5 Handshake with the server failed");
|
||||
+ perr = 1;
|
||||
+ break;
|
||||
default:
|
||||
snprintf(errstr, len, "int_errno=%d", int_errno);
|
||||
perr = 1;
|
||||
diff --git a/src/iperf_locale.c b/src/iperf_locale.c
|
||||
index ae0f63a41..c8b9a71d1 100644
|
||||
--- a/src/iperf_locale.c
|
||||
+++ b/src/iperf_locale.c
|
||||
@@ -194,6 +194,8 @@ const char usage_longstr[] = "Usage: iperf3 [-s|-c host] [options]\n"
|
||||
" --dscp N or --dscp val set the IP dscp value, either 0-63 or symbolic.\n"
|
||||
" Numeric values can be specified in decimal,\n"
|
||||
" octal and hex (see --tos above).\n"
|
||||
+ " --socks5 [user:password@]<proxy-host>[:port] use SOCKS5 Proxy for TCP connections,\n"
|
||||
+ " using no auth or user:password. Default Proxy port is %d \n"
|
||||
#if defined(HAVE_FLOWLABEL)
|
||||
" -L, --flowlabel N set the IPv6 flow label (only supported on Linux)\n"
|
||||
#endif /* HAVE_FLOWLABEL */
|
||||
diff --git a/src/iperf_tcp.c b/src/iperf_tcp.c
|
||||
index 184a1955e..515913581 100644
|
||||
--- a/src/iperf_tcp.c
|
||||
+++ b/src/iperf_tcp.c
|
||||
@@ -375,14 +375,24 @@ iperf_tcp_connect(struct iperf_test *test)
|
||||
socklen_t optlen;
|
||||
int saved_errno;
|
||||
int rcvbuf_actual, sndbuf_actual;
|
||||
int proto = 0;
|
||||
+ const char *connect_server;
|
||||
+ int connect_port;
|
||||
|
||||
#if defined(HAVE_IPPROTO_MPTCP)
|
||||
if (test->mptcp)
|
||||
proto = IPPROTO_MPTCP;
|
||||
#endif
|
||||
|
||||
- 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 (test->socks5_host) {
|
||||
+ connect_server = test->socks5_host;
|
||||
+ connect_port = test->socks5_port;
|
||||
+ } else {
|
||||
+ connect_server = test->server_hostname;
|
||||
+ connect_port = test->server_port;
|
||||
+ }
|
||||
+
|
||||
+ s = create_socket(test->settings->domain, SOCK_STREAM, proto, test->bind_address, test->bind_dev, test->bind_port, connect_server, connect_port, &server_res);
|
||||
if (s < 0) {
|
||||
i_errno = IESTREAMCONNECT;
|
||||
return -1;
|
||||
@@ -571,6 +581,16 @@ iperf_tcp_connect(struct iperf_test *test)
|
||||
|
||||
freeaddrinfo(server_res);
|
||||
|
||||
+ /* socks5 proxy handshake */
|
||||
+ if (test->socks5_host) {
|
||||
+ if (0 != iperf_socks5_handshake(test, s)) {
|
||||
+ saved_errno = errno;
|
||||
+ close(s);
|
||||
+ errno = saved_errno;
|
||||
+ return -1;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
/* Send cookie for verification */
|
||||
if (Nwrite(s, test->cookie, COOKIE_SIZE, Ptcp) < 0) {
|
||||
saved_errno = errno;
|
||||
|
|
@ -1,268 +0,0 @@
|
|||
#
|
||||
# Copyright (C) 2006-2015 OpenWrt.org
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=iproute2
|
||||
PKG_VERSION:=6.12.0
|
||||
PKG_RELEASE:=2
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
|
||||
PKG_SOURCE_URL:=@KERNEL/linux/utils/net/iproute2
|
||||
PKG_HASH:=bbd141ef7b5d0127cc2152843ba61f274dc32814fa3e0f13e7d07a080bef53d9
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
PKG_BUILD_DEPENDS:=iptables
|
||||
PKG_LICENSE:=GPL-2.0
|
||||
PKG_CPE_ID:=cpe:/a:iproute2_project:iproute2
|
||||
|
||||
PKG_BUILD_FLAGS:=gc-sections lto
|
||||
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(INCLUDE_DIR)/nls.mk
|
||||
|
||||
define Package/iproute2/Default
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
URL:=http://www.linuxfoundation.org/collaborate/workgroups/networking/iproute2
|
||||
SUBMENU:=Routing and Redirection
|
||||
MAINTAINER:=Russell Senior <russell@personaltelco.net>
|
||||
endef
|
||||
|
||||
define Package/ip-tiny
|
||||
$(call Package/iproute2/Default)
|
||||
TITLE:=Routing control utility (minimal)
|
||||
VARIANT:=iptiny
|
||||
DEFAULT_VARIANT:=1
|
||||
PROVIDES:=ip
|
||||
ALTERNATIVES:=200:/sbin/ip:/usr/libexec/ip-tiny
|
||||
DEPENDS:=+libnl-tiny +(PACKAGE_devlink||PACKAGE_rdma):libmnl
|
||||
endef
|
||||
|
||||
define Package/ip-full
|
||||
$(call Package/iproute2/Default)
|
||||
TITLE:=Routing control utility (full)
|
||||
VARIANT:=ipfull
|
||||
PROVIDES:=ip
|
||||
ALTERNATIVES:=300:/sbin/ip:/usr/libexec/ip-full
|
||||
DEPENDS:=+libnl-tiny +libbpf +(PACKAGE_devlink||PACKAGE_rdma):libmnl
|
||||
endef
|
||||
|
||||
define Package/tc-tiny
|
||||
$(call Package/iproute2/Default)
|
||||
TITLE:=Traffic control utility (minimal)
|
||||
VARIANT:=tctiny
|
||||
DEFAULT_VARIANT:=1
|
||||
PROVIDES:=tc
|
||||
ALTERNATIVES:=200:/sbin/tc:/usr/libexec/tc-tiny
|
||||
DEPENDS:=+kmod-sched-core +(PACKAGE_devlink||PACKAGE_rdma):libmnl
|
||||
endef
|
||||
|
||||
define Package/tc-bpf
|
||||
$(call Package/iproute2/Default)
|
||||
TITLE:=Traffic control utility (bpf)
|
||||
VARIANT:=tcbpf
|
||||
PROVIDES:=tc
|
||||
ALTERNATIVES:=300:/sbin/tc:/usr/libexec/tc-bpf
|
||||
DEPENDS:=+kmod-sched-core +(PACKAGE_devlink||PACKAGE_rdma):libmnl +libbpf
|
||||
endef
|
||||
|
||||
define Package/tc-full
|
||||
$(call Package/iproute2/Default)
|
||||
TITLE:=Traffic control utility (full)
|
||||
VARIANT:=tcfull
|
||||
PROVIDES:=tc
|
||||
ALTERNATIVES:=400:/sbin/tc:/usr/libexec/tc-full
|
||||
DEPENDS:=+kmod-sched-core +(PACKAGE_devlink||PACKAGE_rdma):libmnl +libbpf +libxtables
|
||||
endef
|
||||
|
||||
define Package/genl
|
||||
$(call Package/iproute2/Default)
|
||||
TITLE:=General netlink utility frontend
|
||||
DEPENDS:=+libnl-tiny +(PACKAGE_devlink||PACKAGE_rdma):libmnl
|
||||
endef
|
||||
|
||||
define Package/ip-bridge
|
||||
$(call Package/iproute2/Default)
|
||||
TITLE:=Bridge configuration utility from iproute2
|
||||
DEPENDS:=+libnl-tiny +(PACKAGE_devlink||PACKAGE_rdma):libmnl
|
||||
endef
|
||||
|
||||
define Package/ss
|
||||
$(call Package/iproute2/Default)
|
||||
TITLE:=Socket statistics utility
|
||||
DEPENDS:=+libnl-tiny +(PACKAGE_devlink||PACKAGE_rdma):libmnl +libbpf +kmod-netlink-diag
|
||||
endef
|
||||
|
||||
define Package/nstat
|
||||
$(call Package/iproute2/Default)
|
||||
TITLE:=Network statistics utility
|
||||
DEPENDS:=+libnl-tiny +(PACKAGE_devlink||PACKAGE_rdma):libmnl
|
||||
endef
|
||||
|
||||
define Package/devlink
|
||||
$(call Package/iproute2/Default)
|
||||
TITLE:=Network devlink utility
|
||||
DEPENDS:=+libmnl
|
||||
endef
|
||||
|
||||
define Package/rdma
|
||||
$(call Package/iproute2/Default)
|
||||
TITLE:=Network rdma utility
|
||||
DEPENDS:=+libmnl
|
||||
endef
|
||||
|
||||
ifeq ($(BUILD_VARIANT),iptiny)
|
||||
IP_CONFIG_TINY:=y
|
||||
LIBBPF_FORCE:=off
|
||||
endif
|
||||
|
||||
ifeq ($(BUILD_VARIANT),ipfull)
|
||||
HAVE_ELF:=y
|
||||
LIBBPF_FORCE:=on
|
||||
endif
|
||||
|
||||
ifeq ($(BUILD_VARIANT),tctiny)
|
||||
LIBBPF_FORCE:=off
|
||||
endif
|
||||
|
||||
ifeq ($(BUILD_VARIANT),tcbpf)
|
||||
HAVE_ELF:=y
|
||||
LIBBPF_FORCE:=on
|
||||
SHARED_LIBS:=y
|
||||
endif
|
||||
|
||||
ifeq ($(BUILD_VARIANT),tcfull)
|
||||
#enable iptables/xtables requirement only if tciptables variant is selected
|
||||
TC_CONFIG_XT:=y
|
||||
TC_CONFIG_XT_OLD:=y
|
||||
TC_CONFIG_XT_OLD_H:=y
|
||||
TC_CONFIG_IPSET:=y
|
||||
HAVE_ELF:=y
|
||||
LIBBPF_FORCE:=on
|
||||
SHARED_LIBS:=y
|
||||
else
|
||||
#disable iptables requirement by default
|
||||
TC_CONFIG_XT:=n
|
||||
TC_CONFIG_XT_OLD:=n
|
||||
TC_CONFIG_XT_OLD_H:=n
|
||||
TC_CONFIG_IPSET:=n
|
||||
endif
|
||||
|
||||
ifdef CONFIG_PACKAGE_devlink
|
||||
HAVE_MNL:=y
|
||||
endif
|
||||
|
||||
ifdef CONFIG_PACKAGE_rdma
|
||||
HAVE_MNL:=y
|
||||
endif
|
||||
|
||||
define Build/Configure
|
||||
echo "static const char SNAPSHOT[] = \"$(PKG_VERSION)-$(PKG_RELEASE)-openwrt\";" \
|
||||
> $(PKG_BUILD_DIR)/include/SNAPSHOT.h
|
||||
endef
|
||||
|
||||
TARGET_LDFLAGS += -Wl,--as-needed
|
||||
TARGET_CPPFLAGS += -I$(STAGING_DIR)/usr/include/libnl-tiny
|
||||
|
||||
MAKE_FLAGS += \
|
||||
KERNEL_INCLUDE="$(LINUX_DIR)/include/uapi" \
|
||||
SHARED_LIBS=$(SHARED_LIBS) \
|
||||
IP_CONFIG_TINY=$(IP_CONFIG_TINY) \
|
||||
BUILD_VARIANT=$(BUILD_VARIANT) \
|
||||
LIBBPF_FORCE=$(LIBBPF_FORCE) \
|
||||
HAVE_ELF=$(HAVE_ELF) \
|
||||
HAVE_MNL=$(HAVE_MNL) \
|
||||
HAVE_CAP=$(HAVE_CAP) \
|
||||
HAVE_TIRPC=n \
|
||||
IPT_LIB_DIR=/usr/lib/iptables \
|
||||
XT_LIB_DIR=/usr/lib/iptables \
|
||||
TC_CONFIG_XT=$(TC_CONFIG_XT) \
|
||||
TC_CONFIG_XT_OLD=$(TC_CONFIG_XT_OLD) \
|
||||
TC_CONFIG_XT_OLD_H=$(TC_CONFIG_XT_OLD_H) \
|
||||
TC_CONFIG_IPSET=$(TC_CONFIG_IPSET) \
|
||||
FPIC="$(FPIC)" \
|
||||
$(if $(findstring c,$(OPENWRT_VERBOSE)),V=1,V='')
|
||||
|
||||
define Build/Compile
|
||||
+$(MAKE_VARS) $(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) $(MAKE_FLAGS)
|
||||
endef
|
||||
|
||||
define Build/InstallDev
|
||||
$(INSTALL_DIR) $(1)/usr/include/iproute2
|
||||
$(CP) $(PKG_BUILD_DIR)/include/bpf_elf.h $(1)/usr/include/iproute2
|
||||
$(CP) $(PKG_BUILD_DIR)/include/{libgenl,libnetlink}.h $(1)/usr/include/
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/lib/libnetlink.a $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
define Package/ip-tiny/install
|
||||
$(INSTALL_DIR) $(1)/usr/libexec
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/ip/ip $(1)/usr/libexec/ip-tiny
|
||||
endef
|
||||
|
||||
define Package/ip-full/install
|
||||
$(INSTALL_DIR) $(1)/usr/libexec
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/ip/ip $(1)/usr/libexec/ip-full
|
||||
endef
|
||||
|
||||
define Package/tc-tiny/install
|
||||
$(INSTALL_DIR) $(1)/usr/libexec
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/tc/tc $(1)/usr/libexec/tc-tiny
|
||||
endef
|
||||
|
||||
define Package/tc-bpf/install
|
||||
$(INSTALL_DIR) $(1)/usr/libexec
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/tc/tc $(1)/usr/libexec/tc-bpf
|
||||
endef
|
||||
|
||||
define Package/tc-full/install
|
||||
$(INSTALL_DIR) $(1)/usr/libexec
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/tc/tc $(1)/usr/libexec/tc-full
|
||||
endef
|
||||
|
||||
define Package/genl/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/genl/genl $(1)/usr/sbin/
|
||||
endef
|
||||
|
||||
define Package/ip-bridge/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bridge/bridge $(1)/usr/sbin/
|
||||
endef
|
||||
|
||||
define Package/ss/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/misc/ss $(1)/usr/sbin/
|
||||
endef
|
||||
|
||||
define Package/nstat/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/misc/nstat $(1)/usr/sbin/
|
||||
endef
|
||||
|
||||
define Package/devlink/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/devlink/devlink $(1)/usr/sbin/
|
||||
endef
|
||||
|
||||
define Package/rdma/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/rdma/rdma $(1)/usr/sbin/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,ip-tiny))
|
||||
$(eval $(call BuildPackage,ip-full))
|
||||
$(eval $(call BuildPackage,tc-tiny))
|
||||
$(eval $(call BuildPackage,tc-bpf))
|
||||
$(eval $(call BuildPackage,tc-full))
|
||||
$(eval $(call BuildPackage,genl))
|
||||
$(eval $(call BuildPackage,ip-bridge))
|
||||
$(eval $(call BuildPackage,ss))
|
||||
$(eval $(call BuildPackage,nstat))
|
||||
$(eval $(call BuildPackage,devlink))
|
||||
$(eval $(call BuildPackage,rdma))
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
From c8b3ecc22ed0edaf0259eaf7d1a5c04f300ad6e4 Mon Sep 17 00:00:00 2001
|
||||
From: Stephen Hemminger <stephen@networkplumber.org>
|
||||
Date: Thu, 12 Dec 2024 11:24:18 -0800
|
||||
Subject: [PATCH] libnetlink: add missing endian.h
|
||||
|
||||
Need endian.h to get htobe64 with musl.
|
||||
|
||||
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
|
||||
---
|
||||
include/libnetlink.h | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
--- a/include/libnetlink.h
|
||||
+++ b/include/libnetlink.h
|
||||
@@ -4,6 +4,7 @@
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
+#include <endian.h>
|
||||
#include <asm/types.h>
|
||||
#include <linux/netlink.h>
|
||||
#include <linux/rtnetlink.h>
|
||||
|
|
@ -1,29 +0,0 @@
|
|||
From fa3949b792e275f75d7d6200dc2036ef7fff8816 Mon Sep 17 00:00:00 2001
|
||||
From: Stephen Hemminger <stephen@networkplumber.org>
|
||||
Date: Thu, 12 Dec 2024 11:21:56 -0800
|
||||
Subject: [PATCH] rdma: add missing header for basename
|
||||
|
||||
The function basename prototype is in libgen.h
|
||||
Fixes build on musl
|
||||
|
||||
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
|
||||
---
|
||||
rdma/rdma.h | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
--- a/rdma/rdma.h
|
||||
+++ b/rdma/rdma.h
|
||||
@@ -10,11 +10,12 @@
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <getopt.h>
|
||||
+#include <time.h>
|
||||
+#include <libgen.h>
|
||||
#include <netinet/in.h>
|
||||
#include <libmnl/libmnl.h>
|
||||
#include <rdma/rdma_netlink.h>
|
||||
#include <rdma/rdma_user_cm.h>
|
||||
-#include <time.h>
|
||||
#include <net/if_arp.h>
|
||||
|
||||
#include "list.h"
|
||||
|
|
@ -1,84 +0,0 @@
|
|||
From 7e23da91fca6e5dedeb32a7d308cf20982e897c3 Mon Sep 17 00:00:00 2001
|
||||
From: Stephen Hemminger <stephen@networkplumber.org>
|
||||
Date: Tue, 10 Dec 2024 13:38:08 -0800
|
||||
Subject: [PATCH] ip: rearrange and prune header files
|
||||
|
||||
The recent report of issues with missing limits.h impacting musl
|
||||
suggested looking at what files are and are not included in ip code.
|
||||
|
||||
The standard practice is to put standard headers first, then system,
|
||||
then local headers. Used iwyu to get suggestions about missing
|
||||
and extraneous headers.
|
||||
|
||||
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
|
||||
---
|
||||
ip/iplink.c | 13 +++++--------
|
||||
ip/ipnetns.c | 19 +++++++++----------
|
||||
2 files changed, 14 insertions(+), 18 deletions(-)
|
||||
|
||||
--- a/ip/iplink.c
|
||||
+++ b/ip/iplink.c
|
||||
@@ -11,17 +11,14 @@
|
||||
#include <fcntl.h>
|
||||
#include <dlfcn.h>
|
||||
#include <errno.h>
|
||||
+#include <string.h>
|
||||
+#include <strings.h>
|
||||
+#include <limits.h>
|
||||
+
|
||||
#include <sys/socket.h>
|
||||
+#include <arpa/inet.h>
|
||||
#include <linux/if.h>
|
||||
-#include <linux/if_packet.h>
|
||||
#include <linux/if_ether.h>
|
||||
-#include <linux/sockios.h>
|
||||
-#include <netinet/in.h>
|
||||
-#include <arpa/inet.h>
|
||||
-#include <string.h>
|
||||
-#include <sys/ioctl.h>
|
||||
-#include <stdbool.h>
|
||||
-#include <linux/mpls.h>
|
||||
|
||||
#include "rt_names.h"
|
||||
#include "utils.h"
|
||||
--- a/ip/ipnetns.c
|
||||
+++ b/ip/ipnetns.c
|
||||
@@ -1,21 +1,21 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
#define _ATFILE_SOURCE
|
||||
-#include <sys/file.h>
|
||||
-#include <sys/types.h>
|
||||
-#include <sys/stat.h>
|
||||
-#include <sys/wait.h>
|
||||
-#include <sys/inotify.h>
|
||||
-#include <sys/mount.h>
|
||||
-#include <sys/syscall.h>
|
||||
+
|
||||
#include <stdio.h>
|
||||
+#include <stdint.h>
|
||||
#include <string.h>
|
||||
-#include <sched.h>
|
||||
#include <fcntl.h>
|
||||
#include <dirent.h>
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
#include <ctype.h>
|
||||
-#include <linux/limits.h>
|
||||
+#include <limits.h>
|
||||
+
|
||||
+#include <sys/file.h>
|
||||
+#include <sys/types.h>
|
||||
+#include <sys/stat.h>
|
||||
+#include <sys/inotify.h>
|
||||
+#include <sys/mount.h>
|
||||
|
||||
#include <linux/net_namespace.h>
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
#include "list.h"
|
||||
#include "ip_common.h"
|
||||
#include "namespace.h"
|
||||
-#include "json_print.h"
|
||||
|
||||
static int usage(void)
|
||||
{
|
||||
|
|
@ -1,26 +0,0 @@
|
|||
From f982f30e166a02e09097de05129449031ba51f76 Mon Sep 17 00:00:00 2001
|
||||
From: Stephen Hemminger <stephen@networkplumber.org>
|
||||
Date: Thu, 12 Dec 2024 11:29:44 -0800
|
||||
Subject: [PATCH] cg_map: use limits.h
|
||||
|
||||
Prefer limits.h from system headers over linux/limits.h
|
||||
Fixes build with musl.
|
||||
|
||||
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
|
||||
---
|
||||
lib/cg_map.c | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
--- a/lib/cg_map.c
|
||||
+++ b/lib/cg_map.c
|
||||
@@ -9,8 +9,9 @@
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <stdbool.h>
|
||||
+#include <limits.h>
|
||||
+
|
||||
#include <linux/types.h>
|
||||
-#include <linux/limits.h>
|
||||
#include <ftw.h>
|
||||
|
||||
#include "cg_map.h"
|
||||
|
|
@ -1,178 +0,0 @@
|
|||
From ac547ad027e3d4e283202ecb487cf54707234491 Mon Sep 17 00:00:00 2001
|
||||
From: Stephen Hemminger <stephen@networkplumber.org>
|
||||
Date: Thu, 12 Dec 2024 14:15:59 -0800
|
||||
Subject: [PATCH] flower: replace XATTR_SIZE_MAX
|
||||
|
||||
The flower tc parser was using XATTR_SIZE_MAX from linux/limits.h,
|
||||
but this constant is intended to before extended filesystem attributes
|
||||
not for TC. Replace it with a local define.
|
||||
|
||||
This fixes issue on systems with musl and XATTR_SIZE_MAX is not
|
||||
defined in limits.h there.
|
||||
|
||||
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
|
||||
---
|
||||
tc/f_flower.c | 37 ++++++++++++++++++++-----------------
|
||||
1 file changed, 20 insertions(+), 17 deletions(-)
|
||||
|
||||
--- a/tc/f_flower.c
|
||||
+++ b/tc/f_flower.c
|
||||
@@ -10,7 +10,7 @@
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#include <net/if.h>
|
||||
-#include <linux/limits.h>
|
||||
+
|
||||
#include <linux/if_arp.h>
|
||||
#include <linux/if_ether.h>
|
||||
#include <linux/ip.h>
|
||||
@@ -22,6 +22,9 @@
|
||||
#include "tc_util.h"
|
||||
#include "rt_names.h"
|
||||
|
||||
+/* maximum length of options string */
|
||||
+#define FLOWER_OPTS_MAX 4096
|
||||
+
|
||||
#ifndef IPPROTO_L2TP
|
||||
#define IPPROTO_L2TP 115
|
||||
#endif
|
||||
@@ -1252,7 +1255,7 @@ static int flower_check_enc_opt_key(char
|
||||
|
||||
static int flower_parse_enc_opts_geneve(char *str, struct nlmsghdr *n)
|
||||
{
|
||||
- char key[XATTR_SIZE_MAX], mask[XATTR_SIZE_MAX];
|
||||
+ char key[FLOWER_OPTS_MAX], mask[FLOWER_OPTS_MAX];
|
||||
int data_len, key_len, mask_len, err;
|
||||
char *token, *slash;
|
||||
struct rtattr *nest;
|
||||
@@ -1265,7 +1268,7 @@ static int flower_parse_enc_opts_geneve(
|
||||
if (slash)
|
||||
*slash = '\0';
|
||||
|
||||
- if ((key_len + strlen(token) > XATTR_SIZE_MAX) ||
|
||||
+ if ((key_len + strlen(token) > FLOWER_OPTS_MAX) ||
|
||||
flower_check_enc_opt_key(token))
|
||||
return -1;
|
||||
|
||||
@@ -1275,7 +1278,7 @@ static int flower_parse_enc_opts_geneve(
|
||||
|
||||
if (!slash) {
|
||||
/* Pad out mask when not provided */
|
||||
- if (mask_len + strlen(token) > XATTR_SIZE_MAX)
|
||||
+ if (mask_len + strlen(token) > FLOWER_OPTS_MAX)
|
||||
return -1;
|
||||
|
||||
data_len = strlen(rindex(token, ':'));
|
||||
@@ -1288,7 +1291,7 @@ static int flower_parse_enc_opts_geneve(
|
||||
continue;
|
||||
}
|
||||
|
||||
- if (mask_len + strlen(slash + 1) > XATTR_SIZE_MAX)
|
||||
+ if (mask_len + strlen(slash + 1) > FLOWER_OPTS_MAX)
|
||||
return -1;
|
||||
|
||||
strcpy(&mask[mask_len], slash + 1);
|
||||
@@ -1318,7 +1321,7 @@ static int flower_parse_enc_opts_geneve(
|
||||
|
||||
static int flower_parse_enc_opts_vxlan(char *str, struct nlmsghdr *n)
|
||||
{
|
||||
- char key[XATTR_SIZE_MAX], mask[XATTR_SIZE_MAX];
|
||||
+ char key[FLOWER_OPTS_MAX], mask[FLOWER_OPTS_MAX];
|
||||
struct rtattr *nest;
|
||||
char *slash;
|
||||
int err;
|
||||
@@ -1326,14 +1329,14 @@ static int flower_parse_enc_opts_vxlan(c
|
||||
slash = strchr(str, '/');
|
||||
if (slash) {
|
||||
*slash++ = '\0';
|
||||
- if (strlen(slash) > XATTR_SIZE_MAX)
|
||||
+ if (strlen(slash) > FLOWER_OPTS_MAX)
|
||||
return -1;
|
||||
strcpy(mask, slash);
|
||||
} else {
|
||||
strcpy(mask, "0xffffffff");
|
||||
}
|
||||
|
||||
- if (strlen(str) > XATTR_SIZE_MAX)
|
||||
+ if (strlen(str) > FLOWER_OPTS_MAX)
|
||||
return -1;
|
||||
strcpy(key, str);
|
||||
|
||||
@@ -1355,7 +1358,7 @@ static int flower_parse_enc_opts_vxlan(c
|
||||
|
||||
static int flower_parse_enc_opts_erspan(char *str, struct nlmsghdr *n)
|
||||
{
|
||||
- char key[XATTR_SIZE_MAX], mask[XATTR_SIZE_MAX];
|
||||
+ char key[FLOWER_OPTS_MAX], mask[FLOWER_OPTS_MAX];
|
||||
struct rtattr *nest;
|
||||
char *slash;
|
||||
int err;
|
||||
@@ -1364,7 +1367,7 @@ static int flower_parse_enc_opts_erspan(
|
||||
slash = strchr(str, '/');
|
||||
if (slash) {
|
||||
*slash++ = '\0';
|
||||
- if (strlen(slash) > XATTR_SIZE_MAX)
|
||||
+ if (strlen(slash) > FLOWER_OPTS_MAX)
|
||||
return -1;
|
||||
strcpy(mask, slash);
|
||||
} else {
|
||||
@@ -1376,7 +1379,7 @@ static int flower_parse_enc_opts_erspan(
|
||||
strcpy(mask + index, ":0xffffffff:0xff:0xff");
|
||||
}
|
||||
|
||||
- if (strlen(str) > XATTR_SIZE_MAX)
|
||||
+ if (strlen(str) > FLOWER_OPTS_MAX)
|
||||
return -1;
|
||||
strcpy(key, str);
|
||||
|
||||
@@ -1398,7 +1401,7 @@ static int flower_parse_enc_opts_erspan(
|
||||
|
||||
static int flower_parse_enc_opts_gtp(char *str, struct nlmsghdr *n)
|
||||
{
|
||||
- char key[XATTR_SIZE_MAX], mask[XATTR_SIZE_MAX];
|
||||
+ char key[FLOWER_OPTS_MAX], mask[FLOWER_OPTS_MAX];
|
||||
struct rtattr *nest;
|
||||
char *slash;
|
||||
int err;
|
||||
@@ -1406,13 +1409,13 @@ static int flower_parse_enc_opts_gtp(cha
|
||||
slash = strchr(str, '/');
|
||||
if (slash) {
|
||||
*slash++ = '\0';
|
||||
- if (strlen(slash) > XATTR_SIZE_MAX)
|
||||
+ if (strlen(slash) > FLOWER_OPTS_MAX)
|
||||
return -1;
|
||||
strcpy(mask, slash);
|
||||
} else
|
||||
strcpy(mask, "ff:ff");
|
||||
|
||||
- if (strlen(str) > XATTR_SIZE_MAX)
|
||||
+ if (strlen(str) > FLOWER_OPTS_MAX)
|
||||
return -1;
|
||||
strcpy(key, str);
|
||||
|
||||
@@ -1433,7 +1436,7 @@ static int flower_parse_enc_opts_gtp(cha
|
||||
|
||||
static int flower_parse_enc_opts_pfcp(char *str, struct nlmsghdr *n)
|
||||
{
|
||||
- char key[XATTR_SIZE_MAX], mask[XATTR_SIZE_MAX];
|
||||
+ char key[FLOWER_OPTS_MAX], mask[FLOWER_OPTS_MAX];
|
||||
struct rtattr *nest;
|
||||
char *slash;
|
||||
int err;
|
||||
@@ -1442,14 +1445,14 @@ static int flower_parse_enc_opts_pfcp(ch
|
||||
slash = strchr(str, '/');
|
||||
if (slash) {
|
||||
*slash++ = '\0';
|
||||
- if (strlen(slash) > XATTR_SIZE_MAX)
|
||||
+ if (strlen(slash) > FLOWER_OPTS_MAX)
|
||||
return -1;
|
||||
strcpy(mask, slash);
|
||||
} else {
|
||||
strcpy(mask, "ff:ffffffffffffffff");
|
||||
}
|
||||
|
||||
- if (strlen(str) > XATTR_SIZE_MAX)
|
||||
+ if (strlen(str) > FLOWER_OPTS_MAX)
|
||||
return -1;
|
||||
strcpy(key, str);
|
||||
|
||||
|
|
@ -1,37 +0,0 @@
|
|||
From 458dce5d0431f0589aca1bc841904b5d1db3bbce Mon Sep 17 00:00:00 2001
|
||||
From: Stephen Hemminger <stephen@networkplumber.org>
|
||||
Date: Thu, 12 Dec 2024 14:18:35 -0800
|
||||
Subject: [PATCH] uapi: remove no longer used linux/limits.h
|
||||
|
||||
Code is now using limits.h instead.
|
||||
|
||||
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
|
||||
---
|
||||
include/uapi/linux/limits.h | 21 ---------------------
|
||||
1 file changed, 21 deletions(-)
|
||||
delete mode 100644 include/uapi/linux/limits.h
|
||||
|
||||
--- a/include/uapi/linux/limits.h
|
||||
+++ /dev/null
|
||||
@@ -1,21 +0,0 @@
|
||||
-/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
|
||||
-#ifndef _LINUX_LIMITS_H
|
||||
-#define _LINUX_LIMITS_H
|
||||
-
|
||||
-#define NR_OPEN 1024
|
||||
-
|
||||
-#define NGROUPS_MAX 65536 /* supplemental group IDs are available */
|
||||
-#define ARG_MAX 131072 /* # bytes of args + environ for exec() */
|
||||
-#define LINK_MAX 127 /* # links a file may have */
|
||||
-#define MAX_CANON 255 /* size of the canonical input queue */
|
||||
-#define MAX_INPUT 255 /* size of the type-ahead buffer */
|
||||
-#define NAME_MAX 255 /* # chars in a file name */
|
||||
-#define PATH_MAX 4096 /* # chars in a path name including nul */
|
||||
-#define PIPE_BUF 4096 /* # bytes in atomic write to a pipe */
|
||||
-#define XATTR_NAME_MAX 255 /* # chars in an extended attribute name */
|
||||
-#define XATTR_SIZE_MAX 65536 /* size of an extended attribute value (64k) */
|
||||
-#define XATTR_LIST_MAX 65536 /* size of extended attribute namelist (64k) */
|
||||
-
|
||||
-#define RTSIG_MAX 32
|
||||
-
|
||||
-#endif
|
||||
|
|
@ -1,59 +0,0 @@
|
|||
--- a/netem/maketable.c
|
||||
+++ b/netem/maketable.c
|
||||
@@ -11,7 +11,9 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <math.h>
|
||||
+#if !defined(__APPLE__) && !defined(__FreeBSD__)
|
||||
#include <malloc.h>
|
||||
+#endif
|
||||
#include <string.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
--- a/netem/normal.c
|
||||
+++ b/netem/normal.c
|
||||
@@ -9,8 +9,12 @@
|
||||
#include <string.h>
|
||||
#include <limits.h>
|
||||
|
||||
+#if !defined(__APPLE__) && !defined(__FreeBSD__)
|
||||
#include <linux/types.h>
|
||||
#include <linux/pkt_sched.h>
|
||||
+#else
|
||||
+#define NETEM_DIST_SCALE 8192
|
||||
+#endif
|
||||
|
||||
#define TABLESIZE 16384
|
||||
#define TABLEFACTOR NETEM_DIST_SCALE
|
||||
--- a/netem/pareto.c
|
||||
+++ b/netem/pareto.c
|
||||
@@ -8,8 +8,12 @@
|
||||
#include <math.h>
|
||||
#include <limits.h>
|
||||
|
||||
+#if !defined(__APPLE__) && !defined(__FreeBSD__)
|
||||
#include <linux/types.h>
|
||||
#include <linux/pkt_sched.h>
|
||||
+#else
|
||||
+#define NETEM_DIST_SCALE 8192
|
||||
+#endif
|
||||
|
||||
static const double a=3.0;
|
||||
#define TABLESIZE 16384
|
||||
--- a/netem/paretonormal.c
|
||||
+++ b/netem/paretonormal.c
|
||||
@@ -15,10 +15,13 @@
|
||||
#include <string.h>
|
||||
#include <math.h>
|
||||
#include <limits.h>
|
||||
+#if !defined(__APPLE__) && !defined(__FreeBSD__)
|
||||
#include <malloc.h>
|
||||
-
|
||||
#include <linux/types.h>
|
||||
#include <linux/pkt_sched.h>
|
||||
+#else
|
||||
+#define NETEM_DIST_SCALE 8192
|
||||
+#endif
|
||||
|
||||
#define TABLESIZE 16384
|
||||
#define TABLEFACTOR NETEM_DIST_SCALE
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
--- a/tc/Makefile
|
||||
+++ b/tc/Makefile
|
||||
@@ -107,6 +107,9 @@ CFLAGS += -DCONFIG_GACT -DCONFIG_GACT_PR
|
||||
ifneq ($(IPT_LIB_DIR),)
|
||||
CFLAGS += -DIPT_LIB_DIR=\"$(IPT_LIB_DIR)\"
|
||||
endif
|
||||
+ifneq ($(XT_LIB_DIR),)
|
||||
+ CFLAGS += -DXT_LIB_DIR=\"$(XT_LIB_DIR)\"
|
||||
+endif
|
||||
|
||||
LEX := flex
|
||||
CFLAGS += -DYY_NO_INPUT
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
--- a/misc/Makefile
|
||||
+++ b/misc/Makefile
|
||||
@@ -2,13 +2,13 @@
|
||||
SSOBJ=ss.o ssfilter_check.o ssfilter.tab.o
|
||||
LNSTATOBJ=lnstat.o lnstat_util.o
|
||||
|
||||
-TARGETS=ss nstat ifstat rtacct lnstat
|
||||
+TARGETS=ss nstat
|
||||
|
||||
include ../config.mk
|
||||
|
||||
-ifeq ($(HAVE_BERKELEY_DB),y)
|
||||
- TARGETS += arpd
|
||||
-endif
|
||||
+#ifeq ($(HAVE_BERKELEY_DB),y)
|
||||
+# TARGETS += arpd
|
||||
+#endif
|
||||
|
||||
all: $(TARGETS)
|
||||
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -69,9 +69,9 @@ WFLAGS += -Wmissing-declarations -Wold-s
|
||||
CFLAGS := $(WFLAGS) $(CCOPTS) -I../include -I../include/uapi $(DEFINES) $(CFLAGS)
|
||||
YACCFLAGS = -d -t -v
|
||||
|
||||
-SUBDIRS=lib ip tc bridge misc netem genl man
|
||||
+SUBDIRS=lib ip tc bridge misc genl
|
||||
ifeq ($(HAVE_MNL),y)
|
||||
-SUBDIRS += tipc devlink rdma dcb vdpa
|
||||
+SUBDIRS += devlink rdma
|
||||
endif
|
||||
|
||||
LIBNETLINK=../lib/libutil.a ../lib/libnetlink.a
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
--- a/tc/q_fifo.c
|
||||
+++ b/tc/q_fifo.c
|
||||
@@ -90,5 +90,6 @@ struct qdisc_util pfifo_head_drop_qdisc_
|
||||
|
||||
struct qdisc_util pfifo_fast_qdisc_util = {
|
||||
.id = "pfifo_fast",
|
||||
+ .parse_qopt = fifo_parse_opt,
|
||||
.print_qopt = prio_print_opt,
|
||||
};
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
--- a/configure
|
||||
+++ b/configure
|
||||
@@ -368,7 +368,7 @@ check_tirpc()
|
||||
|
||||
check_mnl()
|
||||
{
|
||||
- if ${PKG_CONFIG} libmnl --exists; then
|
||||
+ if [ "${HAVE_MNL}" = "y" ] && ${PKG_CONFIG} libmnl --exists; then
|
||||
echo "HAVE_MNL:=y" >>$CONFIG
|
||||
echo "yes"
|
||||
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
--- a/configure
|
||||
+++ b/configure
|
||||
@@ -217,7 +217,7 @@ EOF
|
||||
|
||||
check_elf()
|
||||
{
|
||||
- if ${PKG_CONFIG} libelf --exists; then
|
||||
+ if [ "${HAVE_ELF}" = "y" ] && ${PKG_CONFIG} libelf --exists; then
|
||||
echo "HAVE_ELF:=y" >>$CONFIG
|
||||
echo "yes"
|
||||
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
--- a/configure
|
||||
+++ b/configure
|
||||
@@ -427,7 +427,7 @@ EOF
|
||||
|
||||
check_cap()
|
||||
{
|
||||
- if ${PKG_CONFIG} libcap --exists; then
|
||||
+ if [ "${HAVE_CAP}" = "y" ] && ${PKG_CONFIG} libcap --exists; then
|
||||
echo "HAVE_CAP:=y" >>$CONFIG
|
||||
echo "yes"
|
||||
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
--- a/configure
|
||||
+++ b/configure
|
||||
@@ -355,7 +355,7 @@ check_selinux()
|
||||
|
||||
check_tirpc()
|
||||
{
|
||||
- if ${PKG_CONFIG} libtirpc --exists; then
|
||||
+ if [ "${HAVE_TIRPC}" = "y" ] && ${PKG_CONFIG} libtirpc --exists; then
|
||||
echo "HAVE_RPC:=y" >>$CONFIG
|
||||
echo "yes"
|
||||
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
--- a/lib/Makefile
|
||||
+++ b/lib/Makefile
|
||||
@@ -1,7 +1,7 @@
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
include ../config.mk
|
||||
|
||||
-CFLAGS += -fPIC
|
||||
+CFLAGS += $(FPIC)
|
||||
|
||||
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 \
|
||||
|
|
@ -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 | fou | help | ila | ioam | l2tp | link |\n"
|
||||
" macsec | maddress | monitor | mptcp | mroute | mrule |\n"
|
||||
" neighbor | neighbour | netconf | netns | nexthop | ntable |\n"
|
||||
" ntbl | route | rule | sr | stats | tap | tcpmetrics |\n"
|
||||
" token | tunnel | tuntap | vrf | xfrm }\n"
|
||||
+#else
|
||||
+ "where OBJECT := { address | help | link | maddress | monitor |\n"
|
||||
+ " neighbor | neighbour | netns | route |\n"
|
||||
+ " rule | stats | 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
|
||||
|
|
@ -1,41 +0,0 @@
|
|||
From 4e7dbf76227e8c7be7897dc81def3011f637864d Mon Sep 17 00:00:00 2001
|
||||
From: Jonas Gorski <jogo@openwrt.org>
|
||||
Date: Thu, 30 May 2013 11:54:04 +0200
|
||||
Subject: [PATCH] add support for dropping with FAILED_POLICY
|
||||
|
||||
---
|
||||
include/linux/fib_rules.h | 4 ++++
|
||||
include/linux/rtnetlink.h | 1 +
|
||||
ip/rtm_map.c | 4 ++++
|
||||
3 files changed, 9 insertions(+)
|
||||
|
||||
--- a/ip/rtm_map.c
|
||||
+++ b/ip/rtm_map.c
|
||||
@@ -49,6 +49,8 @@ char *rtnl_rtntype_n2a(int id, char *buf
|
||||
return "nat";
|
||||
case RTN_XRESOLVE:
|
||||
return "xresolve";
|
||||
+ case RTN_FAILED_POLICY:
|
||||
+ return "failed_policy";
|
||||
default:
|
||||
snprintf(buf, len, "%d", id);
|
||||
return buf;
|
||||
@@ -84,6 +86,8 @@ int rtnl_rtntype_a2n(int *id, char *arg)
|
||||
res = RTN_UNICAST;
|
||||
else if (strcmp(arg, "throw") == 0)
|
||||
res = RTN_THROW;
|
||||
+ else if (strcmp(arg, "failed_policy") == 0)
|
||||
+ res = RTN_FAILED_POLICY;
|
||||
else {
|
||||
res = strtoul(arg, &end, 0);
|
||||
if (!end || end == arg || *end || res > 255)
|
||||
--- a/include/uapi/linux/rtnetlink.h
|
||||
+++ b/include/uapi/linux/rtnetlink.h
|
||||
@@ -265,6 +265,7 @@ enum {
|
||||
RTN_THROW, /* Not in this table */
|
||||
RTN_NAT, /* Translate this address */
|
||||
RTN_XRESOLVE, /* Use external resolver */
|
||||
+ RTN_FAILED_POLICY, /* Source address failed policy */
|
||||
__RTN_MAX
|
||||
};
|
||||
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
--- a/configure
|
||||
+++ b/configure
|
||||
@@ -241,7 +241,7 @@ int main(int argc, char **argv) {
|
||||
}
|
||||
EOF
|
||||
|
||||
- $CC -o $TMPDIR/libbpf_test $TMPDIR/libbpf_test.c $LIBBPF_CFLAGS $LIBBPF_LDLIBS >/dev/null 2>&1
|
||||
+ $CC -o $TMPDIR/libbpf_test $TMPDIR/libbpf_test.c $LIBBPF_CFLAGS $LIBBPF_LDLIBS $LDFLAGS >/dev/null 2>&1
|
||||
local ret=$?
|
||||
|
||||
rm -f $TMPDIR/libbpf_test.c $TMPDIR/libbpf_test
|
||||
@@ -259,7 +259,7 @@ int main(int argc, char **argv) {
|
||||
}
|
||||
EOF
|
||||
|
||||
- $CC -o $TMPDIR/libbpf_sec_test $TMPDIR/libbpf_sec_test.c $LIBBPF_CFLAGS $LIBBPF_LDLIBS >/dev/null 2>&1
|
||||
+ $CC -o $TMPDIR/libbpf_sec_test $TMPDIR/libbpf_sec_test.c $LIBBPF_CFLAGS $LIBBPF_LDLIBS $LDFLAGS >/dev/null 2>&1
|
||||
local ret=$?
|
||||
|
||||
rm -f $TMPDIR/libbpf_sec_test.c $TMPDIR/libbpf_sec_test
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
--- a/ip/Makefile
|
||||
+++ b/ip/Makefile
|
||||
@@ -28,7 +28,7 @@ STATIC_SYM_SOURCES:=$(filter-out $(STATI
|
||||
|
||||
ALLOBJ=$(IPOBJ) $(RTMONOBJ)
|
||||
SCRIPTS=routel
|
||||
-TARGETS=ip rtmon
|
||||
+TARGETS=$(findstring ip,$(BUILD_VARIANT)) rtmon
|
||||
|
||||
all: $(TARGETS) $(SCRIPTS)
|
||||
|
||||
--- a/tc/Makefile
|
||||
+++ b/tc/Makefile
|
||||
@@ -120,7 +120,7 @@ MODDESTDIR := $(DESTDIR)$(LIBDIR)/tc
|
||||
$(QUIET_CC)$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -shared -fpic $< -o $@
|
||||
|
||||
|
||||
-all: tc $(TCSO)
|
||||
+all: $(findstring tc,$(BUILD_VARIANT)) $(TCSO)
|
||||
|
||||
tc: $(TCOBJ) $(LIBNETLINK) libtc.a
|
||||
$(QUIET_LINK)$(CC) $^ $(LDFLAGS) $(LDLIBS) -o $@
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
--- a/configure
|
||||
+++ b/configure
|
||||
@@ -413,14 +413,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
|
||||
}
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
--- a/configure
|
||||
+++ b/configure
|
||||
@@ -342,7 +342,7 @@ check_libbpf()
|
||||
check_selinux()
|
||||
# SELinux is a compile time option in the ss utility
|
||||
{
|
||||
- if ${PKG_CONFIG} libselinux --exists; then
|
||||
+ if [ "${HAVE_SELINUX}" = "y" ] && ${PKG_CONFIG} libselinux --exists; then
|
||||
echo "HAVE_SELINUX:=y" >>$CONFIG
|
||||
echo "yes"
|
||||
|
||||
|
|
@ -1,490 +0,0 @@
|
|||
if PACKAGE_lcd4linux-custom
|
||||
|
||||
config LCD4LINUX_CUSTOM_NEEDS_libdbus
|
||||
bool
|
||||
|
||||
#config LCD4LINUX_CUSTOM_NEEDS_libftdi
|
||||
# bool
|
||||
|
||||
config LCD4LINUX_CUSTOM_NEEDS_libgd
|
||||
bool
|
||||
|
||||
config LCD4LINUX_CUSTOM_NEEDS_libiconv
|
||||
bool
|
||||
|
||||
config LCD4LINUX_CUSTOM_NEEDS_libjpeg
|
||||
bool
|
||||
|
||||
config LCD4LINUX_CUSTOM_NEEDS_libmpdclient
|
||||
bool
|
||||
|
||||
config LCD4LINUX_CUSTOM_NEEDS_libmysqlclient
|
||||
bool
|
||||
|
||||
config LCD4LINUX_CUSTOM_NEEDS_libncurses
|
||||
bool
|
||||
|
||||
config LCD4LINUX_CUSTOM_NEEDS_libnmeap
|
||||
bool
|
||||
|
||||
config LCD4LINUX_CUSTOM_NEEDS_libsqlite3
|
||||
bool
|
||||
|
||||
config LCD4LINUX_CUSTOM_NEEDS_libusb
|
||||
bool
|
||||
|
||||
#config LCD4LINUX_CUSTOM_NEEDS_libX11
|
||||
# bool
|
||||
|
||||
config LCD4LINUX_CUSTOM_NEEDS_ppp
|
||||
bool
|
||||
|
||||
config LCD4LINUX_CUSTOM_NEEDS_python
|
||||
bool
|
||||
|
||||
|
||||
comment "Drivers ---"
|
||||
|
||||
config LCD4LINUX_CUSTOM_DRIVER_ASTUSB
|
||||
bool
|
||||
prompt "ASTUSB"
|
||||
|
||||
config LCD4LINUX_CUSTOM_DRIVER_BeckmannEgle
|
||||
bool
|
||||
prompt "BeckmannEgle"
|
||||
|
||||
config LCD4LINUX_CUSTOM_DRIVER_BWCT
|
||||
bool
|
||||
prompt "BWCT"
|
||||
select LCD4LINUX_CUSTOM_NEEDS_libusb
|
||||
|
||||
config LCD4LINUX_CUSTOM_DRIVER_CrystalFontz
|
||||
bool
|
||||
prompt "CrystalFontz"
|
||||
|
||||
config LCD4LINUX_CUSTOM_DRIVER_Curses
|
||||
bool
|
||||
prompt "Curses"
|
||||
select LCD4LINUX_CUSTOM_NEEDS_libncurses
|
||||
|
||||
config LCD4LINUX_CUSTOM_DRIVER_Cwlinux
|
||||
bool
|
||||
prompt "Cwlinux"
|
||||
|
||||
config LCD4LINUX_CUSTOM_DRIVER_D4D
|
||||
bool
|
||||
prompt "D4D"
|
||||
select LCD4LINUX_CUSTOM_NEEDS_libgd
|
||||
|
||||
config LCD4LINUX_CUSTOM_DRIVER_dpf
|
||||
bool
|
||||
prompt "dpf"
|
||||
select LCD4LINUX_CUSTOM_NEEDS_libusb
|
||||
select LCD4LINUX_CUSTOM_NEEDS_libgd
|
||||
|
||||
config LCD4LINUX_CUSTOM_DRIVER_EA232graphic
|
||||
bool
|
||||
prompt "EA232graphic"
|
||||
select LCD4LINUX_CUSTOM_NEEDS_libgd
|
||||
|
||||
config LCD4LINUX_CUSTOM_DRIVER_EFN
|
||||
bool
|
||||
prompt "EFN"
|
||||
|
||||
config LCD4LINUX_CUSTOM_DRIVER_FutabaVFD
|
||||
bool
|
||||
prompt "FutabaVFD"
|
||||
|
||||
config LCD4LINUX_CUSTOM_DRIVER_FW8888
|
||||
bool
|
||||
prompt "FW8888"
|
||||
|
||||
config LCD4LINUX_CUSTOM_DRIVER_G15
|
||||
bool
|
||||
prompt "G15"
|
||||
select LCD4LINUX_CUSTOM_NEEDS_libgd
|
||||
select LCD4LINUX_CUSTOM_NEEDS_libusb
|
||||
|
||||
config LCD4LINUX_CUSTOM_DRIVER_GLCD2USB
|
||||
bool
|
||||
prompt "GLCD2USB"
|
||||
select LCD4LINUX_CUSTOM_NEEDS_libgd
|
||||
select LCD4LINUX_CUSTOM_NEEDS_libusb
|
||||
|
||||
config LCD4LINUX_CUSTOM_DRIVER_HD44780
|
||||
bool
|
||||
prompt "HD44780"
|
||||
depends on BROKEN
|
||||
|
||||
config LCD4LINUX_CUSTOM_DRIVER_HD44780-I2C
|
||||
bool
|
||||
prompt "HD44780-I2C"
|
||||
depends on BROKEN
|
||||
|
||||
config LCD4LINUX_CUSTOM_DRIVER_IRLCD
|
||||
bool
|
||||
prompt "IRLCD"
|
||||
select LCD4LINUX_CUSTOM_NEEDS_libusb
|
||||
|
||||
config LCD4LINUX_CUSTOM_DRIVER_LCD2USB
|
||||
bool
|
||||
prompt "LCD2USB"
|
||||
select LCD4LINUX_CUSTOM_NEEDS_libgd
|
||||
select LCD4LINUX_CUSTOM_NEEDS_libusb
|
||||
|
||||
config LCD4LINUX_CUSTOM_DRIVER_LCDLinux
|
||||
bool
|
||||
prompt "LCDLinux"
|
||||
depends on BROKEN
|
||||
|
||||
config LCD4LINUX_CUSTOM_DRIVER_LCDTerm
|
||||
bool
|
||||
prompt "LCDTerm"
|
||||
|
||||
config LCD4LINUX_CUSTOM_DRIVER_LEDMatrix
|
||||
bool
|
||||
prompt "LEDMatrix"
|
||||
select LCD4LINUX_CUSTOM_NEEDS_libgd
|
||||
|
||||
config LCD4LINUX_CUSTOM_DRIVER_LPH7508
|
||||
bool
|
||||
prompt "LPH7508"
|
||||
select LCD4LINUX_CUSTOM_NEEDS_libgd
|
||||
|
||||
config LCD4LINUX_CUSTOM_DRIVER_LUIse
|
||||
bool
|
||||
prompt "LUIse"
|
||||
select LCD4LINUX_CUSTOM_NEEDS_libgd
|
||||
#select LCD4LINUX_CUSTOM_NEEDS_libluise
|
||||
depends on BROKEN
|
||||
|
||||
config LCD4LINUX_CUSTOM_DRIVER_LW_ABP
|
||||
bool
|
||||
prompt "LW_ABP"
|
||||
|
||||
config LCD4LINUX_CUSTOM_DRIVER_M50530
|
||||
bool
|
||||
prompt "M50530"
|
||||
|
||||
config LCD4LINUX_CUSTOM_DRIVER_MatrixOrbital
|
||||
bool
|
||||
prompt "MatrixOrbital"
|
||||
|
||||
config LCD4LINUX_CUSTOM_DRIVER_MatrixOrbitalGX
|
||||
bool
|
||||
prompt "MatrixOrbitalGX"
|
||||
select LCD4LINUX_CUSTOM_NEEDS_libgd
|
||||
select LCD4LINUX_CUSTOM_NEEDS_libusb
|
||||
|
||||
config LCD4LINUX_CUSTOM_DRIVER_mdm166a
|
||||
bool
|
||||
prompt "mdm166a"
|
||||
select LCD4LINUX_CUSTOM_NEEDS_libgd
|
||||
|
||||
config LCD4LINUX_CUSTOM_DRIVER_MilfordInstruments
|
||||
bool
|
||||
prompt "MilfordInstruments"
|
||||
|
||||
config LCD4LINUX_CUSTOM_DRIVER_Newhaven
|
||||
bool
|
||||
prompt "Newhaven"
|
||||
|
||||
config LCD4LINUX_CUSTOM_DRIVER_Noritake
|
||||
bool
|
||||
prompt "Noritake"
|
||||
select LCD4LINUX_CUSTOM_NEEDS_libgd
|
||||
|
||||
config LCD4LINUX_CUSTOM_DRIVER_NULL
|
||||
bool
|
||||
prompt "NULL"
|
||||
default y
|
||||
|
||||
config LCD4LINUX_CUSTOM_DRIVER_Pertelian
|
||||
bool
|
||||
prompt "Pertelian"
|
||||
|
||||
config LCD4LINUX_CUSTOM_DRIVER_PHAnderson
|
||||
bool
|
||||
prompt "PHAnderson"
|
||||
|
||||
config LCD4LINUX_CUSTOM_DRIVER_PICGraphic
|
||||
bool
|
||||
prompt "PICGraphic"
|
||||
select LCD4LINUX_CUSTOM_NEEDS_libgd
|
||||
|
||||
config LCD4LINUX_CUSTOM_DRIVER_picoLCD
|
||||
bool
|
||||
prompt "picoLCD"
|
||||
select LCD4LINUX_CUSTOM_NEEDS_libusb
|
||||
|
||||
config LCD4LINUX_CUSTOM_DRIVER_picoLCDGraphic
|
||||
bool
|
||||
prompt "picoLCDGraphic"
|
||||
select LCD4LINUX_CUSTOM_NEEDS_libgd
|
||||
select LCD4LINUX_CUSTOM_NEEDS_libusb
|
||||
|
||||
config LCD4LINUX_CUSTOM_DRIVER_PNG
|
||||
bool
|
||||
prompt "PNG"
|
||||
select LCD4LINUX_CUSTOM_NEEDS_libgd
|
||||
|
||||
config LCD4LINUX_CUSTOM_DRIVER_PPM
|
||||
bool
|
||||
prompt "PPM"
|
||||
select LCD4LINUX_CUSTOM_NEEDS_libgd
|
||||
|
||||
config LCD4LINUX_CUSTOM_DRIVER_RouterBoard
|
||||
bool
|
||||
prompt "RouterBoard"
|
||||
depends on TARGET_rb532
|
||||
|
||||
config LCD4LINUX_CUSTOM_DRIVER_SamsungSPF
|
||||
bool
|
||||
prompt "SamsungSPF"
|
||||
select LCD4LINUX_CUSTOM_NEEDS_libgd
|
||||
select LCD4LINUX_CUSTOM_NEEDS_libjpeg
|
||||
|
||||
config LCD4LINUX_CUSTOM_DRIVER_serdisplib
|
||||
bool
|
||||
prompt "serdisplib"
|
||||
select LCD4LINUX_CUSTOM_NEEDS_libgd
|
||||
select LCD4LINUX_CUSTOM_NEEDS_serdisplib
|
||||
|
||||
config LCD4LINUX_CUSTOM_DRIVER_ShuttleVFD
|
||||
bool
|
||||
prompt "ShuttleVFD"
|
||||
select LCD4LINUX_CUSTOM_NEEDS_libusb
|
||||
|
||||
config LCD4LINUX_CUSTOM_DRIVER_SimpleLCD
|
||||
bool
|
||||
prompt "SimpleLCD"
|
||||
|
||||
config LCD4LINUX_CUSTOM_DRIVER_st2205
|
||||
bool
|
||||
prompt "st2205"
|
||||
select LCD4LINUX_CUSTOM_NEEDS_libgd
|
||||
select LCD4LINUX_CUSTOM_NEEDS_st2205tool
|
||||
|
||||
config LCD4LINUX_CUSTOM_DRIVER_T6963
|
||||
bool
|
||||
prompt "T6963"
|
||||
select LCD4LINUX_CUSTOM_NEEDS_libgd
|
||||
|
||||
config LCD4LINUX_CUSTOM_DRIVER_TeakLCM
|
||||
bool
|
||||
prompt "TeakLCM"
|
||||
|
||||
config LCD4LINUX_CUSTOM_DRIVER_TEW673GRU
|
||||
bool
|
||||
select LCD4LINUX_CUSTOM_NEEDS_libgd
|
||||
depends on TARGET_ar71xx
|
||||
default TARGET_ar71xx
|
||||
|
||||
config LCD4LINUX_CUSTOM_DRIVER_Trefon
|
||||
bool
|
||||
prompt "Trefon"
|
||||
select LCD4LINUX_CUSTOM_NEEDS_libusb
|
||||
|
||||
#config LCD4LINUX_CUSTOM_DRIVER_ULA200
|
||||
# bool
|
||||
# prompt "ULA200"
|
||||
# select LCD4LINUX_CUSTOM_NEEDS_libftdi
|
||||
# select LCD4LINUX_CUSTOM_NEEDS_libusb
|
||||
|
||||
config LCD4LINUX_CUSTOM_DRIVER_USBHUB
|
||||
bool
|
||||
prompt "USBHUB"
|
||||
select LCD4LINUX_CUSTOM_NEEDS_libusb
|
||||
|
||||
config LCD4LINUX_CUSTOM_DRIVER_USBLCD
|
||||
bool
|
||||
prompt "USBLCD"
|
||||
select LCD4LINUX_CUSTOM_NEEDS_libusb
|
||||
|
||||
config LCD4LINUX_CUSTOM_DRIVER_VNC
|
||||
bool
|
||||
prompt "VNC"
|
||||
select LCD4LINUX_CUSTOM_NEEDS_libgd
|
||||
select LCD4LINUX_CUSTOM_NEEDS_libvncserver
|
||||
|
||||
config LCD4LINUX_CUSTOM_DRIVER_WincorNixdorf
|
||||
bool
|
||||
prompt "WincorNixdorf"
|
||||
|
||||
#config LCD4LINUX_CUSTOM_DRIVER_X11
|
||||
# bool
|
||||
# prompt "X11"
|
||||
# select LCD4LINUX_CUSTOM_NEEDS_libgd
|
||||
# select LCD4LINUX_CUSTOM_NEEDS_libX11
|
||||
|
||||
|
||||
comment "Plugins ---"
|
||||
|
||||
config LCD4LINUX_CUSTOM_PLUGIN_apm
|
||||
bool
|
||||
prompt "apm"
|
||||
|
||||
config LCD4LINUX_CUSTOM_PLUGIN_asterisk
|
||||
bool
|
||||
prompt "asterisk"
|
||||
|
||||
config LCD4LINUX_CUSTOM_PLUGIN_button_exec
|
||||
bool
|
||||
prompt "button_exec"
|
||||
|
||||
config LCD4LINUX_CUSTOM_PLUGIN_cpuinfo
|
||||
bool
|
||||
prompt "cpuinfo"
|
||||
default y
|
||||
|
||||
config LCD4LINUX_CUSTOM_PLUGIN_dbus
|
||||
bool
|
||||
prompt "dbus"
|
||||
select LCD4LINUX_CUSTOM_NEEDS_libdbus
|
||||
|
||||
config LCD4LINUX_CUSTOM_PLUGIN_diskstats
|
||||
bool
|
||||
prompt "diskstats"
|
||||
|
||||
config LCD4LINUX_CUSTOM_PLUGIN_dvb
|
||||
bool
|
||||
prompt "dvb"
|
||||
|
||||
config LCD4LINUX_CUSTOM_PLUGIN_event
|
||||
bool
|
||||
prompt "event"
|
||||
|
||||
config LCD4LINUX_CUSTOM_PLUGIN_exec
|
||||
bool
|
||||
prompt "exec"
|
||||
|
||||
config LCD4LINUX_CUSTOM_PLUGIN_fifo
|
||||
bool
|
||||
prompt "fifo"
|
||||
|
||||
config LCD4LINUX_CUSTOM_PLUGIN_file
|
||||
bool
|
||||
prompt "file"
|
||||
|
||||
config LCD4LINUX_CUSTOM_PLUGIN_gps
|
||||
bool
|
||||
prompt "gps"
|
||||
select LCD4LINUX_CUSTOM_NEEDS_libnmeap
|
||||
|
||||
config LCD4LINUX_CUSTOM_PLUGIN_hddtemp
|
||||
bool
|
||||
prompt "hddtemp"
|
||||
|
||||
config LCD4LINUX_CUSTOM_PLUGIN_huawei
|
||||
bool
|
||||
prompt "huawei"
|
||||
|
||||
config LCD4LINUX_CUSTOM_PLUGIN_i2c_sensors
|
||||
bool
|
||||
prompt "i2c_sensors"
|
||||
|
||||
config LCD4LINUX_CUSTOM_PLUGIN_iconv
|
||||
bool
|
||||
prompt "iconv"
|
||||
select LCD4LINUX_CUSTOM_NEEDS_libiconv
|
||||
|
||||
config LCD4LINUX_CUSTOM_PLUGIN_imon
|
||||
bool
|
||||
prompt "imon"
|
||||
|
||||
config LCD4LINUX_CUSTOM_PLUGIN_isdn
|
||||
bool
|
||||
prompt "isdn"
|
||||
|
||||
config LCD4LINUX_CUSTOM_PLUGIN_kvv
|
||||
bool
|
||||
prompt "kvv"
|
||||
|
||||
config LCD4LINUX_CUSTOM_PLUGIN_loadavg
|
||||
bool
|
||||
prompt "loadavg"
|
||||
default y
|
||||
|
||||
config LCD4LINUX_CUSTOM_PLUGIN_meminfo
|
||||
bool
|
||||
prompt "meminfo"
|
||||
default y
|
||||
|
||||
config LCD4LINUX_CUSTOM_PLUGIN_mpd
|
||||
bool
|
||||
prompt "mpd"
|
||||
select LCD4LINUX_CUSTOM_NEEDS_libmpdclient
|
||||
|
||||
config LCD4LINUX_CUSTOM_PLUGIN_mpris_dbus
|
||||
bool
|
||||
prompt "mpris_dbus"
|
||||
select LCD4LINUX_CUSTOM_NEEDS_libdbus
|
||||
|
||||
config LCD4LINUX_CUSTOM_PLUGIN_mysql
|
||||
bool
|
||||
prompt "mysql"
|
||||
select LCD4LINUX_CUSTOM_NEEDS_libmysqlclient
|
||||
|
||||
config LCD4LINUX_CUSTOM_PLUGIN_netdev
|
||||
bool
|
||||
prompt "netdev"
|
||||
|
||||
config LCD4LINUX_CUSTOM_PLUGIN_netinfo
|
||||
bool
|
||||
prompt "netinfo"
|
||||
|
||||
config LCD4LINUX_CUSTOM_PLUGIN_pop3
|
||||
bool
|
||||
prompt "pop3"
|
||||
|
||||
config LCD4LINUX_CUSTOM_PLUGIN_ppp
|
||||
bool
|
||||
prompt "ppp"
|
||||
select LCD4LINUX_CUSTOM_NEEDS_ppp
|
||||
|
||||
config LCD4LINUX_CUSTOM_PLUGIN_proc_stat
|
||||
bool
|
||||
prompt "proc_stat"
|
||||
default y
|
||||
|
||||
#config LCD4LINUX_CUSTOM_PLUGIN_python
|
||||
# bool
|
||||
# prompt "python"
|
||||
# select LCD4LINUX_CUSTOM_NEEDS_python
|
||||
|
||||
config LCD4LINUX_CUSTOM_PLUGIN_qnaplog
|
||||
bool
|
||||
prompt "qnaplog"
|
||||
select LCD4LINUX_CUSTOM_NEEDS_libsqlite3
|
||||
|
||||
config LCD4LINUX_CUSTOM_PLUGIN_seti
|
||||
bool
|
||||
prompt "seti"
|
||||
|
||||
config LCD4LINUX_CUSTOM_PLUGIN_statfs
|
||||
bool
|
||||
prompt "statfs"
|
||||
|
||||
config LCD4LINUX_CUSTOM_PLUGIN_uname
|
||||
bool
|
||||
prompt "uname"
|
||||
|
||||
config LCD4LINUX_CUSTOM_PLUGIN_uptime
|
||||
bool
|
||||
prompt "uptime"
|
||||
default y
|
||||
|
||||
config LCD4LINUX_CUSTOM_PLUGIN_w1retap
|
||||
bool
|
||||
prompt "w1retap"
|
||||
|
||||
config LCD4LINUX_CUSTOM_PLUGIN_wireless
|
||||
bool
|
||||
prompt "wireless"
|
||||
depends on BROKEN
|
||||
|
||||
config LCD4LINUX_CUSTOM_PLUGIN_xmms
|
||||
bool
|
||||
prompt "xmms"
|
||||
|
||||
endif
|
||||
|
|
@ -1,306 +0,0 @@
|
|||
#
|
||||
# Copyright (C) 2007-2015 OpenWrt.org
|
||||
# Copyright (C) 2019 Ycarus (Yannick Chabanois) <ycarus@zugaina.org>
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=lcd4linux
|
||||
PKG_REV:=f13470faf00e52d1458f2a88d498716240edc272
|
||||
PKG_VERSION:=r$(PKG_REV)
|
||||
PKG_RELEASE:=4
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
|
||||
#PKG_SOURCE_URL:=https://ssl.bulix.org/svn/lcd4linux/trunk/
|
||||
PKG_SOURCE_URL:=https://github.com/redblue-pkt/lcd4linux.git
|
||||
#PKG_SOURCE_SUBDIR:=lcd4linux-$(PKG_VERSION)
|
||||
PKG_SOURCE_VERSION:=$(PKG_REV)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
|
||||
LCD4LINUX_DRIVERS:= \
|
||||
ASTUSB \
|
||||
BeckmannEgle \
|
||||
BWCT \
|
||||
CrystalFontz \
|
||||
Curses \
|
||||
Cwlinux \
|
||||
D4D \
|
||||
DPF \
|
||||
EA232graphic \
|
||||
EFN \
|
||||
FutabaVFD \
|
||||
FW8888 \
|
||||
GLCD2USB \
|
||||
IRLCD \
|
||||
$(if $(CONFIG_BROKEN),HD44780) \
|
||||
$(if $(CONFIG_BROKEN),HD44780-I2C) \
|
||||
LCD2USB \
|
||||
$(if $(CONFIG_BROKEN),LCDLinux) \
|
||||
LCDTerm \
|
||||
LEDMatrix \
|
||||
LPH7508 \
|
||||
$(if $(CONFIG_BROKEN),LUIse) \
|
||||
LW_ABP \
|
||||
M50530 \
|
||||
MatrixOrbital \
|
||||
MatrixOrbitalGX \
|
||||
MilfordInstruments \
|
||||
Newhaven \
|
||||
Noritake \
|
||||
NULL \
|
||||
Pertelian \
|
||||
PHAnderson \
|
||||
PICGraphic \
|
||||
picoLCD \
|
||||
picoLCDGraphic \
|
||||
PNG \
|
||||
PPM \
|
||||
$(if $(CONFIG_TARGET_rb532),RouterBoard) \
|
||||
$(if $(CONFIG_BROKEN),SamsungSPF) \
|
||||
ShuttleVFD \
|
||||
SimpleLCD \
|
||||
st2205 \
|
||||
T6963 \
|
||||
TeakLCM \
|
||||
$(if $(CONFIG_TARGET_ar71xx),TEW673GRU) \
|
||||
Trefon \
|
||||
USBHUB \
|
||||
USBLCD \
|
||||
VNC \
|
||||
WincorNixdorf \
|
||||
serdisplib \
|
||||
# G15 \
|
||||
# ULA200 \
|
||||
# X11 \
|
||||
|
||||
LCD4LINUX_PLUGINS:= \
|
||||
apm \
|
||||
asterisk \
|
||||
button_exec \
|
||||
cpuinfo \
|
||||
dbus \
|
||||
diskstats \
|
||||
dvb \
|
||||
event \
|
||||
exec \
|
||||
fifo \
|
||||
file \
|
||||
gps \
|
||||
hddtemp \
|
||||
huawei \
|
||||
i2c_sensors \
|
||||
iconv \
|
||||
imon \
|
||||
isdn \
|
||||
kvv \
|
||||
loadavg \
|
||||
netdev \
|
||||
netinfo \
|
||||
meminfo \
|
||||
mpris_dbus \
|
||||
netdev \
|
||||
pop3 \
|
||||
ppp \
|
||||
proc_stat \
|
||||
qnaplog \
|
||||
seti \
|
||||
statfs \
|
||||
uname \
|
||||
uptime \
|
||||
w1retap \
|
||||
$(if $(CONFIG_BROKEN),wireless) \
|
||||
xmms \
|
||||
# mpd \
|
||||
# mysql \
|
||||
# python \
|
||||
|
||||
PKG_FIXUP:=autoreconf
|
||||
PKG_INSTALL:=1
|
||||
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
PKG_BUILD_DEPENDS:= \
|
||||
# ppp \
|
||||
# libftdi \
|
||||
# libX11 \
|
||||
# python \
|
||||
|
||||
PKG_CONFIG_DEPENDS:= \
|
||||
$(patsubst %,CONFIG_LCD4LINUX_CUSTOM_DRIVER_%,$(LCD4LINUX_DRIVERS)) \
|
||||
$(patsubst %,CONFIG_LCD4LINUX_CUSTOM_PLUGIN_%,$(LCD4LINUX_PLUGINS)) \
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(INCLUDE_DIR)/nls.mk
|
||||
|
||||
define Package/lcd4linux/Default
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
PKG_MAINTAINER:=Jonathan McCrohan <jmccrohan@gmail.com>
|
||||
TITLE:=LCD display utility
|
||||
URL:=http://lcd4linux.bulix.org/
|
||||
endef
|
||||
|
||||
define Package/lcd4linux/Default/description
|
||||
LCD4Linux is a small program that grabs information from the kernel and
|
||||
some subsystems and displays it on an external liquid crystal display.
|
||||
endef
|
||||
|
||||
|
||||
define Package/lcd4linux-custom
|
||||
$(call Package/lcd4linux/Default)
|
||||
DEPENDS:= \
|
||||
+LCD4LINUX_CUSTOM_NEEDS_libdbus:libdbus \
|
||||
+LCD4LINUX_CUSTOM_NEEDS_libgd:libgd \
|
||||
$(if $(ICONV_FULL),+LCD4LINUX_CUSTOM_NEEDS_libiconv:libiconv-full) \
|
||||
+LCD4LINUX_CUSTOM_NEEDS_libjpeg:libjpeg \
|
||||
+LCD4LINUX_CUSTOM_NEEDS_libncurses:libncurses \
|
||||
+LCD4LINUX_CUSTOM_NEEDS_libsqlite3:libsqlite3 \
|
||||
+LCD4LINUX_CUSTOM_NEEDS_libusb:libusb-compat \
|
||||
# +LCD4LINUX_CUSTOM_NEEDS_libmpdclient:libmpdclient \
|
||||
# +LCD4LINUX_CUSTOM_NEEDS_libmysqlclient:libmysqlclient \
|
||||
# +LCD4LINUX_CUSTOM_NEEDS_libftdi:libftdi \
|
||||
# +LCD4LINUX_CUSTOM_NEEDS_libX11:libX11 \
|
||||
# +LCD4LINUX_CUSTOM_NEEDS_python:python
|
||||
MENU:=1
|
||||
PROVIDES:=lcd4linux
|
||||
VARIANT=custom
|
||||
endef
|
||||
|
||||
define Package/lcd4linux-custom/config
|
||||
source "$(SOURCE)/Config.in"
|
||||
endef
|
||||
|
||||
define Package/lcd4linux-custom/description
|
||||
$(call Package/lcd4linux/Default/description)
|
||||
.
|
||||
This package contains a customized version of LCD4Linux.
|
||||
endef
|
||||
|
||||
|
||||
define Package/lcd4linux-full
|
||||
$(call Package/lcd4linux/Default)
|
||||
DEPENDS:= \
|
||||
+libdbus \
|
||||
+libgd \
|
||||
$(if $(ICONV_FULL),+libiconv-full) \
|
||||
+libncurses \
|
||||
+libsqlite3 \
|
||||
+libusb-compat \
|
||||
+serdisplib
|
||||
# +libmpdclient \
|
||||
# +libmysqlclient \
|
||||
# +libftdi \
|
||||
# +libX11 \
|
||||
# +python
|
||||
PROVIDES:=lcd4linux
|
||||
VARIANT=full
|
||||
endef
|
||||
|
||||
define Package/lcd4linux-full/description
|
||||
$(call Package/lcd4linux/Default/description)
|
||||
.
|
||||
This package contains a version of LCD4Linux built with all supported
|
||||
drivers and plugins.
|
||||
endef
|
||||
|
||||
|
||||
CONFIGURE_ARGS+= \
|
||||
--disable-rpath \
|
||||
|
||||
EXTRA_LDFLAGS+= -Wl,-rpath-link,$(STAGING_DIR)/usr/lib
|
||||
|
||||
ifeq ($(BUILD_VARIANT),custom)
|
||||
|
||||
LCD4LINUX_CUSTOM_DRIVERS:= $(strip $(foreach c, $(LCD4LINUX_DRIVERS), \
|
||||
$(if $(CONFIG_LCD4LINUX_CUSTOM_DRIVER_$(c)),$(c),) \
|
||||
))
|
||||
ifeq ($(LCD4LINUX_CUSTOM_DRIVERS),)
|
||||
LCD4LINUX_CUSTOM_DRIVERS:=Sample
|
||||
endif
|
||||
|
||||
LCD4LINUX_CUSTOM_PLUGINS:= $(strip $(foreach c, $(LCD4LINUX_PLUGINS), \
|
||||
$(if $(CONFIG_LCD4LINUX_CUSTOM_PLUGIN_$(c)),$(c)) \
|
||||
))
|
||||
ifeq ($(LCD4LINUX_CUSTOM_PLUGINS),)
|
||||
LCD4LINUX_CUSTOM_PLUGINS:=sample
|
||||
endif
|
||||
|
||||
CONFIGURE_ARGS+= \
|
||||
--with-drivers="$(LCD4LINUX_CUSTOM_DRIVERS)" \
|
||||
--with-plugins="$(LCD4LINUX_CUSTOM_PLUGINS)" \
|
||||
|
||||
ifneq ($(CONFIG_LCD4LINUX_CUSTOM_NEEDS_libiconv),)
|
||||
CONFIGURE_ARGS+= --with-libiconv-prefix="$(ICONV_PREFIX)"
|
||||
else
|
||||
CONFIGURE_ARGS+= --without-libiconv-prefix
|
||||
endif
|
||||
|
||||
ifneq ($(CONFIG_LCD4LINUX_CUSTOM_NEEDS_libmysqlclient),)
|
||||
EXTRA_LDFLAGS+= -L$(STAGING_DIR)/usr/lib/mysql
|
||||
endif
|
||||
|
||||
# ifneq ($(CONFIG_LCD4LINUX_CUSTOM_NEEDS_python),)
|
||||
# CONFIGURE_ARGS+= --with-python
|
||||
# else
|
||||
CONFIGURE_ARGS+= --without-python
|
||||
# endif
|
||||
|
||||
# ifneq ($(CONFIG_LCD4LINUX_CUSTOM_NEEDS_libX11),)
|
||||
# CONFIGURE_ARGS+= --with-x
|
||||
# else
|
||||
CONFIGURE_ARGS+= --without-x
|
||||
# endif
|
||||
|
||||
endif
|
||||
|
||||
ifeq ($(BUILD_VARIANT),full)
|
||||
|
||||
LCD4LINUX_FULL_DRIVERS:= $(strip $(foreach c, $(LCD4LINUX_DRIVERS), \
|
||||
$(c) \
|
||||
))
|
||||
|
||||
LCD4LINUX_FULL_PLUGINS:= $(strip $(foreach c, $(LCD4LINUX_PLUGINS), \
|
||||
$(c) \
|
||||
))
|
||||
|
||||
CONFIGURE_ARGS+= \
|
||||
--with-drivers="$(LCD4LINUX_FULL_DRIVERS)" \
|
||||
--with-plugins="$(LCD4LINUX_FULL_PLUGINS)" \
|
||||
--with-libiconv-prefix="$(ICONV_PREFIX)" \
|
||||
--without-python \
|
||||
--without-x \
|
||||
|
||||
EXTRA_LDFLAGS+= -L$(STAGING_DIR)/usr/lib/mysql
|
||||
|
||||
endif
|
||||
|
||||
|
||||
define Package/lcd4linux/conffiles
|
||||
/etc/lcd4linux.conf
|
||||
endef
|
||||
|
||||
define Package/lcd4linux/install
|
||||
$(INSTALL_DIR) $(1)/usr/bin
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/bin/lcd4linux $(1)/usr/bin/
|
||||
$(INSTALL_DIR) $(1)/etc
|
||||
$(INSTALL_CONF) $(PKG_BUILD_DIR)/lcd4linux.conf.sample $(1)/etc/lcd4linux.conf
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_BIN) ./files/lcd4linux.init $(1)/etc/init.d/lcd4linux
|
||||
$(SED) "s|^\(Display 'GLCD2USB'\)|#\1|g" \
|
||||
-e "s|^\(Layout 'TestLayer'\)|#\1|g" \
|
||||
-e "s|^#\(Display 'Image'\)|\1|g" \
|
||||
-e "s|^#\(Layout 'Default'\)|\1|g" \
|
||||
$(1)/etc/lcd4linux.conf
|
||||
endef
|
||||
|
||||
Package/lcd4linux-custom/conffiles = $(Package/lcd4linux/conffiles)
|
||||
Package/lcd4linux-custom/install = $(Package/lcd4linux/install)
|
||||
|
||||
Package/lcd4linux-full/conffiles = $(Package/lcd4linux/conffiles)
|
||||
Package/lcd4linux-full/install = $(Package/lcd4linux/install)
|
||||
|
||||
$(eval $(call BuildPackage,lcd4linux-custom))
|
||||
$(eval $(call BuildPackage,lcd4linux-full))
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
#!/bin/sh /etc/rc.common
|
||||
# Copyright (C) 2007-2015 OpenWrt.org
|
||||
|
||||
START=98
|
||||
|
||||
SERVICE_USE_PID=1
|
||||
|
||||
start() {
|
||||
service_start /usr/bin/lcd4linux -o /tmp/lcd4linux.png -q
|
||||
}
|
||||
|
||||
stop() {
|
||||
service_stop /usr/bin/lcd4linux
|
||||
}
|
||||
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
--- a/Makefile.am
|
||||
+++ b/Makefile.am
|
||||
@@ -18,7 +18,7 @@ ACLOCAL_AMFLAGS=-I m4
|
||||
# use this for lots of warnings
|
||||
#AM_CFLAGS = -D_GNU_SOURCE -std=c99 -m64 -Wall -W -pedantic -Wno-variadic-macros -fno-strict-aliasing
|
||||
|
||||
-lcd4linux_LDFLAGS ="-Wl,--as-needed"
|
||||
+lcd4linux_LDFLAGS =
|
||||
lcd4linux_LDADD = @DRIVERS@ @PLUGINS@ @DRVLIBS@ @PLUGINLIBS@
|
||||
lcd4linux_DEPENDENCIES = @DRIVERS@ @PLUGINS@
|
||||
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
--- a/drv_T6963.c
|
||||
+++ b/drv_T6963.c
|
||||
@@ -114,7 +114,9 @@ static void drv_T6_status1(void)
|
||||
/* wait for STA0=1 and STA1=1 */
|
||||
n = 0;
|
||||
do {
|
||||
+#if 0
|
||||
rep_nop();
|
||||
+#endif
|
||||
if (++n > 1000) {
|
||||
debug("hang in status1");
|
||||
bug = 1;
|
||||
@@ -150,7 +152,9 @@ static void drv_T6_status2(void)
|
||||
/* wait for STA3=1 */
|
||||
n = 0;
|
||||
do {
|
||||
+#if 0
|
||||
rep_nop();
|
||||
+#endif
|
||||
if (++n > 1000) {
|
||||
debug("hang in status2");
|
||||
bug = 1;
|
||||
File diff suppressed because it is too large
Load diff
|
|
@ -1,24 +0,0 @@
|
|||
--- a/drv_G15.c
|
||||
+++ b/drv_G15.c
|
||||
@@ -42,6 +42,7 @@
|
||||
|
||||
#include <usb.h>
|
||||
#include <fcntl.h>
|
||||
+#include <linux/version.h>
|
||||
#include <linux/input.h>
|
||||
#include <linux/uinput.h>
|
||||
|
||||
@@ -269,8 +270,13 @@ void drv_G15_initKeyHandling(char *devic
|
||||
}
|
||||
memset(&device, 0, sizeof(device));
|
||||
strncpy(device.name, "G15 Keys", UINPUT_MAX_NAME_SIZE);
|
||||
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
|
||||
device.id.bustype = BUS_USB;
|
||||
device.id.version = 4;
|
||||
+#else
|
||||
+ device.idbus = BUS_USB;
|
||||
+ device.idversion = 4;
|
||||
+#endif
|
||||
|
||||
ioctl(uinput_fd, UI_SET_EVBIT, EV_KEY);
|
||||
|
||||
|
|
@ -1,195 +0,0 @@
|
|||
--- a/Makefile.am
|
||||
+++ b/Makefile.am
|
||||
@@ -71,6 +71,8 @@ drv_generic_i2c.c \
|
||||
drv_generic_i2c.h \
|
||||
drv_generic_keypad.c \
|
||||
drv_generic_keypad.h \
|
||||
+drv_generic_spidev.c \
|
||||
+drv_generic_spidev.h \
|
||||
drv_ASTUSB.c \
|
||||
drv_BeckmannEgle.c \
|
||||
drv_BWCT.c \
|
||||
--- /dev/null
|
||||
+++ b/drv_generic_spidev.c
|
||||
@@ -0,0 +1,89 @@
|
||||
+/* $Id$
|
||||
+ * $URL$
|
||||
+ *
|
||||
+ * generic driver helper for displays connected via SPI bus
|
||||
+ *
|
||||
+ * Copyright (C) 2012 Gabor Juhos <juhosg@openwrt.org>
|
||||
+ *
|
||||
+ * This file is part of LCD4Linux.
|
||||
+ *
|
||||
+ * LCD4Linux is free software; you can redistribute it and/or modify
|
||||
+ * it under the terms of the GNU General Public License as published by
|
||||
+ * the Free Software Foundation; either version 2, or (at your option)
|
||||
+ * any later version.
|
||||
+ *
|
||||
+ * LCD4Linux is distributed in the hope that it will be useful,
|
||||
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+ * GNU General Public License for more details.
|
||||
+ *
|
||||
+ * You should have received a copy of the GNU General Public License
|
||||
+ * along with this program; if not, write to the Free Software
|
||||
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
+ *
|
||||
+ */
|
||||
+
|
||||
+#include "config.h"
|
||||
+
|
||||
+#include <stdlib.h>
|
||||
+#include <stdio.h>
|
||||
+#include <string.h>
|
||||
+#include <errno.h>
|
||||
+#include <unistd.h>
|
||||
+#include <fcntl.h>
|
||||
+#include <sys/types.h>
|
||||
+#include <sys/ioctl.h>
|
||||
+
|
||||
+#include "debug.h"
|
||||
+#include "qprintf.h"
|
||||
+#include "cfg.h"
|
||||
+#include "drv_generic_spidev.h"
|
||||
+
|
||||
+static char *generic_spidev_section = "";
|
||||
+static char *generic_spidev_driver = "";
|
||||
+static int generic_spidev_fd;
|
||||
+
|
||||
+int drv_generic_spidev_open(const char *section, const char *driver)
|
||||
+{
|
||||
+ char *spidev;
|
||||
+
|
||||
+ udelay_init();
|
||||
+
|
||||
+ generic_spidev_section = (char *) section;
|
||||
+ generic_spidev_driver = (char *) driver;
|
||||
+
|
||||
+ spidev = cfg_get(generic_spidev_section, "Port", NULL);
|
||||
+
|
||||
+ info("%s: initializing SPI device %s", generic_spidev_driver, spidev);
|
||||
+ generic_spidev_fd = open(spidev, O_WRONLY);
|
||||
+ if (generic_spidev_fd < 0) {
|
||||
+ error("%s: unable to open SPI device %s!\n", generic_spidev_driver, spidev);
|
||||
+ goto exit_error;
|
||||
+ }
|
||||
+
|
||||
+ return 0;
|
||||
+
|
||||
+ exit_error:
|
||||
+ free(spidev);
|
||||
+ return -1;
|
||||
+}
|
||||
+
|
||||
+int drv_generic_spidev_close(void)
|
||||
+{
|
||||
+ close(generic_spidev_fd);
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+int drv_generic_spidev_transfer(const int count, struct spi_ioc_transfer *tr)
|
||||
+{
|
||||
+ int ret;
|
||||
+
|
||||
+ ret = ioctl(generic_spidev_fd, SPI_IOC_MESSAGE(count), tr);
|
||||
+ if (ret < count) {
|
||||
+ error("%s: can't send SPI message! (%s)\n",
|
||||
+ generic_spidev_driver, strerror(errno));
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
--- /dev/null
|
||||
+++ b/drv_generic_spidev.h
|
||||
@@ -0,0 +1,54 @@
|
||||
+/* $Id$
|
||||
+ * $URL$
|
||||
+ *
|
||||
+ * generic driver helper for displays connected via SPI bus
|
||||
+ *
|
||||
+ * Copyright (C) 2012 Gabor Juhos <juhosg@openwrt.org>
|
||||
+ * Copyright (C) 2012 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net>
|
||||
+ *
|
||||
+ * This file is part of LCD4Linux.
|
||||
+ *
|
||||
+ * LCD4Linux is free software; you can redistribute it and/or modify
|
||||
+ * it under the terms of the GNU General Public License as published by
|
||||
+ * the Free Software Foundation; either version 2, or (at your option)
|
||||
+ * any later version.
|
||||
+ *
|
||||
+ * LCD4Linux is distributed in the hope that it will be useful,
|
||||
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+ * GNU General Public License for more details.
|
||||
+ *
|
||||
+ * You should have received a copy of the GNU General Public License
|
||||
+ * along with this program; if not, write to the Free Software
|
||||
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
+ *
|
||||
+ */
|
||||
+
|
||||
+/*
|
||||
+ *
|
||||
+ * exported fuctions:
|
||||
+ *
|
||||
+ * int drv_generic_spidev_open (const char *section, const char *driver)
|
||||
+ * reads 'Port' entry from config and opens
|
||||
+ * the SPI device
|
||||
+ * returns 0 if ok, -1 on failure
|
||||
+ *
|
||||
+ * int drv_generic_spidev_close (void)
|
||||
+ * closes SPI device
|
||||
+ * returns 0 if ok, -1 on failure
|
||||
+ *
|
||||
+ * void drv_generic_spidev_transfer (int count, struct spi_ioc_transfer *tr)
|
||||
+ * transfer data to/from the SPI device
|
||||
+ *
|
||||
+ */
|
||||
+
|
||||
+#ifndef _DRV_GENERIC_SPIDEV_H_
|
||||
+#define _DRV_GENERIC_SPIDEV_H_
|
||||
+
|
||||
+#include <linux/spi/spidev.h>
|
||||
+
|
||||
+int drv_generic_spidev_open(const char *section, const char *driver);
|
||||
+int drv_generic_spidev_close(void);
|
||||
+int drv_generic_spidev_transfer(const int count, struct spi_ioc_transfer *tr);
|
||||
+
|
||||
+#endif /* _DRV_GENERIC_SPIDEV_H_ */
|
||||
--- a/drivers.m4
|
||||
+++ b/drivers.m4
|
||||
@@ -301,6 +301,7 @@ PARPORT="no"
|
||||
SERIAL="no"
|
||||
I2C="no"
|
||||
KEYPAD="no"
|
||||
+SPIDEV="no"
|
||||
|
||||
# generic libraries
|
||||
LIBUSB="no"
|
||||
@@ -936,6 +937,12 @@ if test "$LIBJPEG" = "yes"; then
|
||||
DRVLIBS="$DRVLIBS -ljpeg"
|
||||
fi
|
||||
|
||||
+# generic spidev driver
|
||||
+if test "$SPIDEV" = "yes"; then
|
||||
+ DRIVERS="$DRIVERS drv_generic_spidev.o"
|
||||
+ AC_DEFINE(WITH_SPIDEV, 1, [SPIDEV driver])
|
||||
+fi
|
||||
+
|
||||
# libusb
|
||||
if test "$LIBUSB" = "yes"; then
|
||||
DRVLIBS="$DRVLIBS -lusb"
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -115,6 +115,9 @@ AC_ARG_WITH(outb,
|
||||
|
||||
AC_CHECK_HEADERS([asm/io.h] [linux/parport.h linux/ppdev.h], [has_parport="true"], [has_parport="false"])
|
||||
|
||||
+# check for spidev
|
||||
+AC_CHECK_HEADERS([linux/spi/spidev.h], [has_spidev="true"], [has_spidev="false"])
|
||||
+
|
||||
# drivers
|
||||
sinclude(drivers.m4)
|
||||
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
--- a/drv_GLCD2USB.c
|
||||
+++ b/drv_GLCD2USB.c
|
||||
@@ -48,6 +48,7 @@
|
||||
#include <fcntl.h>
|
||||
#include <sys/time.h>
|
||||
#include <usb.h>
|
||||
+#include <endian.h>
|
||||
|
||||
#include "debug.h"
|
||||
#include "cfg.h"
|
||||
@@ -487,6 +488,9 @@ static int drv_GLCD2USB_start(const char
|
||||
return -1;
|
||||
}
|
||||
|
||||
+ buffer.display_info.width = le16toh(buffer.display_info.width);
|
||||
+ buffer.display_info.height = le16toh(buffer.display_info.height);
|
||||
+
|
||||
info("%s: display name = %s", Name, buffer.display_info.name);
|
||||
info("%s: display resolution = %d * %d", Name, buffer.display_info.width, buffer.display_info.height);
|
||||
info("%s: display flags: %x", Name, buffer.display_info.flags);
|
||||
|
|
@ -1,44 +0,0 @@
|
|||
#
|
||||
# Copyright (C) 2020-2021 Ycarus (Yannick Chabanois) <ycarus@zugaina.org>
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=ell
|
||||
PKG_VERSION:=0.41
|
||||
PKG_RELEASE:=1
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
|
||||
PKG_HASH:=4e8dba6c53cf152dbd0fd1dc3d4c7b04abf79e20a948895f85943e586870505c
|
||||
PKG_SOURCE_URL:=@KERNEL/linux/libs/ell
|
||||
PKG_LICENSE:=GPL-2.0
|
||||
PKG_LICENSE_FILES:=GPL
|
||||
PKG_INSTALL:=1
|
||||
PKG_MAINTAINER:=Ycarus <ycarus@zugaina.org>
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/libell
|
||||
SECTION:=libs
|
||||
CATEGORY:=Libraries
|
||||
TITLE:=Embedded Linux library
|
||||
URL:=https://git.kernel.org/pub/scm/libs/ell/ell.git
|
||||
endef
|
||||
|
||||
define Package/libell/description
|
||||
Embeded Linux library
|
||||
endef
|
||||
|
||||
define Package/libell/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libell*.so* $(1)/usr/lib
|
||||
endef
|
||||
|
||||
define Build/InstallDev
|
||||
$(INSTALL_DIR) $(1)
|
||||
$(CP) $(PKG_INSTALL_DIR)/* $(1)/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,libell))
|
||||
|
|
@ -1,125 +0,0 @@
|
|||
#
|
||||
# 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))
|
||||
|
|
@ -1,97 +0,0 @@
|
|||
#
|
||||
# Copyright (C) 2016 Velocloud Inc.
|
||||
# Copyright (C) 2016 Aleksander Morgado <aleksander@aleksander.es>
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libmbim
|
||||
PKG_VERSION:=1.31.6
|
||||
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
|
||||
#libmPKG_MIRROR_HASH:=8fc4e2d78d6a1003bf89303d3ce779283b176d74e84a241ba8efb0d468605268
|
||||
|
||||
PKG_BUILD_FLAGS:=gc-sections
|
||||
|
||||
PKG_MAINTAINER:=Nicholas Smith <nicholas@nbembedded.com>
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(INCLUDE_DIR)/nls.mk
|
||||
include $(INCLUDE_DIR)/meson.mk
|
||||
|
||||
TARGET_CFLAGS += -fno-merge-all-constants -fmerge-constants
|
||||
|
||||
MESON_ARGS += \
|
||||
-Dintrospection=false \
|
||||
-Dman=false \
|
||||
-Dbash_completion=false \
|
||||
-Db_lto=true
|
||||
|
||||
define Package/libmbim
|
||||
SECTION:=libs
|
||||
CATEGORY:=Libraries
|
||||
DEPENDS:=+glib2
|
||||
TITLE:=Helper library and utils to talk to MBIM enabled modems
|
||||
URL:=https://www.freedesktop.org/wiki/Software/libmbim
|
||||
LICENSE:=LGPL-2.0-or-later
|
||||
LICENSE_FILES:=COPYING.LIB
|
||||
endef
|
||||
|
||||
define Package/libmbim/description
|
||||
Helper library to talk to MBIM enabled modems.
|
||||
Add mbim-utils for extra utilities.
|
||||
endef
|
||||
|
||||
define Package/mbim-utils
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
DEPENDS:=+libmbim
|
||||
TITLE:=Utilities to talk to MBIM enabled modems
|
||||
URL:=https://www.freedesktop.org/wiki/Software/libmbim
|
||||
LICENSE:=GPL-2.0-or-later
|
||||
LICENSE_FILES:=COPYING
|
||||
endef
|
||||
|
||||
define Build/InstallDev
|
||||
$(INSTALL_DIR) $(1)/usr/include
|
||||
$(CP) \
|
||||
$(PKG_INSTALL_DIR)/usr/include/libmbim-glib \
|
||||
$(1)/usr/include/
|
||||
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) \
|
||||
$(PKG_INSTALL_DIR)/usr/lib/libmbim*.so* \
|
||||
$(1)/usr/lib/
|
||||
|
||||
$(INSTALL_DIR) $(1)/usr/lib/pkgconfig
|
||||
$(CP) \
|
||||
$(PKG_INSTALL_DIR)/usr/lib/pkgconfig/mbim-glib.pc \
|
||||
$(1)/usr/lib/pkgconfig
|
||||
endef
|
||||
|
||||
define Package/libmbim/install
|
||||
$(INSTALL_DIR) \
|
||||
$(1)/usr/lib \
|
||||
$(1)/usr/libexec
|
||||
|
||||
$(CP) \
|
||||
$(PKG_INSTALL_DIR)/usr/lib/libmbim*.so.* \
|
||||
$(1)/usr/lib/
|
||||
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/libexec/mbim-proxy $(1)/usr/libexec/
|
||||
endef
|
||||
|
||||
define Package/mbim-utils/install
|
||||
$(INSTALL_DIR) $(1)/usr/bin
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/mbimcli $(1)/usr/bin/
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/mbim-network $(1)/usr/bin/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,libmbim))
|
||||
$(eval $(call BuildPackage,mbim-utils))
|
||||
|
|
@ -1,31 +0,0 @@
|
|||
menu "Configuration"
|
||||
depends on PACKAGE_libqmi
|
||||
|
||||
config LIBQMI_WITH_MBIM_QMUX
|
||||
bool "Include MBIM QMUX service support"
|
||||
default y
|
||||
help
|
||||
Compile libqmi with QMI-over-MBIM support
|
||||
|
||||
config LIBQMI_WITH_QRTR_GLIB
|
||||
bool "Include QRTR support"
|
||||
default y
|
||||
help
|
||||
Compile libqmi with QRTR support
|
||||
|
||||
choice
|
||||
prompt "Select QMI message collection to build"
|
||||
default LIBQMI_COLLECTION_BASIC
|
||||
|
||||
config LIBQMI_COLLECTION_MINIMAL
|
||||
depends on !MODEMMANAGER_WITH_QMI
|
||||
bool "minimal"
|
||||
|
||||
config LIBQMI_COLLECTION_BASIC
|
||||
bool "basic (default)"
|
||||
|
||||
config LIBQMI_COLLECTION_FULL
|
||||
bool "full"
|
||||
endchoice
|
||||
|
||||
endmenu
|
||||
113
libqmi/Makefile
113
libqmi/Makefile
|
|
@ -1,113 +0,0 @@
|
|||
#
|
||||
# Copyright (C) 2016 Velocloud Inc.
|
||||
# Copyright (C) 2016 Aleksander Morgado <aleksander@aleksander.es>
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libqmi
|
||||
PKG_VERSION:=1.35.6
|
||||
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_BUILD_FLAGS:=gc-sections
|
||||
|
||||
PKG_MAINTAINER:=Nicholas Smith <nicholas@nbembedded.com>
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(INCLUDE_DIR)/nls.mk
|
||||
include $(INCLUDE_DIR)/meson.mk
|
||||
|
||||
TARGET_CFLAGS += -fno-merge-all-constants -fmerge-constants
|
||||
|
||||
define Package/libqmi/config
|
||||
source "$(SOURCE)/Config.in"
|
||||
endef
|
||||
|
||||
define Package/libqmi
|
||||
SECTION:=libs
|
||||
CATEGORY:=Libraries
|
||||
DEPENDS:= \
|
||||
+glib2 \
|
||||
+LIBQMI_WITH_MBIM_QMUX:libmbim \
|
||||
+LIBQMI_WITH_QRTR_GLIB:libqrtr-glib
|
||||
TITLE:=Helper library to talk to QMI enabled modems
|
||||
URL:=https://www.freedesktop.org/wiki/Software/libqmi
|
||||
LICENSE:=LGPL-2.0-or-later
|
||||
LICENSE_FILES:=COPYING.LIB
|
||||
endef
|
||||
|
||||
define Package/libqmi/description
|
||||
Helper library talk to QMI enabled modems.
|
||||
Add qmi-utils for extra utilities.
|
||||
endef
|
||||
|
||||
define Package/qmi-utils
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
DEPENDS:=+libqmi
|
||||
TITLE:=Utilities to talk to QMI enabled modems
|
||||
URL:=https://www.freedesktop.org/wiki/Software/libqmi
|
||||
LICENSE:=GPL-2.0-or-later
|
||||
LICENSE_FILES:=COPYING
|
||||
endef
|
||||
|
||||
define Package/libqmi-utils/description
|
||||
Utils to talk to QMI enabled modems
|
||||
endef
|
||||
|
||||
MESON_ARGS += \
|
||||
-Dudev=false \
|
||||
-Dintrospection=false \
|
||||
-Dman=false \
|
||||
-Dbash_completion=false \
|
||||
-Db_lto=true \
|
||||
-Dmbim_qmux=$(if $(CONFIG_LIBQMI_WITH_MBIM_QMUX),true,false) \
|
||||
-Dqrtr=$(if $(CONFIG_LIBQMI_WITH_QRTR_GLIB),true,false) \
|
||||
-Dcollection=$(if $(CONFIG_LIBQMI_COLLECTION_MINIMAL),minimal\
|
||||
,$(if $(CONFIG_LIBQMI_COLLECTION_BASIC),basic,full))
|
||||
|
||||
define Build/InstallDev
|
||||
$(INSTALL_DIR) $(1)/usr/include
|
||||
$(CP) \
|
||||
$(PKG_INSTALL_DIR)/usr/include/libqmi-glib \
|
||||
$(1)/usr/include/
|
||||
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) \
|
||||
$(PKG_INSTALL_DIR)/usr/lib/libqmi*.so* \
|
||||
$(1)/usr/lib/
|
||||
|
||||
$(INSTALL_DIR) $(1)/usr/lib/pkgconfig
|
||||
$(CP) \
|
||||
$(PKG_INSTALL_DIR)/usr/lib/pkgconfig/qmi-glib.pc \
|
||||
$(1)/usr/lib/pkgconfig
|
||||
endef
|
||||
|
||||
define Package/libqmi/install
|
||||
$(INSTALL_DIR) \
|
||||
$(1)/usr/lib \
|
||||
$(1)/usr/libexec
|
||||
|
||||
$(CP) \
|
||||
$(PKG_INSTALL_DIR)/usr/lib/libqmi*.so.* \
|
||||
$(1)/usr/lib/
|
||||
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/libexec/qmi-proxy $(1)/usr/libexec/
|
||||
endef
|
||||
|
||||
define Package/qmi-utils/install
|
||||
$(INSTALL_DIR) $(1)/usr/bin
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/qmicli $(1)/usr/bin/
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/qmi-network $(1)/usr/bin/
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/qmi-firmware-update $(1)/usr/bin/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,libqmi))
|
||||
$(eval $(call BuildPackage,qmi-utils))
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
#
|
||||
# Copyright (C) 2018-2020 Ycarus (Yannick Chabanois) <ycarus@zugaina.org>
|
||||
#
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
LUCI_TITLE:=LuCI Interface to DSVPN
|
||||
LUCI_DEPENDS:=+dsvpn
|
||||
|
||||
PKG_LICENSE:=GPLv3
|
||||
|
||||
#include ../luci/luci.mk
|
||||
include $(TOPDIR)/feeds/luci/luci.mk
|
||||
|
||||
# call BuildPackage - OpenWrt buildroot signature
|
||||
|
|
@ -1,66 +0,0 @@
|
|||
'use strict';
|
||||
'require rpc';
|
||||
'require form';
|
||||
'require fs';
|
||||
'require uci';
|
||||
'require tools.widgets as widgets';
|
||||
|
||||
var callHostHints;
|
||||
|
||||
return L.view.extend({
|
||||
callHostHints: rpc.declare({
|
||||
object: 'luci-rpc',
|
||||
method: 'getHostHints',
|
||||
expect: { '': {} }
|
||||
}),
|
||||
|
||||
load: function() {
|
||||
return this.callHostHints();
|
||||
},
|
||||
|
||||
render: function(hosts) {
|
||||
var m, s, o;
|
||||
|
||||
m = new form.Map('dsvpn', _('DSVPN'));
|
||||
|
||||
s = m.section(form.GridSection, 'dsvpn', _('Instances'));
|
||||
s.addremove = true;
|
||||
s.anonymous = true;
|
||||
s.nodescriptions = true;
|
||||
|
||||
o = s.option(form.Flag, 'enable', _('Enabled'));
|
||||
o.default = o.enabled;
|
||||
|
||||
o = s.option(form.Value, 'label', _('Label'));
|
||||
o.rmempty = true;
|
||||
|
||||
o = s.option(form.ListValue, 'mode', _('Mode'));
|
||||
o.value('client',_('Client'));
|
||||
o.value('server',_('Server'));
|
||||
o.modalonly = true;
|
||||
|
||||
o = s.option(form.Value, 'host', _('Host'));
|
||||
o.rmempty = false;
|
||||
|
||||
o = s.option(form.Value, 'port', _('Port'));
|
||||
o.rmempty = false;
|
||||
|
||||
o = s.option(form.Value, 'key', _('Key'));
|
||||
o.rmempty = false;
|
||||
o.modalonly = true;
|
||||
|
||||
o = s.option(form.Value, 'dev', _('Interface name'));
|
||||
o.rmempty = false;
|
||||
o.modalonly = true;
|
||||
|
||||
o = s.option(form.Value, 'localip', _('Local IP'));
|
||||
o.datatype = 'or(ip4addr,ip6addr)';
|
||||
o.rmempty = false;
|
||||
|
||||
o = s.option(form.Value, 'remoteip', _('Remote IP'));
|
||||
o.datatype = 'or(ip4addr,ip6addr)';
|
||||
o.rmempty = false;
|
||||
|
||||
return m.render();
|
||||
}
|
||||
});
|
||||
|
|
@ -1,68 +0,0 @@
|
|||
msgid ""
|
||||
msgstr ""
|
||||
"PO-Revision-Date: 2021-04-30 16:16+0000\n"
|
||||
"Last-Translator: Weblate Admin <contact@openmptcprouter.com>\n"
|
||||
"Language-Team: French <http://weblate.openmptcprouter.com/projects/omr/"
|
||||
"luciapplicationsdsvpn/fr/>\n"
|
||||
"Language: fr\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Plural-Forms: nplurals=2; plural=n > 1;\n"
|
||||
"X-Generator: Weblate 4.5.2\n"
|
||||
|
||||
#: luci-app-dsvpn/htdocs/luci-static/resources/view/services/dsvpn.js:38
|
||||
msgid "Client"
|
||||
msgstr "Client"
|
||||
|
||||
#: luci-app-dsvpn/htdocs/luci-static/resources/view/services/dsvpn.js:24
|
||||
#: luci-app-dsvpn/root/usr/share/luci/menu.d/luci-app-dsvpn.json:3
|
||||
msgid "DSVPN"
|
||||
msgstr "DSVPN"
|
||||
|
||||
#: luci-app-dsvpn/htdocs/luci-static/resources/view/services/dsvpn.js:31
|
||||
msgid "Enabled"
|
||||
msgstr "Activer"
|
||||
|
||||
#: luci-app-dsvpn/root/usr/share/rpcd/acl.d/luci-app-dsvpn.json:3
|
||||
msgid "Grant access to DSVPN"
|
||||
msgstr "Accorder l'accès à DSVPN"
|
||||
|
||||
#: luci-app-dsvpn/htdocs/luci-static/resources/view/services/dsvpn.js:42
|
||||
msgid "Host"
|
||||
msgstr "Hôte"
|
||||
|
||||
#: luci-app-dsvpn/htdocs/luci-static/resources/view/services/dsvpn.js:26
|
||||
msgid "Instances"
|
||||
msgstr "Instances"
|
||||
|
||||
#: luci-app-dsvpn/htdocs/luci-static/resources/view/services/dsvpn.js:52
|
||||
msgid "Interface name"
|
||||
msgstr "Nom de l'interface"
|
||||
|
||||
#: luci-app-dsvpn/htdocs/luci-static/resources/view/services/dsvpn.js:48
|
||||
msgid "Key"
|
||||
msgstr "Clef"
|
||||
|
||||
#: luci-app-dsvpn/htdocs/luci-static/resources/view/services/dsvpn.js:34
|
||||
msgid "Label"
|
||||
msgstr "Étiquette"
|
||||
|
||||
#: luci-app-dsvpn/htdocs/luci-static/resources/view/services/dsvpn.js:56
|
||||
msgid "Local IP"
|
||||
msgstr "Adresse IP locale"
|
||||
|
||||
#: luci-app-dsvpn/htdocs/luci-static/resources/view/services/dsvpn.js:37
|
||||
msgid "Mode"
|
||||
msgstr "Mode"
|
||||
|
||||
#: luci-app-dsvpn/htdocs/luci-static/resources/view/services/dsvpn.js:45
|
||||
msgid "Port"
|
||||
msgstr "Port"
|
||||
|
||||
#: luci-app-dsvpn/htdocs/luci-static/resources/view/services/dsvpn.js:60
|
||||
msgid "Remote IP"
|
||||
msgstr "IP Distante"
|
||||
|
||||
#: luci-app-dsvpn/htdocs/luci-static/resources/view/services/dsvpn.js:39
|
||||
msgid "Server"
|
||||
msgstr "Serveur"
|
||||
|
|
@ -1,68 +0,0 @@
|
|||
msgid ""
|
||||
msgstr ""
|
||||
"PO-Revision-Date: 2021-04-30 16:16+0000\n"
|
||||
"Last-Translator: Weblate Admin <contact@openmptcprouter.com>\n"
|
||||
"Language-Team: French <http://weblate.openmptcprouter.com/projects/omr/"
|
||||
"luciapplicationsdsvpn/fr/>\n"
|
||||
"Language: fr\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Plural-Forms: nplurals=2; plural=n > 1;\n"
|
||||
"X-Generator: Weblate 4.5.2\n"
|
||||
|
||||
#: luci-app-dsvpn/htdocs/luci-static/resources/view/services/dsvpn.js:35
|
||||
msgid "Client"
|
||||
msgstr "Client"
|
||||
|
||||
#: luci-app-dsvpn/htdocs/luci-static/resources/view/services/dsvpn.js:24
|
||||
#: luci-app-dsvpn/root/usr/share/luci/menu.d/luci-app-dsvpn.json:3
|
||||
msgid "DSVPN"
|
||||
msgstr "DSVPN"
|
||||
|
||||
#: luci-app-dsvpn/htdocs/luci-static/resources/view/services/dsvpn.js:31
|
||||
msgid "Enabled"
|
||||
msgstr "Activer"
|
||||
|
||||
#: luci-app-dsvpn/root/usr/share/rpcd/acl.d/luci-app-dsvpn.json:3
|
||||
msgid "Grant access to DSVPN"
|
||||
msgstr "Accorder l'accès à DSVPN"
|
||||
|
||||
#: luci-app-dsvpn/htdocs/luci-static/resources/view/services/dsvpn.js:39
|
||||
msgid "Host"
|
||||
msgstr "Hôte"
|
||||
|
||||
#: luci-app-dsvpn/htdocs/luci-static/resources/view/services/dsvpn.js:26
|
||||
msgid "Instances"
|
||||
msgstr "Instances"
|
||||
|
||||
#: luci-app-dsvpn/htdocs/luci-static/resources/view/services/dsvpn.js:49
|
||||
msgid "Interface name"
|
||||
msgstr "Nom de l'interface"
|
||||
|
||||
#: luci-app-dsvpn/htdocs/luci-static/resources/view/services/dsvpn.js:45
|
||||
msgid "Key"
|
||||
msgstr "Clef"
|
||||
|
||||
#: luci-app-dsvpn/htdocs/luci-static/resources/view/services/dsvpn.js:61
|
||||
msgid "Label"
|
||||
msgstr "Étiquette"
|
||||
|
||||
#: luci-app-dsvpn/htdocs/luci-static/resources/view/services/dsvpn.js:53
|
||||
msgid "Local IP"
|
||||
msgstr "Adresse IP locale"
|
||||
|
||||
#: luci-app-dsvpn/htdocs/luci-static/resources/view/services/dsvpn.js:34
|
||||
msgid "Mode"
|
||||
msgstr "Mode"
|
||||
|
||||
#: luci-app-dsvpn/htdocs/luci-static/resources/view/services/dsvpn.js:42
|
||||
msgid "Port"
|
||||
msgstr "Port"
|
||||
|
||||
#: luci-app-dsvpn/htdocs/luci-static/resources/view/services/dsvpn.js:57
|
||||
msgid "Remote IP"
|
||||
msgstr "IP Distante"
|
||||
|
||||
#: luci-app-dsvpn/htdocs/luci-static/resources/view/services/dsvpn.js:36
|
||||
msgid "Server"
|
||||
msgstr "Serveur"
|
||||
|
|
@ -1,69 +0,0 @@
|
|||
msgid ""
|
||||
msgstr ""
|
||||
"PO-Revision-Date: 2021-06-16 10:51+0000\n"
|
||||
"Last-Translator: Dmitry Galenko <d@monteops.com>\n"
|
||||
"Language-Team: Russian <http://weblate.openmptcprouter.com/projects/omr/"
|
||||
"luciapplicationsdsvpn/ru/>\n"
|
||||
"Language: ru\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
|
||||
"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
|
||||
"X-Generator: Weblate 4.6.1\n"
|
||||
|
||||
#: luci-app-dsvpn/htdocs/luci-static/resources/view/services/dsvpn.js:38
|
||||
msgid "Client"
|
||||
msgstr "Клиент"
|
||||
|
||||
#: luci-app-dsvpn/htdocs/luci-static/resources/view/services/dsvpn.js:24
|
||||
#: luci-app-dsvpn/root/usr/share/luci/menu.d/luci-app-dsvpn.json:3
|
||||
msgid "DSVPN"
|
||||
msgstr "DSVPN"
|
||||
|
||||
#: luci-app-dsvpn/htdocs/luci-static/resources/view/services/dsvpn.js:31
|
||||
msgid "Enabled"
|
||||
msgstr "Установлено"
|
||||
|
||||
#: luci-app-dsvpn/root/usr/share/rpcd/acl.d/luci-app-dsvpn.json:3
|
||||
msgid "Grant access to DSVPN"
|
||||
msgstr "Полный доступ к DSVPN"
|
||||
|
||||
#: luci-app-dsvpn/htdocs/luci-static/resources/view/services/dsvpn.js:42
|
||||
msgid "Host"
|
||||
msgstr "Хост"
|
||||
|
||||
#: luci-app-dsvpn/htdocs/luci-static/resources/view/services/dsvpn.js:26
|
||||
msgid "Instances"
|
||||
msgstr "Экземпляры"
|
||||
|
||||
#: luci-app-dsvpn/htdocs/luci-static/resources/view/services/dsvpn.js:52
|
||||
msgid "Interface name"
|
||||
msgstr "Имя интерфейса"
|
||||
|
||||
#: luci-app-dsvpn/htdocs/luci-static/resources/view/services/dsvpn.js:48
|
||||
msgid "Key"
|
||||
msgstr "Ключ"
|
||||
|
||||
#: luci-app-dsvpn/htdocs/luci-static/resources/view/services/dsvpn.js:34
|
||||
msgid "Label"
|
||||
msgstr "Метка"
|
||||
|
||||
#: luci-app-dsvpn/htdocs/luci-static/resources/view/services/dsvpn.js:56
|
||||
msgid "Local IP"
|
||||
msgstr "Локальный IP"
|
||||
|
||||
#: luci-app-dsvpn/htdocs/luci-static/resources/view/services/dsvpn.js:37
|
||||
msgid "Mode"
|
||||
msgstr "Режим"
|
||||
|
||||
#: luci-app-dsvpn/htdocs/luci-static/resources/view/services/dsvpn.js:45
|
||||
msgid "Port"
|
||||
msgstr "Порт"
|
||||
|
||||
#: luci-app-dsvpn/htdocs/luci-static/resources/view/services/dsvpn.js:60
|
||||
msgid "Remote IP"
|
||||
msgstr "Удаленный IP"
|
||||
|
||||
#: luci-app-dsvpn/htdocs/luci-static/resources/view/services/dsvpn.js:39
|
||||
msgid "Server"
|
||||
msgstr "Сервер"
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue