mirror of
https://github.com/Telecominfraproject/wlan-ap.git
synced 2026-03-20 03:39:54 +00:00
Compare commits
2 Commits
next
...
v2.1.0-rc3
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bcd07e4a15 | ||
|
|
958e14efb0 |
39
.github/actions/create-ami-from-image/action.yml
vendored
39
.github/actions/create-ami-from-image/action.yml
vendored
@@ -1,39 +0,0 @@
|
||||
name: Create AMI from firmware image in S3 bucket
|
||||
|
||||
inputs:
|
||||
firmware_image_name:
|
||||
description: Name of the firmware image
|
||||
required: true
|
||||
firmware_image_s3_bucket:
|
||||
description: Name of the S3 bucket where the image resides
|
||||
required: true
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Import snapshot based on firmware image
|
||||
id: import_snapshot
|
||||
shell: bash
|
||||
run: |
|
||||
echo "import_task_id=$(aws ec2 import-snapshot --description '${{ inputs.firmware_image_name }}' --disk-container 'Format=raw,UserBucket={S3Bucket=${{ inputs.firmware_image_s3_bucket }},S3Key=${{ inputs.firmware_image_name }}}' | jq -r '.ImportTaskId')" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Wait for import task to complete and get snapshot ID
|
||||
id: get_snapshot_id
|
||||
shell: bash
|
||||
run: |
|
||||
IMPORT_TASK_STATUS=""
|
||||
while [[ $IMPORT_TASK_STATUS != 'completed' ]]; do
|
||||
IMPORT_TASK_STATUS=$(aws ec2 describe-import-snapshot-tasks --import-task-ids ${{ steps.import_snapshot.outputs.import_task_id }} | jq -r '.ImportSnapshotTasks[].SnapshotTaskDetail.Status')
|
||||
echo "Import task status is $IMPORT_TASK_STATUS, waiting for completion."
|
||||
done
|
||||
echo "id=$(aws ec2 describe-import-snapshot-tasks --import-task-ids ${{ steps.import_snapshot.outputs.import_task_id }} | jq -r '.ImportSnapshotTasks[].SnapshotTaskDetail.SnapshotId')" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Tag snapshot with image name
|
||||
shell: bash
|
||||
run: |
|
||||
aws ec2 create-tags --resources ${{ steps.get_snapshot_id.outputs.id }} --tags 'Key=Name,Value=${{ inputs.firmware_image_name }}'
|
||||
|
||||
- name: Register AMI based on snapshot
|
||||
shell: bash
|
||||
run: |
|
||||
aws ec2 register-image --name '${{ inputs.firmware_image_name }}' --root-device-name /dev/xvda --block-device-mappings 'DeviceName=/dev/xvda,Ebs={SnapshotId=${{ steps.get_snapshot_id.outputs.id }}}'
|
||||
65
.github/workflows/build-dev.yml
vendored
Executable file → Normal file
65
.github/workflows/build-dev.yml
vendored
Executable file → Normal file
@@ -1,34 +1,20 @@
|
||||
name: Build OpenWrt/uCentral images
|
||||
|
||||
env:
|
||||
AWS_DEFAULT_OUTPUT: json
|
||||
AWS_DEFAULT_REGION: us-east-1
|
||||
AWS_S3_BUCKET_NAME: ucentral-ap-firmware
|
||||
AWS_ACCOUNT_ID: ${{ secrets.UCENTRAL_S3_ACCOUNT_ID }}
|
||||
AWS_ACCESS_KEY_ID: ${{ secrets.UCENTRAL_S3_ACCESS_KEY_ID }}
|
||||
AWS_SECRET_ACCESS_KEY: ${{ secrets.UCENTRAL_S3_ACCESS_KEY_SECRET }}
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ main, next, staging-* ]
|
||||
branches: [ uCentral-* ]
|
||||
tags: [ v* ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-22.04
|
||||
outputs:
|
||||
x64_vm_image_name: ${{ steps.package_and_upload_image.outputs.x64_vm_image_name }}
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
target: [ 'cig_wf189h', 'cig_wf189w', 'cig_wf660a', 'cig_wf672', 'cig_wf186h', 'cig_wf186w', 'cig_wf188n', 'cig_wf189', 'cig_wf196', 'cig_wf196', 'cybertan_eww631-a1', 'cybertan_eww631-b1', 'sonicfi_rap630w-312g', 'sonicfi_rap630c-311g', 'sonicfi_rap630w-311g', 'sonicfi_rap650c', 'sonicfi_rap7110c-341x', 'sonicfi_rap750e-h', 'sonicfi_rap750e-s', 'sonicfi_rap750w-311a', 'edgecore_eap101', 'edgecore_eap102', 'edgecore_eap104', 'edgecore_eap105', 'edgecore_eap111', 'edgecore_oap101', 'edgecore_oap101-6e', 'edgecore_oap101e', 'edgecore_oap101e-6e', 'edgecore_oap103', 'hfcl_ion4xe', 'hfcl_ion4xi', 'hfcl_ion4x', 'hfcl_ion4x_2', 'hfcl_ion4x_3', 'hfcl_ion4xi_w', 'hfcl_ion4x_w', 'indio_um-305ax', 'udaya_a6-id2', 'udaya_a6-od2', 'yuncore_ax820', 'yuncore_ax840', 'yuncore_fap640', 'yuncore_fap650', 'yuncore_fap655', 'zyxel_nwa130be', 'sercomm_ap72tip-v4', 'asterfusion_ap7330']
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
target: ['cig_wf188', 'cig_wf194c', 'cig_wf160d', 'edgecore_eap101', 'edgecore_eap102', 'edgecore_ecs4100-12ph', 'edgecore_ecw5211', 'edgecore_ecw5410', 'edgecore_oap100', 'edgecore_ssw2ac2600', 'edgecore_spw2ac1200', 'indio_um-305ac', 'linksys_e8450-ubi', 'linksys_ea8300', 'mikrotik_nand', 'tplink_cpe210_v3', 'tplink_cpe510_v3', 'tplink_eap225_outdoor_v1', 'tplink_ec420', 'tplink_ex227', 'tplink_ex228', 'tplink_ex447', 'wallys_dr40x9' ]
|
||||
|
||||
# Clean unnecessary files to save disk space
|
||||
- name: clean unncessary files to save space
|
||||
run: |
|
||||
docker rmi `docker images -q` || true
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Build image for ${{ matrix.target }}
|
||||
id: build
|
||||
@@ -38,12 +24,17 @@ jobs:
|
||||
make -j TARGET=${{ matrix.target }}
|
||||
|
||||
- name: Package and upload image for ${{ matrix.target }}
|
||||
id: package_and_upload_image
|
||||
env:
|
||||
GH_BUILD_USERNAME: ${{ secrets.GH_BUILD_USERNAME }}
|
||||
GH_BUILD_PASSWORD: ${{ secrets.GH_BUILD_PASSWORD }}
|
||||
ARTIFACTORY_USERNAME: cicd-indoor-main
|
||||
ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}
|
||||
AWS_S3_BUCKET_NAME: ucentral-ap-firmware
|
||||
AWS_DEFAULT_OUTPUT: json
|
||||
AWS_DEFAULT_REGION: us-east-1
|
||||
AWS_ACCOUNT_ID: ${{ secrets.UCENTRAL_S3_ACCOUNT_ID }}
|
||||
AWS_ACCESS_KEY_ID: ${{ secrets.UCENTRAL_S3_ACCESS_KEY_ID }}
|
||||
AWS_SECRET_ACCESS_KEY: ${{ secrets.UCENTRAL_S3_ACCESS_KEY_SECRET }}
|
||||
run: |
|
||||
LOWERCASE_TARGET=`echo ${{ matrix.target }} | tr '[:upper:]' '[:lower:]'`
|
||||
HASH=$(git rev-parse --short HEAD)
|
||||
@@ -51,10 +42,8 @@ jobs:
|
||||
if [[ ${GITHUB_REF} == "refs/heads/"* ]]
|
||||
then
|
||||
REF=$(echo ${GITHUB_REF#refs/heads/} | tr '/' '-')
|
||||
IS_RELEASE="false"
|
||||
else
|
||||
REF=$(echo ${GITHUB_REF#refs/tags/} | tr '/' '-')
|
||||
IS_RELEASE="true"
|
||||
fi
|
||||
|
||||
BASENAME="$(date +%Y%m%d)-$LOWERCASE_TARGET-$REF-$HASH"
|
||||
@@ -71,36 +60,4 @@ jobs:
|
||||
[ -f openwrt/tmp/image-file ] && curl -u $GH_BUILD_USERNAME:$GH_BUILD_PASSWORD -T "latest-upgrade.json" "https://tip.jfrog.io/artifactory/tip-wlan-ap-firmware/uCentral/$LOWERCASE_TARGET/latest-upgrade.json"
|
||||
|
||||
[ -f openwrt/tmp/image-file ] && aws s3 cp --acl public-read --content-type "application/octet-stream" "openwrt/$(cat openwrt/tmp/image-file)" "s3://$AWS_S3_BUCKET_NAME/$IMG_NAME"
|
||||
[ -f openwrt/tmp/image-file ] && aws s3api put-object-tagging --bucket "$AWS_S3_BUCKET_NAME" --key "$IMG_NAME" --tagging "{\"TagSet\":[{\"Key\":\"release\",\"Value\":\"$IS_RELEASE\"}]}"
|
||||
[ -f openwrt/tmp/image-file ] && aws s3 cp --acl public-read --content-type "application/json" "latest-upgrade.json" "s3://$AWS_S3_BUCKET_NAME/$JSON_NAME"
|
||||
[ -f openwrt/tmp/image-file ] && aws s3api put-object-tagging --bucket "$AWS_S3_BUCKET_NAME" --key "$JSON_NAME" --tagging "{\"TagSet\":[{\"Key\":\"release\",\"Value\":\"$IS_RELEASE\"}]}"
|
||||
|
||||
if [ ${{ matrix.target }} == 'x64_vm' ]; then
|
||||
echo "x64_vm_image_name=$(echo $IMG_NAME)" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
trigger-testing:
|
||||
runs-on: ubuntu-22.04
|
||||
needs: build
|
||||
if: startsWith(github.ref, 'refs/tags/v')
|
||||
steps:
|
||||
- name: Trigger testing of release
|
||||
uses: peter-evans/repository-dispatch@v1
|
||||
with:
|
||||
token: ${{ secrets.WLAN_TESTING_PAT }}
|
||||
repository: Telecominfraproject/wlan-testing
|
||||
event-type: new-ap-release
|
||||
client-payload: '{"ref": "${GITHUB_REF#refs/tags/}", "sha": "${{ github.sha }}"}'
|
||||
|
||||
create-x64_vm-ami:
|
||||
runs-on: ubuntu-22.04
|
||||
needs: build
|
||||
if: startsWith(github.ref, 'refs/tags/v')
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Use create-ami-from-image composite action
|
||||
uses: ./.github/actions/create-ami-from-image
|
||||
with:
|
||||
firmware_image_name: ${{ needs.build.outputs.x64_vm_image_name }}
|
||||
firmware_image_s3_bucket: ${{ env.AWS_S3_BUCKET_NAME }}
|
||||
|
||||
88
.github/workflows/x64_vm-build-test.yml
vendored
88
.github/workflows/x64_vm-build-test.yml
vendored
@@ -1,88 +0,0 @@
|
||||
name: Test x64_vm build and AMI creation
|
||||
|
||||
env:
|
||||
AWS_DEFAULT_OUTPUT: json
|
||||
AWS_DEFAULT_REGION: us-east-1
|
||||
AWS_S3_BUCKET_NAME: ucentral-ap-firmware
|
||||
AWS_ACCOUNT_ID: ${{ secrets.UCENTRAL_S3_ACCOUNT_ID }}
|
||||
AWS_ACCESS_KEY_ID: ${{ secrets.UCENTRAL_S3_ACCESS_KEY_ID }}
|
||||
AWS_SECRET_ACCESS_KEY: ${{ secrets.UCENTRAL_S3_ACCESS_KEY_SECRET }}
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
x64_vm_image_name: ${{ steps.package_and_upload_image.outputs.x64_vm_image_name }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
target: ['x64_vm']
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Build image for ${{ matrix.target }}
|
||||
id: build
|
||||
run: |
|
||||
git config --global user.email "you@example.com"
|
||||
git config --global user.name "Your Name"
|
||||
make -j TARGET=${{ matrix.target }} make -j TARGET=${{ matrix.target }}
|
||||
|
||||
- name: Package and upload image for ${{ matrix.target }}
|
||||
id: package_and_upload_image
|
||||
env:
|
||||
GH_BUILD_USERNAME: ${{ secrets.GH_BUILD_USERNAME }}
|
||||
GH_BUILD_PASSWORD: ${{ secrets.GH_BUILD_PASSWORD }}
|
||||
ARTIFACTORY_USERNAME: cicd-indoor-main
|
||||
ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}
|
||||
run: |
|
||||
LOWERCASE_TARGET=`echo ${{ matrix.target }} | tr '[:upper:]' '[:lower:]'`
|
||||
HASH=$(git rev-parse --short HEAD)
|
||||
|
||||
if [[ ${GITHUB_REF} == "refs/heads/"* ]]
|
||||
then
|
||||
REF=$(echo ${GITHUB_REF#refs/heads/} | tr '/' '-')
|
||||
IS_RELEASE="false"
|
||||
else
|
||||
REF=$(echo ${GITHUB_REF#refs/tags/} | tr '/' '-')
|
||||
IS_RELEASE="true"
|
||||
fi
|
||||
|
||||
BASENAME="$(date +%Y%m%d)-$LOWERCASE_TARGET-$REF-$HASH"
|
||||
TAR_NAME="$BASENAME.tar.gz"
|
||||
IMG_NAME="$BASENAME-upgrade.bin";
|
||||
JSON_NAME="$BASENAME.json";
|
||||
|
||||
tar cfz "$TAR_NAME" -C openwrt/bin/targets/ .
|
||||
curl -s -u $GH_BUILD_USERNAME:$GH_BUILD_PASSWORD -T "$TAR_NAME" "https://tip.jfrog.io/artifactory/tip-wlan-ap-firmware/uCentral/$LOWERCASE_TARGET/"$TAR_NAME""
|
||||
IMG_NAME="$BASENAME-upgrade.bin";
|
||||
TIP_VERSION="$(grep DISTRIB_TIP= openwrt/tmp/openwrt_release | cut -d\' -f2)"
|
||||
echo -e "{\n\t\"image\":\""${IMG_NAME}"\",\n\t\"revision\": \""${TIP_VERSION}"\",\n\t\"timestamp\":\""$(date +%s)"\",\n\t\"compatible\": \""${LOWERCASE_TARGET}"\"\n}" > latest-upgrade.json
|
||||
[ -f openwrt/tmp/image-file ] && curl -s -u $GH_BUILD_USERNAME:$GH_BUILD_PASSWORD -T "openwrt/$(cat openwrt/tmp/image-file)" "https://tip.jfrog.io/artifactory/tip-wlan-ap-firmware/uCentral/$LOWERCASE_TARGET/"$IMG_NAME""
|
||||
[ -f openwrt/tmp/image-file ] && curl -s -u $GH_BUILD_USERNAME:$GH_BUILD_PASSWORD -T "latest-upgrade.json" "https://tip.jfrog.io/artifactory/tip-wlan-ap-firmware/uCentral/$LOWERCASE_TARGET/latest-upgrade.json"
|
||||
|
||||
[ -f openwrt/tmp/image-file ] && aws s3 cp --acl public-read --content-type "application/octet-stream" "openwrt/$(cat openwrt/tmp/image-file)" "s3://$AWS_S3_BUCKET_NAME/$IMG_NAME"
|
||||
[ -f openwrt/tmp/image-file ] && aws s3api put-object-tagging --bucket "$AWS_S3_BUCKET_NAME" --key "$IMG_NAME" --tagging "{\"TagSet\":[{\"Key\":\"release\",\"Value\":\"$IS_RELEASE\"}]}"
|
||||
[ -f openwrt/tmp/image-file ] && aws s3 cp --acl public-read --content-type "application/json" "latest-upgrade.json" "s3://$AWS_S3_BUCKET_NAME/$JSON_NAME"
|
||||
[ -f openwrt/tmp/image-file ] && aws s3api put-object-tagging --bucket "$AWS_S3_BUCKET_NAME" --key "$JSON_NAME" --tagging "{\"TagSet\":[{\"Key\":\"release\",\"Value\":\"$IS_RELEASE\"}]}"
|
||||
|
||||
if [[ ${{ matrix.target }} == 'x64_vm' ]]; then
|
||||
echo "x64_vm_image_name=$(echo $IMG_NAME)" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
create-x64_vm-ami:
|
||||
runs-on: ubuntu-latest
|
||||
needs: build
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
ref: WIFI-7206-add-workflow-to-build-virtual-ap-image
|
||||
|
||||
- name: Use create-ami-from-image composite action
|
||||
uses: ./.github/actions/create-ami-from-image
|
||||
with:
|
||||
firmware_image_name: ${{ needs.build.outputs.x64_vm_image_name }}
|
||||
firmware_image_s3_bucket: ${{ env.AWS_S3_BUCKET_NAME }}
|
||||
28
LICENSE
28
LICENSE
@@ -1,28 +0,0 @@
|
||||
BSD 3-Clause License
|
||||
|
||||
Copyright (c) 2024, Telecom Infra Project
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
3. Neither the name of the copyright holder nor the names of its
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
85
README.md
85
README.md
@@ -1,83 +1,20 @@
|
||||
# OpenWiFi AP NOS
|
||||
# Setting up your build machine
|
||||
|
||||
OpenWrt-based access point network operating system (AP NOS) for TIP OpenWiFi.
|
||||
Read more at [openwifi.tip.build](https://openwifi.tip.build/).
|
||||
Requires a recent linux installation. Older systems without python 3.7 will have trouble. See this link for details: https://openwrt.org/docs/guide-developer/quickstart-build-images
|
||||
|
||||
## Building
|
||||
Install build packages: sudo apt install build-essential libncurses5-dev gawk git libssl-dev gettext zlib1g-dev swig unzip time rsync python3 python3-setuptools python3-yaml.
|
||||
|
||||
### Setting up your build machine
|
||||
|
||||
Building requires a recent Linux installation. Older systems without Python 3.7
|
||||
will have trouble. See this guide for details:
|
||||
https://openwrt.org/docs/guide-developer/toolchain/beginners-build-guide
|
||||
|
||||
Install build packages on Debian/Ubuntu (or see above guide for other systems):
|
||||
# Doing a native build on Linux
|
||||
First we need to clone and setup our tree. This will result in an openwrt/.
|
||||
```
|
||||
sudo apt install build-essential libncurses5-dev gawk git libssl-dev gettext zlib1g-dev swig unzip time rsync python3 python3-setuptools python3-yaml
|
||||
./setup.py --setup
|
||||
```
|
||||
|
||||
### Doing a native build on Linux
|
||||
|
||||
Use `./build.sh <target>`, or follow the manual steps below:
|
||||
|
||||
1. Clone and set up the tree. This will create an `openwrt/` directory.
|
||||
```shell
|
||||
./setup.py --setup # for subsequent builds, use --rebase instead
|
||||
Next we need to select the profile and base package selection. This setup will install the feeds, packages and generate the .config file.
|
||||
```
|
||||
|
||||
2. Select the profile and base package selection. This setup will install the
|
||||
feeds and packages and generate the `.config` file.
|
||||
```shell
|
||||
cd openwrt
|
||||
./scripts/gen_config.py linksys_ea8300
|
||||
./scripts/gen_config.py ea8300
|
||||
```
|
||||
|
||||
3. Build the tree (replace `-j 8` with the number of cores to use).
|
||||
```shell
|
||||
make -j 8 V=s
|
||||
Finally we can build the tree.
|
||||
```
|
||||
make -j X V=s
|
||||
```
|
||||
|
||||
### Build output
|
||||
|
||||
The build results are located in the `openwrt/bin/` directory:
|
||||
|
||||
| Type | Path |
|
||||
| ---------------- | ---------------------------------------------------- |
|
||||
| Firmware images | `openwrt/bin/targets/<target>/<subtarget>/` |
|
||||
| Kernel modules | `openwrt/bin/targets/<target>/<subtarget>/packages/` |
|
||||
| Package binaries | `openwrt/bin/packages/<platform>/<feed>/` |
|
||||
|
||||
## Developer Notes
|
||||
|
||||
### Branching model
|
||||
|
||||
- `main` - Stable dev branch
|
||||
- `next` - Integration branch
|
||||
- `staging-*` - Feature/bug branches
|
||||
- `release/v#.#.#` - Release branches (*major.minor.patch*)
|
||||
|
||||
### Repository structure
|
||||
|
||||
Build files:
|
||||
- `Makefile` - Calls Docker environment per target
|
||||
- `dock-run.sh` - Dockerized build environment
|
||||
- `docker/Dockerfile` - Dockerfile for build image
|
||||
- `build.sh` - Build script
|
||||
- `setup.py` - Clone and set up the tree
|
||||
- `config.yml` - Specifies OpenWrt version and patches to apply
|
||||
|
||||
Directories:
|
||||
- `feeds/` - OpenWiFi feeds
|
||||
- `patches/` - OpenWiFi patches applied during builds
|
||||
- `profiles/` - Per-target kernel configs, packages, and feeds
|
||||
- [wifi-ax](profiles/wifi-ax.yml): Wi-Fi AX packages
|
||||
- [ucentral-ap](profiles/ucentral-ap.yml): uCentral packages
|
||||
- [x64_vm](profiles/x64_vm.yml): x86-64 VM image
|
||||
|
||||
### uCentral packages
|
||||
|
||||
AP-NOS packages implementing the uCentral protocol include the following
|
||||
repositories (refer to the [ucentral](feeds/ucentral/) feed for a full list):
|
||||
- ucentral-client: https://github.com/Telecominfraproject/wlan-ucentral-client
|
||||
- ucentral-schema: https://github.com/Telecominfraproject/wlan-ucentral-schema
|
||||
- ucentral-wifi: https://github.com/blogic/ucentral-wifi
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
From 08be0915e06fb6f2b62c022099e82bb4d849a8c6 Mon Sep 17 00:00:00 2001
|
||||
From: Felix Fietkau <nbd@nbd.name>
|
||||
Date: Thu, 22 Oct 2020 10:29:34 +0200
|
||||
Subject: [PATCH 1/9] build: build kernel image before building
|
||||
modules/packages
|
||||
|
||||
This is needed for linux 5.10, where modules.builtin is generated from
|
||||
vmlinux.o
|
||||
|
||||
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
---
|
||||
include/kernel-defaults.mk | 6 +++---
|
||||
1 file changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/include/kernel-defaults.mk b/include/kernel-defaults.mk
|
||||
index e5a0ba367b..b069c1e671 100644
|
||||
--- a/include/kernel-defaults.mk
|
||||
+++ b/include/kernel-defaults.mk
|
||||
@@ -113,7 +113,7 @@ endef
|
||||
|
||||
define Kernel/CompileModules/Default
|
||||
rm -f $(LINUX_DIR)/vmlinux $(LINUX_DIR)/System.map
|
||||
- +$(KERNEL_MAKE) modules
|
||||
+ +$(KERNEL_MAKE) $(if $(KERNELNAME),$(KERNELNAME),all) modules
|
||||
endef
|
||||
|
||||
OBJCOPY_STRIP = -R .reginfo -R .notes -R .note -R .comment -R .mdebug -R .note.gnu.build-id
|
||||
@@ -137,7 +137,7 @@ endef
|
||||
|
||||
define Kernel/CompileImage/Default
|
||||
rm -f $(TARGET_DIR)/init
|
||||
- +$(KERNEL_MAKE) $(if $(KERNELNAME),$(KERNELNAME),all) modules
|
||||
+ +$(KERNEL_MAKE) $(if $(KERNELNAME),$(KERNELNAME),all)
|
||||
$(call Kernel/CopyImage)
|
||||
endef
|
||||
|
||||
@@ -147,7 +147,7 @@ define Kernel/CompileImage/Initramfs
|
||||
$(CP) $(GENERIC_PLATFORM_DIR)/other-files/init $(TARGET_DIR)/init
|
||||
$(if $(SOURCE_DATE_EPOCH),touch -hcd "@$(SOURCE_DATE_EPOCH)" $(TARGET_DIR)/init)
|
||||
rm -rf $(KERNEL_BUILD_DIR)/linux-$(LINUX_VERSION)/usr/initramfs_data.cpio*
|
||||
- +$(KERNEL_MAKE) $(if $(KERNELNAME),$(KERNELNAME),all) modules
|
||||
+ +$(KERNEL_MAKE) $(if $(KERNELNAME),$(KERNELNAME),all)
|
||||
$(call Kernel/CopyImage,-initramfs)
|
||||
endef
|
||||
else
|
||||
--
|
||||
2.25.1
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
From 6d2e2ff2778ca6360af9bf1e712d7ff276afa54b Mon Sep 17 00:00:00 2001
|
||||
From: Felix Fietkau <nbd@nbd.name>
|
||||
Date: Wed, 17 Feb 2021 13:49:14 +0100
|
||||
Subject: [PATCH 2/9] build: fix build with CONFIG_STRIP_KERNEL_EXPORTS
|
||||
|
||||
Only use symtab.h on the final kernel link
|
||||
|
||||
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
---
|
||||
include/kernel-defaults.mk | 6 +++---
|
||||
1 file changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/include/kernel-defaults.mk b/include/kernel-defaults.mk
|
||||
index b069c1e671..93eed54ae1 100644
|
||||
--- a/include/kernel-defaults.mk
|
||||
+++ b/include/kernel-defaults.mk
|
||||
@@ -3,7 +3,7 @@
|
||||
# Copyright (C) 2006-2020 OpenWrt.org
|
||||
|
||||
ifdef CONFIG_STRIP_KERNEL_EXPORTS
|
||||
- KERNEL_MAKEOPTS += \
|
||||
+ KERNEL_MAKEOPTS_IMAGE += \
|
||||
EXTRA_LDSFLAGS="-I$(KERNEL_BUILD_DIR) -include symtab.h"
|
||||
endif
|
||||
|
||||
@@ -137,7 +137,7 @@ endef
|
||||
|
||||
define Kernel/CompileImage/Default
|
||||
rm -f $(TARGET_DIR)/init
|
||||
- +$(KERNEL_MAKE) $(if $(KERNELNAME),$(KERNELNAME),all)
|
||||
+ +$(KERNEL_MAKE) $(KERNEL_MAKEOPTS_IMAGE) $(if $(KERNELNAME),$(KERNELNAME),all)
|
||||
$(call Kernel/CopyImage)
|
||||
endef
|
||||
|
||||
@@ -147,7 +147,7 @@ define Kernel/CompileImage/Initramfs
|
||||
$(CP) $(GENERIC_PLATFORM_DIR)/other-files/init $(TARGET_DIR)/init
|
||||
$(if $(SOURCE_DATE_EPOCH),touch -hcd "@$(SOURCE_DATE_EPOCH)" $(TARGET_DIR)/init)
|
||||
rm -rf $(KERNEL_BUILD_DIR)/linux-$(LINUX_VERSION)/usr/initramfs_data.cpio*
|
||||
- +$(KERNEL_MAKE) $(if $(KERNELNAME),$(KERNELNAME),all)
|
||||
+ +$(KERNEL_MAKE) $(KERNEL_MAKEOPTS_IMAGE) $(if $(KERNELNAME),$(KERNELNAME),all)
|
||||
$(call Kernel/CopyImage,-initramfs)
|
||||
endef
|
||||
else
|
||||
--
|
||||
2.25.1
|
||||
|
||||
39479
backports/0003-kernel-add-linux-5.10-support.patch
Normal file
39479
backports/0003-kernel-add-linux-5.10-support.patch
Normal file
File diff suppressed because it is too large
Load Diff
108824
backports/0004-mediatek-update-to-latest-trunk-version.patch
Normal file
108824
backports/0004-mediatek-update-to-latest-trunk-version.patch
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,74 @@
|
||||
From 0a0953b5c81a2b5b366a3f0f543db71ffc81f713 Mon Sep 17 00:00:00 2001
|
||||
From: John Crispin <john@phrozen.org>
|
||||
Date: Sat, 20 Feb 2021 08:36:43 +0100
|
||||
Subject: [PATCH 5/9] sysupgrade-nand: allow limiting rootfs_data by setting
|
||||
env variable
|
||||
|
||||
Check if firmware environment variable 'rootfs_data_max' exists and is
|
||||
set to a numerical value greater than 0. If so, limit rootfs_data
|
||||
volume to that size instead of using the maximum available size.
|
||||
|
||||
This is useful on devices with lots of flash where users may want to
|
||||
have eg. a volume for persistent logs and statistics or for external
|
||||
applications/containers. Persistence on rootfs overlay is limited by
|
||||
the size of memory available during the sysugprade process as that
|
||||
data needs to be copied to RAM while the volume is being recreated
|
||||
during sysupgrade. Hence it is unsuitable for keeping larger amounts
|
||||
of data accross upgrade which makes additional volume(s) for
|
||||
application data desirable.
|
||||
|
||||
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
||||
---
|
||||
package/base-files/files/lib/upgrade/nand.sh | 20 ++++++++++++++++----
|
||||
1 file changed, 16 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/package/base-files/files/lib/upgrade/nand.sh b/package/base-files/files/lib/upgrade/nand.sh
|
||||
index 5bc9ff83f9..e335d940ed 100644
|
||||
--- a/package/base-files/files/lib/upgrade/nand.sh
|
||||
+++ b/package/base-files/files/lib/upgrade/nand.sh
|
||||
@@ -117,6 +117,9 @@ nand_restore_config() {
|
||||
nand_upgrade_prepare_ubi() {
|
||||
local rootfs_length="$1"
|
||||
local rootfs_type="$2"
|
||||
+ local rootfs_data_max="$(fw_printenv -n rootfs_data_max 2>/dev/null)"
|
||||
+ [ -n "$rootfs_data_max" ] && rootfs_data_max=$(printf %d "$rootfs_data_max")
|
||||
+
|
||||
local kernel_length="$3"
|
||||
local has_env="${4:-0}"
|
||||
|
||||
@@ -176,11 +179,11 @@ nand_upgrade_prepare_ubi() {
|
||||
|
||||
# update rootfs
|
||||
if [ -n "$rootfs_length" ]; then
|
||||
- local root_size_param
|
||||
+ local rootfs_size_param
|
||||
if [ "$rootfs_type" = "ubifs" ]; then
|
||||
- root_size_param="-m"
|
||||
+ rootfs_size_param="-m"
|
||||
else
|
||||
- root_size_param="-s $rootfs_length"
|
||||
+ rootfs_size_param="-s $rootfs_length"
|
||||
fi
|
||||
if ! ubimkvol /dev/$ubidev -N $CI_ROOTPART $rootfs_size_param; then
|
||||
echo "cannot create rootfs volume"
|
||||
@@ -190,7 +193,16 @@ nand_upgrade_prepare_ubi() {
|
||||
|
||||
# create rootfs_data for non-ubifs rootfs
|
||||
if [ "$rootfs_type" != "ubifs" ]; then
|
||||
- if ! ubimkvol /dev/$ubidev -N rootfs_data -m; then
|
||||
+ local availeb=$(cat /sys/devices/virtual/ubi/$ubidev/avail_eraseblocks)
|
||||
+ local ebsize=$(cat /sys/devices/virtual/ubi/$ubidev/eraseblock_size)
|
||||
+ local avail_size=$(( $availeb * $ebsize ))
|
||||
+ local rootfs_data_size_param="-m"
|
||||
+ if [ -n "$rootfs_data_max" ] &&
|
||||
+ [ "$rootfs_data_max" != "0" ] &&
|
||||
+ [ "$rootfs_data_max" -le "$avail_size" ]; then
|
||||
+ rootfs_data_size_param="-s $rootfs_data_max"
|
||||
+ fi
|
||||
+ if ! ubimkvol /dev/$ubidev -N rootfs_data $rootfs_data_size_param; then
|
||||
echo "cannot initialize rootfs_data volume"
|
||||
return 1
|
||||
fi
|
||||
--
|
||||
2.25.1
|
||||
|
||||
1351
backports/0006-uboot-mediatek-add-support-for-linksys-e8450.patch
Normal file
1351
backports/0006-uboot-mediatek-add-support-for-linksys-e8450.patch
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,70 @@
|
||||
From 256daf33ec9c8cc8b094d7612ba7384db18d0a6b Mon Sep 17 00:00:00 2001
|
||||
From: Daniel Golle <daniel@makrotopia.org>
|
||||
Date: Fri, 12 Feb 2021 03:09:39 +0000
|
||||
Subject: [PATCH 04/64] uboot-envtools: add defaults for linksys-e8450-ubi
|
||||
|
||||
Add U-Boot environment configuration for the Linksys E8450 (UBI) to
|
||||
allow access to the bootloader environment from OpenWrt via
|
||||
'fw_printenv' and 'fw_setenv'.
|
||||
|
||||
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
||||
---
|
||||
package/boot/uboot-envtools/files/mediatek | 46 ++++++++++++++++++++++
|
||||
1 file changed, 46 insertions(+)
|
||||
create mode 100644 package/boot/uboot-envtools/files/mediatek
|
||||
|
||||
diff --git a/package/boot/uboot-envtools/files/mediatek b/package/boot/uboot-envtools/files/mediatek
|
||||
new file mode 100644
|
||||
index 0000000000..495a837274
|
||||
--- /dev/null
|
||||
+++ b/package/boot/uboot-envtools/files/mediatek
|
||||
@@ -0,0 +1,46 @@
|
||||
+#
|
||||
+# Copyright (C) 2021 OpenWrt.org
|
||||
+#
|
||||
+
|
||||
+[ -e /etc/config/ubootenv ] && exit 0
|
||||
+
|
||||
+touch /etc/config/ubootenv
|
||||
+
|
||||
+. /lib/uboot-envtools.sh
|
||||
+. /lib/functions.sh
|
||||
+
|
||||
+board=$(board_name)
|
||||
+
|
||||
+case "$board" in
|
||||
+linksys,e8450-ubi)
|
||||
+ ubootenv_add_uci_config "/dev/ubi0_0" "0x0" "0x1f000" "0x1f000" "1"
|
||||
+ ubootenv_add_uci_config "/dev/ubi0_1" "0x0" "0x1f000" "0x1f000" "1"
|
||||
+ ;;
|
||||
+bananapi,bpi-r64)
|
||||
+ . /lib/upgrade/common.sh
|
||||
+ export_bootdevice
|
||||
+ export_partdevice rootdev 0
|
||||
+ case "$rootdev" in
|
||||
+ mmc*)
|
||||
+ local envdev=/dev/$(get_partition_by_name $rootdev ubootenv)
|
||||
+ ubootenv_add_uci_config "$envdev" "0x0" "0x80000" "0x80000" "1"
|
||||
+ ubootenv_add_uci_config "$envdev" "0x80000" "0x80000" "0x80000" "1"
|
||||
+ ;;
|
||||
+ *)
|
||||
+ ubootenv_add_uci_config "/dev/ubi0_0" "0x0" "0x1f000" "0x1f000" "1"
|
||||
+ ubootenv_add_uci_config "/dev/ubi0_1" "0x0" "0x1f000" "0x1f000" "1"
|
||||
+ ;;
|
||||
+ esac
|
||||
+ ;;
|
||||
+buffalo,wsr-2533dhp2)
|
||||
+ ubootenv_add_uci_config "/dev/mtd3" "0x0" "0x1000" "0x20000"
|
||||
+ ;;
|
||||
+ubnt,unifi-6-lr-ubootmod)
|
||||
+ ubootenv_add_uci_config "/dev/mtd2" "0x0" "0x4000" "0x10000"
|
||||
+ ;;
|
||||
+esac
|
||||
+
|
||||
+config_load ubootenv
|
||||
+config_foreach ubootenv_add_app_config ubootenv
|
||||
+
|
||||
+exit 0
|
||||
--
|
||||
2.25.1
|
||||
|
||||
20604
backports/0008-realtek-update-to-latest-owrt-HEAD.patch
Normal file
20604
backports/0008-realtek-update-to-latest-owrt-HEAD.patch
Normal file
File diff suppressed because it is too large
Load Diff
33
backports/0009-include-set-kernel-version.mk.patch
Normal file
33
backports/0009-include-set-kernel-version.mk.patch
Normal file
@@ -0,0 +1,33 @@
|
||||
From 3b896a540de03ca8dfd5596881f9ec6dc15d72c9 Mon Sep 17 00:00:00 2001
|
||||
From: John Crispin <john@phrozen.org>
|
||||
Date: Wed, 7 Apr 2021 10:46:26 +0200
|
||||
Subject: [PATCH 01/32] include: set kernel-version.mk
|
||||
|
||||
Signed-off-by: John Crispin <john@phrozen.org>
|
||||
---
|
||||
include/kernel-version.mk | 6 ++++++
|
||||
1 file changed, 6 insertions(+)
|
||||
|
||||
diff --git a/include/kernel-version.mk b/include/kernel-version.mk
|
||||
index 52e5c11d75..547f57fa11 100644
|
||||
--- a/include/kernel-version.mk
|
||||
+++ b/include/kernel-version.mk
|
||||
@@ -6,9 +6,15 @@ ifdef CONFIG_TESTING_KERNEL
|
||||
KERNEL_PATCHVER:=$(KERNEL_TESTING_PATCHVER)
|
||||
endif
|
||||
|
||||
+LINUX_VERSION-4.4 = .60
|
||||
+LINUX_VERSION-4.14 = .193
|
||||
LINUX_VERSION-5.4 = .111
|
||||
+LINUX_VERSION-5.10 = .27
|
||||
|
||||
+LINUX_KERNEL_HASH-4.4.60 = 2cd8df6f1ac6a5329c5a286ec9b5956215977221a1b731597ed169fff74a9659
|
||||
+LINUX_KERNEL_HASH-4.14.193 = 0b0fb41d4430e1a42738b341cbfd2f41951aa5cd02acabbd53f076119c8b9f03
|
||||
LINUX_KERNEL_HASH-5.4.111 = 21626132658dc34cb41b7aa7b80ecf83751890a71ac1a63d77aea9d488271a03
|
||||
+LINUX_KERNEL_HASH-5.10.27 = d99dc9662951299c53a0a8d8c8d0a72a16ff861d20e927c0f9b14f63282d69d9
|
||||
|
||||
remove_uri_prefix=$(subst git://,,$(subst http://,,$(subst https://,,$(1))))
|
||||
sanitize_uri=$(call qstrip,$(subst @,_,$(subst :,_,$(subst .,_,$(subst -,_,$(subst /,_,$(1)))))))
|
||||
--
|
||||
2.25.1
|
||||
|
||||
137757
backports/0010-ar71xx-forward-port-target-to-get-routerboard-suppor.patch
Normal file
137757
backports/0010-ar71xx-forward-port-target-to-get-routerboard-suppor.patch
Normal file
File diff suppressed because it is too large
Load Diff
266
backports/0011-backport-mkits.sh.patch
Normal file
266
backports/0011-backport-mkits.sh.patch
Normal file
@@ -0,0 +1,266 @@
|
||||
From 43f832c25bb9dee1a817370ab11531e81348f177 Mon Sep 17 00:00:00 2001
|
||||
From: John Crispin <john@phrozen.org>
|
||||
Date: Sun, 9 May 2021 12:23:00 +0200
|
||||
Subject: [PATCH 42/43] backport: mkits.sh
|
||||
|
||||
969083634481c3ab5fb80509f385ef10ab45b55f
|
||||
e991c1b8a2385397fc1e657ed73878938997d951
|
||||
9f714398e060c6338fbfad44cdbfa8c940dbb84b
|
||||
|
||||
Signed-off-by: John Crispin <john@phrozen.org>
|
||||
---
|
||||
include/image-commands.mk | 2 +-
|
||||
include/image.mk | 2 +-
|
||||
scripts/mkits.sh | 101 +++++++++++++++++++++++++---
|
||||
target/linux/ipq40xx/image/Makefile | 1 +
|
||||
target/linux/ipq806x/image/Makefile | 1 +
|
||||
5 files changed, 95 insertions(+), 12 deletions(-)
|
||||
|
||||
diff --git a/include/image-commands.mk b/include/image-commands.mk
|
||||
index bde6e030bc..f97d4363d1 100644
|
||||
--- a/include/image-commands.mk
|
||||
+++ b/include/image-commands.mk
|
||||
@@ -204,7 +204,7 @@ define Build/fit
|
||||
$(if $(word 3,$(1)),-r $(IMAGE_ROOTFS) -f $(subst _,$(comma),$(DEVICE_NAME))) \
|
||||
-a $(KERNEL_LOADADDR) -e $(if $(KERNEL_ENTRY),$(KERNEL_ENTRY),$(KERNEL_LOADADDR)) \
|
||||
$(if $(DEVICE_FDT_NUM),-n $(DEVICE_FDT_NUM)) \
|
||||
- -c $(if $(DEVICE_DTS_CONFIG),$(DEVICE_DTS_CONFIG),"config@1") \
|
||||
+ -c $(if $(DEVICE_DTS_CONFIG),$(DEVICE_DTS_CONFIG),"config-1") \
|
||||
-A $(LINUX_KARCH) -v $(LINUX_VERSION)
|
||||
PATH=$(LINUX_DIR)/scripts/dtc:$(PATH) mkimage $(if $(word 3,$(1)),-E -B 0x1000 -p 0x1000) -f $@.its $@.new
|
||||
@mv $@.new $@
|
||||
diff --git a/include/image.mk b/include/image.mk
|
||||
index fc46012e87..7a48b789af 100644
|
||||
--- a/include/image.mk
|
||||
+++ b/include/image.mk
|
||||
@@ -139,7 +139,7 @@ endef
|
||||
define Image/BuildKernel/MkFIT
|
||||
$(TOPDIR)/scripts/mkits.sh \
|
||||
-D $(1) -o $(KDIR)/fit-$(1).its -k $(2) $(if $(3),-d $(3)) -C $(4) -a $(5) -e $(6) \
|
||||
- -c $(if $(DEVICE_DTS_CONFIG),$(DEVICE_DTS_CONFIG),"config@1") \
|
||||
+ -c $(if $(DEVICE_DTS_CONFIG),$(DEVICE_DTS_CONFIG),"config-1") \
|
||||
-A $(LINUX_KARCH) -v $(LINUX_VERSION)
|
||||
PATH=$(LINUX_DIR)/scripts/dtc:$(PATH) mkimage -f $(KDIR)/fit-$(1).its $(KDIR)/fit-$(1)$(7).itb
|
||||
endef
|
||||
diff --git a/scripts/mkits.sh b/scripts/mkits.sh
|
||||
index 3d68fdacbc..7533baf799 100755
|
||||
--- a/scripts/mkits.sh
|
||||
+++ b/scripts/mkits.sh
|
||||
@@ -24,22 +24,29 @@ usage() {
|
||||
printf "\n\t-a ==> set load address to 'addr' (hex)"
|
||||
printf "\n\t-e ==> set entry point to 'entry' (hex)"
|
||||
printf "\n\t-f ==> set device tree compatible string"
|
||||
+ printf "\n\t-i ==> include initrd Blob 'initrd'"
|
||||
printf "\n\t-v ==> set kernel version to 'version'"
|
||||
printf "\n\t-k ==> include kernel image 'kernel'"
|
||||
printf "\n\t-D ==> human friendly Device Tree Blob 'name'"
|
||||
printf "\n\t-n ==> fdt unit-address 'address'"
|
||||
printf "\n\t-d ==> include Device Tree Blob 'dtb'"
|
||||
- printf "\n\t-r ==> include RootFS blob"
|
||||
+ printf "\n\t-r ==> include RootFS blob 'rootfs'"
|
||||
printf "\n\t-H ==> specify hash algo instead of SHA1"
|
||||
- printf "\n\t-o ==> create output file 'its_file'\n"
|
||||
+ printf "\n\t-o ==> create output file 'its_file'"
|
||||
+ printf "\n\t-O ==> create config with dt overlay 'name:dtb'"
|
||||
+ printf "\n\t\t(can be specified more than once)\n"
|
||||
exit 1
|
||||
}
|
||||
|
||||
FDTNUM=1
|
||||
ROOTFSNUM=1
|
||||
+INITRDNUM=1
|
||||
HASH=sha1
|
||||
+LOADABLES=
|
||||
+DTOVERLAY=
|
||||
+DTADDR=
|
||||
|
||||
-while getopts ":A:a:c:C:D:d:e:f:k:n:o:v:r:S" OPTION
|
||||
+while getopts ":A:a:c:C:D:d:e:f:i:k:n:o:O:v:r:S" OPTION
|
||||
do
|
||||
case $OPTION in
|
||||
A ) ARCH=$OPTARG;;
|
||||
@@ -50,9 +57,11 @@ do
|
||||
d ) DTB=$OPTARG;;
|
||||
e ) ENTRY_ADDR=$OPTARG;;
|
||||
f ) COMPATIBLE=$OPTARG;;
|
||||
+ i ) INITRD=$OPTARG;;
|
||||
k ) KERNEL=$OPTARG;;
|
||||
n ) FDTNUM=$OPTARG;;
|
||||
o ) OUTPUT=$OPTARG;;
|
||||
+ O ) DTOVERLAY="$DTOVERLAY ${OPTARG}";;
|
||||
r ) ROOTFS=$OPTARG;;
|
||||
S ) HASH=$OPTARG;;
|
||||
v ) VERSION=$OPTARG;;
|
||||
@@ -74,14 +83,20 @@ if [ -n "${COMPATIBLE}" ]; then
|
||||
COMPATIBLE_PROP="compatible = \"${COMPATIBLE}\";"
|
||||
fi
|
||||
|
||||
+[ "$DTOVERLAY" ] && {
|
||||
+ dtbsize=$(wc -c "$DTB" | cut -d' ' -f1)
|
||||
+ DTADDR=$(printf "0x%08x" $(($LOAD_ADDR - $dtbsize)) )
|
||||
+}
|
||||
+
|
||||
# Conditionally create fdt information
|
||||
if [ -n "${DTB}" ]; then
|
||||
FDT_NODE="
|
||||
- fdt@$FDTNUM {
|
||||
+ fdt-$FDTNUM {
|
||||
description = \"${ARCH_UPPER} OpenWrt ${DEVICE} device tree blob\";
|
||||
${COMPATIBLE_PROP}
|
||||
data = /incbin/(\"${DTB}\");
|
||||
type = \"flat_dt\";
|
||||
+ ${DTADDR:+load = <${DTADDR}>;}
|
||||
arch = \"${ARCH}\";
|
||||
compression = \"none\";
|
||||
hash@1 {
|
||||
@@ -92,13 +107,34 @@ if [ -n "${DTB}" ]; then
|
||||
};
|
||||
};
|
||||
"
|
||||
- FDT_PROP="fdt = \"fdt@$FDTNUM\";"
|
||||
+ FDT_PROP="fdt = \"fdt-$FDTNUM\";"
|
||||
fi
|
||||
|
||||
+if [ -n "${INITRD}" ]; then
|
||||
+ INITRD_NODE="
|
||||
+ initrd-$INITRDNUM {
|
||||
+ description = \"${ARCH_UPPER} OpenWrt ${DEVICE} initrd\";
|
||||
+ ${COMPATIBLE_PROP}
|
||||
+ data = /incbin/(\"${INITRD}\");
|
||||
+ type = \"ramdisk\";
|
||||
+ arch = \"${ARCH}\";
|
||||
+ os = \"linux\";
|
||||
+ hash@1 {
|
||||
+ algo = \"crc32\";
|
||||
+ };
|
||||
+ hash@2 {
|
||||
+ algo = \"${HASH}\";
|
||||
+ };
|
||||
+ };
|
||||
+"
|
||||
+ INITRD_PROP="ramdisk=\"initrd-${INITRDNUM}\";"
|
||||
+fi
|
||||
+
|
||||
+
|
||||
if [ -n "${ROOTFS}" ]; then
|
||||
dd if="${ROOTFS}" of="${ROOTFS}.pagesync" bs=4096 conv=sync
|
||||
ROOTFS_NODE="
|
||||
- rootfs@$ROOTFSNUM {
|
||||
+ rootfs-$ROOTFSNUM {
|
||||
description = \"${ARCH_UPPER} OpenWrt ${DEVICE} rootfs\";
|
||||
${COMPATIBLE_PROP}
|
||||
data = /incbin/(\"${ROOTFS}.pagesync\");
|
||||
@@ -113,9 +149,50 @@ if [ -n "${ROOTFS}" ]; then
|
||||
};
|
||||
};
|
||||
"
|
||||
- ROOTFS_PROP="loadables = \"rootfs@${ROOTFSNUM}\";"
|
||||
+ LOADABLES="${LOADABLES:+$LOADABLES, }\"rootfs-${ROOTFSNUM}\""
|
||||
fi
|
||||
|
||||
+# add DT overlay blobs
|
||||
+FDTOVERLAY_NODE=""
|
||||
+OVCONFIGS=""
|
||||
+[ "$DTOVERLAY" ] && for overlay in $DTOVERLAY ; do
|
||||
+ overlay_blob=${overlay##*:}
|
||||
+ ovname=${overlay%%:*}
|
||||
+ ovnode="fdt-$ovname"
|
||||
+ ovsize=$(wc -c "$overlay_blob" | cut -d' ' -f1)
|
||||
+ echo "$ovname ($overlay_blob) : $ovsize" >&2
|
||||
+ DTADDR=$(printf "0x%08x" $(($DTADDR - $ovsize)))
|
||||
+ FDTOVERLAY_NODE="$FDTOVERLAY_NODE
|
||||
+
|
||||
+ $ovnode {
|
||||
+ description = \"${ARCH_UPPER} OpenWrt ${DEVICE} device tree overlay $ovname\";
|
||||
+ ${COMPATIBLE_PROP}
|
||||
+ data = /incbin/(\"${overlay_blob}\");
|
||||
+ type = \"flat_dt\";
|
||||
+ arch = \"${ARCH}\";
|
||||
+ load = <${DTADDR}>;
|
||||
+ compression = \"none\";
|
||||
+ hash@1 {
|
||||
+ algo = \"crc32\";
|
||||
+ };
|
||||
+ hash@2 {
|
||||
+ algo = \"${HASH}\";
|
||||
+ };
|
||||
+ };
|
||||
+"
|
||||
+ OVCONFIGS="$OVCONFIGS
|
||||
+
|
||||
+ config-$ovname {
|
||||
+ description = \"OpenWrt ${DEVICE} with $ovname\";
|
||||
+ kernel = \"kernel-1\";
|
||||
+ fdt = \"fdt-$FDTNUM\", \"$ovnode\";
|
||||
+ ${LOADABLES:+loadables = ${LOADABLES};}
|
||||
+ ${COMPATIBLE_PROP}
|
||||
+ ${INITRD_PROP}
|
||||
+ };
|
||||
+ "
|
||||
+done
|
||||
+
|
||||
# Create a default, fully populated DTS file
|
||||
DATA="/dts-v1/;
|
||||
|
||||
@@ -124,7 +201,7 @@ DATA="/dts-v1/;
|
||||
#address-cells = <1>;
|
||||
|
||||
images {
|
||||
- kernel@1 {
|
||||
+ kernel-1 {
|
||||
description = \"${ARCH_UPPER} OpenWrt Linux-${VERSION}\";
|
||||
data = /incbin/(\"${KERNEL}\");
|
||||
type = \"kernel\";
|
||||
@@ -140,7 +217,9 @@ DATA="/dts-v1/;
|
||||
algo = \"$HASH\";
|
||||
};
|
||||
};
|
||||
+${INITRD_NODE}
|
||||
${FDT_NODE}
|
||||
+${FDTOVERLAY_NODE}
|
||||
${ROOTFS_NODE}
|
||||
};
|
||||
|
||||
@@ -148,11 +227,13 @@ ${ROOTFS_NODE}
|
||||
default = \"${CONFIG}\";
|
||||
${CONFIG} {
|
||||
description = \"OpenWrt ${DEVICE}\";
|
||||
- kernel = \"kernel@1\";
|
||||
+ kernel = \"kernel-1\";
|
||||
${FDT_PROP}
|
||||
- ${ROOTFS_PROP}
|
||||
+ ${LOADABLES:+loadables = ${LOADABLES};}
|
||||
${COMPATIBLE_PROP}
|
||||
+ ${INITRD_PROP}
|
||||
};
|
||||
+ ${OVCONFIGS}
|
||||
};
|
||||
};"
|
||||
|
||||
diff --git a/target/linux/ipq40xx/image/Makefile b/target/linux/ipq40xx/image/Makefile
|
||||
index 2be262936f..a0d6242a28 100644
|
||||
--- a/target/linux/ipq40xx/image/Makefile
|
||||
+++ b/target/linux/ipq40xx/image/Makefile
|
||||
@@ -8,6 +8,7 @@ define Device/Default
|
||||
KERNEL_PREFIX := $$(IMAGE_PREFIX)
|
||||
KERNEL_LOADADDR := 0x80208000
|
||||
DEVICE_DTS = $$(SOC)-$(lastword $(subst _, ,$(1)))
|
||||
+ DEVICE_DTS_CONFIG := config@1
|
||||
IMAGES := sysupgrade.bin
|
||||
IMAGE/sysupgrade.bin = sysupgrade-tar | append-metadata
|
||||
IMAGE/sysupgrade.bin/squashfs :=
|
||||
diff --git a/target/linux/ipq806x/image/Makefile b/target/linux/ipq806x/image/Makefile
|
||||
index bab1da0090..3bc60fa931 100644
|
||||
--- a/target/linux/ipq806x/image/Makefile
|
||||
+++ b/target/linux/ipq806x/image/Makefile
|
||||
@@ -30,6 +30,7 @@ define Device/Default
|
||||
KERNEL_PREFIX := $$(IMAGE_PREFIX)
|
||||
KERNEL_LOADADDR = 0x42208000
|
||||
DEVICE_DTS = $$(SOC)-$(lastword $(subst _, ,$(1)))
|
||||
+ DEVICE_DTS_CONFIG := config@1
|
||||
IMAGES := sysupgrade.bin
|
||||
IMAGE/sysupgrade.bin = sysupgrade-tar | append-metadata
|
||||
IMAGE/sysupgrade.bin/squashfs :=
|
||||
--
|
||||
2.25.1
|
||||
|
||||
167
backports/0013-iw-update-to-latest-HEAD.patch
Normal file
167
backports/0013-iw-update-to-latest-HEAD.patch
Normal file
@@ -0,0 +1,167 @@
|
||||
From 0ddce2498be815e098154867d0b18293fe613f12 Mon Sep 17 00:00:00 2001
|
||||
From: John Crispin <john@phrozen.org>
|
||||
Date: Thu, 27 May 2021 11:57:10 +0200
|
||||
Subject: [PATCH 13/13] iw: update to latest HEAD
|
||||
|
||||
Signed-off-by: John Crispin <john@phrozen.org>
|
||||
---
|
||||
package/network/utils/iw/Makefile | 11 +++----
|
||||
.../utils/iw/patches/200-reduce_size.patch | 30 +++++++++----------
|
||||
2 files changed, 21 insertions(+), 20 deletions(-)
|
||||
|
||||
diff --git a/package/network/utils/iw/Makefile b/package/network/utils/iw/Makefile
|
||||
index 6db9aaf105..8e11046189 100644
|
||||
--- a/package/network/utils/iw/Makefile
|
||||
+++ b/package/network/utils/iw/Makefile
|
||||
@@ -8,12 +8,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=iw
|
||||
-PKG_VERSION:=5.9
|
||||
-PKG_RELEASE:=1
|
||||
+PKG_VERSION:=5.9-8fab0c9e
|
||||
+PKG_RELEASE:=$(AUTORELEASE)
|
||||
|
||||
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
|
||||
-PKG_SOURCE_URL:=@KERNEL/software/network/iw
|
||||
-PKG_HASH:=293a07109aeb7e36267cf59e3ce52857e9ffae3a6666eb8ac77894b1839fe1f2
|
||||
+PKG_SOURCE_PROTO:=git
|
||||
+PKG_SOURCE_URL:=https://git.kernel.org/pub/scm/linux/kernel/git/jberg/iw.git
|
||||
+PKG_SOURCE_VERSION:=8fab0c9ee9db217587a58efcc37421c86edcb638
|
||||
+PKG_MIRROR_HASH:=797b322bc03952f3127ae0a7da476c14ada1bbe9a9ae234a56dd6f864c568e16
|
||||
|
||||
PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
|
||||
PKG_LICENSE:=GPL-2.0
|
||||
diff --git a/package/network/utils/iw/patches/200-reduce_size.patch b/package/network/utils/iw/patches/200-reduce_size.patch
|
||||
index af30876012..83e11405cb 100644
|
||||
--- a/package/network/utils/iw/patches/200-reduce_size.patch
|
||||
+++ b/package/network/utils/iw/patches/200-reduce_size.patch
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/event.c
|
||||
+++ b/event.c
|
||||
-@@ -944,6 +944,7 @@ static int print_event(struct nl_msg *ms
|
||||
+@@ -956,6 +956,7 @@ static int print_event(struct nl_msg *ms
|
||||
}
|
||||
|
||||
switch (gnlh->cmd) {
|
||||
@@ -8,7 +8,7 @@
|
||||
case NL80211_CMD_NEW_WIPHY:
|
||||
printf("renamed to %s\n", nla_get_string(tb[NL80211_ATTR_WIPHY_NAME]));
|
||||
break;
|
||||
-@@ -979,6 +980,7 @@ static int print_event(struct nl_msg *ms
|
||||
+@@ -991,6 +992,7 @@ static int print_event(struct nl_msg *ms
|
||||
case NL80211_CMD_SCHED_SCAN_RESULTS:
|
||||
printf("got scheduled scan results\n");
|
||||
break;
|
||||
@@ -16,7 +16,7 @@
|
||||
case NL80211_CMD_WIPHY_REG_CHANGE:
|
||||
case NL80211_CMD_REG_CHANGE:
|
||||
if (gnlh->cmd == NL80211_CMD_WIPHY_REG_CHANGE)
|
||||
-@@ -1061,6 +1063,7 @@ static int print_event(struct nl_msg *ms
|
||||
+@@ -1073,6 +1075,7 @@ static int print_event(struct nl_msg *ms
|
||||
mac_addr_n2a(macbuf, nla_data(tb[NL80211_ATTR_MAC]));
|
||||
printf("del station %s\n", macbuf);
|
||||
break;
|
||||
@@ -24,7 +24,7 @@
|
||||
case NL80211_CMD_JOIN_IBSS:
|
||||
mac_addr_n2a(macbuf, nla_data(tb[NL80211_ATTR_MAC]));
|
||||
printf("IBSS %s joined\n", macbuf);
|
||||
-@@ -1254,9 +1257,9 @@ static int print_event(struct nl_msg *ms
|
||||
+@@ -1271,9 +1274,9 @@ static int print_event(struct nl_msg *ms
|
||||
case NL80211_CMD_CH_SWITCH_NOTIFY:
|
||||
parse_ch_switch_notify(tb, gnlh->cmd);
|
||||
break;
|
||||
@@ -134,7 +134,7 @@
|
||||
{
|
||||
--- a/scan.c
|
||||
+++ b/scan.c
|
||||
-@@ -1297,6 +1297,9 @@ static void print_ht_op(const uint8_t ty
|
||||
+@@ -1306,6 +1306,9 @@ static void print_ht_op(const uint8_t ty
|
||||
printf("\t\t * secondary channel offset: %s\n",
|
||||
ht_secondary_offset[data[1] & 0x3]);
|
||||
printf("\t\t * STA channel width: %s\n", sta_chan_width[(data[1] & 0x4)>>2]);
|
||||
@@ -144,7 +144,7 @@
|
||||
printf("\t\t * RIFS: %d\n", (data[1] & 0x8)>>3);
|
||||
printf("\t\t * HT protection: %s\n", protection[data[2] & 0x3]);
|
||||
printf("\t\t * non-GF present: %d\n", (data[2] & 0x4) >> 2);
|
||||
-@@ -1707,6 +1710,14 @@ static void print_ie(const struct ie_pri
|
||||
+@@ -1716,6 +1719,14 @@ static void print_ie(const struct ie_pri
|
||||
|
||||
static const struct ie_print ieprinters[] = {
|
||||
[0] = { "SSID", print_ssid, 0, 32, BIT(PRINT_SCAN) | BIT(PRINT_LINK), },
|
||||
@@ -159,7 +159,7 @@
|
||||
[1] = { "Supported rates", print_supprates, 0, 255, BIT(PRINT_SCAN), },
|
||||
[3] = { "DS Parameter set", print_ds, 1, 1, BIT(PRINT_SCAN), },
|
||||
[5] = { "TIM", print_tim, 4, 255, BIT(PRINT_SCAN), },
|
||||
-@@ -1716,26 +1727,20 @@ static const struct ie_print ieprinters[
|
||||
+@@ -1725,26 +1736,20 @@ static const struct ie_print ieprinters[
|
||||
[32] = { "Power constraint", print_powerconstraint, 1, 1, BIT(PRINT_SCAN), },
|
||||
[35] = { "TPC report", print_tpcreport, 2, 2, BIT(PRINT_SCAN), },
|
||||
[42] = { "ERP", print_erp, 1, 255, BIT(PRINT_SCAN), },
|
||||
@@ -187,15 +187,15 @@
|
||||
};
|
||||
|
||||
static void print_wifi_wpa(const uint8_t type, uint8_t len, const uint8_t *data,
|
||||
-@@ -2279,6 +2284,7 @@ void print_ies(unsigned char *ie, int ie
|
||||
+@@ -2326,6 +2331,7 @@ void print_ies(unsigned char *ie, int ie
|
||||
ieprinters[ie[0]].flags & BIT(ptype)) {
|
||||
print_ie(&ieprinters[ie[0]],
|
||||
ie[0], ie[1], ie + 2, &ie_buffer);
|
||||
+#ifdef IW_FULL
|
||||
} else if (ie[0] == 221 /* vendor */) {
|
||||
print_vendor(ie[1], ie + 2, unknown, ptype);
|
||||
- } else if (unknown) {
|
||||
-@@ -2288,6 +2294,7 @@ void print_ies(unsigned char *ie, int ie
|
||||
+ } else if (ie[0] == 255 /* extension */) {
|
||||
+@@ -2337,6 +2343,7 @@ void print_ies(unsigned char *ie, int ie
|
||||
for (i=0; i<ie[1]; i++)
|
||||
printf(" %.2x", ie[2+i]);
|
||||
printf("\n");
|
||||
@@ -203,7 +203,7 @@
|
||||
}
|
||||
ielen -= ie[1] + 2;
|
||||
ie += ie[1] + 2;
|
||||
-@@ -2328,6 +2335,7 @@ static void print_capa_non_dmg(__u16 cap
|
||||
+@@ -2377,6 +2384,7 @@ static void print_capa_non_dmg(__u16 cap
|
||||
printf(" ESS");
|
||||
if (capa & WLAN_CAPABILITY_IBSS)
|
||||
printf(" IBSS");
|
||||
@@ -211,7 +211,7 @@
|
||||
if (capa & WLAN_CAPABILITY_CF_POLLABLE)
|
||||
printf(" CfPollable");
|
||||
if (capa & WLAN_CAPABILITY_CF_POLL_REQUEST)
|
||||
-@@ -2356,6 +2364,7 @@ static void print_capa_non_dmg(__u16 cap
|
||||
+@@ -2405,6 +2413,7 @@ static void print_capa_non_dmg(__u16 cap
|
||||
printf(" DelayedBACK");
|
||||
if (capa & WLAN_CAPABILITY_IMM_BACK)
|
||||
printf(" ImmediateBACK");
|
||||
@@ -219,7 +219,7 @@
|
||||
}
|
||||
|
||||
static int print_bss_handler(struct nl_msg *msg, void *arg)
|
||||
-@@ -2440,8 +2449,10 @@ static int print_bss_handler(struct nl_m
|
||||
+@@ -2489,8 +2498,10 @@ static int print_bss_handler(struct nl_m
|
||||
if (bss[NL80211_BSS_FREQUENCY]) {
|
||||
int freq = nla_get_u32(bss[NL80211_BSS_FREQUENCY]);
|
||||
printf("\tfreq: %d\n", freq);
|
||||
@@ -230,7 +230,7 @@
|
||||
}
|
||||
if (bss[NL80211_BSS_BEACON_INTERVAL])
|
||||
printf("\tbeacon interval: %d TUs\n",
|
||||
-@@ -2635,6 +2646,7 @@ static int handle_stop_sched_scan(struct
|
||||
+@@ -2684,6 +2695,7 @@ static int handle_stop_sched_scan(struct
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -238,7 +238,7 @@
|
||||
COMMAND(scan, sched_start,
|
||||
SCHED_SCAN_OPTIONS,
|
||||
NL80211_CMD_START_SCHED_SCAN, 0, CIB_NETDEV, handle_start_sched_scan,
|
||||
-@@ -2645,3 +2657,4 @@ COMMAND(scan, sched_start,
|
||||
+@@ -2694,3 +2706,4 @@ COMMAND(scan, sched_start,
|
||||
COMMAND(scan, sched_stop, "",
|
||||
NL80211_CMD_STOP_SCHED_SCAN, 0, CIB_NETDEV, handle_stop_sched_scan,
|
||||
"Stop an ongoing scheduled scan.");
|
||||
--
|
||||
2.25.1
|
||||
|
||||
44
backports/0014-libubox-update-to-latest-HEAD.patch
Normal file
44
backports/0014-libubox-update-to-latest-HEAD.patch
Normal file
@@ -0,0 +1,44 @@
|
||||
From 029282d8ef8e4e813817d1c7d4aeae4208bc2da5 Mon Sep 17 00:00:00 2001
|
||||
From: John Crispin <john@phrozen.org>
|
||||
Date: Tue, 18 May 2021 10:46:43 +0200
|
||||
Subject: [PATCH 01/52] libubox: update to latest HEAD
|
||||
|
||||
Signed-off-by: John Crispin <john@phrozen.org>
|
||||
---
|
||||
package/libs/libubox/Makefile | 10 +++++-----
|
||||
1 file changed, 5 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/package/libs/libubox/Makefile b/package/libs/libubox/Makefile
|
||||
index 4d582eacfd..33aa73eef7 100644
|
||||
--- a/package/libs/libubox/Makefile
|
||||
+++ b/package/libs/libubox/Makefile
|
||||
@@ -1,13 +1,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libubox
|
||||
-PKG_RELEASE=1
|
||||
+PKG_RELEASE=2
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL=$(PROJECT_GIT)/project/libubox.git
|
||||
-PKG_MIRROR_HASH:=97dc4eba01cf2c5d6a6d0db3747e0cdc0d95cb87e51b3115272e7d3e69a8b255
|
||||
-PKG_SOURCE_DATE:=2020-12-12
|
||||
-PKG_SOURCE_VERSION:=357877693ca363b12e6e7e14d345639b2440cd07
|
||||
+PKG_MIRROR_HASH:=1cdb91ac0ee925f133ee9f70eac131a99def312fe7cf0aed44df84eb1762e30b
|
||||
+PKG_SOURCE_DATE:=2021-08-19
|
||||
+PKG_SOURCE_VERSION:=d716ac4bc4236031d4c3cc1ed362b502e20e3787
|
||||
PKG_ABI_VERSION:=$(call abi_version_str,$(PKG_SOURCE_DATE))
|
||||
CMAKE_INSTALL:=1
|
||||
|
||||
@@ -67,7 +67,7 @@ define Package/libubox-lua
|
||||
endef
|
||||
|
||||
TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include
|
||||
-CMAKE_OPTIONS = \
|
||||
+CMAKE_OPTIONS += \
|
||||
-DLUAPATH=/usr/lib/lua \
|
||||
-DABIVERSION="$(PKG_ABI_VERSION)"
|
||||
|
||||
--
|
||||
2.25.1
|
||||
|
||||
30
backports/0015-umdns-update-to-latest-HEAD.patch
Normal file
30
backports/0015-umdns-update-to-latest-HEAD.patch
Normal file
@@ -0,0 +1,30 @@
|
||||
From e413c12b77acc0012a79e8981b553e35d4a2b20e Mon Sep 17 00:00:00 2001
|
||||
From: John Crispin <john@phrozen.org>
|
||||
Date: Wed, 30 Jun 2021 14:21:23 +0200
|
||||
Subject: [PATCH] umdns: update to latest HEAD
|
||||
|
||||
Signed-off-by: John Crispin <john@phrozen.org>
|
||||
---
|
||||
package/network/services/umdns/Makefile | 6 +++---
|
||||
1 file changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/package/network/services/umdns/Makefile b/package/network/services/umdns/Makefile
|
||||
index 9a5f46a705..908758e44b 100644
|
||||
--- a/package/network/services/umdns/Makefile
|
||||
+++ b/package/network/services/umdns/Makefile
|
||||
@@ -12,9 +12,9 @@ PKG_RELEASE:=$(AUTORELEASE)
|
||||
|
||||
PKG_SOURCE_URL=$(PROJECT_GIT)/project/mdnsd.git
|
||||
PKG_SOURCE_PROTO:=git
|
||||
-PKG_SOURCE_DATE:=2021-01-26
|
||||
-PKG_SOURCE_VERSION:=78aa36b0e9808e801c527c6dc47320e593309522
|
||||
-PKG_MIRROR_HASH:=241833f2bf2f3366f356703159be386862ef747d9b253af6c13555f252cc970d
|
||||
+PKG_SOURCE_DATE:=2021-06-30
|
||||
+PKG_SOURCE_VERSION:=4a8747193ab2b8f2d68a9d26334545e19d89cbe2
|
||||
+PKG_MIRROR_HASH:=bdddec2793303e4cc1a90cb2ed2241c04fdd0a736b6c0cbbb1fab9de5527566a
|
||||
|
||||
PKG_MAINTAINER:=John Crispin <john@phrozen.org>
|
||||
PKG_LICENSE:=LGPL-2.1
|
||||
--
|
||||
2.25.1
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
From 6c7e11cccbd28224a9a473a36df1102b4257d356 Mon Sep 17 00:00:00 2001
|
||||
From: DENG Qingfang <dqfext@gmail.com>
|
||||
Date: Fri, 9 Apr 2021 12:25:08 +0800
|
||||
Subject: [PATCH 5/6] kernel/modules: move act_gact into kmod-sched-core
|
||||
|
||||
As the name suggests, act_gact has the generic actions such as dropping
|
||||
and accepting packets, so move it into kmod-sched-core.
|
||||
|
||||
Signed-off-by: DENG Qingfang <dqfext@gmail.com>
|
||||
---
|
||||
package/kernel/linux/modules/netsupport.mk | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/package/kernel/linux/modules/netsupport.mk b/package/kernel/linux/modules/netsupport.mk
|
||||
index 9fd49c1392..4343e850e9 100644
|
||||
--- a/package/kernel/linux/modules/netsupport.mk
|
||||
+++ b/package/kernel/linux/modules/netsupport.mk
|
||||
@@ -721,7 +721,7 @@ $(eval $(call KernelPackage,mppe))
|
||||
|
||||
|
||||
SCHED_MODULES = $(patsubst $(LINUX_DIR)/net/sched/%.ko,%,$(wildcard $(LINUX_DIR)/net/sched/*.ko))
|
||||
-SCHED_MODULES_CORE = sch_ingress sch_fq_codel sch_hfsc sch_htb sch_tbf cls_basic cls_fw cls_route cls_flow cls_tcindex cls_u32 em_u32 act_mirred act_skbedit cls_matchall
|
||||
+SCHED_MODULES_CORE = sch_ingress sch_fq_codel sch_hfsc sch_htb sch_tbf cls_basic cls_fw cls_route cls_flow cls_tcindex cls_u32 em_u32 act_gact act_mirred act_skbedit cls_matchall
|
||||
SCHED_MODULES_FILTER = $(SCHED_MODULES_CORE) act_connmark act_ctinfo sch_cake sch_netem sch_mqprio em_ipset cls_bpf cls_flower act_bpf act_vlan
|
||||
SCHED_MODULES_EXTRA = $(filter-out $(SCHED_MODULES_FILTER),$(SCHED_MODULES))
|
||||
SCHED_FILES = $(patsubst %,$(LINUX_DIR)/net/sched/%.ko,$(filter $(SCHED_MODULES_CORE),$(SCHED_MODULES)))
|
||||
@@ -745,6 +745,7 @@ define KernelPackage/sched-core
|
||||
CONFIG_NET_CLS_ROUTE4 \
|
||||
CONFIG_NET_CLS_TCINDEX \
|
||||
CONFIG_NET_CLS_U32 \
|
||||
+ CONFIG_NET_ACT_GACT \
|
||||
CONFIG_NET_ACT_MIRRED \
|
||||
CONFIG_NET_ACT_SKBEDIT \
|
||||
CONFIG_NET_CLS_MATCHALL \
|
||||
@@ -899,7 +900,6 @@ define KernelPackage/sched
|
||||
CONFIG_NET_SCH_FQ \
|
||||
CONFIG_NET_SCH_PIE \
|
||||
CONFIG_NET_ACT_POLICE \
|
||||
- CONFIG_NET_ACT_GACT \
|
||||
CONFIG_NET_ACT_IPT \
|
||||
CONFIG_NET_ACT_PEDIT \
|
||||
CONFIG_NET_ACT_SIMP \
|
||||
--
|
||||
2.25.1
|
||||
|
||||
242
backports/0017-kernel-add-bdpu-filter-support.patch
Normal file
242
backports/0017-kernel-add-bdpu-filter-support.patch
Normal file
@@ -0,0 +1,242 @@
|
||||
From 97fb5323a826e6b5ad89b5281c0b9d9e92bfc0b4 Mon Sep 17 00:00:00 2001
|
||||
From: John Crispin <john@phrozen.org>
|
||||
Date: Fri, 27 Aug 2021 16:52:34 +0200
|
||||
Subject: [PATCH 59/59] kernel: add bdpu filter support
|
||||
|
||||
Signed-off-by: John Crispin <john@phrozen.org>
|
||||
---
|
||||
...l-knob-for-filtering-rx-tx-BPDU-pack.patch | 107 ++++++++++++++++++
|
||||
...l-knob-for-filtering-rx-tx-BPDU-pack.patch | 107 ++++++++++++++++++
|
||||
2 files changed, 214 insertions(+)
|
||||
create mode 100644 target/linux/generic/pending-5.10/710-bridge-add-sysctl-knob-for-filtering-rx-tx-BPDU-pack.patch
|
||||
create mode 100644 target/linux/generic/pending-5.4/710-bridge-add-sysctl-knob-for-filtering-rx-tx-BPDU-pack.patch
|
||||
|
||||
diff --git a/target/linux/generic/pending-5.10/710-bridge-add-sysctl-knob-for-filtering-rx-tx-BPDU-pack.patch b/target/linux/generic/pending-5.10/710-bridge-add-sysctl-knob-for-filtering-rx-tx-BPDU-pack.patch
|
||||
new file mode 100644
|
||||
index 0000000000..918ae05d12
|
||||
--- /dev/null
|
||||
+++ b/target/linux/generic/pending-5.10/710-bridge-add-sysctl-knob-for-filtering-rx-tx-BPDU-pack.patch
|
||||
@@ -0,0 +1,107 @@
|
||||
+From: Felix Fietkau <nbd@nbd.name>
|
||||
+Date: Fri, 27 Aug 2021 12:22:32 +0200
|
||||
+Subject: [PATCH] bridge: add sysctl knob for filtering rx/tx BPDU packets on a
|
||||
+ port
|
||||
+
|
||||
+Some devices (e.g. wireless APs) can't have devices behind them be part of
|
||||
+a bridge topology with redundant links, due to address limitations.
|
||||
+Additionally, broadcast traffic on these devices is somewhat expensive, due to
|
||||
+the low data rate and wakeups of clients in powersave mode.
|
||||
+This sysctl knob can be used to ensure that BPDU packets are never sent
|
||||
+or forwarded to/from these devices
|
||||
+
|
||||
+Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
+---
|
||||
+
|
||||
+--- a/include/linux/if_bridge.h
|
||||
++++ b/include/linux/if_bridge.h
|
||||
+@@ -56,6 +56,7 @@ struct br_ip_list {
|
||||
+ #define BR_MRP_AWARE BIT(17)
|
||||
+ #define BR_MRP_LOST_CONT BIT(18)
|
||||
+ #define BR_MRP_LOST_IN_CONT BIT(19)
|
||||
++#define BR_BPDU_FILTER BIT(20)
|
||||
+
|
||||
+ #define BR_DEFAULT_AGEING_TIME (300 * HZ)
|
||||
+
|
||||
+--- a/net/bridge/br_forward.c
|
||||
++++ b/net/bridge/br_forward.c
|
||||
+@@ -191,6 +191,7 @@ out:
|
||||
+ void br_flood(struct net_bridge *br, struct sk_buff *skb,
|
||||
+ enum br_pkt_type pkt_type, bool local_rcv, bool local_orig)
|
||||
+ {
|
||||
++ const unsigned char *dest = eth_hdr(skb)->h_dest;
|
||||
+ struct net_bridge_port *prev = NULL;
|
||||
+ struct net_bridge_port *p;
|
||||
+
|
||||
+@@ -206,6 +207,10 @@ void br_flood(struct net_bridge *br, str
|
||||
+ case BR_PKT_MULTICAST:
|
||||
+ if (!(p->flags & BR_MCAST_FLOOD) && skb->dev != br->dev)
|
||||
+ continue;
|
||||
++ if ((p->flags & BR_BPDU_FILTER) &&
|
||||
++ unlikely(is_link_local_ether_addr(dest) &&
|
||||
++ dest[5] == 0))
|
||||
++ continue;
|
||||
+ break;
|
||||
+ case BR_PKT_BROADCAST:
|
||||
+ if (!(p->flags & BR_BCAST_FLOOD) && skb->dev != br->dev)
|
||||
+--- a/net/bridge/br_input.c
|
||||
++++ b/net/bridge/br_input.c
|
||||
+@@ -305,6 +305,8 @@ static rx_handler_result_t br_handle_fra
|
||||
+ fwd_mask |= p->group_fwd_mask;
|
||||
+ switch (dest[5]) {
|
||||
+ case 0x00: /* Bridge Group Address */
|
||||
++ if (p->flags & BR_BPDU_FILTER)
|
||||
++ goto drop;
|
||||
+ /* If STP is turned off,
|
||||
+ then must forward to keep loop detection */
|
||||
+ if (p->br->stp_enabled == BR_NO_STP ||
|
||||
+--- a/net/bridge/br_sysfs_if.c
|
||||
++++ b/net/bridge/br_sysfs_if.c
|
||||
+@@ -233,6 +233,7 @@ BRPORT_ATTR_FLAG(multicast_flood, BR_MCA
|
||||
+ BRPORT_ATTR_FLAG(broadcast_flood, BR_BCAST_FLOOD);
|
||||
+ BRPORT_ATTR_FLAG(neigh_suppress, BR_NEIGH_SUPPRESS);
|
||||
+ BRPORT_ATTR_FLAG(isolated, BR_ISOLATED);
|
||||
++BRPORT_ATTR_FLAG(bpdu_filter, BR_BPDU_FILTER);
|
||||
+
|
||||
+ #ifdef CONFIG_BRIDGE_IGMP_SNOOPING
|
||||
+ static ssize_t show_multicast_router(struct net_bridge_port *p, char *buf)
|
||||
+@@ -285,6 +286,7 @@ static const struct brport_attribute *br
|
||||
+ &brport_attr_group_fwd_mask,
|
||||
+ &brport_attr_neigh_suppress,
|
||||
+ &brport_attr_isolated,
|
||||
++ &brport_attr_bpdu_filter,
|
||||
+ &brport_attr_backup_port,
|
||||
+ NULL
|
||||
+ };
|
||||
+--- a/net/bridge/br_stp_bpdu.c
|
||||
++++ b/net/bridge/br_stp_bpdu.c
|
||||
+@@ -80,7 +80,8 @@ void br_send_config_bpdu(struct net_brid
|
||||
+ {
|
||||
+ unsigned char buf[35];
|
||||
+
|
||||
+- if (p->br->stp_enabled != BR_KERNEL_STP)
|
||||
++ if (p->br->stp_enabled != BR_KERNEL_STP ||
|
||||
++ (p->flags & BR_BPDU_FILTER))
|
||||
+ return;
|
||||
+
|
||||
+ buf[0] = 0;
|
||||
+@@ -127,7 +128,8 @@ void br_send_tcn_bpdu(struct net_bridge_
|
||||
+ {
|
||||
+ unsigned char buf[4];
|
||||
+
|
||||
+- if (p->br->stp_enabled != BR_KERNEL_STP)
|
||||
++ if (p->br->stp_enabled != BR_KERNEL_STP ||
|
||||
++ (p->flags & BR_BPDU_FILTER))
|
||||
+ return;
|
||||
+
|
||||
+ buf[0] = 0;
|
||||
+@@ -172,6 +174,9 @@ void br_stp_rcv(const struct stp_proto *
|
||||
+ if (!(br->dev->flags & IFF_UP))
|
||||
+ goto out;
|
||||
+
|
||||
++ if (p->flags & BR_BPDU_FILTER)
|
||||
++ goto out;
|
||||
++
|
||||
+ if (p->state == BR_STATE_DISABLED)
|
||||
+ goto out;
|
||||
+
|
||||
diff --git a/target/linux/generic/pending-5.4/710-bridge-add-sysctl-knob-for-filtering-rx-tx-BPDU-pack.patch b/target/linux/generic/pending-5.4/710-bridge-add-sysctl-knob-for-filtering-rx-tx-BPDU-pack.patch
|
||||
new file mode 100644
|
||||
index 0000000000..586d264cd5
|
||||
--- /dev/null
|
||||
+++ b/target/linux/generic/pending-5.4/710-bridge-add-sysctl-knob-for-filtering-rx-tx-BPDU-pack.patch
|
||||
@@ -0,0 +1,107 @@
|
||||
+From: Felix Fietkau <nbd@nbd.name>
|
||||
+Date: Fri, 27 Aug 2021 12:22:32 +0200
|
||||
+Subject: [PATCH] bridge: add sysctl knob for filtering rx/tx BPDU packets on a
|
||||
+ port
|
||||
+
|
||||
+Some devices (e.g. wireless APs) can't have devices behind them be part of
|
||||
+a bridge topology with redundant links, due to address limitations.
|
||||
+Additionally, broadcast traffic on these devices is somewhat expensive, due to
|
||||
+the low data rate and wakeups of clients in powersave mode.
|
||||
+This sysctl knob can be used to ensure that BPDU packets are never sent
|
||||
+or forwarded to/from these devices
|
||||
+
|
||||
+Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
+---
|
||||
+
|
||||
+--- a/include/linux/if_bridge.h
|
||||
++++ b/include/linux/if_bridge.h
|
||||
+@@ -47,6 +47,7 @@ struct br_ip_list {
|
||||
+ #define BR_BCAST_FLOOD BIT(14)
|
||||
+ #define BR_NEIGH_SUPPRESS BIT(15)
|
||||
+ #define BR_ISOLATED BIT(16)
|
||||
++#define BR_BPDU_FILTER BIT(17)
|
||||
+
|
||||
+ #define BR_DEFAULT_AGEING_TIME (300 * HZ)
|
||||
+
|
||||
+--- a/net/bridge/br_forward.c
|
||||
++++ b/net/bridge/br_forward.c
|
||||
+@@ -191,6 +191,7 @@ out:
|
||||
+ void br_flood(struct net_bridge *br, struct sk_buff *skb,
|
||||
+ enum br_pkt_type pkt_type, bool local_rcv, bool local_orig)
|
||||
+ {
|
||||
++ const unsigned char *dest = eth_hdr(skb)->h_dest;
|
||||
+ struct net_bridge_port *prev = NULL;
|
||||
+ struct net_bridge_port *p;
|
||||
+
|
||||
+@@ -206,6 +207,10 @@ void br_flood(struct net_bridge *br, str
|
||||
+ case BR_PKT_MULTICAST:
|
||||
+ if (!(p->flags & BR_MCAST_FLOOD) && skb->dev != br->dev)
|
||||
+ continue;
|
||||
++ if ((p->flags & BR_BPDU_FILTER) &&
|
||||
++ unlikely(is_link_local_ether_addr(dest) &&
|
||||
++ dest[5] == 0))
|
||||
++ continue;
|
||||
+ break;
|
||||
+ case BR_PKT_BROADCAST:
|
||||
+ if (!(p->flags & BR_BCAST_FLOOD) && skb->dev != br->dev)
|
||||
+--- a/net/bridge/br_input.c
|
||||
++++ b/net/bridge/br_input.c
|
||||
+@@ -300,6 +300,8 @@ rx_handler_result_t br_handle_frame(stru
|
||||
+ fwd_mask |= p->group_fwd_mask;
|
||||
+ switch (dest[5]) {
|
||||
+ case 0x00: /* Bridge Group Address */
|
||||
++ if (p->flags & BR_BPDU_FILTER)
|
||||
++ goto drop;
|
||||
+ /* If STP is turned off,
|
||||
+ then must forward to keep loop detection */
|
||||
+ if (p->br->stp_enabled == BR_NO_STP ||
|
||||
+--- a/net/bridge/br_sysfs_if.c
|
||||
++++ b/net/bridge/br_sysfs_if.c
|
||||
+@@ -233,6 +233,7 @@ BRPORT_ATTR_FLAG(multicast_flood, BR_MCA
|
||||
+ BRPORT_ATTR_FLAG(broadcast_flood, BR_BCAST_FLOOD);
|
||||
+ BRPORT_ATTR_FLAG(neigh_suppress, BR_NEIGH_SUPPRESS);
|
||||
+ BRPORT_ATTR_FLAG(isolated, BR_ISOLATED);
|
||||
++BRPORT_ATTR_FLAG(bpdu_filter, BR_BPDU_FILTER);
|
||||
+
|
||||
+ #ifdef CONFIG_BRIDGE_IGMP_SNOOPING
|
||||
+ static ssize_t show_multicast_router(struct net_bridge_port *p, char *buf)
|
||||
+@@ -285,6 +286,7 @@ static const struct brport_attribute *br
|
||||
+ &brport_attr_group_fwd_mask,
|
||||
+ &brport_attr_neigh_suppress,
|
||||
+ &brport_attr_isolated,
|
||||
++ &brport_attr_bpdu_filter,
|
||||
+ &brport_attr_backup_port,
|
||||
+ NULL
|
||||
+ };
|
||||
+--- a/net/bridge/br_stp_bpdu.c
|
||||
++++ b/net/bridge/br_stp_bpdu.c
|
||||
+@@ -80,7 +80,8 @@ void br_send_config_bpdu(struct net_brid
|
||||
+ {
|
||||
+ unsigned char buf[35];
|
||||
+
|
||||
+- if (p->br->stp_enabled != BR_KERNEL_STP)
|
||||
++ if (p->br->stp_enabled != BR_KERNEL_STP ||
|
||||
++ (p->flags & BR_BPDU_FILTER))
|
||||
+ return;
|
||||
+
|
||||
+ buf[0] = 0;
|
||||
+@@ -125,7 +126,8 @@ void br_send_tcn_bpdu(struct net_bridge_
|
||||
+ {
|
||||
+ unsigned char buf[4];
|
||||
+
|
||||
+- if (p->br->stp_enabled != BR_KERNEL_STP)
|
||||
++ if (p->br->stp_enabled != BR_KERNEL_STP ||
|
||||
++ (p->flags & BR_BPDU_FILTER))
|
||||
+ return;
|
||||
+
|
||||
+ buf[0] = 0;
|
||||
+@@ -168,6 +170,9 @@ void br_stp_rcv(const struct stp_proto *
|
||||
+ if (!(br->dev->flags & IFF_UP))
|
||||
+ goto out;
|
||||
+
|
||||
++ if (p->flags & BR_BPDU_FILTER)
|
||||
++ goto out;
|
||||
++
|
||||
+ if (p->state == BR_STATE_DISABLED)
|
||||
+ goto out;
|
||||
+
|
||||
--
|
||||
2.25.1
|
||||
|
||||
157
backports/0035-uhttp-update-to-latest-HEAD.patch
Normal file
157
backports/0035-uhttp-update-to-latest-HEAD.patch
Normal file
@@ -0,0 +1,157 @@
|
||||
From patchwork Fri Aug 20 13:11:12 2021
|
||||
Content-Type: text/plain; charset="utf-8"
|
||||
MIME-Version: 1.0
|
||||
Content-Transfer-Encoding: 7bit
|
||||
X-Patchwork-Submitter: Stijn Tintel <stijn@linux-ipv6.be>
|
||||
X-Patchwork-Id: 1519040
|
||||
X-Patchwork-Delegate: stijn@linux-ipv6.be
|
||||
Return-Path:
|
||||
<openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org>
|
||||
X-Original-To: incoming@patchwork.ozlabs.org
|
||||
Delivered-To: patchwork-incoming@bilbo.ozlabs.org
|
||||
Authentication-Results: ozlabs.org;
|
||||
spf=none (no SPF record) smtp.mailfrom=lists.openwrt.org
|
||||
(client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org;
|
||||
envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org;
|
||||
receiver=<UNKNOWN>)
|
||||
Authentication-Results: ozlabs.org;
|
||||
dkim=pass (2048-bit key;
|
||||
secure) header.d=lists.infradead.org header.i=@lists.infradead.org
|
||||
header.a=rsa-sha256 header.s=bombadil.20210309 header.b=r2Ly8Vhy;
|
||||
dkim=fail reason="signature verification failed" (1024-bit key;
|
||||
unprotected) header.d=linux-ipv6.be header.i=@linux-ipv6.be
|
||||
header.a=rsa-sha256 header.s=502B7754-045F-11E5-BBC5-64595FD46BE8
|
||||
header.b=BipII9T0;
|
||||
dkim-atps=neutral
|
||||
Received: from bombadil.infradead.org (bombadil.infradead.org
|
||||
[IPv6:2607:7c80:54:e::133])
|
||||
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
|
||||
key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest
|
||||
SHA256)
|
||||
(No client certificate requested)
|
||||
by ozlabs.org (Postfix) with ESMTPS id 4Grhsz3FQvz9s1l
|
||||
for <incoming@patchwork.ozlabs.org>; Fri, 20 Aug 2021 23:13:59 +1000 (AEST)
|
||||
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
|
||||
d=lists.infradead.org; s=bombadil.20210309; h=Sender:
|
||||
Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post:
|
||||
List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc
|
||||
:To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:
|
||||
Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:
|
||||
List-Owner; bh=Dxw7atu76L/aBQntt7pW1jTYPCULL0mkcY2U1BYT2sI=; b=r2Ly8VhysFZseN
|
||||
kLaheAFj130coCdyeHSxT/951GnDDBkmyursFZAP2hBLaKv9Z+9HpHIGM3sOiNhM/zDKfabNJ/1D2
|
||||
CV4iyPpVkhRxG9t6HPpPx94E6J5Oknl7l6eyL04DWUB28EzXcoBSMiP0zYsoOWjI8sQO8wITNp6hf
|
||||
neAM1VlZlNb22n5/Wu5oD1RoEiMUS5GeyhU7kEFEWpC45rcpyuQdvHpPLMn5GkcqCOO6i90E7BKAK
|
||||
ipYG2tptIjqjrmR+nC6CPRavA+hSG/o6HzDSYNJvWmgVjCc6RpN/xliN03Rum4+mbDtMEB4Wpidmj
|
||||
FepfgPqKxWRJ0UiXBJew==;
|
||||
Received: from localhost ([::1] helo=bombadil.infradead.org)
|
||||
by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux))
|
||||
id 1mH4J2-00BF23-C2; Fri, 20 Aug 2021 13:11:32 +0000
|
||||
Received: from mail.tintel.eu ([51.83.127.189])
|
||||
by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux))
|
||||
id 1mH4Iw-00BF1P-CR
|
||||
for openwrt-devel@lists.openwrt.org; Fri, 20 Aug 2021 13:11:30 +0000
|
||||
Received: from localhost (localhost [IPv6:::1])
|
||||
by mail.tintel.eu (Postfix) with ESMTP id 1BE4C4486AC4;
|
||||
Fri, 20 Aug 2021 15:11:14 +0200 (CEST)
|
||||
Received: from mail.tintel.eu ([IPv6:::1])
|
||||
by localhost (mail.tintel.eu [IPv6:::1]) (amavisd-new, port 10032)
|
||||
with ESMTP id npDXmiQngdDU; Fri, 20 Aug 2021 15:11:13 +0200 (CEST)
|
||||
Received: from localhost (localhost [IPv6:::1])
|
||||
by mail.tintel.eu (Postfix) with ESMTP id 5B1EC4486ACC;
|
||||
Fri, 20 Aug 2021 15:11:13 +0200 (CEST)
|
||||
DKIM-Filter: OpenDKIM Filter v2.10.3 mail.tintel.eu 5B1EC4486ACC
|
||||
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-ipv6.be;
|
||||
s=502B7754-045F-11E5-BBC5-64595FD46BE8; t=1629465073;
|
||||
bh=3YKw9bephsRsf4MDuHSX4MioHjRWefi/5PEc54pFn4g=;
|
||||
h=From:To:Date:Message-Id:MIME-Version;
|
||||
b=BipII9T0eY8ENYqcdZ7rxKFn6rwkKKOhJ2IoeLZ1fx4lgpPuGWsZrexzqU6mYTDRa
|
||||
Aihei2/ovPeWgUDbzfjNC9hIqv0fXRaEW0sCAPZGOP6gNHWNCkJxuPqYI+4pjijRRt
|
||||
6YYC2qCi8DqzQJv7St1FqeVFoIaF8SfbniBW+1N4=
|
||||
X-Virus-Scanned: amavisd-new at mail.tintel.eu
|
||||
Received: from mail.tintel.eu ([IPv6:::1])
|
||||
by localhost (mail.tintel.eu [IPv6:::1]) (amavisd-new, port 10026)
|
||||
with ESMTP id J5m0pY66LdR7; Fri, 20 Aug 2021 15:11:13 +0200 (CEST)
|
||||
Received: from taz.sof.bg.adlevio.net (unknown [IPv6:2001:67c:21bc:20::10])
|
||||
by mail.tintel.eu (Postfix) with SMTP id 17DF94486AC4;
|
||||
Fri, 20 Aug 2021 15:11:13 +0200 (CEST)
|
||||
Received: (nullmailer pid 141125 invoked by uid 1000);
|
||||
Fri, 20 Aug 2021 13:11:12 -0000
|
||||
From: Stijn Tintel <stijn@linux-ipv6.be>
|
||||
To: openwrt-devel@lists.openwrt.org
|
||||
Cc: nbd@nbd.name
|
||||
Subject: [PATCH] uhttpd: add config option for json_script
|
||||
Date: Fri, 20 Aug 2021 16:11:12 +0300
|
||||
Message-Id: <20210820131112.141077-1-stijn@linux-ipv6.be>
|
||||
X-Mailer: git-send-email 2.31.1
|
||||
MIME-Version: 1.0
|
||||
X-Rspamd-Queue-Id: 17DF94486AC4
|
||||
X-Spamd-Result: default: False [0.00 / 15.00];
|
||||
IP_WHITELIST(0.00)[2001:67c:21bc:20::10];
|
||||
ASN(0.00)[asn:200533, ipnet:2001:67c:21bc::/48, country:BG]
|
||||
X-Rspamd-Server: skulls
|
||||
X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3
|
||||
X-CRM114-CacheID: sfid-20210820_061126_592239_17869382
|
||||
X-CRM114-Status: UNSURE ( 9.50 )
|
||||
X-CRM114-Notice: Please train this message.
|
||||
X-Spam-Score: 0.2 (/)
|
||||
X-Spam-Report: Spam detection software,
|
||||
running on the system "bombadil.infradead.org",
|
||||
has NOT identified this incoming email as spam. The original
|
||||
message has been attached to this so you can view it or label
|
||||
similar future email. If you have any questions, see
|
||||
the administrator of that system for details.
|
||||
Content preview: Add a config option for json_script instead of
|
||||
unconditionally
|
||||
including all json files in /etc/uhttpd in every uhttpd instance. This makes
|
||||
it possible to configure a single instance with an unconditi [...]
|
||||
Content analysis details: (0.2 points, 5.0 required)
|
||||
pts rule name description
|
||||
---- ----------------------
|
||||
--------------------------------------------------
|
||||
-0.0 SPF_PASS SPF: sender matches SPF record
|
||||
-0.0 SPF_HELO_PASS SPF: HELO matches SPF record
|
||||
0.1 DKIM_SIGNED Message has a DKIM or DK signature,
|
||||
not necessarily
|
||||
valid
|
||||
0.1 DKIM_INVALID DKIM or DK signature exists, but is not valid
|
||||
X-BeenThere: openwrt-devel@lists.openwrt.org
|
||||
X-Mailman-Version: 2.1.34
|
||||
Precedence: list
|
||||
List-Id: OpenWrt Development List <openwrt-devel.lists.openwrt.org>
|
||||
List-Unsubscribe: <https://lists.openwrt.org/mailman/options/openwrt-devel>,
|
||||
<mailto:openwrt-devel-request@lists.openwrt.org?subject=unsubscribe>
|
||||
List-Archive: <http://lists.openwrt.org/pipermail/openwrt-devel/>
|
||||
List-Post: <mailto:openwrt-devel@lists.openwrt.org>
|
||||
List-Help: <mailto:openwrt-devel-request@lists.openwrt.org?subject=help>
|
||||
List-Subscribe: <https://lists.openwrt.org/mailman/listinfo/openwrt-devel>,
|
||||
<mailto:openwrt-devel-request@lists.openwrt.org?subject=subscribe>
|
||||
Sender: "openwrt-devel" <openwrt-devel-bounces@lists.openwrt.org>
|
||||
Errors-To:
|
||||
openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org
|
||||
|
||||
Add a config option for json_script instead of unconditionally including
|
||||
all json files in /etc/uhttpd in every uhttpd instance. This makes it
|
||||
possible to configure a single instance with an unconditional redirect,
|
||||
which is currently not possible as it would render all other uhttpd
|
||||
instances unusable.
|
||||
|
||||
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
|
||||
---
|
||||
package/network/services/uhttpd/Makefile | 2 +-
|
||||
package/network/services/uhttpd/files/uhttpd.init | 3 ++-
|
||||
2 files changed, 3 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/package/network/services/uhttpd/files/uhttpd.init b/package/network/services/uhttpd/files/uhttpd.init
|
||||
index e7709941c2..30fd7b4259 100755
|
||||
--- a/package/network/services/uhttpd/files/uhttpd.init
|
||||
+++ b/package/network/services/uhttpd/files/uhttpd.init
|
||||
@@ -196,7 +196,8 @@ start_instance()
|
||||
append_bool "$cfg" redirect_https "-q" 0
|
||||
}
|
||||
|
||||
- for file in /etc/uhttpd/*.json; do
|
||||
+ config_get json_script "$cfg" json_script
|
||||
+ for file in $json_script; do
|
||||
[ -s "$file" ] && procd_append_param command -H "$file"
|
||||
done
|
||||
|
||||
39
backports/0036-iwinfo-update-to-latest-git-HEAD.patch
Normal file
39
backports/0036-iwinfo-update-to-latest-git-HEAD.patch
Normal file
@@ -0,0 +1,39 @@
|
||||
From c90fec205137d8d8c1197722a39d5c700ae3f6b1 Mon Sep 17 00:00:00 2001
|
||||
From: John Crispin <john@phrozen.org>
|
||||
Date: Mon, 21 Jun 2021 12:53:28 +0200
|
||||
Subject: [PATCH 02/36] iwinfo: update to latest git HEAD
|
||||
|
||||
Signed-off-by: John Crispin <john@phrozen.org>
|
||||
---
|
||||
package/network/utils/iwinfo/Makefile | 8 ++++----
|
||||
1 file changed, 4 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/package/network/utils/iwinfo/Makefile b/package/network/utils/iwinfo/Makefile
|
||||
index 3454d615a9..b7c8370bba 100644
|
||||
--- a/package/network/utils/iwinfo/Makefile
|
||||
+++ b/package/network/utils/iwinfo/Makefile
|
||||
@@ -11,9 +11,9 @@ PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL=$(PROJECT_GIT)/project/iwinfo.git
|
||||
-PKG_SOURCE_DATE:=2021-01-31
|
||||
-PKG_SOURCE_VERSION:=4a32b33e9606f1bc1125f4bc24b0581349e55f2e
|
||||
-PKG_MIRROR_HASH:=414e5d150efaadba21103e66f862be66a94dcf83c16a2850f7c05051a9b0739d
|
||||
+PKG_SOURCE_DATE:=2021-06-09
|
||||
+PKG_SOURCE_VERSION:=c0414642fead263a4a6a686ad3cb7e965ec8a23a
|
||||
+PKG_MIRROR_HASH:=c5686bbae86753c53db03a686b034bbb80d31107cc359ebd8522ea1c82db35ea
|
||||
PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io>
|
||||
PKG_LICENSE:=GPL-2.0
|
||||
|
||||
@@ -25,7 +25,7 @@ PKG_CONFIG_DEPENDS := \
|
||||
CONFIG_PACKAGE_kmod-brcm-wl-mimo \
|
||||
CONFIG_PACKAGE_kmod-cfg80211
|
||||
|
||||
-IWINFO_ABI_VERSION:=20210106
|
||||
+IWINFO_ABI_VERSION:=20210430
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
--
|
||||
2.25.1
|
||||
|
||||
105
backports/0037-netifd-update-to-latest-HEAD.patch
Normal file
105
backports/0037-netifd-update-to-latest-HEAD.patch
Normal file
@@ -0,0 +1,105 @@
|
||||
From a622ab0c15a2f58b724362339d6b467c02ee7576 Mon Sep 17 00:00:00 2001
|
||||
From: John Crispin <john@phrozen.org>
|
||||
Date: Thu, 27 May 2021 13:24:47 +0200
|
||||
Subject: [PATCH 01/57] netifd: update to latest HEAD
|
||||
|
||||
Signed-off-by: John Crispin <john@phrozen.org>
|
||||
---
|
||||
package/network/config/netifd/Makefile | 14 +++++++++-----
|
||||
.../network/config/netifd/files/etc/udhcpc.user | 1 +
|
||||
.../config/netifd/files/lib/netifd/dhcp.script | 3 +++
|
||||
.../netifd/patches/002-fix-dhcp-issue.patch | 17 +++++++++++++++++
|
||||
4 files changed, 30 insertions(+), 5 deletions(-)
|
||||
create mode 100644 package/network/config/netifd/files/etc/udhcpc.user
|
||||
create mode 100644 package/network/config/netifd/patches/002-fix-dhcp-issue.patch
|
||||
|
||||
diff --git a/package/network/config/netifd/Makefile b/package/network/config/netifd/Makefile
|
||||
index 7061456b08..13c1d96ed7 100644
|
||||
--- a/package/network/config/netifd/Makefile
|
||||
+++ b/package/network/config/netifd/Makefile
|
||||
@@ -5,16 +5,14 @@ PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL=$(PROJECT_GIT)/project/netifd.git
|
||||
-PKG_SOURCE_DATE:=2021-01-09
|
||||
-PKG_SOURCE_VERSION:=c00c8335d6188daa326ecfe5a62da15a9b9987e1
|
||||
-PKG_MIRROR_HASH:=c740e51e0cec13eec336ba1c7a643db3b64a9a2235f8c1b73a566cb89e841190
|
||||
+PKG_SOURCE_DATE:=2021-09-01
|
||||
+PKG_SOURCE_VERSION:=300b1220fab38600f102bb8cfcc59a29ce41b095
|
||||
+PKG_MIRROR_HASH:=310fa90059795b1c956f9822db712ecc58bc19725b0f05f98c9e0a6824c8ca36
|
||||
PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
|
||||
|
||||
PKG_LICENSE:=GPL-2.0
|
||||
PKG_LICENSE_FILES:=
|
||||
|
||||
-PKG_BUILD_PARALLEL:=1
|
||||
-
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(INCLUDE_DIR)/cmake.mk
|
||||
|
||||
@@ -25,6 +23,11 @@ define Package/netifd
|
||||
TITLE:=OpenWrt Network Interface Configuration Daemon
|
||||
endef
|
||||
|
||||
+define Package/netifd/conffiles
|
||||
+/etc/udhcpc.user
|
||||
+/etc/udhcpc.user.d/
|
||||
+endef
|
||||
+
|
||||
TARGET_CFLAGS += \
|
||||
-I$(STAGING_DIR)/usr/include/libnl-tiny \
|
||||
-I$(STAGING_DIR)/usr/include \
|
||||
@@ -40,6 +43,7 @@ define Package/netifd/install
|
||||
$(INSTALL_DIR) $(1)/sbin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/netifd $(1)/sbin/
|
||||
$(CP) ./files/* $(1)/
|
||||
+ $(INSTALL_DIR) $(1)/etc/udhcpc.user.d/
|
||||
$(CP) $(PKG_BUILD_DIR)/scripts/* $(1)/lib/netifd/
|
||||
endef
|
||||
|
||||
diff --git a/package/network/config/netifd/files/etc/udhcpc.user b/package/network/config/netifd/files/etc/udhcpc.user
|
||||
new file mode 100644
|
||||
index 0000000000..78e2ba5f18
|
||||
--- /dev/null
|
||||
+++ b/package/network/config/netifd/files/etc/udhcpc.user
|
||||
@@ -0,0 +1 @@
|
||||
+# This script is sourced by udhcpc's dhcp.script at every DHCP event.
|
||||
diff --git a/package/network/config/netifd/files/lib/netifd/dhcp.script b/package/network/config/netifd/files/lib/netifd/dhcp.script
|
||||
index 6585b641d6..e46005d84c 100755
|
||||
--- a/package/network/config/netifd/files/lib/netifd/dhcp.script
|
||||
+++ b/package/network/config/netifd/files/lib/netifd/dhcp.script
|
||||
@@ -112,5 +112,8 @@ esac
|
||||
|
||||
# user rules
|
||||
[ -f /etc/udhcpc.user ] && . /etc/udhcpc.user "$@"
|
||||
+for f in /etc/udhcpc.user.d/*; do
|
||||
+ [ -f "$f" ] && (. "$f" "$@")
|
||||
+done
|
||||
|
||||
exit 0
|
||||
diff --git a/package/network/config/netifd/patches/002-fix-dhcp-issue.patch b/package/network/config/netifd/patches/002-fix-dhcp-issue.patch
|
||||
new file mode 100644
|
||||
index 0000000000..6f1d2e708e
|
||||
--- /dev/null
|
||||
+++ b/package/network/config/netifd/patches/002-fix-dhcp-issue.patch
|
||||
@@ -0,0 +1,17 @@
|
||||
+Index: netifd-2019-08-05-5e02f944/interface.c
|
||||
+===================================================================
|
||||
+--- netifd-2019-08-05-5e02f944.orig/interface.c
|
||||
++++ netifd-2019-08-05-5e02f944/interface.c
|
||||
+@@ -424,7 +424,11 @@ interface_main_dev_cb(struct device_user
|
||||
+ interface_set_link_state(iface, false);
|
||||
+ break;
|
||||
+ case DEV_EVENT_TOPO_CHANGE:
|
||||
+- interface_proto_event(iface->proto, PROTO_CMD_RENEW, false);
|
||||
++ /* This renews the dhcp lease when the bridge adds/deletes a
|
||||
++ * new interface. It causes some dhcp servers to fail in
|
||||
++ * case where there are many interfaces being added to the
|
||||
++ * bridge frequently. Disabling this for now. */
|
||||
++ /* interface_proto_event(iface->proto, PROTO_CMD_RENEW, false); */
|
||||
+ return;
|
||||
+ default:
|
||||
+ break;
|
||||
--
|
||||
2.25.1
|
||||
|
||||
6668
backports/0038-mac80211-update-to-latest-HEAD.patch
Normal file
6668
backports/0038-mac80211-update-to-latest-HEAD.patch
Normal file
File diff suppressed because it is too large
Load Diff
5858
backports/0039-hostapd-upsate-to-latest-HEAD.patch
Normal file
5858
backports/0039-hostapd-upsate-to-latest-HEAD.patch
Normal file
File diff suppressed because it is too large
Load Diff
51
backports/0040-mt76-update-to-latest-HEAD.patch
Normal file
51
backports/0040-mt76-update-to-latest-HEAD.patch
Normal file
@@ -0,0 +1,51 @@
|
||||
From e01de214b2492e1b8001d6057211017b5f0f6f49 Mon Sep 17 00:00:00 2001
|
||||
From: John Crispin <john@phrozen.org>
|
||||
Date: Thu, 27 May 2021 13:25:41 +0200
|
||||
Subject: [PATCH 04/44] mt76: update to latest HEAD
|
||||
|
||||
Signed-off-by: John Crispin <john@phrozen.org>
|
||||
---
|
||||
package/kernel/mt76/Makefile | 11 ++++++-----
|
||||
1 file changed, 6 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/package/kernel/mt76/Makefile b/package/kernel/mt76/Makefile
|
||||
index e9e95fa9b3..431c57a240 100644
|
||||
--- a/package/kernel/mt76/Makefile
|
||||
+++ b/package/kernel/mt76/Makefile
|
||||
@@ -8,11 +8,12 @@ PKG_LICENSE_FILES:=
|
||||
|
||||
PKG_SOURCE_URL:=https://github.com/openwrt/mt76
|
||||
PKG_SOURCE_PROTO:=git
|
||||
-PKG_SOURCE_DATE:=2021-04-11
|
||||
-PKG_SOURCE_VERSION:=bf45b30d891961dd7c4139dddb58b909ea2c2b5a
|
||||
-PKG_MIRROR_HASH:=431cecf80dafa986e805f809522721c2bb26289867d6770695d49baf8b471bea
|
||||
+PKG_SOURCE_DATE:=2021-07-15
|
||||
+PKG_SOURCE_VERSION:=bbebea7d6dc64313132226adc3f7369d36e9359d
|
||||
+PKG_MIRROR_HASH:=17cd74e72c1f6c8742b698bf6772afacc6fba71b233af8c4d59530600cf44d5b
|
||||
|
||||
PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
|
||||
+PKG_USE_NINJA:=0
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
|
||||
PKG_CONFIG_DEPENDS += \
|
||||
@@ -155,7 +156,7 @@ define KernelPackage/mt7615-common
|
||||
$(KernelPackage/mt76-default)
|
||||
TITLE:=MediaTek MT7615 wireless driver common code
|
||||
HIDDEN:=1
|
||||
- DEPENDS+=@PCI_SUPPORT +kmod-mt76-core +kmod-mt76-connac
|
||||
+ DEPENDS+=@PCI_SUPPORT +kmod-mt76-core +kmod-mt76-connac +kmod-hwmon-core
|
||||
FILES:= $(PKG_BUILD_DIR)/mt7615/mt7615-common.ko
|
||||
endef
|
||||
|
||||
@@ -213,7 +214,7 @@ endef
|
||||
define KernelPackage/mt7915e
|
||||
$(KernelPackage/mt76-default)
|
||||
TITLE:=MediaTek MT7915e wireless driver
|
||||
- DEPENDS+=@PCI_SUPPORT +kmod-mt7615-common +@DRIVER_11AX_SUPPORT
|
||||
+ DEPENDS+=@PCI_SUPPORT +kmod-mt7615-common +kmod-hwmon-core +kmod-thermal +@DRIVER_11AX_SUPPORT
|
||||
FILES:= $(PKG_BUILD_DIR)/mt7915/mt7915e.ko
|
||||
AUTOLOAD:=$(call AutoProbe,mt7915e)
|
||||
endef
|
||||
--
|
||||
2.25.1
|
||||
|
||||
53
backports/0041-ar71xx-hacks.patch
Normal file
53
backports/0041-ar71xx-hacks.patch
Normal file
@@ -0,0 +1,53 @@
|
||||
From d01d8c9e5cf7de98222860011d1d5b362bfde005 Mon Sep 17 00:00:00 2001
|
||||
From: John Crispin <john@phrozen.org>
|
||||
Date: Mon, 12 Jul 2021 13:09:25 +0200
|
||||
Subject: [PATCH 01/39] ar71xx: hacks
|
||||
|
||||
Signed-off-by: John Crispin <john@phrozen.org>
|
||||
---
|
||||
package/kernel/linux/modules/crypto.mk | 2 +-
|
||||
package/kernel/mac80211/ath.mk | 1 +
|
||||
target/linux/ar71xx/files/arch/mips/ath79/mach-rb91x.c | 2 ++
|
||||
3 files changed, 4 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/package/kernel/linux/modules/crypto.mk b/package/kernel/linux/modules/crypto.mk
|
||||
index 19b0d4696b..1b1c1e1a51 100644
|
||||
--- a/package/kernel/linux/modules/crypto.mk
|
||||
+++ b/package/kernel/linux/modules/crypto.mk
|
||||
@@ -882,7 +882,7 @@ define KernelPackage/crypto-sha256
|
||||
CONFIG_CRYPTO_SHA256_SSSE3
|
||||
FILES:= \
|
||||
$(LINUX_DIR)/crypto/sha256_generic.ko \
|
||||
- $(LINUX_DIR)/lib/crypto/libsha256.ko
|
||||
+ $(LINUX_DIR)/lib/crypto/libsha256.ko@ge4.15
|
||||
AUTOLOAD:=$(call AutoLoad,09,sha256_generic)
|
||||
$(call AddDepends/crypto)
|
||||
endef
|
||||
diff --git a/package/kernel/mac80211/ath.mk b/package/kernel/mac80211/ath.mk
|
||||
index ba03ae11a6..ad2860a98e 100644
|
||||
--- a/package/kernel/mac80211/ath.mk
|
||||
+++ b/package/kernel/mac80211/ath.mk
|
||||
@@ -43,6 +43,7 @@ config-$(call config_package,ath9k) += ATH9K
|
||||
config-$(call config_package,ath9k-common) += ATH9K_COMMON
|
||||
config-$(call config_package,owl-loader) += ATH9K_PCI_NO_EEPROM
|
||||
config-$(CONFIG_TARGET_ath79) += ATH9K_AHB
|
||||
+config-$(CONFIG_TARGET_ar71xx) += ATH9K_AHB
|
||||
config-$(CONFIG_TARGET_ipq40xx) += ATH10K_AHB
|
||||
config-$(CONFIG_PCI) += ATH9K_PCI
|
||||
config-$(CONFIG_ATH_USER_REGD) += ATH_USER_REGD ATH_REG_DYNAMIC_USER_REG_HINTS
|
||||
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-rb91x.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-rb91x.c
|
||||
index 9620718962..2cdf97efd6 100644
|
||||
--- a/target/linux/ar71xx/files/arch/mips/ath79/mach-rb91x.c
|
||||
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-rb91x.c
|
||||
@@ -271,6 +271,8 @@ static const struct rb_board_info rb711gr100_boards[] __initconst = {
|
||||
RB_BOARD_INFO("911G-5HPnD", 0),
|
||||
RB_BOARD_INFO("912UAG-2HPnD", RB91X_FLAG_USB | RB91X_FLAG_PCIE),
|
||||
RB_BOARD_INFO("912UAG-5HPnD", RB91X_FLAG_USB | RB91X_FLAG_PCIE),
|
||||
+ RB_BOARD_INFO("RB912UAG-2HPnD", RB91X_FLAG_USB | RB91X_FLAG_PCIE),
|
||||
+ RB_BOARD_INFO("RB912UAG-5HPnD", RB91X_FLAG_USB | RB91X_FLAG_PCIE),
|
||||
};
|
||||
|
||||
static u32 rb711gr100_get_flags(const struct rb_info *info)
|
||||
--
|
||||
2.25.1
|
||||
|
||||
170
backports/0100-procd-add-uxc-support.patch
Normal file
170
backports/0100-procd-add-uxc-support.patch
Normal file
@@ -0,0 +1,170 @@
|
||||
From 8897bab871fb43701fad786c94af5d1b1ef123ae Mon Sep 17 00:00:00 2001
|
||||
From: John Crispin <john@phrozen.org>
|
||||
Date: Sun, 25 Jul 2021 13:32:37 +0200
|
||||
Subject: [PATCH 01/46] procd: add uxc support
|
||||
|
||||
Signed-off-by: John Crispin <john@phrozen.org>
|
||||
---
|
||||
package/system/procd/Makefile | 12 ++---
|
||||
package/system/procd/files/procd.sh | 79 +++++++++++++++++++++++++++++
|
||||
package/system/procd/files/uxc.init | 4 ++
|
||||
3 files changed, 89 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/package/system/procd/Makefile b/package/system/procd/Makefile
|
||||
index fff9faa1bf..98f1ed1775 100644
|
||||
--- a/package/system/procd/Makefile
|
||||
+++ b/package/system/procd/Makefile
|
||||
@@ -12,9 +12,9 @@ PKG_RELEASE:=$(AUTORELEASE)
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL=$(PROJECT_GIT)/project/procd.git
|
||||
-PKG_SOURCE_DATE:=2021-02-08
|
||||
-PKG_SOURCE_VERSION:=08938fe1cbc06eeaafa39448057368391d165272
|
||||
-PKG_MIRROR_HASH:=efc3deac56057e929789d44742858b2a16d976f6bfa0a2036e413d10afcaeee4
|
||||
+PKG_SOURCE_DATE:=2021-08-15
|
||||
+PKG_SOURCE_VERSION:=104b49d6ab25a8cf067e6d8d1f2da7defb9876d4
|
||||
+PKG_MIRROR_HASH:=d13b566a14e84f6babe8b7d3dfb88e34c3dff0e97d7770d6fe71174685bca628
|
||||
CMAKE_INSTALL:=1
|
||||
|
||||
PKG_LICENSE:=GPL-2.0
|
||||
@@ -32,7 +32,7 @@ include $(INCLUDE_DIR)/package.mk
|
||||
include $(INCLUDE_DIR)/cmake.mk
|
||||
|
||||
ifeq ($(DUMP),)
|
||||
- STAMP_CONFIGURED:=$(strip $(STAMP_CONFIGURED))_$(shell echo $(CONFIG_TARGET_INIT_PATH) | mkhash md5)
|
||||
+ STAMP_CONFIGURED:=$(strip $(STAMP_CONFIGURED))_$(shell echo $(CONFIG_TARGET_INIT_PATH) | $(MKHASH) md5)
|
||||
endif
|
||||
|
||||
CMAKE_OPTIONS += -DEARLY_PATH="$(TARGET_INIT_PATH)"
|
||||
@@ -82,7 +82,7 @@ endef
|
||||
define Package/procd-seccomp
|
||||
SECTION:=base
|
||||
CATEGORY:=Base system
|
||||
- DEPENDS:=@(arm||armeb||mips||mipsel||i386||powerpc||x86_64) @!TARGET_uml \
|
||||
+ DEPENDS:=@(aarch64||arm||armeb||mips||mipsel||i386||powerpc||x86_64) @!TARGET_uml \
|
||||
@KERNEL_SECCOMP +libubox +libblobmsg-json
|
||||
TITLE:=OpenWrt process seccomp helper + utrace
|
||||
endef
|
||||
@@ -90,7 +90,7 @@ endef
|
||||
define Package/uxc
|
||||
SECTION:=base
|
||||
CATEGORY:=Base system
|
||||
- DEPENDS:=+procd-ujail +libubus +libubox +libblobmsg-json
|
||||
+ DEPENDS:=+procd-ujail +libubus +libubox +libblobmsg-json +blockd +rpcd
|
||||
TITLE:=OpenWrt container management
|
||||
MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
|
||||
endef
|
||||
diff --git a/package/system/procd/files/procd.sh b/package/system/procd/files/procd.sh
|
||||
index d86b7219da..3549a5a914 100644
|
||||
--- a/package/system/procd/files/procd.sh
|
||||
+++ b/package/system/procd/files/procd.sh
|
||||
@@ -329,6 +329,82 @@ _procd_add_config_trigger() {
|
||||
json_close_array
|
||||
}
|
||||
|
||||
+_procd_add_mount_trigger() {
|
||||
+ json_add_array
|
||||
+ _procd_add_array_data "$1"
|
||||
+ local action="$2"
|
||||
+ local multi=0
|
||||
+ shift ; shift
|
||||
+
|
||||
+ json_add_array
|
||||
+ _procd_add_array_data "if"
|
||||
+
|
||||
+ if [ "$2" ]; then
|
||||
+ json_add_array
|
||||
+ _procd_add_array_data "or"
|
||||
+ multi=1
|
||||
+ fi
|
||||
+
|
||||
+ while [ "$1" ]; do
|
||||
+ json_add_array
|
||||
+ _procd_add_array_data "eq" "target" "$1"
|
||||
+ shift
|
||||
+ json_close_array
|
||||
+ done
|
||||
+
|
||||
+ [ $multi = 1 ] && json_close_array
|
||||
+
|
||||
+ json_add_array
|
||||
+ _procd_add_array_data "run_script" /etc/init.d/$name $action
|
||||
+ json_close_array
|
||||
+
|
||||
+ json_close_array
|
||||
+ _procd_add_timeout
|
||||
+ json_close_array
|
||||
+}
|
||||
+
|
||||
+_procd_add_action_mount_trigger() {
|
||||
+ local script=$(readlink "$initscript")
|
||||
+ local name=$(basename ${script:-$initscript})
|
||||
+ local action="$1"
|
||||
+ local mpath
|
||||
+ shift
|
||||
+
|
||||
+ _procd_open_trigger
|
||||
+ _procd_add_mount_trigger mount.add $action "$@"
|
||||
+ _procd_close_trigger
|
||||
+}
|
||||
+
|
||||
+procd_get_mountpoints() {
|
||||
+ (
|
||||
+ __procd_check_mount() {
|
||||
+ local cfg="$1"
|
||||
+ local path="${2%%/}/"
|
||||
+ local target
|
||||
+ config_get target "$cfg" target
|
||||
+ target="${target%%/}/"
|
||||
+ [ "$path" != "${path##$target}" ] && echo "${target%%/}"
|
||||
+ }
|
||||
+
|
||||
+ config_load fstab
|
||||
+ for mpath in "$@"; do
|
||||
+ config_foreach __procd_check_mount mount "$mpath"
|
||||
+ done
|
||||
+ ) | sort -u
|
||||
+}
|
||||
+
|
||||
+_procd_add_restart_mount_trigger() {
|
||||
+ local mountpoints="$(procd_get_mountpoints "$@")"
|
||||
+ [ "${mountpoints//[[:space:]]}" ] &&
|
||||
+ _procd_add_action_mount_trigger restart $mountpoints
|
||||
+}
|
||||
+
|
||||
+_procd_add_reload_mount_trigger() {
|
||||
+ local mountpoints="$(procd_get_mountpoints "$@")"
|
||||
+ [ "${mountpoints//[[:space:]]}" ] &&
|
||||
+ _procd_add_action_mount_trigger reload $mountpoints
|
||||
+}
|
||||
+
|
||||
_procd_add_raw_trigger() {
|
||||
json_add_array
|
||||
_procd_add_array_data "$1"
|
||||
@@ -560,8 +636,11 @@ _procd_wrapper \
|
||||
procd_add_raw_trigger \
|
||||
procd_add_config_trigger \
|
||||
procd_add_interface_trigger \
|
||||
+ procd_add_mount_trigger \
|
||||
procd_add_reload_trigger \
|
||||
procd_add_reload_interface_trigger \
|
||||
+ procd_add_reload_mount_trigger \
|
||||
+ procd_add_restart_mount_trigger \
|
||||
procd_open_trigger \
|
||||
procd_close_trigger \
|
||||
procd_open_instance \
|
||||
diff --git a/package/system/procd/files/uxc.init b/package/system/procd/files/uxc.init
|
||||
index 035c8b0b9e..1e75b796f8 100644
|
||||
--- a/package/system/procd/files/uxc.init
|
||||
+++ b/package/system/procd/files/uxc.init
|
||||
@@ -16,3 +16,7 @@ boot() {
|
||||
__BOOT_UXC=1
|
||||
start
|
||||
}
|
||||
+
|
||||
+service_triggers() {
|
||||
+ procd_add_raw_trigger "mount.add" 3000 /etc/init.d/uxc boot
|
||||
+}
|
||||
--
|
||||
2.25.1
|
||||
|
||||
174
backports/0101-build-create-APK-files-parrallel-to-IPK.patch
Normal file
174
backports/0101-build-create-APK-files-parrallel-to-IPK.patch
Normal file
@@ -0,0 +1,174 @@
|
||||
From 0a31ac2bfc8aa43c2a5e43eac81c4647dbf2d1b7 Mon Sep 17 00:00:00 2001
|
||||
From: Paul Spooren <mail@aparcar.org>
|
||||
Date: Fri, 2 Oct 2020 23:30:30 -1000
|
||||
Subject: [PATCH 01/45] build: create APK files parrallel to IPK
|
||||
|
||||
Create APK files based on the folder and control files of IPK packages.
|
||||
|
||||
Signed-off-by: Paul Spooren <mail@aparcar.org>
|
||||
---
|
||||
include/package-ipkg.mk | 48 +++++++++++++++++++++++++------------
|
||||
package/Makefile | 2 ++
|
||||
package/base-files/Makefile | 4 ++++
|
||||
rules.mk | 2 ++
|
||||
scripts/apk-make-index.sh | 20 ++++++++++++++++
|
||||
5 files changed, 61 insertions(+), 15 deletions(-)
|
||||
create mode 100755 scripts/apk-make-index.sh
|
||||
|
||||
diff --git a/include/package-ipkg.mk b/include/package-ipkg.mk
|
||||
index c2017cd220..b0177070f8 100644
|
||||
--- a/include/package-ipkg.mk
|
||||
+++ b/include/package-ipkg.mk
|
||||
@@ -102,6 +102,7 @@ ifeq ($(DUMP),)
|
||||
ABIV_$(1):=$(if $(filter-out kmod-%,$(1)),$(ABI_VERSION))
|
||||
PDIR_$(1):=$(call FeedPackageDir,$(1))
|
||||
IPKG_$(1):=$$(PDIR_$(1))/$(1)$$(ABIV_$(1))_$(VERSION)_$(PKGARCH).ipk
|
||||
+ APK_$(1):=$$(PDIR_$(1))/$(1)$$(ABIV_$(1))_$(VERSION)_$(PKGARCH).apk
|
||||
IDIR_$(1):=$(PKG_BUILD_DIR)/ipkg-$(PKGARCH)/$(1)
|
||||
KEEP_$(1):=$(strip $(call Package/$(1)/conffiles))
|
||||
|
||||
@@ -200,7 +201,7 @@ $(_endef)
|
||||
$(PKG_INFO_DIR)/$(1).provides $$(IPKG_$(1)): $(STAMP_BUILT) $(INCLUDE_DIR)/package-ipkg.mk
|
||||
@rm -rf $$(IDIR_$(1)); \
|
||||
$$(call remove_ipkg_files,$(1),$$(call opkg_package_files,$(call gen_ipkg_wildcard,$(1))))
|
||||
- mkdir -p $(PACKAGE_DIR) $$(IDIR_$(1))/CONTROL $(PKG_INFO_DIR)
|
||||
+ mkdir -p $(PACKAGE_DIR) $$(IDIR_$(1)) $(PKG_INFO_DIR)
|
||||
$(call Package/$(1)/install,$$(IDIR_$(1)))
|
||||
$(if $(Package/$(1)/install-overlay),mkdir -p $(PACKAGE_DIR) $$(IDIR_$(1))/rootfs-overlay)
|
||||
$(call Package/$(1)/install-overlay,$$(IDIR_$(1))/rootfs-overlay)
|
||||
@@ -226,6 +227,37 @@ $(_endef)
|
||||
) || true \
|
||||
)
|
||||
endif
|
||||
+
|
||||
+ ifneq ($$(KEEP_$(1)),)
|
||||
+ @( \
|
||||
+ keepfiles=""; \
|
||||
+ for x in $$(KEEP_$(1)); do \
|
||||
+ [ -f "$$(IDIR_$(1))/$$$$x" ] || keepfiles="$$$${keepfiles:+$$$$keepfiles }$$$$x"; \
|
||||
+ done; \
|
||||
+ [ -z "$$$$keepfiles" ] || { \
|
||||
+ mkdir -p $$(IDIR_$(1))/lib/upgrade/keep.d; \
|
||||
+ for x in $$$$keepfiles; do echo $$$$x >> $$(IDIR_$(1))/lib/upgrade/keep.d/$(1); done; \
|
||||
+ }; \
|
||||
+ )
|
||||
+ endif
|
||||
+
|
||||
+ $(INSTALL_DIR) $$(PDIR_$(1))
|
||||
+
|
||||
+ $(FAKEROOT) apk mkpkg \
|
||||
+ --info "name:$(1)" \
|
||||
+ --info "version:$(VERSION)" \
|
||||
+ --info "description:$()" \
|
||||
+ --info "arch:$(PKGARCH)" \
|
||||
+ --info "license:$(LICENSE)" \
|
||||
+ --info "origin:$(SOURCE)" \
|
||||
+ --info "maintainer:$(MAINTAINER)" \
|
||||
+ $$(foreach dep,$$(Package/$(1)/DEPENDS),--info "depends:$$(subst $$(comma),,$$(dep))") \
|
||||
+ --files "$$(IDIR_$(1))" \
|
||||
+ --output "$$(APK_$(1))" \
|
||||
+ --sign "$(BUILD_KEY_APK_SEC)"
|
||||
+
|
||||
+ mkdir -p $$(IDIR_$(1))/CONTROL
|
||||
+
|
||||
(cd $$(IDIR_$(1))/CONTROL; \
|
||||
( \
|
||||
echo "$$$$CONTROL"; \
|
||||
@@ -249,20 +281,6 @@ $(_endef)
|
||||
$($(1)_COMMANDS) \
|
||||
)
|
||||
|
||||
- ifneq ($$(KEEP_$(1)),)
|
||||
- @( \
|
||||
- keepfiles=""; \
|
||||
- for x in $$(KEEP_$(1)); do \
|
||||
- [ -f "$$(IDIR_$(1))/$$$$x" ] || keepfiles="$$$${keepfiles:+$$$$keepfiles }$$$$x"; \
|
||||
- done; \
|
||||
- [ -z "$$$$keepfiles" ] || { \
|
||||
- mkdir -p $$(IDIR_$(1))/lib/upgrade/keep.d; \
|
||||
- for x in $$$$keepfiles; do echo $$$$x >> $$(IDIR_$(1))/lib/upgrade/keep.d/$(1); done; \
|
||||
- }; \
|
||||
- )
|
||||
- endif
|
||||
-
|
||||
- $(INSTALL_DIR) $$(PDIR_$(1))
|
||||
$(FAKEROOT) $(SCRIPT_DIR)/ipkg-build -m "$(FILE_MODES)" $$(IDIR_$(1)) $$(PDIR_$(1))
|
||||
@[ -f $$(IPKG_$(1)) ]
|
||||
|
||||
diff --git a/package/Makefile b/package/Makefile
|
||||
index ec503dc527..18a19fff13 100644
|
||||
--- a/package/Makefile
|
||||
+++ b/package/Makefile
|
||||
@@ -60,6 +60,7 @@ $(curdir)/merge-index: $(curdir)/merge
|
||||
|
||||
ifndef SDK
|
||||
$(curdir)/compile: $(curdir)/system/opkg/host/compile
|
||||
+ $(patsubst %,$(curdir)/%/compile,$(filter-out %/apk/host,$($(curdir)/builddirs))): $(curdir)/system/apk/host/compile
|
||||
endif
|
||||
|
||||
$(curdir)/install: $(TMP_DIR)/.build $(curdir)/merge $(if $(CONFIG_TARGET_PER_DEVICE_ROOTFS),$(curdir)/merge-index)
|
||||
@@ -84,6 +85,7 @@ $(curdir)/index: FORCE
|
||||
@for d in $(PACKAGE_SUBDIRS); do ( \
|
||||
mkdir -p $$d; \
|
||||
cd $$d || continue; \
|
||||
+ $(SCRIPT_DIR)/apk-make-index.sh . 2>&1; \
|
||||
$(SCRIPT_DIR)/ipkg-make-index.sh . 2>&1 > Packages.manifest; \
|
||||
grep -vE '^(Maintainer|LicenseFiles|Source|SourceName|Require|SourceDateEpoch)' Packages.manifest > Packages; \
|
||||
case "$$(((64 + $$(stat -L -c%s Packages)) % 128))" in 110|111) \
|
||||
diff --git a/package/base-files/Makefile b/package/base-files/Makefile
|
||||
index 8a1ddf96f5..9db4812981 100644
|
||||
--- a/package/base-files/Makefile
|
||||
+++ b/package/base-files/Makefile
|
||||
@@ -107,6 +107,10 @@ ifdef CONFIG_SIGNED_PACKAGES
|
||||
[ -s $(BUILD_KEY).ucert ] || \
|
||||
$(STAGING_DIR_HOST)/bin/ucert -I -c $(BUILD_KEY).ucert -p $(BUILD_KEY).pub -s $(BUILD_KEY)
|
||||
|
||||
+ [ -s $(BUILD_KEY_APK_SEC) -a -s $(BUILD_KEY_APK_PUB) ] || \
|
||||
+ openssl ecparam -name prime256v1 -genkey -noout -out $(BUILD_KEY_APK_SEC); \
|
||||
+ openssl ec -in $(BUILD_KEY_APK_SEC) -pubout > $(BUILD_KEY_APK_PUB)
|
||||
+
|
||||
endef
|
||||
|
||||
ifndef CONFIG_BUILDBOT
|
||||
diff --git a/rules.mk b/rules.mk
|
||||
index f31d9bb113..de81b65d46 100644
|
||||
--- a/rules.mk
|
||||
+++ b/rules.mk
|
||||
@@ -258,6 +258,8 @@ else
|
||||
endif
|
||||
|
||||
BUILD_KEY=$(TOPDIR)/key-build
|
||||
+BUILD_KEY_APK_SEC=$(TOPDIR)/private-key.pem
|
||||
+BUILD_KEY_APK_PUB=$(TOPDIR)/public-key.pem
|
||||
|
||||
FAKEROOT:=$(STAGING_DIR_HOST)/bin/fakeroot
|
||||
|
||||
diff --git a/scripts/apk-make-index.sh b/scripts/apk-make-index.sh
|
||||
new file mode 100755
|
||||
index 0000000000..df1f1a2e2b
|
||||
--- /dev/null
|
||||
+++ b/scripts/apk-make-index.sh
|
||||
@@ -0,0 +1,20 @@
|
||||
+#!/usr/bin/env bash
|
||||
+set -e
|
||||
+
|
||||
+pkg_dir=$1
|
||||
+
|
||||
+if [ -z "$pkg_dir" ] || [ ! -d "$pkg_dir" ]; then
|
||||
+ echo "Usage: apk-make-index <package_directory>" >&2
|
||||
+ exit 1
|
||||
+fi
|
||||
+
|
||||
+(
|
||||
+ cd "$pkg_dir" || exit 1
|
||||
+ GLOBIGNORE="kernel*:libc*"
|
||||
+ set -- *.apk
|
||||
+ if [ "$1" = '*.apk' ]; then
|
||||
+ echo "No APK packages found"
|
||||
+ fi
|
||||
+ apk index --output APKINDEX.tar.gz "$@"
|
||||
+ unset GLOBIGNORE
|
||||
+)
|
||||
--
|
||||
2.25.1
|
||||
|
||||
69
backports/0102-fstools-update-to-git-HEAD.patch
Normal file
69
backports/0102-fstools-update-to-git-HEAD.patch
Normal file
@@ -0,0 +1,69 @@
|
||||
From 2239c3c87a723bee8efa64ecf22c61a15433517e Mon Sep 17 00:00:00 2001
|
||||
From: Daniel Golle <daniel@makrotopia.org>
|
||||
Date: Sun, 25 Jul 2021 01:20:31 +0100
|
||||
Subject: [PATCH 102/146] fstools: update to git HEAD
|
||||
|
||||
bad1835 fstools: add partname volume driver
|
||||
19d7d93 libfstools: partname: several fixes
|
||||
3c38f0c libfstools: fix build with glibc
|
||||
d05ad93 libfstools: remove superflus include
|
||||
964d1e3 partname: allow skipping existing 'rootfs_data' partition
|
||||
c44b40b overlay: fix syncronizing typo
|
||||
b5397a1 fstools: block: fix segfault on mount with no target
|
||||
bd7cc8d block: use dynamically allocated target string
|
||||
6d8450e blockd: use allocated strings instead of fixed buffers
|
||||
d47909e libblkid-tiny: fix buffer overflow
|
||||
67d2297 block: match device path instead of assuming /dev/%s
|
||||
2aeba88 block: allow autofs and umount commands also on MTD/UBI
|
||||
3d40a1b blockd: add missing #define _GNU_SOURCE
|
||||
4d4dcfb blockd: detect mountpoint of /dev/mapper/*
|
||||
2f42515 block: resolve /dev/mapper/* name for /dev/dm-0 when hotplugging
|
||||
39558a1 blockd: also send ubus notification on mount hotplug
|
||||
3386b6b blockd: fix trigger name
|
||||
cdc9939 blockd: move to its own POSIX process group
|
||||
59f7c11 blockd: create mountpoint parent folder if needed
|
||||
9cc96af Revert "block: resolve /dev/mapper/* name for /dev/dm-0 when hotplugging"
|
||||
06334ac Revert "blockd: detect mountpoint of /dev/mapper/*"
|
||||
9ab3551 block: use /dev/dm-* instead of /dev/mapper/*
|
||||
5114595 block: allow remove hotplug event to arrive at blockd
|
||||
a846c6b blockd: fix length of timeout int passed to ioctl
|
||||
1d681ca block: support umount device basename
|
||||
|
||||
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
||||
---
|
||||
package/system/fstools/Makefile | 6 +++---
|
||||
package/system/fstools/files/blockd.init | 1 +
|
||||
2 files changed, 4 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/package/system/fstools/Makefile b/package/system/fstools/Makefile
|
||||
index 2da508d541..b582a17bae 100644
|
||||
--- a/package/system/fstools/Makefile
|
||||
+++ b/package/system/fstools/Makefile
|
||||
@@ -12,9 +12,9 @@ PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL=$(PROJECT_GIT)/project/fstools.git
|
||||
-PKG_MIRROR_HASH:=a485792d90c71cd4fb396ce97f42a57ee4d2a3d78e5f3fd0748270ffb14209e6
|
||||
-PKG_SOURCE_DATE:=2021-01-04
|
||||
-PKG_SOURCE_VERSION:=c53b18820756f6f32ad0782d3bf489422b7c4ad3
|
||||
+PKG_MIRROR_HASH:=6a457b812166e04e2244ee1be92a4957666b5d1554315c0e18db1b30376cc617
|
||||
+PKG_SOURCE_DATE:=2021-07-28
|
||||
+PKG_SOURCE_VERSION:=cc63933faedd8d4fcdabb872cf4661ac04fe4ba2
|
||||
CMAKE_INSTALL:=1
|
||||
|
||||
PKG_LICENSE:=GPL-2.0
|
||||
diff --git a/package/system/fstools/files/blockd.init b/package/system/fstools/files/blockd.init
|
||||
index a4ce57d40d..bdd8bbf622 100755
|
||||
--- a/package/system/fstools/files/blockd.init
|
||||
+++ b/package/system/fstools/files/blockd.init
|
||||
@@ -16,6 +16,7 @@ reload_service() {
|
||||
start_service() {
|
||||
procd_open_instance
|
||||
procd_set_param command "$PROG"
|
||||
+ procd_set_param watch block
|
||||
procd_set_param respawn
|
||||
procd_close_instance
|
||||
}
|
||||
--
|
||||
2.25.1
|
||||
|
||||
40
backports/0103-tools-libressl-update-to-3.3.3.patch
Normal file
40
backports/0103-tools-libressl-update-to-3.3.3.patch
Normal file
@@ -0,0 +1,40 @@
|
||||
From c40bb49f31443d9c03043c4361e4af56e5c3eba4 Mon Sep 17 00:00:00 2001
|
||||
From: Rosen Penev <rosenp@gmail.com>
|
||||
Date: Sat, 19 Jun 2021 14:45:11 -0700
|
||||
Subject: [PATCH 103/146] tools/libressl: update to 3.3.3
|
||||
|
||||
Fix wrong FPIC variable usage. Fixes compilation under sparc64 host.
|
||||
|
||||
Signed-off-by: Rosen Penev <rosenp@gmail.com>
|
||||
(cherry picked from commit bf4dbbb55e2b8e23f186e1334f1e9ce6a3a8ddfe)
|
||||
---
|
||||
tools/libressl/Makefile | 6 +++---
|
||||
1 file changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/tools/libressl/Makefile b/tools/libressl/Makefile
|
||||
index 2b5a33450c..e25b5661ee 100644
|
||||
--- a/tools/libressl/Makefile
|
||||
+++ b/tools/libressl/Makefile
|
||||
@@ -8,8 +8,8 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libressl
|
||||
-PKG_VERSION:=3.3.1
|
||||
-PKG_HASH:=a6d331865e0164a13ac85a228e52517f7cf8f8488f2f95f34e7857302f97cfdb
|
||||
+PKG_VERSION:=3.3.3
|
||||
+PKG_HASH:=a471565b36ccd1a70d0bd7d37c6e95c43a26a62829b487d9d2cdebfe58be3066
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_CPE_ID:=cpe:/a:openbsd:libressl
|
||||
@@ -25,7 +25,7 @@ include $(INCLUDE_DIR)/host-build.mk
|
||||
|
||||
HOSTCC := $(HOSTCC_NOCACHE)
|
||||
HOST_CONFIGURE_ARGS += --enable-static --disable-shared --disable-tests
|
||||
-HOST_CFLAGS += $(FPIC)
|
||||
+HOST_CFLAGS += $(HOST_FPIC)
|
||||
|
||||
ifeq ($(GNU_HOST_NAME),x86_64-linux-gnux32)
|
||||
HOST_CONFIGURE_ARGS += --disable-asm
|
||||
--
|
||||
2.25.1
|
||||
|
||||
1213
backports/0104-uvol-backport-package.patch
Normal file
1213
backports/0104-uvol-backport-package.patch
Normal file
File diff suppressed because it is too large
Load Diff
312
backports/0105-apk-backport-package.patch
Normal file
312
backports/0105-apk-backport-package.patch
Normal file
@@ -0,0 +1,312 @@
|
||||
From 6741963067c4be8999896a5e653dc0d72487e392 Mon Sep 17 00:00:00 2001
|
||||
From: John Crispin <john@phrozen.org>
|
||||
Date: Fri, 13 Aug 2021 08:47:11 +0200
|
||||
Subject: [PATCH 06/46] apk: backport package
|
||||
|
||||
Signed-off-by: John Crispin <john@phrozen.org>
|
||||
---
|
||||
package/system/apk/Makefile | 93 +++++++++++++++++++
|
||||
...vel@lists.alpinelinux.org-4a6a0840.rsa.pub | 9 ++
|
||||
...vel@lists.alpinelinux.org-5243ef4b.rsa.pub | 9 ++
|
||||
...vel@lists.alpinelinux.org-5261cecb.rsa.pub | 9 ++
|
||||
package/system/apk/files/alpine-repositories | 3 +
|
||||
.../apk/patches/000-Makefile-version.patch | 11 +++
|
||||
.../patches/0001-remove-doc-generation.patch | 21 +++++
|
||||
package/system/apk/patches/100-link.patch | 16 ++++
|
||||
package/system/apk/patches/100-phtread.patch | 12 +++
|
||||
...ude-limits.h-to-fix-build-with-glibc.patch | 20 ++++
|
||||
package/system/apk/test.sh | 9 ++
|
||||
11 files changed, 212 insertions(+)
|
||||
create mode 100644 package/system/apk/Makefile
|
||||
create mode 100644 package/system/apk/files/alpine-keys/alpine-devel@lists.alpinelinux.org-4a6a0840.rsa.pub
|
||||
create mode 100644 package/system/apk/files/alpine-keys/alpine-devel@lists.alpinelinux.org-5243ef4b.rsa.pub
|
||||
create mode 100644 package/system/apk/files/alpine-keys/alpine-devel@lists.alpinelinux.org-5261cecb.rsa.pub
|
||||
create mode 100644 package/system/apk/files/alpine-repositories
|
||||
create mode 100644 package/system/apk/patches/000-Makefile-version.patch
|
||||
create mode 100644 package/system/apk/patches/0001-remove-doc-generation.patch
|
||||
create mode 100644 package/system/apk/patches/100-link.patch
|
||||
create mode 100644 package/system/apk/patches/100-phtread.patch
|
||||
create mode 100644 package/system/apk/patches/100-tar-include-limits.h-to-fix-build-with-glibc.patch
|
||||
create mode 100644 package/system/apk/test.sh
|
||||
|
||||
diff --git a/package/system/apk/Makefile b/package/system/apk/Makefile
|
||||
new file mode 100644
|
||||
index 0000000000..335f50c155
|
||||
--- /dev/null
|
||||
+++ b/package/system/apk/Makefile
|
||||
@@ -0,0 +1,93 @@
|
||||
+include $(TOPDIR)/rules.mk
|
||||
+
|
||||
+PKG_NAME:=apk
|
||||
+PKG_VERSION:=3.0.0_pre0
|
||||
+
|
||||
+PKG_SOURCE_PROTO:=git
|
||||
+PKG_SOURCE_URL:=https://git.alpinelinux.org/apk-tools.git
|
||||
+PKG_SOURCE_DATE:=2021-08-17
|
||||
+PKG_SOURCE_VERSION:=a46043bcc4cc15b456ef1eac5c5f9d93bd905d53
|
||||
+PKG_MIRROR_HASH:=e16fd04b18043e78a177acd8c6958fa03fd1484b62c879c2dd0bed8ce9c50625
|
||||
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_SOURCE_DATE)-$(call version_abbrev,$(PKG_SOURCE_VERSION))
|
||||
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_SUBDIR)
|
||||
+HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/$(PKG_SOURCE_SUBDIR)
|
||||
+PKG_SOURCE:=$(PKG_SOURCE_SUBDIR).tar.xz
|
||||
+PKG_RELEASE:=r$(PKG_SOURCE_DATE)-$(call version_abbrev,$(PKG_SOURCE_VERSION))-$(AUTORELEASE)
|
||||
+
|
||||
+PKG_MAINTAINER:=Paul Spooren <mail@aparcar.org>
|
||||
+PKG_LICENSE:=GPL-2.0-only
|
||||
+PKG_LICENSE_FILES:=LICENSE
|
||||
+
|
||||
+PKG_INSTALL:=1
|
||||
+PKG_BUILD_PARALLEL:=1
|
||||
+
|
||||
+HOST_BUILD_DEPENDS:=lua/host lua-lzlib/host
|
||||
+PKG_BUILD_DEPENDS:=$(HOST_BUILD_DEPENDS)
|
||||
+
|
||||
+include $(INCLUDE_DIR)/package.mk
|
||||
+include $(INCLUDE_DIR)/host-build.mk
|
||||
+
|
||||
+define Package/apk
|
||||
+ SECTION:=utils
|
||||
+ CATEGORY:=Utilities
|
||||
+ TITLE:=apk package manager
|
||||
+ DEPENDS:=+liblua +libopenssl +zlib @!arc
|
||||
+ URL:=$(PKG_SOURCE_URL)
|
||||
+endef
|
||||
+
|
||||
+define Package/alpine-keys
|
||||
+ SECTION:=utils
|
||||
+ CATEGORY:=Utilities
|
||||
+ TITLE:=Alpine apk public signing keys
|
||||
+ DEPENDS:=apk
|
||||
+endef
|
||||
+
|
||||
+define Package/alpine-repositories
|
||||
+ SECTION:=utils
|
||||
+ CATEGORY:=Utilities
|
||||
+ TITLE:=Official Alpine repositories
|
||||
+ DEPENDS:=apk
|
||||
+endef
|
||||
+
|
||||
+MAKE_FLAGS += \
|
||||
+ LUA=$(STAGING_DIR_HOSTPKG)/bin/lua \
|
||||
+ LUA_VERSION=5.1 \
|
||||
+ LUA_PC=lua
|
||||
+
|
||||
+HOST_MAKE_FLAGS += \
|
||||
+ LUA=$(STAGING_DIR_HOSTPKG)/bin/lua \
|
||||
+ LUA_VERSION=5.1 \
|
||||
+ DESTDIR=$(STAGING_DIR_HOSTPKG) \
|
||||
+ SBINDIR=/bin \
|
||||
+ PREFIX=
|
||||
+
|
||||
+HOST_LDFLAGS+=-Wl,-rpath=$(STAGING_DIR_HOSTPKG)/lib -lpthread
|
||||
+
|
||||
+define Package/apk/install
|
||||
+ $(INSTALL_DIR) $(1)/lib/apk/db
|
||||
+
|
||||
+ $(INSTALL_DIR) $(1)/bin
|
||||
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/sbin/apk $(1)/bin/apk
|
||||
+
|
||||
+ $(INSTALL_DIR) $(1)/usr/lib
|
||||
+ $(CP) $(PKG_INSTALL_DIR)/lib/*.so.* $(1)/usr/lib/
|
||||
+
|
||||
+ $(INSTALL_DIR) $(1)/etc/apk/
|
||||
+ echo $(ARCH) > $(1)/etc/apk/arch
|
||||
+ touch $(1)/etc/apk/world
|
||||
+endef
|
||||
+
|
||||
+define Package/alpine-keys/install
|
||||
+ $(INSTALL_DIR) $(1)/etc/apk/keys
|
||||
+ $(INSTALL_DATA) ./files/alpine-keys/* $(1)/etc/apk/keys
|
||||
+endef
|
||||
+
|
||||
+define Package/alpine-repositories/install
|
||||
+ $(INSTALL_DIR) $(1)/etc/apk/keys
|
||||
+ $(INSTALL_DATA) ./files/alpine-repositories $(1)/etc/apk/repositories
|
||||
+endef
|
||||
+
|
||||
+$(eval $(call BuildPackage,apk))
|
||||
+$(eval $(call BuildPackage,alpine-keys))
|
||||
+$(eval $(call BuildPackage,alpine-repositories))
|
||||
+$(eval $(call HostBuild))
|
||||
diff --git a/package/system/apk/files/alpine-keys/alpine-devel@lists.alpinelinux.org-4a6a0840.rsa.pub b/package/system/apk/files/alpine-keys/alpine-devel@lists.alpinelinux.org-4a6a0840.rsa.pub
|
||||
new file mode 100644
|
||||
index 0000000000..bb4bdc80fd
|
||||
--- /dev/null
|
||||
+++ b/package/system/apk/files/alpine-keys/alpine-devel@lists.alpinelinux.org-4a6a0840.rsa.pub
|
||||
@@ -0,0 +1,9 @@
|
||||
+-----BEGIN PUBLIC KEY-----
|
||||
+MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA1yHJxQgsHQREclQu4Ohe
|
||||
+qxTxd1tHcNnvnQTu/UrTky8wWvgXT+jpveroeWWnzmsYlDI93eLI2ORakxb3gA2O
|
||||
+Q0Ry4ws8vhaxLQGC74uQR5+/yYrLuTKydFzuPaS1dK19qJPXB8GMdmFOijnXX4SA
|
||||
+jixuHLe1WW7kZVtjL7nufvpXkWBGjsfrvskdNA/5MfxAeBbqPgaq0QMEfxMAn6/R
|
||||
+L5kNepi/Vr4S39Xvf2DzWkTLEK8pcnjNkt9/aafhWqFVW7m3HCAII6h/qlQNQKSo
|
||||
+GuH34Q8GsFG30izUENV9avY7hSLq7nggsvknlNBZtFUcmGoQrtx3FmyYsIC8/R+B
|
||||
+ywIDAQAB
|
||||
+-----END PUBLIC KEY-----
|
||||
diff --git a/package/system/apk/files/alpine-keys/alpine-devel@lists.alpinelinux.org-5243ef4b.rsa.pub b/package/system/apk/files/alpine-keys/alpine-devel@lists.alpinelinux.org-5243ef4b.rsa.pub
|
||||
new file mode 100644
|
||||
index 0000000000..6cbfad7441
|
||||
--- /dev/null
|
||||
+++ b/package/system/apk/files/alpine-keys/alpine-devel@lists.alpinelinux.org-5243ef4b.rsa.pub
|
||||
@@ -0,0 +1,9 @@
|
||||
+-----BEGIN PUBLIC KEY-----
|
||||
+MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvNijDxJ8kloskKQpJdx+
|
||||
+mTMVFFUGDoDCbulnhZMJoKNkSuZOzBoFC94omYPtxnIcBdWBGnrm6ncbKRlR+6oy
|
||||
+DO0W7c44uHKCFGFqBhDasdI4RCYP+fcIX/lyMh6MLbOxqS22TwSLhCVjTyJeeH7K
|
||||
+aA7vqk+QSsF4TGbYzQDDpg7+6aAcNzg6InNePaywA6hbT0JXbxnDWsB+2/LLSF2G
|
||||
+mnhJlJrWB1WGjkz23ONIWk85W4S0XB/ewDefd4Ly/zyIciastA7Zqnh7p3Ody6Q0
|
||||
+sS2MJzo7p3os1smGjUF158s6m/JbVh4DN6YIsxwl2OjDOz9R0OycfJSDaBVIGZzg
|
||||
+cQIDAQAB
|
||||
+-----END PUBLIC KEY-----
|
||||
diff --git a/package/system/apk/files/alpine-keys/alpine-devel@lists.alpinelinux.org-5261cecb.rsa.pub b/package/system/apk/files/alpine-keys/alpine-devel@lists.alpinelinux.org-5261cecb.rsa.pub
|
||||
new file mode 100644
|
||||
index 0000000000..83f0658e9c
|
||||
--- /dev/null
|
||||
+++ b/package/system/apk/files/alpine-keys/alpine-devel@lists.alpinelinux.org-5261cecb.rsa.pub
|
||||
@@ -0,0 +1,9 @@
|
||||
+-----BEGIN PUBLIC KEY-----
|
||||
+MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAwlzMkl7b5PBdfMzGdCT0
|
||||
+cGloRr5xGgVmsdq5EtJvFkFAiN8Ac9MCFy/vAFmS8/7ZaGOXoCDWbYVLTLOO2qtX
|
||||
+yHRl+7fJVh2N6qrDDFPmdgCi8NaE+3rITWXGrrQ1spJ0B6HIzTDNEjRKnD4xyg4j
|
||||
+g01FMcJTU6E+V2JBY45CKN9dWr1JDM/nei/Pf0byBJlMp/mSSfjodykmz4Oe13xB
|
||||
+Ca1WTwgFykKYthoLGYrmo+LKIGpMoeEbY1kuUe04UiDe47l6Oggwnl+8XD1MeRWY
|
||||
+sWgj8sF4dTcSfCMavK4zHRFFQbGp/YFJ/Ww6U9lA3Vq0wyEI6MCMQnoSMFwrbgZw
|
||||
+wwIDAQAB
|
||||
+-----END PUBLIC KEY-----
|
||||
diff --git a/package/system/apk/files/alpine-repositories b/package/system/apk/files/alpine-repositories
|
||||
new file mode 100644
|
||||
index 0000000000..5babbb23b4
|
||||
--- /dev/null
|
||||
+++ b/package/system/apk/files/alpine-repositories
|
||||
@@ -0,0 +1,3 @@
|
||||
+https://dl-cdn.alpinelinux.org/alpine/edge/main
|
||||
+https://dl-cdn.alpinelinux.org/alpine/edge/community
|
||||
+
|
||||
diff --git a/package/system/apk/patches/000-Makefile-version.patch b/package/system/apk/patches/000-Makefile-version.patch
|
||||
new file mode 100644
|
||||
index 0000000000..2e7f5b0f15
|
||||
--- /dev/null
|
||||
+++ b/package/system/apk/patches/000-Makefile-version.patch
|
||||
@@ -0,0 +1,11 @@
|
||||
+--- a/Makefile
|
||||
++++ b/Makefile
|
||||
+@@ -4,7 +4,7 @@
|
||||
+ -include config.mk
|
||||
+
|
||||
+ PACKAGE := apk-tools
|
||||
+-VERSION := 2.12.0
|
||||
++VERSION := 3.0.0_pre0
|
||||
+
|
||||
+ export VERSION
|
||||
+
|
||||
diff --git a/package/system/apk/patches/0001-remove-doc-generation.patch b/package/system/apk/patches/0001-remove-doc-generation.patch
|
||||
new file mode 100644
|
||||
index 0000000000..dee05c56f2
|
||||
--- /dev/null
|
||||
+++ b/package/system/apk/patches/0001-remove-doc-generation.patch
|
||||
@@ -0,0 +1,21 @@
|
||||
+From b05a93c48fdbb50f0c464310dc2ce45777d32ea2 Mon Sep 17 00:00:00 2001
|
||||
+From: Paul Spooren <mail@aparcar.org>
|
||||
+Date: Fri, 2 Oct 2020 14:08:52 -1000
|
||||
+Subject: [PATCH] remove doc generation
|
||||
+
|
||||
+Signed-off-by: Paul Spooren <mail@aparcar.org>
|
||||
+---
|
||||
+ Makefile | 2 +-
|
||||
+ 1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
+
|
||||
+--- a/Makefile
|
||||
++++ b/Makefile
|
||||
+@@ -25,7 +25,7 @@ export DESTDIR SBINDIR LIBDIR CONFDIR MA
|
||||
+ ##
|
||||
+ # Top-level subdirs
|
||||
+
|
||||
+-subdirs := libfetch/ src/ doc/
|
||||
++subdirs := libfetch/ src/
|
||||
+
|
||||
+ ##
|
||||
+ # Include all rules and stuff
|
||||
diff --git a/package/system/apk/patches/100-link.patch b/package/system/apk/patches/100-link.patch
|
||||
new file mode 100644
|
||||
index 0000000000..9cae2787d9
|
||||
--- /dev/null
|
||||
+++ b/package/system/apk/patches/100-link.patch
|
||||
@@ -0,0 +1,16 @@
|
||||
+diff -urN apk-2021-08-17-a46043bc.orig/src/Makefile apk-2021-08-17-a46043bc/src/Makefile
|
||||
+--- apk-2021-08-17-a46043bc.orig/src/Makefile 2021-08-17 14:21:04.117760513 +0200
|
||||
++++ apk-2021-08-17-a46043bc/src/Makefile 2021-08-17 14:21:16.653830180 +0200
|
||||
+@@ -65,7 +65,11 @@
|
||||
+ app_convdb.o app_convndx.o app_del.o app_dot.o app_extract.o app_fetch.o \
|
||||
+ app_fix.o app_index.o app_info.o app_list.o app_manifest.o app_mkndx.o \
|
||||
+ app_mkpkg.o app_policy.o app_update.o app_upgrade.o app_search.o \
|
||||
+- app_stats.o app_verify.o app_version.o app_vertest.o applet.o
|
||||
++ app_stats.o app_verify.o app_version.o app_vertest.o applet.o \
|
||||
++ adb.o adb_comp.o adb_walk_adb.o adb_walk_genadb.o adb_walk_gentext.o adb_walk_text.o apk_adb.o \
|
||||
++ atom.o blob.o commit.o common.o context.o crypto_openssl.o database.o hash.o \
|
||||
++ extract.o extract_v2.o extract_v3.o io.o io_gunzip.o io_url.o tar.o \
|
||||
++ package.o pathbuilder.o print.o solver.o trust.o version.o
|
||||
+
|
||||
+ ifeq ($(ADB),y)
|
||||
+ libapk.so.$(libapk_soname)-objs += apk_adb.o
|
||||
diff --git a/package/system/apk/patches/100-phtread.patch b/package/system/apk/patches/100-phtread.patch
|
||||
new file mode 100644
|
||||
index 0000000000..c252e14dc1
|
||||
--- /dev/null
|
||||
+++ b/package/system/apk/patches/100-phtread.patch
|
||||
@@ -0,0 +1,12 @@
|
||||
+diff -urN apk-2021-07-23-3d203e8f.orig/src/Makefile apk-2021-07-23-3d203e8f/src/Makefile
|
||||
+--- apk-2021-07-23-3d203e8f.orig/src/Makefile 2021-07-25 12:55:05.576564663 +0200
|
||||
++++ apk-2021-07-23-3d203e8f/src/Makefile 2021-07-25 12:55:48.660862181 +0200
|
||||
+@@ -87,7 +87,7 @@
|
||||
+ apk.static-libs := $(apk-static-libs)
|
||||
+ LDFLAGS_apk.static := -static
|
||||
+ LIBS_apk.static := -Wl,--as-needed -ldl -Wl,--no-as-needed
|
||||
+-LDFLAGS_apk += -L$(obj)
|
||||
++LDFLAGS_apk += -L$(obj) -pthread
|
||||
+ LDFLAGS_apk-test += -L$(obj)
|
||||
+
|
||||
+ CFLAGS_ALL += $(OPENSSL_CFLAGS) $(ZLIB_CFLAGS)
|
||||
diff --git a/package/system/apk/patches/100-tar-include-limits.h-to-fix-build-with-glibc.patch b/package/system/apk/patches/100-tar-include-limits.h-to-fix-build-with-glibc.patch
|
||||
new file mode 100644
|
||||
index 0000000000..43ec7d5f1a
|
||||
--- /dev/null
|
||||
+++ b/package/system/apk/patches/100-tar-include-limits.h-to-fix-build-with-glibc.patch
|
||||
@@ -0,0 +1,20 @@
|
||||
+From c72ea983e287ec1d8b1f2b3aab1bf40aa7a30b03 Mon Sep 17 00:00:00 2001
|
||||
+From: Daniel Golle <daniel@makrotopia.org>
|
||||
+Date: Wed, 4 Aug 2021 21:37:40 +0100
|
||||
+Subject: [PATCH] tar: include <limits.h> to fix build with glibc
|
||||
+
|
||||
+Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
||||
+---
|
||||
+ src/tar.c | 1 +
|
||||
+ 1 file changed, 1 insertion(+)
|
||||
+
|
||||
+--- a/src/tar.c
|
||||
++++ b/src/tar.c
|
||||
+@@ -9,6 +9,7 @@
|
||||
+
|
||||
+ #include <sys/stat.h>
|
||||
+ #include <sys/sysmacros.h>
|
||||
++#include <limits.h> /* for SSIZE_MAX with glibc */
|
||||
+
|
||||
+ #include "apk_defines.h"
|
||||
+ #include "apk_tar.h"
|
||||
diff --git a/package/system/apk/test.sh b/package/system/apk/test.sh
|
||||
new file mode 100644
|
||||
index 0000000000..814777fd70
|
||||
--- /dev/null
|
||||
+++ b/package/system/apk/test.sh
|
||||
@@ -0,0 +1,9 @@
|
||||
+#!/bin/sh
|
||||
+
|
||||
+case "$1" in
|
||||
+ "apk")
|
||||
+ apk --version | grep "${2/-r*/}"
|
||||
+ ;;
|
||||
+ *)
|
||||
+ return 0;
|
||||
+esac
|
||||
--
|
||||
2.25.1
|
||||
|
||||
104
backports/0106-lua-lzlib-backport-package.patch
Normal file
104
backports/0106-lua-lzlib-backport-package.patch
Normal file
@@ -0,0 +1,104 @@
|
||||
From 900d18f3ae2cd5bb3d8d6e2584d2280cb5302e01 Mon Sep 17 00:00:00 2001
|
||||
From: John Crispin <john@phrozen.org>
|
||||
Date: Fri, 13 Aug 2021 08:48:02 +0200
|
||||
Subject: [PATCH 106/146] lua-lzlib: backport package
|
||||
|
||||
Signed-off-by: John Crispin <john@phrozen.org>
|
||||
---
|
||||
package/libs/lua-lzlib/Makefile | 64 +++++++++++++++++++
|
||||
.../patches/001-allow_optim_flags.patch | 12 ++++
|
||||
2 files changed, 76 insertions(+)
|
||||
create mode 100644 package/libs/lua-lzlib/Makefile
|
||||
create mode 100644 package/libs/lua-lzlib/patches/001-allow_optim_flags.patch
|
||||
|
||||
diff --git a/package/libs/lua-lzlib/Makefile b/package/libs/lua-lzlib/Makefile
|
||||
new file mode 100644
|
||||
index 0000000000..5e0a16b135
|
||||
--- /dev/null
|
||||
+++ b/package/libs/lua-lzlib/Makefile
|
||||
@@ -0,0 +1,64 @@
|
||||
+#
|
||||
+# Copyright (C) 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:=lua-lzlib
|
||||
+PKG_VERSION:=0.4.3
|
||||
+PKG_RELEASE:=1
|
||||
+PKG_MAINTAINER:=Dirk Chang <dirk@kooiot.com>
|
||||
+PKG_LICENSE:=MIT
|
||||
+
|
||||
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
+PKG_MIRROR_HASH:=b6ef5e3f04b7f2137b39931a175ee802489a2486e70537770919bcccca10e723
|
||||
+PKG_SOURCE_URL:=https://github.com/LuaDist/lzlib.git
|
||||
+PKG_SOURCE_PROTO:=git
|
||||
+PKG_SOURCE_VERSION:=79329a07d8f79c19eadd7ea2752b4c4e1574b015
|
||||
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
+
|
||||
+HOST_BUILD_DEPENDS:=lua/host
|
||||
+
|
||||
+include $(INCLUDE_DIR)/package.mk
|
||||
+include $(INCLUDE_DIR)/host-build.mk
|
||||
+
|
||||
+define Package/lua-lzlib
|
||||
+ SUBMENU:=Lua
|
||||
+ SECTION:=lang
|
||||
+ CATEGORY:=Languages
|
||||
+ TITLE:=Lua zlib binding
|
||||
+ URL:=http://github.com/LuaDist/lzlib
|
||||
+ DEPENDS:= +lua +zlib
|
||||
+endef
|
||||
+
|
||||
+define Package/lua-lzlib/description
|
||||
+ A library to access zlib library functions and also to read/write gzip files using an interface similar to the base io package.
|
||||
+endef
|
||||
+
|
||||
+MAKE_FLAGS += \
|
||||
+ LUA="$(STAGING_DIR)/usr" \
|
||||
+ OFLAGS="$(TARGET_CFLAGS)" \
|
||||
+
|
||||
+HOST_MAKE_FLAGS += \
|
||||
+ LUA="$(STAGING_DIR_HOSTPKG)" \
|
||||
+ OFLAGS="$(HOST_CFLAGS)" \
|
||||
+
|
||||
+define Package/lua-lzlib/install
|
||||
+ $(INSTALL_DIR) $(1)/usr/lib/lua
|
||||
+ $(INSTALL_BIN) $(PKG_BUILD_DIR)/zlib.so $(1)/usr/lib/lua/
|
||||
+
|
||||
+ $(INSTALL_DATA) $(PKG_BUILD_DIR)/gzip.lua $(1)/usr/lib/lua/
|
||||
+endef
|
||||
+
|
||||
+define Host/Install
|
||||
+ $(INSTALL_DIR) $(STAGING_DIR_HOSTPKG)/lib/lua/5.1
|
||||
+ $(INSTALL_BIN) $(HOST_BUILD_DIR)/zlib.so $(STAGING_DIR_HOSTPKG)/lib/lua/5.1
|
||||
+
|
||||
+ $(INSTALL_DATA) $(HOST_BUILD_DIR)/gzip.lua $(STAGING_DIR_HOSTPKG)/lib/lua/5.1
|
||||
+endef
|
||||
+
|
||||
+$(eval $(call BuildPackage,lua-lzlib))
|
||||
+$(eval $(call HostBuild))
|
||||
diff --git a/package/libs/lua-lzlib/patches/001-allow_optim_flags.patch b/package/libs/lua-lzlib/patches/001-allow_optim_flags.patch
|
||||
new file mode 100644
|
||||
index 0000000000..78f981d237
|
||||
--- /dev/null
|
||||
+++ b/package/libs/lua-lzlib/patches/001-allow_optim_flags.patch
|
||||
@@ -0,0 +1,12 @@
|
||||
+--- a/Makefile
|
||||
++++ b/Makefile
|
||||
+@@ -14,7 +14,8 @@ LUABIN= $(LUA)/bin
|
||||
+ ZLIB=../zlib-1.2.3
|
||||
+
|
||||
+ # no need to change anything below here
|
||||
+-CFLAGS= $(INCS) $(DEFS) $(WARN) -O0 -fPIC
|
||||
++CFLAGS= $(INCS) $(DEFS) $(WARN) $(OFLAGS) -fPIC
|
||||
++OFLAGS= -O0
|
||||
+ WARN= -g -Werror -Wall -pedantic #-ansi
|
||||
+ INCS= -I$(LUAINC) -I$(ZLIB)
|
||||
+ LIBS= -L$(ZLIB) -lz -L$(LUALIB) -L$(LUABIN) #-llua51
|
||||
--
|
||||
2.25.1
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
From 5c8a575ec759105e63a3aad033289d124516ec69 Mon Sep 17 00:00:00 2001
|
||||
From: Daniel Golle <daniel@makrotopia.org>
|
||||
Date: Sat, 10 Jul 2021 20:21:26 +0100
|
||||
Subject: [PATCH 107/146] lua: make it easier to detect host-built Lua
|
||||
|
||||
Install pkg-config file also for host-build, clean up Lua symlinks.
|
||||
|
||||
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
||||
(cherry picked from commit 315f52e0f3bfa3d65ad14ca21a696c6d31c4edcd)
|
||||
---
|
||||
package/utils/lua/Makefile | 8 ++++++--
|
||||
1 file changed, 6 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/package/utils/lua/Makefile b/package/utils/lua/Makefile
|
||||
index a54ef7d25a..be18880cb1 100644
|
||||
--- a/package/utils/lua/Makefile
|
||||
+++ b/package/utils/lua/Makefile
|
||||
@@ -134,8 +134,12 @@ define Host/Install
|
||||
INSTALL_TOP="$(STAGING_DIR_HOSTPKG)" \
|
||||
install
|
||||
|
||||
- $(LN) $(STAGING_DIR_HOSTPKG)/bin/lua5.1 $(STAGING_DIR_HOSTPKG)/bin/lua
|
||||
- $(LN) $(STAGING_DIR_HOSTPKG)/bin/luac5.1 $(STAGING_DIR_HOSTPKG)/bin/luac
|
||||
+ $(INSTALL_DIR) $(STAGING_DIR_HOSTPKG)/lib/pkgconfig
|
||||
+ $(CP) $(HOST_BUILD_DIR)/etc/lua.pc $(STAGING_DIR_HOSTPKG)/lib/pkgconfig/lua5.1.pc
|
||||
+
|
||||
+ $(LN) lua5.1 $(STAGING_DIR_HOSTPKG)/bin/lua
|
||||
+ $(LN) luac5.1 $(STAGING_DIR_HOSTPKG)/bin/luac
|
||||
+ $(LN) lua5.1.pc $(STAGING_DIR_HOSTPKG)/lib/pkgconfig/lua.pc
|
||||
endef
|
||||
|
||||
define Build/InstallDev
|
||||
--
|
||||
2.25.1
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
repo: https://github.com/openwrt/openwrt.git
|
||||
branch: openwrt-25.12
|
||||
revision: 1353227ad391b0008b8365eebd38495e01ed7577
|
||||
branch: openwrt-21.02
|
||||
revision: 6fd65c657351908302b37447675ee352ec927d93
|
||||
output_dir: ./output
|
||||
|
||||
patch_folders:
|
||||
- patches-25.12
|
||||
- backports/
|
||||
- patches/
|
||||
|
||||
@@ -3,7 +3,7 @@ FROM ubuntu:20.04
|
||||
RUN apt-get update \
|
||||
&& DEBIAN_FRONTEND="noninteractive" apt-get -y install tzdata \
|
||||
&& apt-get install -y \
|
||||
time git-core build-essential gcc-multilib clang \
|
||||
time git-core build-essential gcc-multilib \
|
||||
libncurses5-dev zlib1g-dev gawk flex gettext wget unzip python \
|
||||
python3 python3-pip python3-yaml libssl-dev rsync \
|
||||
&& apt-get clean
|
||||
|
||||
53
feeds/bluetooth/bluetooth-6lowpand/Makefile
Normal file
53
feeds/bluetooth/bluetooth-6lowpand/Makefile
Normal file
@@ -0,0 +1,53 @@
|
||||
#
|
||||
# Copyright (C) 2016 Nordic Semiconductor ASA.
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=bluetooth-6lowpand
|
||||
PKG_VERSION:=0.0.1
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_SOURCE_URL:=https://github.com/NordicSemiconductor/Linux-ble-6lowpan-joiner.git
|
||||
PKG_SOURCE_VERSION:=5ce5b248846a6d4ac4a609eb0e8d023cf920b247
|
||||
PKG_SOURCE_PROTO:=git
|
||||
|
||||
BLUEZ_DIR:=$(wildcard $(BUILD_DIR)/bluez-*)
|
||||
|
||||
TARGET_CFLAGS += -I$(BLUEZ_DIR)
|
||||
TARGET_LDFLAGS += -L$(BLUEZ_DIR)/lib/.libs/ -L$(BLUEZ_DIR)/src/.libs/ -lshared-mainloop -lbluetooth-internal
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/bluetooth-6lowpand
|
||||
SECTION:=base
|
||||
CATEGORY:=Network
|
||||
TITLE:=Bluetooth LE 6lowpan joiner daemon
|
||||
URL:=http://www.nordicsemi.com/
|
||||
DEPENDS:=+libusb-1.0 +bluez-libs
|
||||
endef
|
||||
|
||||
define Package/bluetooth-6lowpand/description
|
||||
Bluetooth Low Energy IPSP device scanner and connection daemon.
|
||||
The Daemon can be used to whitelist certain IPSP Bluetooth LE MAC
|
||||
addresses, or autoconnect using SSID and Key derived from Wifi AP
|
||||
setup to authenticate the devices in order to connect. Also, manual
|
||||
configuration of software SSID and Key can be used.
|
||||
endef
|
||||
|
||||
define Package/bluetooth-6lowpand/install
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_BIN) ./files/bluetooth_6lowpand.init $(1)/etc/init.d/bluetooth_6lowpand
|
||||
|
||||
$(INSTALL_DIR) $(1)/etc/bluetooth
|
||||
$(INSTALL_DATA) ./files/bluetooth_6lowpand.conf $(1)/etc/bluetooth
|
||||
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/bluetooth_6lowpand $(1)/usr/sbin
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,bluetooth-6lowpand))
|
||||
@@ -0,0 +1,24 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=63
|
||||
PROG=/usr/sbin/bluetooth_6lowpand
|
||||
HCICONFIG=/usr/bin/hciconfig
|
||||
|
||||
start() {
|
||||
config_load btle
|
||||
config_get enable bluetooth_6lowpand enable 0
|
||||
[ "$enable" -eq 1 ] || return
|
||||
echo "start bluetooth_6lowpand"
|
||||
sleep 1
|
||||
echo 1 > /sys/kernel/debug/bluetooth/6lowpan_enable
|
||||
sleep 1
|
||||
killall bluetoothd
|
||||
sleep 1
|
||||
$HCICONFIG hci0 reset
|
||||
$PROG -w 3 -t 5 -a -d
|
||||
}
|
||||
|
||||
stop() {
|
||||
echo "stop bluetooth_6lowpand"
|
||||
killall -9 bluetooth_6lowpand
|
||||
}
|
||||
33
feeds/bluetooth/bluez-ibeacon/Makefile
Normal file
33
feeds/bluetooth/bluez-ibeacon/Makefile
Normal file
@@ -0,0 +1,33 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=bluez-ibeacon
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_URL=https://github.com/blogic/bluez-ibeacon
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_DATE:=2022-10-31
|
||||
PKG_SOURCE_VERSION:=07c082bf3e139ce061ff62a42b7876860256f4ea
|
||||
|
||||
PKG_MAINTAINER:=John Crispin <john@phrozen.org>
|
||||
PKG_LICENSE:=MIT
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/bluez-ibeacon
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=bluez-ibeacon
|
||||
DEPENDS:=+bluez-libs
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
$(MAKE_VARS) $(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR)/bluez-beacon $(MAKE_FLAGS)
|
||||
endef
|
||||
|
||||
define Package/bluez-ibeacon/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/init.d
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bluez-beacon/ibeacon $(1)/usr/sbin/
|
||||
$(INSTALL_BIN) ./files/ibeacon $(1)/etc/init.d/ibeacon
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,bluez-ibeacon))
|
||||
25
feeds/bluetooth/bluez-ibeacon/files/ibeacon
Normal file
25
feeds/bluetooth/bluez-ibeacon/files/ibeacon
Normal file
@@ -0,0 +1,25 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=80
|
||||
|
||||
USE_PROCD=1
|
||||
PROG=/usr/sbin/ibeacon
|
||||
|
||||
service_triggers() {
|
||||
procd_add_reload_trigger btle
|
||||
}
|
||||
|
||||
start_service() {
|
||||
config_load btle
|
||||
config_get enable ibeacon enable 0
|
||||
config_get uuid ibeacon uuid 0
|
||||
config_get major ibeacon major 0
|
||||
config_get minor ibeacon minor 0
|
||||
|
||||
[ "$enable" -eq 1 ] || return
|
||||
|
||||
procd_open_instance
|
||||
procd_set_param command "$PROG" 200 "${uuid}" "${major}" "${minor}" -29
|
||||
procd_set_param respawn
|
||||
procd_close_instance
|
||||
}
|
||||
32
feeds/bluetooth/ubtled/Makefile
Normal file
32
feeds/bluetooth/ubtled/Makefile
Normal file
@@ -0,0 +1,32 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=ubtled
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_URL=https://github.com/blogic/ubtled.git
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_DATE:=2022-10-31
|
||||
PKG_SOURCE_VERSION:=7e01ab86c562fc8ab3777d04e60b8dce596a4c5f
|
||||
|
||||
PKG_MAINTAINER:=John Crispin <john@phrozen.org>
|
||||
PKG_LICENSE:=GPL-2.0
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(INCLUDE_DIR)/cmake.mk
|
||||
|
||||
define Package/ubtled
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=OpenWrt BTLE daemon
|
||||
DEPENDS:=+libubox +libubus +bluez-libs
|
||||
endef
|
||||
|
||||
define Package/ubtled/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/{config,init.d,uci-defaults}
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/ubtled $(1)/usr/sbin/
|
||||
$(INSTALL_BIN) ./files/ubtled.init $(1)/etc/init.d/ubtled
|
||||
$(INSTALL_DATA) ./files/btle.config $(1)/etc/config/btle
|
||||
$(INSTALL_DATA) ./files/99-btle $(1)/etc/uci-defaults/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,ubtled))
|
||||
8
feeds/bluetooth/ubtled/files/99-btle
Normal file
8
feeds/bluetooth/ubtled/files/99-btle
Normal file
@@ -0,0 +1,8 @@
|
||||
#!/bin/sh
|
||||
|
||||
cat >> /etc/bluetooth/main.conf <<EOF
|
||||
[General]
|
||||
Name = TIP AP
|
||||
[GATT]
|
||||
[Policy]
|
||||
EOF
|
||||
11
feeds/bluetooth/ubtled/files/btle.config
Normal file
11
feeds/bluetooth/ubtled/files/btle.config
Normal file
@@ -0,0 +1,11 @@
|
||||
config ubtled ubtled
|
||||
option enable 0
|
||||
|
||||
config bluetooth_6lowpand bluetooth_6lowpand
|
||||
option enable 0
|
||||
|
||||
config ubtled ibeacon
|
||||
option enable 0
|
||||
option uuid 0
|
||||
option major 0
|
||||
option minor 0
|
||||
24
feeds/bluetooth/ubtled/files/ubtled.init
Normal file
24
feeds/bluetooth/ubtled/files/ubtled.init
Normal file
@@ -0,0 +1,24 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=80
|
||||
|
||||
USE_PROCD=1
|
||||
PROG=/usr/sbin/ubtled
|
||||
|
||||
service_triggers() {
|
||||
procd_add_reload_trigger btle
|
||||
}
|
||||
|
||||
start_service() {
|
||||
config_load btle
|
||||
config_get enable ubtled enable 0
|
||||
|
||||
[ "$enable" -eq 1 ] || return
|
||||
|
||||
hciconfig hci0 up
|
||||
|
||||
procd_open_instance
|
||||
procd_set_param command "$PROG"
|
||||
procd_set_param respawn
|
||||
procd_close_instance
|
||||
}
|
||||
56
feeds/facebook/fbwifi/Makefile
Normal file
56
feeds/facebook/fbwifi/Makefile
Normal file
@@ -0,0 +1,56 @@
|
||||
# Copyright (c) Facebook, Inc. and its affiliates.
|
||||
# All rights reserved.
|
||||
#
|
||||
# This source code is licensed under the license found in the
|
||||
# LICENSE file in the root directory of this source tree.
|
||||
#
|
||||
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=fbwifi
|
||||
PKG_VERSION:=2
|
||||
PKG_RELEASE:=0
|
||||
PKG_LICENSE:=GPL-2.0
|
||||
|
||||
PKG_MAINTAINER:=Simon Kinane <skinane@fb.com>
|
||||
|
||||
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/fbwifi
|
||||
SUBMENU:=Captive Portals
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
DEPENDS:=+iptables +luasec +luasocket \
|
||||
+luci-base +libuci-lua +luaposix \
|
||||
+luci-mod-network +luci-mod-status +luci-theme-bootstrap \
|
||||
+lua-cjson +uhttpd
|
||||
TITLE:=Facebook Wi-Fi
|
||||
PKGARCH:=all
|
||||
endef
|
||||
|
||||
define Package/fbwifi/description
|
||||
Facebook Wi-Fi, an AP authorisation solution
|
||||
endef
|
||||
|
||||
define Package/fbwifi/conffiles
|
||||
/etc/config/fbwifi
|
||||
endef
|
||||
|
||||
define Build/Prepare
|
||||
endef
|
||||
|
||||
define Build/Configure
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
endef
|
||||
|
||||
define Package/fbwifi/install
|
||||
$(INSTALL_DIR) $(1)
|
||||
$(CP) ./files/* $(1)/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,fbwifi))
|
||||
55
feeds/facebook/fbwifi/README.md
Normal file
55
feeds/facebook/fbwifi/README.md
Normal file
@@ -0,0 +1,55 @@
|
||||
# Facebook Wi-Fi v2.0 Reference Implementation for OpenWrt
|
||||
|
||||
## Getting started
|
||||
|
||||
Case studies for OEM customers are available at the official page of [Facebook Wi-Fi](https://www.facebook.com/facebook-wifi).
|
||||
|
||||
For OEM engineers, start by reading the init script in [files/etc/init.d/fbwifi](https://github.com/facebookincubator/fbc_owrt_feed/blob/master/fbwifi/files/etc/init.d/fbwifi)
|
||||
|
||||
## Contents
|
||||
|
||||
The 'files' subdirectory contains all the configuration, script and code
|
||||
that implements the Facebook Wi-Fi v2.0 standard for OpenWrt.
|
||||
|
||||
The folder structure follows *nix conventions :
|
||||
- 'etc' is the boot time scripts and configuration
|
||||
- 'usr' contains procedural scripts, lua common code module and GUI prototype for luci
|
||||
- 'www' contains the HTTP endpoints as CGI handlers
|
||||
|
||||
```
|
||||
files/
|
||||
├── etc
|
||||
│ ├── config
|
||||
│ │ └── fbwifi
|
||||
│ ├── hotplug.d
|
||||
│ │ └── iface
|
||||
│ │ └── 50-fbwifi
|
||||
│ ├── init.d
|
||||
│ │ └── fbwifi
|
||||
├── usr
|
||||
│ ├── lib
|
||||
│ │ └── lua
|
||||
│ │ ├── fbwifi.lua
|
||||
│ │ └── luci
|
||||
│ │ ├── controller
|
||||
│ │ │ └── fbwifi.lua
|
||||
│ │ └── view
|
||||
│ │ └── fbwifi.htm
|
||||
│ ├── sbin
|
||||
│ │ ├── fbwifi
|
||||
│ │ ├── fbwifi_debug_dump
|
||||
│ │ ├── fbwifi_gateway_info_update
|
||||
│ │ ├── fbwifi_get_config
|
||||
│ │ └── fbwifi_validate_token_db
|
||||
│ └── share
|
||||
│ └── fbwifi
|
||||
│ ├── firewall.include
|
||||
│ └── uhttpd.json
|
||||
└── www
|
||||
└── cgi-bin
|
||||
└── fbwifi
|
||||
└── v2.0
|
||||
├── auth
|
||||
├── capport
|
||||
└── info
|
||||
```
|
||||
6
feeds/facebook/fbwifi/files/etc/config/fbwifi
Normal file
6
feeds/facebook/fbwifi/files/etc/config/fbwifi
Normal file
@@ -0,0 +1,6 @@
|
||||
config fbwifi 'main'
|
||||
option enabled '0'
|
||||
option gateway_token 'FBWIFI:GATEWAY|123456789|0123456789|abcdeABCDE123456789'
|
||||
option http_port '2060'
|
||||
option https_port '2061'
|
||||
option zone 'lan'
|
||||
10
feeds/facebook/fbwifi/files/etc/hotplug.d/iface/50-fbwifi
Normal file
10
feeds/facebook/fbwifi/files/etc/hotplug.d/iface/50-fbwifi
Normal file
@@ -0,0 +1,10 @@
|
||||
#!/bin/sh
|
||||
|
||||
[ "$ACTION" = ifup ] || exit 0
|
||||
|
||||
/etc/init.d/fbwifi enabled || exit 0
|
||||
|
||||
ip route get fibmatch 1.1.1.1 | grep -q "$DEVICE" || exit 0
|
||||
|
||||
logger -t fbwifi "Reloading fbwifi due to $ACTION of $INTERFACE ($DEVICE)"
|
||||
/etc/init.d/fbwifi restart
|
||||
43
feeds/facebook/fbwifi/files/etc/init.d/fbwifi
Executable file
43
feeds/facebook/fbwifi/files/etc/init.d/fbwifi
Executable file
@@ -0,0 +1,43 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=90
|
||||
|
||||
USE_PROCD=1
|
||||
|
||||
reload_service() {
|
||||
restart
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
procd_add_reload_trigger fbwifi
|
||||
}
|
||||
|
||||
start_service() {
|
||||
|
||||
config_load fbwifi
|
||||
config_get_bool enabled 'main' 'enabled' '0'
|
||||
[ "$enabled" -eq 0 ] && return
|
||||
|
||||
config_get http_port main http_port
|
||||
[ -z "$http_port" ] && {
|
||||
logger -t fbwifi "required option http_port not set"
|
||||
exit 1
|
||||
}
|
||||
|
||||
config_get https_port main https_port
|
||||
[ -z "$https_port" ] && {
|
||||
logger -t fbwifi "required option https_port not set"
|
||||
exit 1
|
||||
}
|
||||
|
||||
logger "[fbwifi] Enabled; starting"
|
||||
|
||||
mkdir -p /tmp/fbwifi
|
||||
|
||||
/usr/sbin/fbwifi reload
|
||||
|
||||
procd_open_instance
|
||||
procd_set_param command /usr/sbin/fbwifi_validate_token_db
|
||||
procd_set_param respawn 1 300 0
|
||||
procd_close_instance
|
||||
}
|
||||
153
feeds/facebook/fbwifi/files/usr/lib/lua/fbwifi.lua
Normal file
153
feeds/facebook/fbwifi/files/usr/lib/lua/fbwifi.lua
Normal file
@@ -0,0 +1,153 @@
|
||||
-- FBWIFI Lua library
|
||||
-- function table
|
||||
local fbwifi = {}
|
||||
|
||||
local http = require("ssl.https")
|
||||
local json = require("cjson")
|
||||
local log = require("posix.syslog")
|
||||
local uci = require("uci")
|
||||
|
||||
function fbwifi.gateway_token()
|
||||
|
||||
state = uci.cursor(nil, "/var/state")
|
||||
token = state:get("fbwifi", "main", "gateway_token")
|
||||
if token and string.len(token) > 0 then
|
||||
return token
|
||||
else
|
||||
log.syslog( log.LOG_WARNING, "[fbwifi] UCI option fbwifi.main.gateway_token is missing" )
|
||||
return nil
|
||||
end
|
||||
end
|
||||
|
||||
function fbwifi.validate_token( token )
|
||||
|
||||
local valid = false
|
||||
|
||||
if string.len(token or '' ) > 0 then
|
||||
|
||||
GATEWAY_TOKEN = fbwifi.gateway_token()
|
||||
|
||||
URL="https://api.fbwifi.com/v2.0/token"
|
||||
BODY="token="..token
|
||||
body, code, headers = http.request(URL.."?access_token="..GATEWAY_TOKEN, BODY)
|
||||
|
||||
if code==200 then
|
||||
valid = true
|
||||
else
|
||||
log.syslog(log.LOG_WARNING, "[fbwifi] validate_token:"..body)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
return valid
|
||||
end
|
||||
|
||||
local mac_to_purge=''
|
||||
function remove_client_by_mac(client)
|
||||
state = uci.cursor(nil, "/var/state")
|
||||
|
||||
for key, value in pairs(client) do
|
||||
if
|
||||
key == 'mac' and
|
||||
value == mac_to_purge
|
||||
then
|
||||
log.syslog(log.LOG_INFO, string.format("[fbwifi] Purging DB entry %s for MAC %s", client['.name'] or 'unknown', mac_to_purge) )
|
||||
state:delete("fbwifi", client['.name'])
|
||||
return
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function fbwifi.instate_client_rule( token, client_mac )
|
||||
|
||||
log.syslog(log.LOG_INFO, "[fbwifi] Validating client "..client_mac)
|
||||
|
||||
state = uci.cursor(nil, "/var/state")
|
||||
state_name = "token_" .. token
|
||||
|
||||
RULE_COND="iptables -w -L FBWIFI_CLIENT_TO_INTERNET -t mangle | grep -i -q \"%s\""
|
||||
RULE_FMT="iptables -w -t mangle -%s FBWIFI_CLIENT_TO_INTERNET -m mac --mac-source \"%s\" -j MARK --set-mark 0xfb"
|
||||
local RULE
|
||||
|
||||
log.syslog(log.LOG_INFO, string.format("[fbwifi] Cleaning DB for MAC %s", client_mac) )
|
||||
mac_to_purge = client_mac
|
||||
state:foreach("fbwifi", "client", remove_client_by_mac)
|
||||
|
||||
|
||||
log.syslog(log.LOG_INFO, string.format("[fbwifi] Adding DB entry %s for MAC %s", state_name, client_mac) )
|
||||
state:set("fbwifi", state_name, "client")
|
||||
state:set("fbwifi", state_name, "token", token)
|
||||
state:set("fbwifi", state_name, "mac", client_mac)
|
||||
state:set("fbwifi", state_name, "authenticated", "true")
|
||||
|
||||
-- verify a rule exists for the given client MAC,
|
||||
-- OR install it
|
||||
RULE=string.format(RULE_COND.." || "..RULE_FMT, client_mac, "A", client_mac)
|
||||
|
||||
log.syslog(log.LOG_INFO, string.format( "[fbwifi] Opening iptables for %s", client_mac ) )
|
||||
res = os.execute(RULE)
|
||||
if res ~= 0 then
|
||||
log.syslog(log.LOG_WARNING, string.format( "[fbwifi] Failed to update iptables (%s)", res ) )
|
||||
end
|
||||
log.syslog(log.LOG_INFO, "[fbwifi] "..RULE)
|
||||
|
||||
state:save('fbwifi')
|
||||
end
|
||||
|
||||
function fbwifi.revoke_client_rule( token )
|
||||
|
||||
if (token == nil) then
|
||||
log.syslog(log.LOG_INFO, "[fbwifi] Invalidating token, but token is Nil")
|
||||
return
|
||||
end
|
||||
|
||||
log.syslog(log.LOG_INFO, string.format( "[fbwifi] Invalidating token (%s)", token) )
|
||||
|
||||
state = uci.cursor(nil, "/var/state")
|
||||
state_name = "token_" .. token
|
||||
|
||||
client_mac = state:get("fbwifi", state_name, "mac")
|
||||
|
||||
if client_mac then
|
||||
RULE_COND="iptables -w -L FBWIFI_CLIENT_TO_INTERNET -t mangle | grep -i -q \"%s\""
|
||||
RULE_FMT="iptables -w -t mangle -%s FBWIFI_CLIENT_TO_INTERNET -m mac --mac-source \"%s\" -j MARK --set-mark 0xfb"
|
||||
|
||||
-- verify a rule exists for the given client MAC,
|
||||
-- AND delete it
|
||||
RULE=string.format(RULE_COND.." && "..RULE_FMT, client_mac, "D", client_mac)
|
||||
|
||||
res = os.execute(RULE)
|
||||
if res ~= 0 then
|
||||
log.syslog(log.LOG_WARNING, string.format( "[fbwifi] Failed to update iptables (%s)", res ) )
|
||||
end
|
||||
log.syslog(log.LOG_INFO, "[fbwifi] "..RULE)
|
||||
|
||||
state:delete("fbwifi", state_name)
|
||||
state:save('fbwifi')
|
||||
else
|
||||
log.syslog(log.LOG_WARNING, string.format( "[fbwifi] Client MAC not found in DB (%s)", state_name ) )
|
||||
end
|
||||
end
|
||||
|
||||
function fbwifi.reset()
|
||||
|
||||
local success = false
|
||||
GATEWAY_TOKEN = fbwifi.gateway_token()
|
||||
URL="https://api.fbwifi.com/v2.0/gateway/reset"
|
||||
BODY="{}"
|
||||
body, code, headers = http.request(URL.."?access_token="..GATEWAY_TOKEN, BODY)
|
||||
|
||||
if code==200 then
|
||||
log.syslog(log.LOG_INFO, "[fbwifi] Reset committed")
|
||||
success = true
|
||||
else
|
||||
log.syslog(log.LOG_WARNING, "[fbwifi] Reset failed : "..body)
|
||||
end
|
||||
|
||||
return success
|
||||
end
|
||||
|
||||
--
|
||||
-- Return the function table to the host script
|
||||
--
|
||||
return fbwifi
|
||||
@@ -0,0 +1,12 @@
|
||||
-- Copyright
|
||||
-- Licensed to the public under the GNU General Public License v2.
|
||||
|
||||
module("luci.controller.fbwifi", package.seeall)
|
||||
|
||||
sys = require "luci.sys"
|
||||
ut = require "luci.util"
|
||||
|
||||
function index()
|
||||
entry({"admin", "network", "fbwifi"}, template("fbwifi"), "Facebook Wi-Fi", 90).dependent=false
|
||||
end
|
||||
|
||||
16
feeds/facebook/fbwifi/files/usr/lib/lua/luci/view/fbwifi.htm
Normal file
16
feeds/facebook/fbwifi/files/usr/lib/lua/luci/view/fbwifi.htm
Normal file
@@ -0,0 +1,16 @@
|
||||
<%#
|
||||
Copyright
|
||||
Licensed to the public under the GNU General Public License v2.
|
||||
-%>
|
||||
|
||||
<%+header%>
|
||||
|
||||
<h1>Facebook Wi-Fi</h1>
|
||||
<%
|
||||
require("uci")
|
||||
state = uci.cursor(nil, "/var/state")
|
||||
url = state:get("fbwifi", "main", "captive_portal_config_url")
|
||||
%>
|
||||
<a href="<% print(url) %>">Configure FB business page</a>
|
||||
|
||||
<%+footer%>
|
||||
57
feeds/facebook/fbwifi/files/usr/sbin/fbwifi
Executable file
57
feeds/facebook/fbwifi/files/usr/sbin/fbwifi
Executable file
@@ -0,0 +1,57 @@
|
||||
#!/bin/sh
|
||||
|
||||
case "$1" in
|
||||
disable)
|
||||
uci set fbwifi.main.enabled=0
|
||||
|
||||
uci delete firewall.fbwifi
|
||||
|
||||
uci delete uhttpd.fbwifi_redirect
|
||||
|
||||
uci delete uhttpd.main.json_script
|
||||
uci set uhttpd.main.cert='/etc/uhttpd.crt'
|
||||
uci set uhttpd.main.key='/etc/uhttpd.key'
|
||||
uci set uhttpd.main.rfc1918_filter=1
|
||||
;;
|
||||
enable)
|
||||
uci set fbwifi.main.enabled=1
|
||||
|
||||
uci set firewall.fbwifi=include
|
||||
uci set firewall.fbwifi.enabled=1
|
||||
uci set firewall.fbwifi.family=ipv4
|
||||
uci set firewall.fbwifi.path=/usr/share/fbwifi/firewall.include
|
||||
uci set firewall.fbwifi.reload=1
|
||||
uci set firewall.fbwifi.type=script
|
||||
|
||||
uci set uhttpd.fbwifi_redirect=uhttpd
|
||||
uci set uhttpd.fbwifi_redirect.enabled=1
|
||||
uci set uhttpd.fbwifi_redirect.cert='/tmp/fbwifi/https_server_cert'
|
||||
uci set uhttpd.fbwifi_redirect.json_script='/tmp/fbwifi/uhttpd-redirect.json'
|
||||
uci set uhttpd.fbwifi_redirect.key='/tmp/fbwifi/https_server_key'
|
||||
uci set uhttpd.fbwifi_redirect.listen_http='0.0.0.0:2060'
|
||||
uci set uhttpd.fbwifi_redirect.listen_https='0.0.0.0:2061'
|
||||
|
||||
uci set uhttpd.main.cert='/tmp/fbwifi/https_server_cert'
|
||||
uci set uhttpd.main.json_script='/usr/share/fbwifi/uhttpd.json'
|
||||
uci set uhttpd.main.key='/tmp/fbwifi/https_server_key'
|
||||
uci set uhttpd.main.rfc1918_filter=0
|
||||
;;
|
||||
reload)
|
||||
/usr/sbin/fbwifi_get_config
|
||||
|
||||
login_url=$(uci -p /var/state get fbwifi.main.captive_portal_url)
|
||||
[ -z "$login_url" ] && {
|
||||
logger -t fbwifi "captive_portal_url not available yet"
|
||||
exit 1
|
||||
}
|
||||
printf '{ "request": [ ["redirect", "%s", 302] ] }' "$login_url" > /tmp/fbwifi/uhttpd-redirect.json
|
||||
|
||||
/etc/init.d/uhttpd restart
|
||||
|
||||
exit 0
|
||||
;;
|
||||
esac
|
||||
|
||||
uci commit
|
||||
/etc/init.d/uhttpd restart
|
||||
reload_config
|
||||
8
feeds/facebook/fbwifi/files/usr/sbin/fbwifi_debug_dump
Executable file
8
feeds/facebook/fbwifi/files/usr/sbin/fbwifi_debug_dump
Executable file
@@ -0,0 +1,8 @@
|
||||
echo -e "Runtime configuration and token DB\n"
|
||||
uci -p /var/state export fbwifi
|
||||
|
||||
echo -e "\nDynamic firewall flow rules\n"
|
||||
iptables -t mangle -L FBWIFI_CLIENT_TO_INTERNET
|
||||
|
||||
echo -e "\nDHCP leases\n"
|
||||
cat /tmp/dhcp.leases
|
||||
38
feeds/facebook/fbwifi/files/usr/sbin/fbwifi_gateway_info_update
Executable file
38
feeds/facebook/fbwifi/files/usr/sbin/fbwifi_gateway_info_update
Executable file
@@ -0,0 +1,38 @@
|
||||
#!/usr/bin/lua
|
||||
|
||||
http = require("ssl.https")
|
||||
json = require("cjson")
|
||||
log = require("posix.syslog")
|
||||
socket = require("socket")
|
||||
require("uci")
|
||||
fbwifi = require("fbwifi")
|
||||
|
||||
GATEWAY_TOKEN = fbwifi.gateway_token()
|
||||
state = uci.cursor(nil, "/var/state")
|
||||
|
||||
payload="name="..socket.dns.gethostname()
|
||||
|
||||
function queue_ssid_update(iface)
|
||||
bssid_file="/sys/class/net/br-"..iface["network"].."/address"
|
||||
local file = io.open(bssid_file)
|
||||
if file then
|
||||
for line in file:lines() do
|
||||
payload=payload.."&bssid[]="..line
|
||||
end
|
||||
payload=payload.."ssid[]="..iface["ssid"]
|
||||
else
|
||||
log.syslog(log.LOG_WARNING, "[fbwifi] Failed to find BSSID for interface br-"..iface["network"])
|
||||
end
|
||||
end
|
||||
|
||||
state:foreach("wireless", "wifi-iface", queue_ssid_update)
|
||||
|
||||
URL="https://api.fbwifi.com/v2.0/gateway"
|
||||
body, code, headers = http.request(URL.."?access_token="..GATEWAY_TOKEN, payload)
|
||||
if code == 200 then
|
||||
log.syslog(log.LOG_INFO, "[fbwifi] gateway information updated "..body)
|
||||
os.exit(0)
|
||||
else
|
||||
log.syslog(log.LOG_WARNING, "[fbwifi] gateway API failed "..body)
|
||||
os.exit(code)
|
||||
end
|
||||
106
feeds/facebook/fbwifi/files/usr/sbin/fbwifi_get_config
Executable file
106
feeds/facebook/fbwifi/files/usr/sbin/fbwifi_get_config
Executable file
@@ -0,0 +1,106 @@
|
||||
#!/usr/bin/lua
|
||||
http = require("ssl.https")
|
||||
json = require("cjson")
|
||||
require("uci")
|
||||
log = require("posix.syslog")
|
||||
fbwifi = require("fbwifi")
|
||||
|
||||
GATEWAY_TOKEN = fbwifi.gateway_token()
|
||||
|
||||
http_port = uci.get("fbwifi.main.http_port")
|
||||
https_port = uci.get("fbwifi.main.https_port")
|
||||
|
||||
state = uci.cursor(nil, "/var/state")
|
||||
|
||||
URL="https://api.fbwifi.com/v2.0/gateway"
|
||||
body, code, headers = http.request(URL.."?access_token="..GATEWAY_TOKEN.."&fields=config,config_version")
|
||||
|
||||
if code == 200 then
|
||||
log.syslog(log.LOG_INFO, "[fbwifi] Got gateway config ("..code..")")
|
||||
else
|
||||
log.syslog(log.LOG_CRIT, "[fbwifi] Failed to get gateway config ("..code..")")
|
||||
os.exit(1)
|
||||
end
|
||||
|
||||
obj = json.decode(body)
|
||||
|
||||
function save_cert(name, value)
|
||||
log.syslog(log.LOG_INFO, "[fbwifi] Saving cert "..name)
|
||||
local f = assert(io.open("/tmp/fbwifi/"..name, "w"))
|
||||
f:write(value)
|
||||
f:close()
|
||||
end
|
||||
|
||||
function process_redirect(ix, host)
|
||||
IP_SET = "ip addr replace dev lo "..host
|
||||
local result = os.execute(IP_SET)
|
||||
if result == 0 then
|
||||
log.syslog(log.LOG_INFO, "[fbwifi] Redirect address applied "..host)
|
||||
else
|
||||
log.syslog(log.LOG_WARNING, "[fbwifi] Failed to apply redirect address "..host)
|
||||
end
|
||||
|
||||
ip = string.match(host, '([0-9\.]*)/([0-9]*)')
|
||||
RULE_FMT="grep -q \"%s\" /etc/hosts || echo \"%s\tstar.fbwifigateway.net\" >> /etc/hosts"
|
||||
HOSTS_RULE = string.format(RULE_FMT, ip, ip)
|
||||
result = os.execute(HOSTS_RULE)
|
||||
if result == 0 then
|
||||
log.syslog(log.LOG_INFO, "[fbwifi] Cached redirect host for DNS")
|
||||
else
|
||||
log.syslog(log.LOG_WARNING, "[fbwifi] Failed to amend /etc/hosts")
|
||||
log.syslog(log.LOG_INFO, "[fbwifi] "..HOSTS_RULE)
|
||||
end
|
||||
|
||||
result = os.execute("iptables -t nat -A FBWIFI_HOST_REDIRLIST -p tcp --dport 80 -d "..ip.." -j ACCEPT # REDIRECT --to-ports "..http_port)
|
||||
--print(result)
|
||||
result = os.execute("iptables -t nat -A FBWIFI_HOST_REDIRLIST -p tcp --dport 443 -d "..ip.." -j ACCEPT # REDIRECT --to-ports "..https_port)
|
||||
--print(result)
|
||||
end
|
||||
|
||||
save_cert("https_server_cert", obj['config']['https_server_cert'])
|
||||
save_cert("https_server_key", obj['config']['https_server_key'])
|
||||
|
||||
result = os.execute("iptables -t nat -F FBWIFI_HOST_REDIRLIST")
|
||||
--print(result)
|
||||
table.foreach(obj['config']['host_redirect_ips'], process_redirect)
|
||||
|
||||
RULE_FORMAT = "iptables -t mangle -A FBWIFI_TRAFFIC_ALLOWLIST -d %s -p %s --dport %s -j MARK --set-mark 0xfb"
|
||||
function process_traffic_rule(ix, rule)
|
||||
log.syslog(log.LOG_INFO, "[fbwifi] Traffic rule "..ix)
|
||||
|
||||
if rule["protocol"] == 6 then
|
||||
PROTO = "tcp"
|
||||
elseif rule["protocol"] == 17 then
|
||||
PROTO = "udp"
|
||||
end
|
||||
RULE = string.format(RULE_FORMAT, rule["ip"], PROTO, rule["port"])
|
||||
local result = os.execute(RULE)
|
||||
if result == 0 then
|
||||
log.syslog(log.LOG_INFO, "[fbwifi] Traffic rule "..ix)
|
||||
else
|
||||
log.syslog(log.LOG_WARNING, "[fbwifi] Failed to install traffic rule ; "..RULE)
|
||||
end
|
||||
end
|
||||
|
||||
local cross_origin_list = {}
|
||||
function process_cross_origin_rule(ix, url)
|
||||
log.syslog(log.LOG_INFO, "[fbwifi] Cross origin rule "..url)
|
||||
table.insert(cross_origin_list, url)
|
||||
end
|
||||
|
||||
function process_url(url_purpose, fqdn)
|
||||
log.syslog(log.LOG_INFO, "[fbwifi] Caching "..url_purpose)
|
||||
state:set("fbwifi", "main", url_purpose, fqdn)
|
||||
end
|
||||
|
||||
state:set("fbwifi", "main", "config")
|
||||
|
||||
result = os.execute("iptables -t mangle -F FBWIFI_TRAFFIC_ALLOWLIST ")
|
||||
--print(result)
|
||||
table.foreach(obj['config']['traffic_allowlist'], process_traffic_rule)
|
||||
table.foreach(obj['config']['cross_origin_allowlist'], process_cross_origin_rule)
|
||||
table.foreach(obj['config']['urls'], process_url)
|
||||
state:set("fbwifi", "main", "cross_origin_allow_rules", cross_origin_list)
|
||||
|
||||
state:set("fbwifi", "main", "config_version", obj['config_version'])
|
||||
state:save('fbwifi')
|
||||
75
feeds/facebook/fbwifi/files/usr/sbin/fbwifi_validate_token_db
Executable file
75
feeds/facebook/fbwifi/files/usr/sbin/fbwifi_validate_token_db
Executable file
@@ -0,0 +1,75 @@
|
||||
#!/usr/bin/lua
|
||||
|
||||
https = require("ssl.https")
|
||||
json = require("cjson")
|
||||
log = require("posix.syslog")
|
||||
fbwifi = require("fbwifi")
|
||||
require("uci")
|
||||
|
||||
state = uci.cursor(nil, "/var/state")
|
||||
GATEWAY_TOKEN = fbwifi.gateway_token()
|
||||
|
||||
request = {
|
||||
tokens = {},
|
||||
traffic_type = "total",
|
||||
config_version = state:get("fbwifi", "main", "config_version")
|
||||
}
|
||||
|
||||
function queue_token(client)
|
||||
|
||||
request.tokens[client.token]={
|
||||
incoming = json.null,
|
||||
outgoing = json.null,
|
||||
connected_time_sec = json.null,
|
||||
inactive_time_sec = json.null,
|
||||
signal_rssi_dbm = json.null,
|
||||
--expected_tpus_mbps = json.null,
|
||||
is_connected = true
|
||||
}
|
||||
|
||||
end
|
||||
|
||||
state:foreach("fbwifi", "client", queue_token)
|
||||
print( "\nRequest:\n"..json.encode(request) )
|
||||
|
||||
URL="https://api.fbwifi.com/v2.0/tokens"
|
||||
BODY=string.format(
|
||||
"tokens=%s&traffic_type=%s&config_version=%s",
|
||||
json.encode(request.tokens),
|
||||
"'total'",
|
||||
state:get("fbwifi", "main", "config_version")
|
||||
)
|
||||
|
||||
body, code, headers = https.request(URL.."?access_token="..GATEWAY_TOKEN, BODY)
|
||||
|
||||
if code then
|
||||
print( "\nResponse:\n"..body )
|
||||
end
|
||||
|
||||
response = json.decode(body)
|
||||
--print(response)
|
||||
--table.foreach(response,print)
|
||||
--table.foreach(response.tokens,print)
|
||||
|
||||
if response.config_valid then
|
||||
log.syslog(log.LOG_INFO, "[fbwifi] Config validated")
|
||||
else
|
||||
log.syslog(log.LOG_WARNING, "[fbwifi] config is stale, refreshing config")
|
||||
local result = os.execute("/usr/sbin/fbwifi reload")
|
||||
if result == 0 then
|
||||
log.syslog(log.LOG_INFO, "[fbwifi] successfully fetched and loaded new config ")
|
||||
else
|
||||
log.syslog(log.LOG_WARNING, "[fbwifi] failed to fetch and load new config, possible stale config")
|
||||
end
|
||||
end
|
||||
|
||||
function process_token(token, metadata)
|
||||
table.foreach(metadata,print)
|
||||
if metadata.valid then
|
||||
print("OK: "..token)
|
||||
else
|
||||
print("Nok: "..token)
|
||||
fbwifi.revoke_client_rule( token )
|
||||
end
|
||||
end
|
||||
table.foreach(response.tokens,process_token)
|
||||
@@ -0,0 +1,67 @@
|
||||
#!/bin/sh
|
||||
|
||||
IPT4="/usr/sbin/iptables"
|
||||
|
||||
fbwifi_http_port="$(uci get fbwifi.main.http_port)"
|
||||
[ -n "$fbwifi_http_port" ] || {
|
||||
logger -t fbwifi "required option http_port not set"
|
||||
exit 1
|
||||
}
|
||||
|
||||
fbwifi_https_port="$(uci get fbwifi.main.https_port)"
|
||||
[ -n "$fbwifi_https_port" ] || {
|
||||
logger -t fbwifi "required option https_port not set"
|
||||
exit 1
|
||||
}
|
||||
|
||||
fbwifi_zone="$(uci get fbwifi.main.zone)"
|
||||
[ -n "$fbwifi_zone" ] || {
|
||||
logger -t fbwifi "required option zone not set"
|
||||
exit 1
|
||||
}
|
||||
|
||||
fbwifi_ifaces="$(fw3 -q zone "$fbwifi_zone")"
|
||||
|
||||
## Create custom chains
|
||||
$IPT4 -t filter -N FBWIFI_FORWARD 2>/dev/null
|
||||
$IPT4 -t filter -N FBWIFI_INPUT 2>/dev/null
|
||||
$IPT4 -t mangle -N FBWIFI_CLIENT_TO_INTERNET 2>/dev/null
|
||||
$IPT4 -t mangle -N FBWIFI_PREROUTING 2>/dev/null
|
||||
$IPT4 -t mangle -N FBWIFI_TRAFFIC_ALLOWLIST 2>/dev/null
|
||||
$IPT4 -t nat -N FBWIFI_CLIENT_TO_INTERNET 2>/dev/null
|
||||
$IPT4 -t nat -N FBWIFI_PREROUTING 2>/dev/null
|
||||
$IPT4 -t nat -N FBWIFI_HOST_REDIRLIST 2>/dev/null
|
||||
|
||||
## Flush custom chains
|
||||
$IPT4 -t filter -F FBWIFI_FORWARD
|
||||
$IPT4 -t filter -F FBWIFI_INPUT
|
||||
$IPT4 -t mangle -F FBWIFI_CLIENT_TO_INTERNET
|
||||
$IPT4 -t mangle -F FBWIFI_PREROUTING
|
||||
$IPT4 -t mangle -F FBWIFI_TRAFFIC_ALLOWLIST
|
||||
$IPT4 -t nat -F FBWIFI_CLIENT_TO_INTERNET
|
||||
$IPT4 -t nat -F FBWIFI_PREROUTING
|
||||
$IPT4 -t nat -F FBWIFI_HOST_REDIRLIST
|
||||
|
||||
## Populate custom chains
|
||||
$IPT4 -t filter -A FBWIFI_FORWARD -p udp --dport 53 -m conntrack --ctstate NEW -j ACCEPT
|
||||
$IPT4 -t filter -A FBWIFI_FORWARD -m conntrack --ctstate NEW -m mark --mark 0xfb -j ACCEPT
|
||||
$IPT4 -t filter -A FBWIFI_FORWARD -j REJECT
|
||||
$IPT4 -t filter -A FBWIFI_INPUT -p tcp --dport "$fbwifi_http_port" -m conntrack --ctstate NEW -j ACCEPT
|
||||
$IPT4 -t filter -A FBWIFI_INPUT -p tcp --dport "$fbwifi_https_port" -m conntrack --ctstate NEW -j ACCEPT
|
||||
$IPT4 -t mangle -A FBWIFI_PREROUTING -j FBWIFI_CLIENT_TO_INTERNET
|
||||
$IPT4 -t mangle -A FBWIFI_PREROUTING -j FBWIFI_TRAFFIC_ALLOWLIST
|
||||
$IPT4 -t nat -A FBWIFI_PREROUTING -j FBWIFI_CLIENT_TO_INTERNET
|
||||
$IPT4 -t nat -A FBWIFI_CLIENT_TO_INTERNET -p tcp --dport 80 -m conntrack --ctstate NEW -j FBWIFI_HOST_REDIRLIST
|
||||
$IPT4 -t nat -A FBWIFI_CLIENT_TO_INTERNET -p tcp --dport 443 -m conntrack --ctstate NEW -j FBWIFI_HOST_REDIRLIST
|
||||
$IPT4 -t nat -A FBWIFI_CLIENT_TO_INTERNET -p tcp --dport 80 -m conntrack --ctstate NEW -m mark --mark 0xfb -j ACCEPT
|
||||
$IPT4 -t nat -A FBWIFI_CLIENT_TO_INTERNET -p tcp --dport 443 -m conntrack --ctstate NEW -m mark --mark 0xfb -j ACCEPT
|
||||
$IPT4 -t nat -A FBWIFI_CLIENT_TO_INTERNET -p tcp --dport 80 -m conntrack --ctstate NEW -j REDIRECT --to-ports "$fbwifi_http_port"
|
||||
|
||||
## Hook custom chains in firewall3 chains
|
||||
$IPT4 -t filter -I "zone_${fbwifi_zone}_input" 2 -j FBWIFI_INPUT
|
||||
$IPT4 -t filter -I "zone_${fbwifi_zone}_forward" 2 -j FBWIFI_FORWARD
|
||||
$IPT4 -t nat -I "zone_${fbwifi_zone}_prerouting" 2 -j FBWIFI_PREROUTING
|
||||
# There are no firewall3 zone chains in the mangle table so we need to do this for all interfaces in the zone
|
||||
for iface in $fbwifi_ifaces; do
|
||||
$IPT4 -t mangle -I PREROUTING -i "$iface" -j FBWIFI_PREROUTING
|
||||
done
|
||||
8
feeds/facebook/fbwifi/files/usr/share/fbwifi/uhttpd.json
Normal file
8
feeds/facebook/fbwifi/files/usr/share/fbwifi/uhttpd.json
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"request": [
|
||||
[ "if",
|
||||
[ "regex", "REQUEST_URI", "^/fbwifi" ],
|
||||
[ "rewrite", "/cgi-bin%REQUEST_URI%" ]
|
||||
]
|
||||
]
|
||||
}
|
||||
69
feeds/facebook/fbwifi/files/www/cgi-bin/fbwifi/v2.0/auth
Executable file
69
feeds/facebook/fbwifi/files/www/cgi-bin/fbwifi/v2.0/auth
Executable file
@@ -0,0 +1,69 @@
|
||||
#!/usr/bin/lua
|
||||
require("uci")
|
||||
log = require("posix.syslog")
|
||||
fbwifi = require("fbwifi")
|
||||
|
||||
state = uci.cursor(nil, "/var/state")
|
||||
function process_cors()
|
||||
origin = os.getenv("HTTP_ORIGIN")
|
||||
log.syslog(log.LOG_INFO, string.format("[fbwifi] [auth] process_cors origin %s", origin or 'not found') )
|
||||
if string.len(origin or '') > 0 then
|
||||
allow_list = state:get("fbwifi", "main", "cross_origin_allow_rules")
|
||||
for _, value in pairs(allow_list) do
|
||||
if value == origin then
|
||||
log.syslog(log.LOG_INFO, "[fbwifi] [auth] process_cors Appending CORS Headers to HTTP")
|
||||
print("Access-Control-Allow-Origin: "..origin)
|
||||
print("Vary: Origin")
|
||||
break
|
||||
end
|
||||
end
|
||||
else
|
||||
log.syslog(log.LOG_INFO, "[fbwifi] [auth] process_cors No CORS Headers added to Response")
|
||||
end
|
||||
end
|
||||
|
||||
method = os.getenv("REQUEST_METHOD")
|
||||
if method == 'GET' then
|
||||
log.syslog(log.LOG_INFO, "[fbwifi] [auth] GET handler")
|
||||
print("Status: 302")
|
||||
print("Location: "..state:get("fbwifi", "main", "landing_page_url"))
|
||||
process_cors()
|
||||
print ('\n')
|
||||
|
||||
elseif method == 'POST' then
|
||||
local token
|
||||
|
||||
log.syslog(log.LOG_INFO, "[fbwifi] [auth] POST handler")
|
||||
process_cors()
|
||||
print("Status: 200")
|
||||
|
||||
form_data=io.read()
|
||||
while form_data do
|
||||
token = string.match(form_data, '[%d]+')
|
||||
if string.len(token or '') > 14 then
|
||||
|
||||
client = os.getenv("REMOTE_ADDR")
|
||||
f = io.popen("awk '/"..client.."/ { printf(\"%s\", $4) }' /proc/net/arp", 'r')
|
||||
client_mac = assert(f:read('*a'))
|
||||
|
||||
if fbwifi.validate_token(token) then
|
||||
log.syslog(log.LOG_INFO, string.format( "[fbwifi] [auth] POST handler : Validating Token (%s) for MAC (%s)", token or 'nil', client_mac or 'nil') )
|
||||
fbwifi.instate_client_rule(token, client_mac)
|
||||
print("\n{\"valid\":true}\n")
|
||||
else
|
||||
log.syslog(log.LOG_WARNING, string.format( "[fbwifi] [auth] POST handler : ! Invalid token (%s) for mac (%s) !", token or 'nil', client_mac or 'nil') )
|
||||
fbwifi.revoke_client_rule(token)
|
||||
print("\n{\"valid\":false}\n")
|
||||
end
|
||||
log.syslog(log.LOG_INFO, "[fbwifi] [auth] POST handler completed")
|
||||
return
|
||||
end
|
||||
|
||||
form_data=io.read()
|
||||
end
|
||||
print ('\n')
|
||||
|
||||
log.syslog(log.LOG_WARNING, string.format("[fbwifi] [auth] POST handler : token not found" ))
|
||||
fbwifi.revoke_client_rule(token)
|
||||
print("\n{\"valid\":false}\n")
|
||||
end
|
||||
41
feeds/facebook/fbwifi/files/www/cgi-bin/fbwifi/v2.0/capport
Executable file
41
feeds/facebook/fbwifi/files/www/cgi-bin/fbwifi/v2.0/capport
Executable file
@@ -0,0 +1,41 @@
|
||||
#!/usr/bin/lua
|
||||
json = require("cjson")
|
||||
require("uci")
|
||||
|
||||
state = uci.cursor(nil, "/var/state")
|
||||
client_mac = ""
|
||||
token = ""
|
||||
|
||||
response = {}
|
||||
response['venue-info-url'] = state:get("fbwifi", "main", "capport_venue_info_url")
|
||||
|
||||
function map_remote_mac_to_token(client)
|
||||
for key, value in pairs(client) do
|
||||
if
|
||||
key == 'mac' and
|
||||
value == client_mac
|
||||
then
|
||||
token = client.token
|
||||
return false
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function hasValidToken(client_ip)
|
||||
f = io.popen("awk '/"..client_ip.."/ { printf(\"%s\", $4) }' /proc/net/arp", 'r')
|
||||
client_mac = assert(f:read('*a'))
|
||||
state:foreach("fbwifi", "client", map_remote_mac_to_token)
|
||||
|
||||
return 0 < string.len(token)
|
||||
end
|
||||
|
||||
print("Content-type: application/captive+json; charset=utf-8\n")
|
||||
|
||||
client = os.getenv("REMOTE_ADDR")
|
||||
response['captive'] = not hasValidToken(client)
|
||||
|
||||
if response['captive'] then
|
||||
response['user-portal-url'] = state:get("fbwifi", "main", "captive_portal_url")
|
||||
end
|
||||
|
||||
print( json.encode(response) )
|
||||
58
feeds/facebook/fbwifi/files/www/cgi-bin/fbwifi/v2.0/info
Executable file
58
feeds/facebook/fbwifi/files/www/cgi-bin/fbwifi/v2.0/info
Executable file
@@ -0,0 +1,58 @@
|
||||
#!/usr/bin/lua
|
||||
require "luci.cacheloader"
|
||||
require "luci.sgi.cgi"
|
||||
json = require("cjson")
|
||||
fbwifi = require("fbwifi")
|
||||
|
||||
state = uci.cursor(nil, "/var/state")
|
||||
GATEWAY_TOKEN = fbwifi.gateway_token()
|
||||
|
||||
response = { api_version = "2.0", token = json.null }
|
||||
client_mac = ""
|
||||
|
||||
function process_cors()
|
||||
origin = os.getenv("HTTP_ORIGIN")
|
||||
if string.len(origin or '') > 0 then
|
||||
allow_list = state:get("fbwifi", "main", "cross_origin_allow_rules")
|
||||
for _, value in pairs(allow_list) do
|
||||
if value == origin then
|
||||
print("Access-Control-Allow-Origin: "..origin)
|
||||
print("Vary: Origin")
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function map_remote_mac_to_token(client)
|
||||
|
||||
for key, value in pairs(client) do
|
||||
if
|
||||
key == 'mac' and
|
||||
value == client_mac
|
||||
then
|
||||
response.token = client.token
|
||||
return false -- escape outer loop
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function getClientToken(client_ip)
|
||||
f = io.popen("awk '/"..client_ip.."/ { printf(\"%s\", $4) }' /proc/net/arp", 'r')
|
||||
client_mac = assert(f:read('*a'))
|
||||
|
||||
state:foreach("fbwifi", "client", map_remote_mac_to_token)
|
||||
end
|
||||
|
||||
function getGatewayId()
|
||||
id = string.match(GATEWAY_TOKEN, 'FBWIFI:GATEWAY|[0-9]*|([0-9]*)')
|
||||
return id
|
||||
end
|
||||
|
||||
process_cors()
|
||||
print("Content-type: application/json; charset=utf-8\n")
|
||||
|
||||
getClientToken(os.getenv("REMOTE_ADDR"))
|
||||
response.gateway_id = getGatewayId()
|
||||
|
||||
print( json.encode(response) )
|
||||
67
feeds/ipq807x/protobuf-c/Makefile
Normal file
67
feeds/ipq807x/protobuf-c/Makefile
Normal file
@@ -0,0 +1,67 @@
|
||||
#
|
||||
# Copyright (C) 2011 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:=libprotobuf-c
|
||||
PKG_VERSION:=1.3.1
|
||||
PKG_RELEASE:=2
|
||||
|
||||
PKG_SOURCE:=protobuf-c-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=https://github.com/protobuf-c/protobuf-c/releases/download/v$(PKG_VERSION)
|
||||
PKG_HASH:=51472d3a191d6d7b425e32b612e477c06f73fe23e07f6a6a839b11808e9d2267
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/protobuf-c-$(PKG_VERSION)
|
||||
HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/protobuf-c-$(PKG_VERSION)
|
||||
|
||||
PKG_MAINTAINER:=Rosen Penev <rosenp@gmail.com>
|
||||
PKG_LICENSE:=BSD-2c
|
||||
|
||||
PKG_BUILD_DEPENDS:=protobuf-c/host
|
||||
HOST_BUILD_DEPENDS:=protobuf/host
|
||||
|
||||
PKG_INSTALL:=1
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(INCLUDE_DIR)/host-build.mk
|
||||
|
||||
define Package/libprotobuf-c
|
||||
TITLE:=Protocol Buffers library
|
||||
SECTION:=libs
|
||||
CATEGORY:=Libraries
|
||||
URL:=https://github.com/protobuf-c/protobuf-c
|
||||
endef
|
||||
|
||||
define Package/libprotobuf-c/description
|
||||
Runtime library to use Google Protocol Buffers from C applications.
|
||||
Protocol Buffers are a way of encoding structured data in an efficient yet
|
||||
extensible format. Google uses Protocol Buffers for almost all of its
|
||||
internal RPC protocols and file formats.
|
||||
endef
|
||||
|
||||
CONFIGURE_ARGS += \
|
||||
--enable-shared \
|
||||
--enable-static \
|
||||
--disable-protoc
|
||||
|
||||
define Build/InstallDev
|
||||
$(INSTALL_DIR) $(1)/usr/include/
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libprotobuf-c.{a,la,so*} $(1)/usr/lib/
|
||||
$(INSTALL_DIR) $(1)/usr/lib/pkgconfig
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/* $(1)/usr/lib/pkgconfig/
|
||||
endef
|
||||
|
||||
define Package/libprotobuf-c/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libprotobuf-c.so.* $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,libprotobuf-c))
|
||||
$(eval $(call HostBuild))
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
Index: protobuf-c-1.3.1/t/generated-code2/cxx-generate-packed-data.cc
|
||||
===================================================================
|
||||
--- protobuf-c-1.3.1.orig/t/generated-code2/cxx-generate-packed-data.cc
|
||||
+++ protobuf-c-1.3.1/t/generated-code2/cxx-generate-packed-data.cc
|
||||
@@ -998,7 +998,7 @@ static void dump_test_packed_repeated_en
|
||||
static void dump_test_unknown_fields (void)
|
||||
{
|
||||
EmptyMess mess;
|
||||
- const google::protobuf::Message::Reflection *reflection = mess.GetReflection();
|
||||
+ const google::protobuf::Reflection *reflection = mess.GetReflection();
|
||||
google::protobuf::UnknownFieldSet *fs = reflection->MutableUnknownFields(&mess);
|
||||
|
||||
#if GOOGLE_PROTOBUF_VERSION >= 2001000
|
||||
110
feeds/ipq807x/protobuf/Makefile
Normal file
110
feeds/ipq807x/protobuf/Makefile
Normal file
@@ -0,0 +1,110 @@
|
||||
#
|
||||
# Copyright (C) 2007-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:=protobuf
|
||||
PKG_VERSION:=3.7.1
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-cpp-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=https://github.com/google/protobuf/releases/download/v$(PKG_VERSION)
|
||||
PKG_HASH:=97f6cdaa0724d5a8cd3375d5f5cf4bd253d5ad5291154f533ed0d94a9d501ef3
|
||||
|
||||
PKG_LICENSE:=BSD-3-Clause
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
PKG_CPE_ID:=cpe:/a:google:protobuf
|
||||
|
||||
PKG_BUILD_DEPENDS:=protobuf/host
|
||||
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
PKG_INSTALL:=1
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(INCLUDE_DIR)/host-build.mk
|
||||
|
||||
define Package/protobuf/Default
|
||||
SECTION:=libs
|
||||
CATEGORY:=Libraries
|
||||
TITLE:=A structured data encoding library
|
||||
URL:=https://github.com/google/protobuf
|
||||
DEPENDS:=+zlib +libpthread +libatomic +libstdcpp
|
||||
MAINTAINER:=Ken Keys <kkeys@caida.org>
|
||||
endef
|
||||
|
||||
define Package/protobuf
|
||||
$(call Package/protobuf/Default)
|
||||
DEPENDS+=+protobuf-lite
|
||||
endef
|
||||
|
||||
define Package/protobuf-lite
|
||||
$(call Package/protobuf/Default)
|
||||
endef
|
||||
|
||||
define Package/protobuf/description/Default
|
||||
Protocol Buffers are a way of encoding structured data in an efficient
|
||||
yet extensible format. Google uses Protocol Buffers for almost all
|
||||
of its internal RPC protocols and file formats.
|
||||
endef
|
||||
|
||||
define Package/protobuf/description
|
||||
$(call Package/protobuf/description/Default)
|
||||
|
||||
This package provides the libprotoc, libprotobuf, and libprotobuf-lite
|
||||
libraries. For a much smaller protobuf package, see "protobuf-lite".
|
||||
|
||||
endef
|
||||
|
||||
define Package/protobuf-lite/description
|
||||
$(call Package/protobuf/description/Default)
|
||||
|
||||
This package provides the libprotobuf-lite library.
|
||||
|
||||
endef
|
||||
|
||||
EXTRA_CPPFLAGS+=-std=c++11
|
||||
CONFIGURE_ARGS += --with-protoc=$(STAGING_DIR_HOSTPKG)/bin/protoc
|
||||
|
||||
define Build/InstallDev
|
||||
$(INSTALL_DIR) \
|
||||
$(1)/usr/lib \
|
||||
$(1)/usr/include
|
||||
|
||||
$(CP) \
|
||||
$(PKG_INSTALL_DIR)/usr/include/* \
|
||||
$(1)/usr/include/
|
||||
|
||||
$(CP) \
|
||||
$(PKG_INSTALL_DIR)/usr/lib/* \
|
||||
$(1)/usr/lib/
|
||||
endef
|
||||
|
||||
define Package/protobuf-lite/install
|
||||
$(INSTALL_DIR) \
|
||||
$(1)/usr/lib
|
||||
|
||||
$(CP) \
|
||||
$(PKG_INSTALL_DIR)/usr/lib/libprotobuf-lite.so* \
|
||||
$(1)/usr/lib/
|
||||
endef
|
||||
|
||||
define Package/protobuf/install
|
||||
$(INSTALL_DIR) \
|
||||
$(1)/usr/lib
|
||||
|
||||
$(CP) \
|
||||
$(PKG_INSTALL_DIR)/usr/lib/libprotoc.so* \
|
||||
$(1)/usr/lib/
|
||||
|
||||
$(CP) \
|
||||
$(PKG_INSTALL_DIR)/usr/lib/libprotobuf.so* \
|
||||
$(1)/usr/lib/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,protobuf))
|
||||
$(eval $(call BuildPackage,protobuf-lite))
|
||||
$(eval $(call HostBuild))
|
||||
626
feeds/ipq807x/qca-nss-clients/Makefile
Normal file
626
feeds/ipq807x/qca-nss-clients/Makefile
Normal file
@@ -0,0 +1,626 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
PKG_NAME:=qca-nss-clients
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_BRANCH:=master
|
||||
PKG_RELEASE:=2
|
||||
PKG_SOURCE_URL:=https://source.codeaurora.org/quic/qsdk/oss/lklm/nss-clients/
|
||||
PKG_VERSION:=9136ef60bf68ceed760781d3acbeddb05470e432
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_SOURCE_VERSION:=$(PKG_VERSION)
|
||||
|
||||
#PKG_BUILD_DEPENDS := PACKAGE_kmod-qca-nss-crypto:kmod-qca-nss-crypto
|
||||
MAKE_OPTS:=
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
# Keep default as ipq806x for branches that does not have subtarget framework
|
||||
ifeq ($(CONFIG_TARGET_ipq),y)
|
||||
subtarget:=$(SUBTARGET)
|
||||
else
|
||||
subtarget:=$(CONFIG_TARGET_BOARD)
|
||||
endif
|
||||
|
||||
ifneq (, $(findstring $(subtarget), "ipq807x" "ipq807x_ipq807x" "ipq60xx" "ipq807x_ipq60xx"))
|
||||
# DTLS Manager v2.0 for Hawkeye/Cypress
|
||||
DTLSMGR_DIR:=v2.0
|
||||
# IPsec Manager v2.0 for Hawkeye/Cypress
|
||||
IPSECMGR_DIR:=v2.0
|
||||
else
|
||||
# DTLS Manager v1.0 for Akronite.
|
||||
DTLSMGR_DIR:=v1.0
|
||||
# IPsec Manager v1.0 for Akronite.
|
||||
IPSECMGR_DIR:=v1.0
|
||||
endif
|
||||
|
||||
define KernelPackage/qca-nss-drv-tun6rd
|
||||
SECTION:=kernel
|
||||
CATEGORY:=Kernel modules
|
||||
SUBMENU:=Network Devices
|
||||
TITLE:=Kernel driver for NSS (connection manager) - tun6rd
|
||||
DEPENDS:=+kmod-qca-nss-drv +kmod-sit @!LINUX_3_18
|
||||
FILES:=$(PKG_BUILD_DIR)/qca-nss-tun6rd.ko
|
||||
AUTOLOAD:=$(call AutoLoad,60,qca-nss-tun6rd)
|
||||
endef
|
||||
|
||||
define KernelPackage/qca-nss-drv-tun6rd/Description
|
||||
Kernel modules for NSS connection manager - Support for 6rd tunnel
|
||||
endef
|
||||
|
||||
define KernelPackage/qca-nss-drv-dtlsmgr
|
||||
SECTION:=kernel
|
||||
CATEGORY:=Kernel modules
|
||||
SUBMENU:=Network Devices
|
||||
TITLE:=Kernel driver for NSS (connection manager) - dtlsmgr
|
||||
DEPENDS:=+kmod-qca-nss-drv +kmod-qca-nss-cfi-cryptoapi @!LINUX_3_18
|
||||
FILES:=$(PKG_BUILD_DIR)/dtls/$(DTLSMGR_DIR)/qca-nss-dtlsmgr.ko
|
||||
endef
|
||||
|
||||
define KernelPackage/qca-nss-drv-dtls/Description
|
||||
Kernel modules for NSS connection manager - Support for DTLS sessions
|
||||
endef
|
||||
|
||||
define KernelPackage/qca-nss-drv-tlsmgr
|
||||
SECTION:=kernel
|
||||
CATEGORY:=Kernel modules
|
||||
SUBMENU:=Network Devices
|
||||
TITLE:=Kernel driver for NSS (connection manager) - tlsmgr
|
||||
DEPENDS:=@TARGET_ipq_ipq807x||TARGET_ipq_ipq807x_ipq807x||TARGET_ipq807x||TARGET_ipq807x_ipq807x||TARGET_ipq_ipq60xx||TARGET_ipq807x_ipq60xx +kmod-qca-nss-drv +kmod-qca-nss-cfi @!LINUX_3_18
|
||||
FILES:=$(PKG_BUILD_DIR)/tls/qca-nss-tlsmgr.ko
|
||||
endef
|
||||
|
||||
define KernelPackage/qca-nss-drv-tls/Description
|
||||
Kernel modules for NSS connection manager - Support for TLS sessions
|
||||
endef
|
||||
|
||||
define KernelPackage/qca-nss-drv-l2tpv2
|
||||
SECTION:=kernel
|
||||
CATEGORY:=Kernel modules
|
||||
SUBMENU:=Network Devices
|
||||
TITLE:=Kernel driver for NSS (connection manager) - l2tp
|
||||
DEPENDS:=+kmod-qca-nss-drv +kmod-ppp +kmod-l2tp @!LINUX_3_18
|
||||
FILES:=$(PKG_BUILD_DIR)/l2tp/l2tpv2/qca-nss-l2tpv2.ko
|
||||
AUTOLOAD:=$(call AutoLoad,51,qca-nss-l2tpv2)
|
||||
endef
|
||||
|
||||
define KernelPackage/qca-nss-drv-l2tp/Description
|
||||
Kernel modules for NSS connection manager - Support for l2tp tunnel
|
||||
endef
|
||||
|
||||
define KernelPackage/qca-nss-drv-pptp
|
||||
SECTION:=kernel
|
||||
CATEGORY:=Kernel modules
|
||||
SUBMENU:=Network Devices
|
||||
TITLE:=Kernel driver for NSS (connection manager) - PPTP
|
||||
DEPENDS:=+kmod-qca-nss-drv +kmod-pptp @!LINUX_3_18
|
||||
FILES:=$(PKG_BUILD_DIR)/pptp/qca-nss-pptp.ko
|
||||
AUTOLOAD:=$(call AutoLoad,51,qca-nss-pptp)
|
||||
endef
|
||||
|
||||
define KernelPackage/qca-nss-drv-pptp/Description
|
||||
Kernel modules for NSS connection manager - Support for PPTP tunnel
|
||||
endef
|
||||
|
||||
define KernelPackage/qca-nss-drv-pppoe
|
||||
SECTION:=kernel
|
||||
CATEGORY:=Kernel modules
|
||||
SUBMENU:=Network Devices
|
||||
TITLE:=Kernel driver for NSS (connection manager) - PPPoE
|
||||
DEPENDS:=+kmod-qca-nss-drv +kmod-pppoe @!LINUX_3_18 \
|
||||
+!(TARGET_ipq_ipq807x_QSDK_256||TARGET_ipq_ipq60xx_QSDK_256):kmod-bonding
|
||||
FILES:=$(PKG_BUILD_DIR)/pppoe/qca-nss-pppoe.ko
|
||||
AUTOLOAD:=$(call AutoLoad,51,qca-nss-pppoe)
|
||||
endef
|
||||
|
||||
define KernelPackage/qca-nss-drv-pppoe/Description
|
||||
Kernel modules for NSS connection manager - Support for PPPoE
|
||||
endef
|
||||
|
||||
define KernelPackage/qca-nss-drv-map-t
|
||||
SECTION:=kernel
|
||||
CATEGORY:=Kernel modules
|
||||
SUBMENU:=Network Devices
|
||||
TITLE:=Kernel driver for NSS (connection manager) - MAP-T
|
||||
DEPENDS:=+kmod-qca-nss-drv +kmod-nat46 @!LINUX_3_18
|
||||
FILES:=$(PKG_BUILD_DIR)/map/map-t/qca-nss-map-t.ko
|
||||
AUTOLOAD:=$(call AutoLoad,51,qca-nss-map-t)
|
||||
endef
|
||||
|
||||
define KernelPackage/qca-nss-drv-map-t/Description
|
||||
Kernel modules for NSS connection manager - Support for MAP-T
|
||||
endef
|
||||
|
||||
define KernelPackage/qca-nss-drv-gre
|
||||
SECTION:=kernel
|
||||
CATEGORY:=Kernel modules
|
||||
SUBMENU:=Network Devices
|
||||
TITLE:=Kernel driver for NSS (connection manager) - GRE
|
||||
DEPENDS:=@TARGET_ipq_ipq806x||TARGET_ipq806x||TARGET_ipq_ipq807x||TARGET_ipq_ipq807x_ipq807x||TARGET_ipq807x||TARGET_ipq807x_ipq807x||TARGET_ipq_ipq60xx||TARGET_ipq807x_ipq60xx||TARGET_ipq_ipq50xx||TARGET_ipq_ipq50xx_64 \
|
||||
+kmod-qca-nss-drv @!LINUX_3_18 +kmod-gre6
|
||||
FILES:=$(PKG_BUILD_DIR)/gre/qca-nss-gre.ko $(PKG_BUILD_DIR)/gre/test/qca-nss-gre-test.ko
|
||||
AUTOLOAD:=$(call AutoLoad,51,qca-nss-gre)
|
||||
endef
|
||||
|
||||
define KernelPackage/qca-nss-drv-gre/Description
|
||||
Kernel modules for NSS connection manager - Support for GRE
|
||||
endef
|
||||
|
||||
define KernelPackage/qca-nss-drv-tunipip6
|
||||
SECTION:=kernel
|
||||
CATEGORY:=Kernel modules
|
||||
SUBMENU:=Network Devices
|
||||
TITLE:=Kernel driver for NSS (connection manager) - DS-lite and ipip6 Tunnel
|
||||
DEPENDS:=+kmod-qca-nss-drv +kmod-iptunnel6 +kmod-ip6-tunnel @!LINUX_3_18
|
||||
FILES:=$(PKG_BUILD_DIR)/tunipip6/qca-nss-tunipip6.ko
|
||||
AUTOLOAD:=$(call AutoLoad,60,qca-nss-tunipip6)
|
||||
endef
|
||||
|
||||
define KernelPackage/qca-nss-drv-tunipip6/Description
|
||||
Kernel modules for NSS connection manager
|
||||
Add support for DS-lite and ipip6 tunnel
|
||||
endef
|
||||
|
||||
define KernelPackage/qca-nss-drv-profile
|
||||
SECTION:=kernel
|
||||
CATEGORY:=Kernel modules
|
||||
SUBMENU:=Network Devices
|
||||
DEPENDS:=+kmod-qca-nss-drv @!LINUX_3_18
|
||||
TITLE:=Profiler for QCA NSS driver (IPQ806x)
|
||||
FILES:=$(PKG_BUILD_DIR)/profiler/qca-nss-profile-drv.ko
|
||||
endef
|
||||
|
||||
define KernelPackage/qca-nss-drv-profile/Description
|
||||
This package contains a NSS driver profiler for QCA chipset
|
||||
endef
|
||||
|
||||
define KernelPackage/qca-nss-drv-ipsecmgr
|
||||
SECTION:=kernel
|
||||
CATEGORY:=Kernel modules
|
||||
SUBMENU:=Network Devices
|
||||
TITLE:=Kernel driver for NSS (ipsec manager) - ipsecmgr
|
||||
DEPENDS:=@TARGET_ipq806x||TARGET_ipq_ipq806x||TARGET_ipq_ipq807x||TARGET_ipq_ipq807x_ipq807x||TARGET_ipq807x||TARGET_ipq807x_ipq807x||TARGET_ipq_ipq60xx||TARGET_ipq807x_ipq60xx \
|
||||
+kmod-qca-nss-drv +kmod-qca-nss-cfi-cryptoapi +kmod-qca-nss-cfi-ocf @!LINUX_3_18
|
||||
ifneq ($(CONFIG_PACKAGE_kmod-qca-nss-drv-l2tpv2),)
|
||||
DEPENDS:=+kmod-qca-nss-drv-l2tpv2
|
||||
endif
|
||||
FILES:=$(PKG_BUILD_DIR)/ipsecmgr/$(IPSECMGR_DIR)/qca-nss-ipsecmgr.ko
|
||||
AUTOLOAD:=$(call AutoLoad,60,qca-nss-ipsecmgr)
|
||||
endef
|
||||
|
||||
define KernelPackage/qca-nss-drv-ipsecmgr/Description
|
||||
Kernel module for NSS IPsec offload manager
|
||||
endef
|
||||
|
||||
define KernelPackage/qca-nss-drv-ipsecmgr-klips
|
||||
SECTION:=kernel
|
||||
CATEGORY:=Kernel modules
|
||||
SUBMENU:=Network Devices
|
||||
TITLE:=Kernel driver for NSS (ipsec klips)
|
||||
DEPENDS:=@TARGET_ipq_ipq807x||TARGET_ipq_ipq807x_ipq807x||TARGET_ipq807x||TARGET_ipq_ipq60xx||TARGET_ipq807x_ipq60xx \
|
||||
+kmod-qca-nss-drv-ipsecmgr kmod-qca-nss-ecm
|
||||
FILES:=$(PKG_BUILD_DIR)/ipsecmgr/$(IPSECMGR_DIR)/plugins/klips/qca-nss-ipsec-klips.ko
|
||||
endef
|
||||
|
||||
define KernelPackage/qca-nss-drv-ipsecmgr-klips/Description
|
||||
NSS Kernel module for IPsec klips offload
|
||||
endef
|
||||
|
||||
|
||||
define KernelPackage/qca-nss-drv-capwapmgr
|
||||
SECTION:=kernel
|
||||
CATEGORY:=Kernel modules
|
||||
SUBMENU:=Network Devices
|
||||
DEPENDS:=+kmod-qca-nss-drv +kmod-qca-nss-drv-dtlsmgr @!LINUX_3_18
|
||||
TITLE:=NSS CAPWAP Manager for QCA NSS driver (IPQ806x)
|
||||
FILES:=$(PKG_BUILD_DIR)/capwapmgr/qca-nss-capwapmgr.ko
|
||||
endef
|
||||
|
||||
define KernelPackage/qca-nss-drv-capwapmgr/Description
|
||||
This package contains a NSS CAPWAP Manager
|
||||
endef
|
||||
|
||||
define KernelPackage/qca-nss-drv-bridge-mgr
|
||||
SECTION:=kernel
|
||||
CATEGORY:=Kernel modules
|
||||
SUBMENU:=Network Devices
|
||||
TITLE:=Kernel driver for NSS bridge manager
|
||||
DEPENDS:=@TARGET_ipq_ipq807x||TARGET_ipq_ipq807x_ipq807x||TARGET_ipq807x||TARGET_ipq807x_ipq807x||TARGET_ipq_ipq60xx||TARGET_ipq807x_ipq60xx \
|
||||
+TARGET_ipq_ipq807x:kmod-qca-nss-drv-vlan-mgr \
|
||||
+TARGET_ipq_ipq807x_ipq807x:kmod-qca-nss-drv-vlan-mgr \
|
||||
+TARGET_ipq807x:kmod-qca-nss-drv-vlan-mgr \
|
||||
+TARGET_ipq807x_ipq807x:kmod-qca-nss-drv-vlan-mgr \
|
||||
+TARGET_ipq_ipq60xx:kmod-qca-nss-drv-vlan-mgr \
|
||||
+TARGET_ipq807x_ipq60xx:kmod-qca-nss-drv-vlan-mgr @!LINUX_3_18 \
|
||||
+!(TARGET_ipq_ipq807x_QSDK_256||TARGET_ipq_ipq60xx_QSDK_256):kmod-bonding
|
||||
FILES:=$(PKG_BUILD_DIR)/bridge/qca-nss-bridge-mgr.ko
|
||||
AUTOLOAD:=$(call AutoLoad,51,qca-nss-bridge-mgr)
|
||||
endef
|
||||
|
||||
define KernelPackage/qca-nss-drv-bridge-mgr/Description
|
||||
Kernel modules for NSS bridge manager
|
||||
endef
|
||||
|
||||
define KernelPackage/qca-nss-drv-vlan-mgr
|
||||
SECTION:=kernel
|
||||
CATEGORY:=Kernel modules
|
||||
SUBMENU:=Network Devices
|
||||
TITLE:=Kernel driver for NSS vlan manager
|
||||
DEPENDS:=@TARGET_ipq_ipq807x||TARGET_ipq_ipq807x_ipq807x||TARGET_ipq807x||TARGET_ipq807x_ipq807x||TARGET_ipq_ipq60xx||TARGET_ipq807x_ipq60xx +kmod-qca-nss-drv @!LINUX_3_18 \
|
||||
+!(TARGET_ipq_ipq807x_QSDK_256||TARGET_ipq_ipq60xx_QSDK_256):kmod-bonding
|
||||
FILES:=$(PKG_BUILD_DIR)/vlan/qca-nss-vlan.ko
|
||||
AUTOLOAD:=$(call AutoLoad,51,qca-nss-vlan)
|
||||
endef
|
||||
|
||||
define KernelPackage/qca-nss-drv-vlan-mgr/Description
|
||||
Kernel modules for NSS vlan manager
|
||||
endef
|
||||
|
||||
define KernelPackage/qca-nss-drv-qdisc
|
||||
SECTION:=kernel
|
||||
CATEGORY:=Kernel modules
|
||||
SUBMENU:=Network Support
|
||||
TITLE:=Qdisc for configuring shapers in NSS
|
||||
DEPENDS:=+kmod-qca-nss-drv @!LINUX_3_18
|
||||
FILES:=$(PKG_BUILD_DIR)/nss_qdisc/qca-nss-qdisc.ko
|
||||
AUTOLOAD:=$(call AutoLoad,58,qca-nss-qdisc)
|
||||
endef
|
||||
|
||||
define KernelPackage/qca-nss-drv-qdisc/Description
|
||||
Linux qdisc that aids in configuring shapers in the NSS
|
||||
endef
|
||||
|
||||
define KernelPackage/qca-nss-drv-igs
|
||||
SECTION:=kernel
|
||||
CATEGORY:=Kernel modules
|
||||
SUBMENU:=Network Support
|
||||
TITLE:=Action for offloading traffic to an IFB interface to perform ingress shaping.
|
||||
DEPENDS:=@TARGET_ipq_ipq807x||TARGET_ipq_ipq807x_ipq807x||TARGET_ipq_ipq60xx||TARGET_ipq807x_ipq60xx||TARGET_ipq_ipq50xx||TARGET_ipq_ipq50xx_64 \
|
||||
+kmod-qca-nss-drv +kmod-sched-core +kmod-ifb +kmod-qca-nss-drv-qdisc @!LINUX_3_18
|
||||
FILES:=$(PKG_BUILD_DIR)/nss_qdisc/igs/act_nssmirred.ko
|
||||
endef
|
||||
|
||||
define KernelPackage/qca-nss-drv-igs/Description
|
||||
Linux action that helps in offloading traffic to an IFB interface to perform ingress shaping.
|
||||
endef
|
||||
|
||||
define KernelPackage/qca-nss-drv-lag-mgr
|
||||
SECTION:=kernel
|
||||
CATEGORY:=Kernel modules
|
||||
SUBMENU:=Network Devices
|
||||
TITLE:=Kernel driver for NSS LAG manager
|
||||
DEPENDS:=+kmod-qca-nss-drv @!LINUX_3_18 \
|
||||
+TARGET_ipq_ipq807x:kmod-qca-nss-drv-vlan-mgr \
|
||||
+TARGET_ipq_ipq807x_ipq807x:kmod-qca-nss-drv-vlan-mgr @!LINUX_3_18 \
|
||||
+TARGET_ipq807x:kmod-qca-nss-drv-vlan-mgr \
|
||||
+TARGET_ipq807x_ipq807x:kmod-qca-nss-drv-vlan-mgr @!LINUX_3_18 \
|
||||
+TARGET_ipq_ipq60xx:kmod-qca-nss-drv-vlan-mgr @!LINUX_3_18 \
|
||||
+TARGET_ipq807x_ipq60xx:kmod-qca-nss-drv-vlan-mgr @!LINUX_3_18 \
|
||||
+kmod-bonding
|
||||
FILES:=$(PKG_BUILD_DIR)/lag/qca-nss-lag-mgr.ko
|
||||
AUTOLOAD:=$(call AutoLoad,51,qca-nss-lag-mgr)
|
||||
endef
|
||||
|
||||
define KernelPackage/qca-nss-drv-lag-mgr/Description
|
||||
Kernel modules for NSS LAG manager
|
||||
endef
|
||||
|
||||
define KernelPackage/qca-nss-drv-netlink
|
||||
SECTION:=kernel
|
||||
CATEGORY:=Kernel modules
|
||||
SUBMENU:=Network Devices
|
||||
DEPENDS:=@TARGET_ipq807x||TARGET_ipq_ipq807x||TARGET_ipq807x_ipq807x||TARGET_ipq_ipq807x_ipq807x||TARGET_ipq_ipq60xx||TARGET_ipq807x_ipq60xx||TARGET_ipq_ipq50xx||TARGET_ipq_ipq50xx_64 \
|
||||
+kmod-qca-nss-drv @!LINUX_3_18 \
|
||||
+PACKAGE_kmod-qca-nss-drv-ipsecmgr:kmod-qca-nss-drv-ipsecmgr \
|
||||
+PACKAGE_kmod-qca-nss-drv-dtlsmgr:kmod-qca-nss-drv-dtlsmgr \
|
||||
+PACKAGE_kmod-qca-nss-drv-capwapmgr:kmod-qca-nss-drv-capwapmgr @!LINUX_3_18
|
||||
TITLE:=NSS NETLINK Manager for QCA NSS driver
|
||||
FILES:=$(PKG_BUILD_DIR)/netlink/qca-nss-netlink.ko
|
||||
endef
|
||||
|
||||
define KernelPackage/qca-nss-drv-netlink/Description
|
||||
Kernel module for NSS netlink manager
|
||||
endef
|
||||
|
||||
define KernelPackage/qca-nss-drv-ovpn-mgr
|
||||
SECTION:=kernel
|
||||
CATEGORY:=Kernel modules
|
||||
SUBMENU:=Network Devices
|
||||
TITLE:=Kernel driver for NSS OpenVPN manager
|
||||
DEPENDS:=+kmod-qca-nss-drv +kmod-qca-nss-cfi +kmod-tun +kmod-ipt-conntrack @!LINUX_3_18 \
|
||||
@TARGET_ipq_ipq807x||TARGET_ipq_ipq807x_ipq807x||TARGET_ipq_ipq60xx||TARGET_ipq807x_ipq60xx
|
||||
FILES:=$(PKG_BUILD_DIR)/openvpn/src/qca-nss-ovpn-mgr.ko
|
||||
endef
|
||||
|
||||
define KernelPackage/qca-nss-drv-ovpn-mgr/Description
|
||||
Kernel module for NSS OpenVPN manager
|
||||
endef
|
||||
|
||||
define KernelPackage/qca-nss-drv-ovpn-link
|
||||
SECTION:=kernel
|
||||
CATEGORY:=Kernel modules
|
||||
SUBMENU:=Network Devices
|
||||
TITLE:=Kernel driver for interfacing NSS OpenVPN manager with ECM
|
||||
DEPENDS:=+kmod-qca-nss-drv-ovpn-mgr +kmod-qca-nss-ecm-premium @!LINUX_3_18 \
|
||||
@TARGET_ipq_ipq807x||TARGET_ipq_ipq807x_ipq807x||TARGET_ipq_ipq60xx||TARGET_ipq807x_ipq60xx
|
||||
FILES:=$(PKG_BUILD_DIR)/openvpn/plugins/qca-nss-ovpn-link.ko
|
||||
endef
|
||||
|
||||
define KernelPackage/qca-nss-drv-ovpn-link/Description
|
||||
This module registers with ECM and communicates with NSS OpenVPN manager for supporting OpenVPN offload.
|
||||
endef
|
||||
|
||||
define KernelPackage/qca-nss-drv-pvxlanmgr
|
||||
SECTION:=kernel
|
||||
CATEGORY:=Kernel modules
|
||||
SUBMENU:=Network Devices
|
||||
DEPENDS:=+kmod-qca-nss-drv @!LINUX_3_18
|
||||
TITLE:=NSS PVXLAN Manager for QCA NSS driver
|
||||
FILES:=$(PKG_BUILD_DIR)/pvxlanmgr/qca-nss-pvxlanmgr.ko
|
||||
endef
|
||||
|
||||
define KernelPackage/qca-nss-drv-pvxlanmgr/Description
|
||||
Kernel module for managing NSS PVxLAN
|
||||
endef
|
||||
|
||||
define KernelPackage/qca-nss-drv-eogremgr
|
||||
SECTION:=kernel
|
||||
CATEGORY:=Kernel modules
|
||||
SUBMENU:=Network Devices
|
||||
DEPENDS:=+kmod-qca-nss-drv +kmod-qca-nss-drv-gre @!LINUX_3_18
|
||||
TITLE:=NSS EOGRE Manager for QCA NSS driver
|
||||
FILES:=$(PKG_BUILD_DIR)/eogremgr/qca-nss-eogremgr.ko
|
||||
endef
|
||||
|
||||
define KernelPackage/qca-nss-drv-eogremgr/Description
|
||||
Kernel module for managing NSS EoGRE
|
||||
endef
|
||||
|
||||
define KernelPackage/qca-nss-drv-clmapmgr
|
||||
SECTION:=kernel
|
||||
CATEGORY:=Kernel modules
|
||||
SUBMENU:=Network Devices
|
||||
DEPENDS:=+kmod-qca-nss-drv +kmod-qca-nss-drv-eogremgr @!LINUX_3_18
|
||||
TITLE:=NSS clmap Manager for QCA NSS driver
|
||||
FILES:=$(PKG_BUILD_DIR)/clmapmgr/qca-nss-clmapmgr.ko
|
||||
endef
|
||||
|
||||
define KernelPackage/qca-nss-drv-clmapmgr/Description
|
||||
Kernel module for managing NSS clmap
|
||||
endef
|
||||
|
||||
define KernelPackage/qca-nss-drv-vxlanmgr
|
||||
SECTION:=kernel
|
||||
CATEGORY:=Kernel modules
|
||||
SUBMENU:=Network Devices
|
||||
DEPENDS:=+kmod-qca-nss-drv +kmod-vxlan @!LINUX_3_18
|
||||
TITLE:=NSS VxLAN Manager for QCA NSS driver
|
||||
FILES:=$(PKG_BUILD_DIR)/vxlanmgr/qca-nss-vxlanmgr.ko
|
||||
AUTOLOAD:=$(call AutoLoad,51,qca-nss-vxlanmgr)
|
||||
endef
|
||||
|
||||
define KernelPackage/qca-nss-drv-vxlanmgr/Description
|
||||
Kernel module for managing NSS VxLAN
|
||||
endef
|
||||
|
||||
define KernelPackage/qca-nss-drv-match
|
||||
SECTION:=kernel
|
||||
CATEGORY:=Kernel modules
|
||||
SUBMENU:=Network Devices
|
||||
DEPENDS:=+kmod-qca-nss-drv @!LINUX_3_18
|
||||
TITLE:=NSS Match for QCA NSS driver
|
||||
FILES:=$(PKG_BUILD_DIR)/match/qca-nss-match.ko
|
||||
endef
|
||||
|
||||
define KernelPackage/qca-nss-drv-match/Description
|
||||
Kernel module for managing NSS Match
|
||||
endef
|
||||
|
||||
define KernelPackage/qca-nss-drv-mirror
|
||||
SECTION:=kernel
|
||||
CATEGORY:=Kernel modules
|
||||
SUBMENU:=Network Support
|
||||
TITLE:=Module for mirroring packets from NSS to host.
|
||||
DEPENDS:=+kmod-qca-nss-drv @!LINUX_3_18
|
||||
FILES:=$(PKG_BUILD_DIR)/mirror/qca-nss-mirror.ko
|
||||
endef
|
||||
|
||||
define KernelPackage/qca-nss-drv-mirror/Description
|
||||
Kernel module for managing NSS Mirror
|
||||
endef
|
||||
|
||||
define Build/InstallDev/qca-nss-clients
|
||||
$(INSTALL_DIR) $(1)/usr/include/qca-nss-clients
|
||||
$(CP) $(PKG_BUILD_DIR)/netlink/include/* $(1)/usr/include/qca-nss-clients/
|
||||
$(CP) $(PKG_BUILD_DIR)/exports/* $(1)/usr/include/qca-nss-clients/
|
||||
endef
|
||||
|
||||
define Build/InstallDev
|
||||
$(call Build/InstallDev/qca-nss-clients,$(1))
|
||||
endef
|
||||
|
||||
define KernelPackage/qca-nss-drv-ovpn-mgr/install
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_BIN) ./files/qca-nss-ovpn.init $(1)/etc/init.d/qca-nss-ovpn
|
||||
endef
|
||||
|
||||
define KernelPackage/qca-nss-drv-ipsecmgr-klips/install
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_BIN) ./files/qca-nss-ipsec $(1)/etc/init.d/qca-nss-ipsec
|
||||
endef
|
||||
|
||||
define KernelPackage/qca-nss-drv-igs/install
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_BIN) ./files/qca-nss-mirred.init $(1)/etc/init.d/qca-nss-mirred
|
||||
endef
|
||||
|
||||
EXTRA_CFLAGS+= \
|
||||
-I$(STAGING_DIR)/usr/include/qca-nss-drv \
|
||||
-I$(STAGING_DIR)/usr/include/qca-nss-crypto \
|
||||
-I$(STAGING_DIR)/usr/include/qca-nss-cfi \
|
||||
-I$(STAGING_DIR)/usr/include/qca-nss-gmac \
|
||||
-I$(STAGING_DIR)/usr/include/qca-ssdk \
|
||||
-I$(STAGING_DIR)/usr/include/qca-ssdk/fal \
|
||||
-I$(STAGING_DIR)/usr/include/nat46
|
||||
|
||||
# Build individual packages if selected
|
||||
ifneq ($(CONFIG_PACKAGE_kmod-qca-nss-drv-profile),)
|
||||
MAKE_OPTS+=profile=y
|
||||
endif
|
||||
|
||||
ifneq ($(CONFIG_PACKAGE_kmod-qca-nss-drv-capwapmgr),)
|
||||
MAKE_OPTS+=capwapmgr=y
|
||||
EXTRA_CFLAGS += -DNSS_CAPWAPMGR_ONE_NETDEV
|
||||
endif
|
||||
|
||||
ifneq ($(CONFIG_PACKAGE_kmod-qca-nss-drv-tun6rd),)
|
||||
MAKE_OPTS+=tun6rd=m
|
||||
endif
|
||||
|
||||
ifneq ($(CONFIG_PACKAGE_kmod-qca-nss-drv-dtlsmgr),)
|
||||
MAKE_OPTS+=dtlsmgr=y
|
||||
endif
|
||||
|
||||
ifneq ($(CONFIG_PACKAGE_kmod-qca-nss-drv-tlsmgr),)
|
||||
MAKE_OPTS+=tlsmgr=y
|
||||
endif
|
||||
|
||||
ifneq ($(CONFIG_PACKAGE_kmod-qca-nss-drv-l2tpv2),)
|
||||
MAKE_OPTS+=l2tpv2=y
|
||||
EXTRA_CFLAGS += -DNSS_L2TPV2_ENABLED
|
||||
endif
|
||||
|
||||
ifneq ($(CONFIG_PACKAGE_kmod-qca-nss-drv-pptp),)
|
||||
MAKE_OPTS+=pptp=y
|
||||
endif
|
||||
|
||||
ifneq ($(CONFIG_PACKAGE_kmod-qca-nss-drv-map-t),)
|
||||
MAKE_OPTS+=map-t=y
|
||||
endif
|
||||
|
||||
ifneq ($(CONFIG_PACKAGE_kmod-qca-nss-drv-tunipip6),)
|
||||
MAKE_OPTS+=tunipip6=m
|
||||
endif
|
||||
|
||||
ifneq ($(CONFIG_PACKAGE_kmod-qca-nss-drv-qdisc),)
|
||||
MAKE_OPTS+=qdisc=y
|
||||
endif
|
||||
|
||||
ifneq ($(CONFIG_PACKAGE_kmod-qca-nss-drv-igs),)
|
||||
MAKE_OPTS+=igs=y
|
||||
endif
|
||||
|
||||
ifneq ($(CONFIG_PACKAGE_kmod-qca-nss-drv-ipsecmgr),)
|
||||
EXTRA_CFLAGS+= -I$(PKG_BUILD_DIR)/exports
|
||||
MAKE_OPTS+=ipsecmgr=y
|
||||
endif
|
||||
|
||||
ifneq ($(CONFIG_PACKAGE_kmod-qca-nss-drv-ipsecmgr-klips),)
|
||||
EXTRA_CFLAGS+= -I$(STAGING_DIR)/usr/include/qca-nss-ecm
|
||||
MAKE_OPTS+=ipsecmgr-klips=m
|
||||
endif
|
||||
|
||||
|
||||
ifneq ($(CONFIG_PACKAGE_kmod-qca-nss-drv-bridge-mgr),)
|
||||
MAKE_OPTS+=bridge-mgr=y
|
||||
#enable OVS bridge if ovsmgr is enabled
|
||||
ifneq ($(CONFIG_PACKAGE_kmod-qca-ovsmgr),)
|
||||
MAKE_OPTS+= NSS_BRIDGE_MGR_OVS_ENABLE=y
|
||||
EXTRA_CFLAGS+= -I$(STAGING_DIR)/usr/include/qca-ovsmgr
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(CONFIG_PACKAGE_kmod-qca-nss-drv-vlan-mgr),)
|
||||
MAKE_OPTS+=vlan-mgr=y
|
||||
endif
|
||||
|
||||
ifneq ($(CONFIG_PACKAGE_kmod-qca-nss-drv-lag-mgr),)
|
||||
MAKE_OPTS+=lag-mgr=y
|
||||
endif
|
||||
|
||||
ifneq ($(CONFIG_PACKAGE_kmod-qca-nss-drv-gre),)
|
||||
EXTRA_CFLAGS+= -I$(PKG_BUILD_DIR)/exports
|
||||
MAKE_OPTS+=gre=y
|
||||
endif
|
||||
|
||||
ifneq ($(CONFIG_PACKAGE_kmod-qca-nss-drv-pppoe),)
|
||||
MAKE_OPTS+=pppoe=y
|
||||
endif
|
||||
|
||||
ifneq ($(CONFIG_PACKAGE_kmod-qca-nss-drv-netlink),)
|
||||
MAKE_OPTS+=netlink=y
|
||||
endif
|
||||
|
||||
ifneq ($(CONFIG_PACKAGE_kmod-qca-nss-drv-ovpn-mgr),)
|
||||
MAKE_OPTS+=ovpn-mgr=y
|
||||
endif
|
||||
|
||||
ifneq ($(CONFIG_PACKAGE_kmod-qca-nss-drv-ovpn-link),)
|
||||
MAKE_OPTS+=ovpn-link=y
|
||||
endif
|
||||
|
||||
ifneq ($(CONFIG_PACKAGE_kmod-qca-nss-drv-pvxlanmgr),)
|
||||
MAKE_OPTS+=pvxlanmgr=y
|
||||
endif
|
||||
|
||||
ifneq ($(CONFIG_PACKAGE_kmod-qca-nss-drv-eogremgr),)
|
||||
MAKE_OPTS+=eogremgr=y
|
||||
endif
|
||||
|
||||
ifneq ($(CONFIG_PACKAGE_kmod-qca-nss-drv-clmapmgr),)
|
||||
MAKE_OPTS+=clmapmgr=y
|
||||
endif
|
||||
|
||||
ifneq ($(CONFIG_PACKAGE_kmod-qca-nss-drv-vxlanmgr),)
|
||||
MAKE_OPTS+=vxlanmgr=y
|
||||
endif
|
||||
|
||||
ifneq ($(CONFIG_PACKAGE_kmod-qca-nss-drv-match),)
|
||||
MAKE_OPTS+=match=y
|
||||
endif
|
||||
|
||||
ifneq ($(CONFIG_PACKAGE_kmod-qca-nss-drv-mirror),)
|
||||
MAKE_OPTS+=mirror=y
|
||||
endif
|
||||
|
||||
define Build/Compile
|
||||
$(MAKE) -C "$(LINUX_DIR)" $(strip $(MAKE_OPTS)) \
|
||||
CROSS_COMPILE="$(TARGET_CROSS)" \
|
||||
ARCH="$(LINUX_KARCH)" \
|
||||
M="$(PKG_BUILD_DIR)" \
|
||||
EXTRA_CFLAGS="$(EXTRA_CFLAGS)" \
|
||||
SoC="$(subtarget)" \
|
||||
DTLSMGR_DIR="$(DTLSMGR_DIR)" \
|
||||
IPSECMGR_DIR="$(IPSECMGR_DIR)" \
|
||||
modules
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,qca-nss-drv-profile))
|
||||
#$(eval $(call KernelPackage,qca-nss-drv-capwapmgr))
|
||||
$(eval $(call KernelPackage,qca-nss-drv-tun6rd))
|
||||
#$(eval $(call KernelPackage,qca-nss-drv-dtlsmgr))
|
||||
$(eval $(call KernelPackage,qca-nss-drv-l2tpv2))
|
||||
$(eval $(call KernelPackage,qca-nss-drv-pptp))
|
||||
$(eval $(call KernelPackage,qca-nss-drv-pppoe))
|
||||
$(eval $(call KernelPackage,qca-nss-drv-map-t))
|
||||
$(eval $(call KernelPackage,qca-nss-drv-tunipip6))
|
||||
$(eval $(call KernelPackage,qca-nss-drv-qdisc))
|
||||
$(eval $(call KernelPackage,qca-nss-drv-igs))
|
||||
#$(eval $(call KernelPackage,qca-nss-drv-netlink))
|
||||
#$(eval $(call KernelPackage,qca-nss-drv-ipsecmgr))
|
||||
#$(eval $(call KernelPackage,qca-nss-drv-ipsecmgr-klips))
|
||||
$(eval $(call KernelPackage,qca-nss-drv-bridge-mgr))
|
||||
$(eval $(call KernelPackage,qca-nss-drv-vlan-mgr))
|
||||
$(eval $(call KernelPackage,qca-nss-drv-lag-mgr))
|
||||
$(eval $(call KernelPackage,qca-nss-drv-gre))
|
||||
#$(eval $(call KernelPackage,qca-nss-drv-ovpn-mgr))
|
||||
#$(eval $(call KernelPackage,qca-nss-drv-ovpn-link))
|
||||
$(eval $(call KernelPackage,qca-nss-drv-pvxlanmgr))
|
||||
$(eval $(call KernelPackage,qca-nss-drv-eogremgr))
|
||||
$(eval $(call KernelPackage,qca-nss-drv-clmapmgr))
|
||||
$(eval $(call KernelPackage,qca-nss-drv-vxlanmgr))
|
||||
$(eval $(call KernelPackage,qca-nss-drv-match))
|
||||
#$(eval $(call KernelPackage,qca-nss-drv-tlsmgr))
|
||||
$(eval $(call KernelPackage,qca-nss-drv-mirror))
|
||||
92
feeds/ipq807x/qca-nss-clients/files/qca-nss-ipsec
Executable file
92
feeds/ipq807x/qca-nss-clients/files/qca-nss-ipsec
Executable file
@@ -0,0 +1,92 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
#
|
||||
# Copyright (c) 2018-2019 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.
|
||||
|
||||
NSS_IPSEC_LOG_FILE=/tmp/.nss_ipsec_log
|
||||
NSS_IPSEC_LOG_STR_ECM="ECM_Loaded"
|
||||
|
||||
ecm_load () {
|
||||
if [ ! -d /sys/module/ecm ]; then
|
||||
/etc/init.d/qca-nss-ecm start
|
||||
if [ -d /sys/module/ecm ]; then
|
||||
echo ${NSS_IPSEC_LOG_STR_ECM} >> ${NSS_IPSEC_LOG_FILE}
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
ecm_unload () {
|
||||
if [ -f /tmp/.nss_ipsec_log ]; then
|
||||
str=`grep ${NSS_IPSEC_LOG_STR_ECM} ${NSS_IPSEC_LOG_FILE}`
|
||||
if [[ $str == ${NSS_IPSEC_LOG_STR_ECM} ]]; then
|
||||
/etc/init.d/qca-nss-ecm stop
|
||||
`sed 's/${NSS_IPSEC_LOG_STR_ECM}/ /g' $NSS_IPSEC_LOG_FILE > $NSS_IPSEC_LOG_FILE`
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
ecm_disable() {
|
||||
|
||||
if [ ! -d /sys/module/ecm ]; then
|
||||
return;
|
||||
fi
|
||||
|
||||
echo 1 > /sys/kernel/debug/ecm/front_end_ipv4_stop
|
||||
echo 1 > /sys/kernel/debug/ecm/front_end_ipv6_stop
|
||||
echo 1 > /sys/kernel/debug/ecm/ecm_db/defunct_all
|
||||
sleep 2
|
||||
}
|
||||
|
||||
ecm_enable() {
|
||||
if [ ! -d /sys/module/ecm ]; then
|
||||
return;
|
||||
fi
|
||||
|
||||
echo 0 > /sys/kernel/debug/ecm/ecm_db/defunct_all
|
||||
echo 0 > /sys/kernel/debug/ecm/front_end_ipv4_stop
|
||||
echo 0 > /sys/kernel/debug/ecm/front_end_ipv6_stop
|
||||
}
|
||||
|
||||
start() {
|
||||
ecm_load
|
||||
|
||||
local kernel_version=$(uname -r)
|
||||
|
||||
insmod /lib/modules/${kernel_version}/qca-nss-ipsec-klips.ko
|
||||
if [ "$?" -gt 0 ]; then
|
||||
echo "Failed to load plugin. Please start ecm if not done already"
|
||||
ecm_enable
|
||||
return
|
||||
fi
|
||||
|
||||
/etc/init.d/ipsec start
|
||||
sleep 2
|
||||
ipsec eroute
|
||||
|
||||
ecm_enable
|
||||
}
|
||||
|
||||
stop() {
|
||||
ecm_disable
|
||||
|
||||
/etc/init.d/ipsec stop
|
||||
rmmod qca-nss-ipsec-klips
|
||||
|
||||
ecm_unload
|
||||
}
|
||||
|
||||
restart() {
|
||||
stop
|
||||
start
|
||||
}
|
||||
52
feeds/ipq807x/qca-nss-dp/Makefile
Normal file
52
feeds/ipq807x/qca-nss-dp/Makefile
Normal file
@@ -0,0 +1,52 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
PKG_NAME:=qca-nss-dp
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_BRANCH:=master
|
||||
PKG_RELEASE:=1
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define KernelPackage/qca-nss-dp
|
||||
SECTION:=kernel
|
||||
CATEGORY:=Kernel modules
|
||||
SUBMENU:=Network Devices
|
||||
DEPENDS:=@TARGET_ipq807x +kmod-qca-ssdk
|
||||
TITLE:=Kernel driver for NSS data plane
|
||||
FILES:=$(PKG_BUILD_DIR)/qca-nss-dp.ko
|
||||
AUTOLOAD:=$(call AutoLoad,31,qca-nss-dp)
|
||||
endef
|
||||
|
||||
define KernelPackage/qca-nss-dp/Description
|
||||
This package contains a NSS data plane driver for QCA chipset
|
||||
endef
|
||||
|
||||
define Build/InstallDev
|
||||
mkdir -p $(1)/usr/include/qca-nss-dp
|
||||
$(CP) $(PKG_BUILD_DIR)/exports/* $(1)/usr/include/qca-nss-dp/
|
||||
endef
|
||||
|
||||
EXTRA_CFLAGS+= \
|
||||
-I$(STAGING_DIR)/usr/include/qca-ssdk
|
||||
|
||||
subtarget:=$(SUBTARGET)
|
||||
|
||||
NSS_DP_HAL_DIR:=$(PKG_BUILD_DIR)/hal
|
||||
hal_arch:=$(subtarget)
|
||||
|
||||
define Build/Configure
|
||||
$(LN) $(NSS_DP_HAL_DIR)/arch/$(hal_arch)/nss_$(hal_arch).h \
|
||||
$(PKG_BUILD_DIR)/exports/nss_dp_arch.h
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
$(MAKE) -C "$(LINUX_DIR)" \
|
||||
CROSS_COMPILE="$(TARGET_CROSS)" \
|
||||
ARCH="$(LINUX_KARCH)" \
|
||||
M="$(PKG_BUILD_DIR)" \
|
||||
EXTRA_CFLAGS="$(EXTRA_CFLAGS)" SoC="$(subtarget)" \
|
||||
modules
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,qca-nss-dp))
|
||||
56
feeds/ipq807x/qca-nss-dp/src/Makefile
Normal file
56
feeds/ipq807x/qca-nss-dp/src/Makefile
Normal file
@@ -0,0 +1,56 @@
|
||||
###################################################
|
||||
# Makefile for the NSS data plane driver
|
||||
###################################################
|
||||
|
||||
obj ?= .
|
||||
|
||||
obj-m += qca-nss-dp.o
|
||||
|
||||
qca-nss-dp-objs += nss_dp_attach.o \
|
||||
nss_dp_ethtools.o \
|
||||
nss_dp_main.o
|
||||
|
||||
ifneq ($(CONFIG_NET_SWITCHDEV),)
|
||||
qca-nss-dp-objs += nss_dp_switchdev.o
|
||||
endif
|
||||
|
||||
ifeq ($(SoC),$(filter $(SoC),ipq807x ipq807x_64 ipq60xx ipq60xx_64))
|
||||
qca-nss-dp-objs += hal/edma/edma_cfg.o \
|
||||
hal/edma/edma_data_plane.o \
|
||||
hal/edma/edma_tx_rx.o \
|
||||
hal/gmac_hal_ops/qcom/qcom_if.o \
|
||||
hal/gmac_hal_ops/syn/xgmac/syn_if.o
|
||||
endif
|
||||
|
||||
NSS_DP_INCLUDE = -I$(obj)/include -I$(obj)/exports -I$(obj)/gmac_hal_ops/include \
|
||||
-I$(obj)/hal/include
|
||||
|
||||
ifeq ($(SoC),$(filter $(SoC),ipq50xx ipq50xx_64))
|
||||
NSS_DP_INCLUDE += -I$(obj)/hal/gmac_hal_ops/syn/gmac
|
||||
endif
|
||||
|
||||
ccflags-y += $(NSS_DP_INCLUDE)
|
||||
ccflags-y += -Werror
|
||||
|
||||
ifeq ($(SoC),$(filter $(SoC),ipq807x ipq807x_64 ipq60xx ipq60xx_64))
|
||||
ccflags-y += -DNSS_DP_PPE_SUPPORT
|
||||
endif
|
||||
|
||||
ifeq ($(SoC),$(filter $(SoC),ipq60xx ipq60xx_64))
|
||||
qca-nss-dp-objs += hal/arch/ipq60xx/nss_ipq60xx.o
|
||||
ccflags-y += -DNSS_DP_IPQ60XX
|
||||
endif
|
||||
|
||||
ifeq ($(SoC),$(filter $(SoC),ipq807x ipq807x_64))
|
||||
qca-nss-dp-objs += hal/arch/ipq807x/nss_ipq807x.o
|
||||
ccflags-y += -DNSS_DP_IPQ807X
|
||||
endif
|
||||
|
||||
ifeq ($(SoC),$(filter $(SoC),ipq50xx ipq50xx_64))
|
||||
qca-nss-dp-objs += hal/arch/ipq50xx/nss_ipq50xx.o \
|
||||
hal/gmac_hal_ops/syn/gmac/syn_if.o \
|
||||
hal/syn_gmac_dp/syn_data_plane.o \
|
||||
hal/syn_gmac_dp/syn_dp_tx_rx.o \
|
||||
hal/syn_gmac_dp/syn_dp_cfg.o
|
||||
ccflags-y += -DNSS_DP_IPQ50XX
|
||||
endif
|
||||
219
feeds/ipq807x/qca-nss-dp/src/exports/nss_dp_api_if.h
Normal file
219
feeds/ipq807x/qca-nss-dp/src/exports/nss_dp_api_if.h
Normal file
@@ -0,0 +1,219 @@
|
||||
/*
|
||||
**************************************************************************
|
||||
* Copyright (c) 2016-2020, 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.
|
||||
**************************************************************************
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file nss_dp_api_if.h
|
||||
* nss-dp exported structures/apis.
|
||||
*
|
||||
* This file declares all the public interfaces
|
||||
* for NSS data-plane driver.
|
||||
*/
|
||||
|
||||
#ifndef __NSS_DP_API_IF_H
|
||||
#define __NSS_DP_API_IF_H
|
||||
|
||||
#include "nss_dp_arch.h"
|
||||
|
||||
/**
|
||||
* @addtogroup nss_dp_subsystem
|
||||
* @{
|
||||
*/
|
||||
|
||||
/*
|
||||
* NSS DP status
|
||||
*/
|
||||
#define NSS_DP_SUCCESS 0
|
||||
#define NSS_DP_FAILURE -1
|
||||
|
||||
/*
|
||||
* NSS DP platform specific defines
|
||||
*/
|
||||
#define NSS_DP_START_IFNUM NSS_DP_HAL_START_IFNUM
|
||||
/**< First GMAC interface number (0/1) depending on SoC. */
|
||||
#define NSS_DP_MAX_MTU_SIZE NSS_DP_HAL_MAX_MTU_SIZE
|
||||
#define NSS_DP_MAX_PACKET_LEN NSS_DP_HAL_MAX_PACKET_LEN
|
||||
#define NSS_DP_MAX_INTERFACES (NSS_DP_HAL_MAX_PORTS + NSS_DP_HAL_START_IFNUM)
|
||||
/**< Last interface index for the SoC, to be used by qca-nss-drv. */
|
||||
|
||||
/*
|
||||
* NSS PTP service code
|
||||
*/
|
||||
#define NSS_PTP_EVENT_SERVICE_CODE 0x9
|
||||
|
||||
/**
|
||||
* nss_dp_data_plane_ctx
|
||||
* Data plane context base class.
|
||||
*/
|
||||
struct nss_dp_data_plane_ctx {
|
||||
struct net_device *dev;
|
||||
};
|
||||
|
||||
/**
|
||||
* nss_dp_gmac_stats
|
||||
* The per-GMAC statistics structure.
|
||||
*/
|
||||
struct nss_dp_gmac_stats {
|
||||
struct nss_dp_hal_gmac_stats stats;
|
||||
};
|
||||
|
||||
/**
|
||||
* nss_dp_data_plane_ops
|
||||
* Per data-plane ops structure.
|
||||
*
|
||||
* Default would be slowpath and can be overridden by nss-drv
|
||||
*/
|
||||
struct nss_dp_data_plane_ops {
|
||||
int (*init)(struct nss_dp_data_plane_ctx *dpc);
|
||||
int (*open)(struct nss_dp_data_plane_ctx *dpc, uint32_t tx_desc_ring,
|
||||
uint32_t rx_desc_ring, uint32_t mode);
|
||||
int (*close)(struct nss_dp_data_plane_ctx *dpc);
|
||||
int (*link_state)(struct nss_dp_data_plane_ctx *dpc,
|
||||
uint32_t link_state);
|
||||
int (*mac_addr)(struct nss_dp_data_plane_ctx *dpc, uint8_t *addr);
|
||||
int (*change_mtu)(struct nss_dp_data_plane_ctx *dpc, uint32_t mtu);
|
||||
netdev_tx_t (*xmit)(struct nss_dp_data_plane_ctx *dpc, struct sk_buff *os_buf);
|
||||
void (*set_features)(struct nss_dp_data_plane_ctx *dpc);
|
||||
int (*pause_on_off)(struct nss_dp_data_plane_ctx *dpc,
|
||||
uint32_t pause_on);
|
||||
int (*vsi_assign)(struct nss_dp_data_plane_ctx *dpc, uint32_t vsi);
|
||||
int (*vsi_unassign)(struct nss_dp_data_plane_ctx *dpc, uint32_t vsi);
|
||||
int (*rx_flow_steer)(struct nss_dp_data_plane_ctx *dpc, struct sk_buff *skb,
|
||||
uint32_t cpu, bool is_add);
|
||||
void (*get_stats)(struct nss_dp_data_plane_ctx *dpc, struct nss_dp_gmac_stats *stats);
|
||||
int (*deinit)(struct nss_dp_data_plane_ctx *dpc);
|
||||
};
|
||||
|
||||
/**
|
||||
* nss_dp_receive
|
||||
* Called by overlay drivers to deliver packets to nss-dp.
|
||||
*
|
||||
* @datatypes
|
||||
* net_device
|
||||
* sk_buff
|
||||
* napi_struct
|
||||
*
|
||||
* @param[in] netdev Pointer to netdev structure on which packet is received.
|
||||
* @param[in] skb Pointer to the received packet.
|
||||
* @param[in] napi Pointer to napi context.
|
||||
*/
|
||||
void nss_dp_receive(struct net_device *netdev, struct sk_buff *skb,
|
||||
struct napi_struct *napi);
|
||||
|
||||
/**
|
||||
* nss_dp_is_in_open_state
|
||||
* Returns if a data plane is opened or not.
|
||||
*
|
||||
* @datatypes
|
||||
* net_device
|
||||
*
|
||||
* @param[in] netdev Pointer to netdev structure.
|
||||
*
|
||||
* @return
|
||||
* bool
|
||||
*/
|
||||
bool nss_dp_is_in_open_state(struct net_device *netdev);
|
||||
|
||||
/**
|
||||
* nss_dp_override_data_palne
|
||||
* API to allow overlay drivers to override the data plane.
|
||||
*
|
||||
* @datatypes
|
||||
* net_device
|
||||
* nss_dp_data_plane_ops
|
||||
* nss_dp_data_plane_ctx
|
||||
*
|
||||
* @param[in] netdev Pointer to netdev structure.
|
||||
* @param[in] dp_ops Pointer to respective data plane ops structure.
|
||||
* @param[in] dpc Pointer to data plane context.
|
||||
*
|
||||
* @return
|
||||
* int
|
||||
*/
|
||||
int nss_dp_override_data_plane(struct net_device *netdev,
|
||||
struct nss_dp_data_plane_ops *dp_ops,
|
||||
struct nss_dp_data_plane_ctx *dpc);
|
||||
|
||||
/**
|
||||
* nss_dp_start_data_plane
|
||||
* Dataplane API to inform netdev when it is ready to start.
|
||||
*
|
||||
* @datatypes
|
||||
* net_device
|
||||
* nss_dp_data_plane_ctx
|
||||
*
|
||||
* @param[in] netdev Pointer to netdev structure.
|
||||
* @param[in] dpc Pointer to data plane context.
|
||||
*/
|
||||
void nss_dp_start_data_plane(struct net_device *netdev,
|
||||
struct nss_dp_data_plane_ctx *dpc);
|
||||
|
||||
/**
|
||||
* nss_dp_restore_data_plane
|
||||
* Called by overlay drivers to detach itself from nss-dp.
|
||||
*
|
||||
* @datatypes
|
||||
* net_device
|
||||
*
|
||||
* @param[in] netdev Pointer to netdev structure.
|
||||
*/
|
||||
void nss_dp_restore_data_plane(struct net_device *netdev);
|
||||
|
||||
/**
|
||||
* nss_dp_get_netdev_by_nss_if_num
|
||||
* Returns the net device of the corresponding id if it exists.
|
||||
*
|
||||
* @datatypes
|
||||
* int
|
||||
*
|
||||
* @param[in] interface ID of the physical mac port.
|
||||
*
|
||||
* @return
|
||||
* Pointer to netdev structure.
|
||||
*/
|
||||
struct net_device *nss_dp_get_netdev_by_nss_if_num(int if_num);
|
||||
|
||||
/**
|
||||
* nss_phy_tstamp_rx_buf
|
||||
* Receive timestamp packet.
|
||||
*
|
||||
* @datatypes
|
||||
* sk_buff
|
||||
*
|
||||
* @param[in] app_data Pointer to the application context of the message.
|
||||
* @param[in] skb Pointer to the packet.
|
||||
*/
|
||||
void nss_phy_tstamp_rx_buf(void *app_data, struct sk_buff *skb);
|
||||
|
||||
/**
|
||||
* nss_phy_tstamp_tx_buf
|
||||
* Transmit timestamp packet
|
||||
*
|
||||
* @datatypes
|
||||
* net_device
|
||||
* sk_buff
|
||||
*
|
||||
* @param[in] net_device Pointer to netdev structure.
|
||||
* @param[in] skb Pointer to the packet.
|
||||
*/
|
||||
void nss_phy_tstamp_tx_buf(struct net_device *ndev, struct sk_buff *skb);
|
||||
|
||||
/**
|
||||
*@}
|
||||
*/
|
||||
|
||||
#endif /** __NSS_DP_API_IF_H */
|
||||
148
feeds/ipq807x/qca-nss-dp/src/hal/arch/ipq50xx/nss_ipq50xx.c
Normal file
148
feeds/ipq807x/qca-nss-dp/src/hal/arch/ipq50xx/nss_ipq50xx.c
Normal file
@@ -0,0 +1,148 @@
|
||||
/*
|
||||
* Copyright (c) 2020, 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/of.h>
|
||||
#include <linux/clk.h>
|
||||
#include <linux/ioport.h>
|
||||
#include <linux/qcom_scm.h>
|
||||
#include "nss_dp_hal.h"
|
||||
|
||||
/*
|
||||
* nss_dp_hal_tcsr_base_get
|
||||
* Reads TCSR base address from DTS
|
||||
*/
|
||||
static uint32_t nss_dp_hal_tcsr_base_get(void)
|
||||
{
|
||||
uint32_t tcsr_base_addr = 0;
|
||||
struct device_node *dp_cmn;
|
||||
|
||||
/*
|
||||
* Get reference to NSS dp common device node
|
||||
*/
|
||||
dp_cmn = of_find_node_by_name(NULL, "nss-dp-common");
|
||||
if (!dp_cmn) {
|
||||
pr_info("%s: NSS DP common node not found\n", __func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (of_property_read_u32(dp_cmn, "qcom,tcsr-base", &tcsr_base_addr)) {
|
||||
pr_err("%s: error reading TCSR base\n", __func__);
|
||||
}
|
||||
of_node_put(dp_cmn);
|
||||
|
||||
return tcsr_base_addr;
|
||||
}
|
||||
|
||||
/*
|
||||
* nss_dp_hal_tcsr_set
|
||||
* Sets the TCSR axi cache override register
|
||||
*/
|
||||
static void nss_dp_hal_tcsr_set(void)
|
||||
{
|
||||
void __iomem *tcsr_addr = NULL;
|
||||
uint32_t tcsr_base;
|
||||
int err;
|
||||
|
||||
tcsr_base = nss_dp_hal_tcsr_base_get();
|
||||
if (!tcsr_base) {
|
||||
pr_err("%s: Unable to get TCSR base address\n", __func__);
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* Check if Trust Zone is enabled in the system.
|
||||
* If yes, we need to go through SCM API call to program TCSR register.
|
||||
* If TZ is not enabled, we can write to the register directly.
|
||||
*/
|
||||
if (qcom_scm_is_available()) {
|
||||
err = qcom_scm_tcsr_reg_write((tcsr_base + TCSR_GMAC_AXI_CACHE_OVERRIDE_OFFSET),
|
||||
TCSR_GMAC_AXI_CACHE_OVERRIDE_VALUE);
|
||||
if (err) {
|
||||
pr_err("%s: SCM TCSR write error: %d\n", __func__, err);
|
||||
}
|
||||
} else {
|
||||
tcsr_addr = ioremap_nocache((tcsr_base + TCSR_GMAC_AXI_CACHE_OVERRIDE_OFFSET),
|
||||
TCSR_GMAC_AXI_CACHE_OVERRIDE_REG_SIZE);
|
||||
if (!tcsr_addr) {
|
||||
pr_err("%s: ioremap failed\n", __func__);
|
||||
return;
|
||||
}
|
||||
writel(TCSR_GMAC_AXI_CACHE_OVERRIDE_VALUE, tcsr_addr);
|
||||
iounmap(tcsr_addr);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* nss_dp_hal_get_data_plane_ops
|
||||
* Return the data plane ops for GMAC data plane.
|
||||
*/
|
||||
struct nss_dp_data_plane_ops *nss_dp_hal_get_data_plane_ops(void)
|
||||
{
|
||||
return &nss_dp_gmac_ops;
|
||||
}
|
||||
|
||||
/*
|
||||
* nss_dp_hal_clk_enable
|
||||
* Function to enable GCC_SNOC_GMAC_AXI_CLK.
|
||||
*
|
||||
* These clocks are required for GMAC operations.
|
||||
*/
|
||||
void nss_dp_hal_clk_enable(struct nss_dp_dev *dp_priv)
|
||||
{
|
||||
struct platform_device *pdev = dp_priv->pdev;
|
||||
struct device *dev = &pdev->dev;
|
||||
struct clk *gmac_clk = NULL;
|
||||
int err;
|
||||
|
||||
gmac_clk = devm_clk_get(dev, NSS_SNOC_GMAC_AXI_CLK);
|
||||
if (IS_ERR(gmac_clk)) {
|
||||
pr_err("%s: cannot get clock: %s\n", __func__,
|
||||
NSS_SNOC_GMAC_AXI_CLK);
|
||||
return;
|
||||
}
|
||||
|
||||
err = clk_prepare_enable(gmac_clk);
|
||||
if (err) {
|
||||
pr_err("%s: cannot enable clock: %s, err: %d\n", __func__,
|
||||
NSS_SNOC_GMAC_AXI_CLK, err);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* nss_dp_hal_init
|
||||
* Sets the gmac ops based on the GMAC type.
|
||||
*/
|
||||
bool nss_dp_hal_init(void)
|
||||
{
|
||||
nss_dp_hal_set_gmac_ops(&syn_hal_ops, GMAC_HAL_TYPE_SYN_GMAC);
|
||||
|
||||
/*
|
||||
* Program the global GMAC AXI Cache override register
|
||||
* for optimized AXI DMA operation.
|
||||
*/
|
||||
nss_dp_hal_tcsr_set();
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
* nss_dp_hal_cleanup
|
||||
* Sets the gmac ops to NULL.
|
||||
*/
|
||||
void nss_dp_hal_cleanup(void)
|
||||
{
|
||||
nss_dp_hal_set_gmac_ops(NULL, GMAC_HAL_TYPE_SYN_GMAC);
|
||||
}
|
||||
130
feeds/ipq807x/qca-nss-dp/src/hal/arch/ipq50xx/nss_ipq50xx.h
Normal file
130
feeds/ipq807x/qca-nss-dp/src/hal/arch/ipq50xx/nss_ipq50xx.h
Normal file
@@ -0,0 +1,130 @@
|
||||
/*
|
||||
* Copyright (c) 2020, 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.
|
||||
*/
|
||||
|
||||
#ifndef __NSS_DP_ARCH_H__
|
||||
#define __NSS_DP_ARCH_H__
|
||||
|
||||
#define NSS_DP_HAL_MAX_PORTS 2
|
||||
#define NSS_DP_HAL_CPU_NUM 2
|
||||
#define NSS_DP_HAL_START_IFNUM 0
|
||||
#define NSS_DP_GMAC_NORMAL_FRAME_MTU 1500
|
||||
#define NSS_DP_GMAC_MINI_JUMBO_FRAME_MTU 1978
|
||||
#define NSS_DP_GMAC_FULL_JUMBO_FRAME_MTU 9000
|
||||
#define NSS_DP_HAL_MAX_MTU_SIZE NSS_DP_GMAC_FULL_JUMBO_FRAME_MTU
|
||||
#define NSS_DP_HAL_MAX_PACKET_LEN 65535
|
||||
|
||||
/*
|
||||
* TCSR_GMAC_AXI_CACHE_OVERRIDE register size
|
||||
*/
|
||||
#define TCSR_GMAC_AXI_CACHE_OVERRIDE_REG_SIZE 4
|
||||
|
||||
/*
|
||||
* TCSR_GMAC_AXI_CACHE_OVERRIDE Register offset
|
||||
*/
|
||||
#define TCSR_GMAC_AXI_CACHE_OVERRIDE_OFFSET 0x6224
|
||||
|
||||
/*
|
||||
* Value for TCSR_GMAC_AXI_CACHE_OVERRIDE register
|
||||
*/
|
||||
#define TCSR_GMAC_AXI_CACHE_OVERRIDE_VALUE 0x05050505
|
||||
|
||||
/*
|
||||
* GCC_SNOC_GMAC_AXI_CLOCK
|
||||
*/
|
||||
#define NSS_SNOC_GMAC_AXI_CLK "nss-snoc-gmac-axi-clk"
|
||||
|
||||
/**
|
||||
* nss_dp_hal_gmac_stats
|
||||
* The per-GMAC statistics structure.
|
||||
*/
|
||||
struct nss_dp_hal_gmac_stats {
|
||||
uint64_t rx_bytes; /**< Number of RX bytes */
|
||||
uint64_t rx_packets; /**< Number of RX packets */
|
||||
uint64_t rx_errors; /**< Number of RX errors */
|
||||
uint64_t rx_receive_errors; /**< Number of RX receive errors */
|
||||
uint64_t rx_descriptor_errors; /**< Number of RX descriptor errors */
|
||||
uint64_t rx_late_collision_errors;
|
||||
/**< Number of RX late collision errors */
|
||||
uint64_t rx_dribble_bit_errors; /**< Number of RX dribble bit errors */
|
||||
uint64_t rx_length_errors; /**< Number of RX length errors */
|
||||
uint64_t rx_ip_header_errors; /**< Number of RX IP header errors read from rxdec */
|
||||
uint64_t rx_ip_payload_errors; /**< Number of RX IP payload errors */
|
||||
uint64_t rx_no_buffer_errors; /**< Number of RX no-buffer errors */
|
||||
uint64_t rx_transport_csum_bypassed;
|
||||
/**< Number of RX packets where the transport checksum was bypassed */
|
||||
uint64_t tx_bytes; /**< Number of TX bytes */
|
||||
uint64_t tx_packets; /**< Number of TX packets */
|
||||
uint64_t tx_collisions; /**< Number of TX collisions */
|
||||
uint64_t tx_errors; /**< Number of TX errors */
|
||||
uint64_t tx_jabber_timeout_errors;
|
||||
/**< Number of TX jabber timeout errors */
|
||||
uint64_t tx_frame_flushed_errors;
|
||||
/**< Number of TX frame flushed errors */
|
||||
uint64_t tx_loss_of_carrier_errors;
|
||||
/**< Number of TX loss of carrier errors */
|
||||
uint64_t tx_no_carrier_errors; /**< Number of TX no carrier errors */
|
||||
uint64_t tx_late_collision_errors;
|
||||
/**< Number of TX late collision errors */
|
||||
uint64_t tx_excessive_collision_errors;
|
||||
/**< Number of TX excessive collision errors */
|
||||
uint64_t tx_excessive_deferral_errors;
|
||||
/**< Number of TX excessive deferral errors */
|
||||
uint64_t tx_underflow_errors; /**< Number of TX underflow errors */
|
||||
uint64_t tx_ip_header_errors; /**< Number of TX IP header errors */
|
||||
uint64_t tx_ip_payload_errors; /**< Number of TX IP payload errors */
|
||||
uint64_t tx_dropped; /**< Number of TX dropped packets */
|
||||
uint64_t hw_errs[10]; /**< GMAC DMA error counters */
|
||||
uint64_t rx_missed; /**< Number of RX packets missed by the DMA */
|
||||
uint64_t fifo_overflows; /**< Number of RX FIFO overflows signalled by the DMA */
|
||||
uint64_t rx_scatter_errors; /**< Number of scattered frames received by the DMA */
|
||||
uint64_t tx_ts_create_errors; /**< Number of tx timestamp creation errors */
|
||||
uint64_t gmac_total_ticks; /**< Total clock ticks spend inside the GMAC */
|
||||
uint64_t gmac_worst_case_ticks; /**< Worst case iteration of the GMAC in ticks */
|
||||
uint64_t gmac_iterations; /**< Number of iterations around the GMAC */
|
||||
uint64_t tx_pause_frames; /**< Number of pause frames sent by the GMAC */
|
||||
uint64_t mmc_rx_overflow_errors;
|
||||
/**< Number of RX overflow errors */
|
||||
uint64_t mmc_rx_watchdog_timeout_errors;
|
||||
/**< Number of RX watchdog timeout errors */
|
||||
uint64_t mmc_rx_crc_errors; /**< Number of RX CRC errors */
|
||||
uint64_t mmc_rx_ip_header_errors;
|
||||
/**< Number of RX IP header errors read from MMC counter*/
|
||||
uint64_t mmc_rx_octets_g;
|
||||
/**< Number of good octets received */
|
||||
uint64_t mmc_rx_ucast_frames; /**< Number of Unicast frames received */
|
||||
uint64_t mmc_rx_bcast_frames; /**< Number of Bcast frames received */
|
||||
uint64_t mmc_rx_mcast_frames; /**< Number of Mcast frames received */
|
||||
uint64_t mmc_rx_undersize;
|
||||
/**< Number of RX undersize frames */
|
||||
uint64_t mmc_rx_oversize;
|
||||
/**< Number of RX oversize frames */
|
||||
uint64_t mmc_rx_jabber; /**< Number of jabber frames */
|
||||
uint64_t mmc_rx_octets_gb;
|
||||
/**< Number of good/bad octets */
|
||||
uint64_t mmc_rx_frag_frames_g; /**< Number of good ipv4 frag frames */
|
||||
uint64_t mmc_tx_octets_g; /**< Number of good octets sent */
|
||||
uint64_t mmc_tx_ucast_frames; /**< Number of Unicast frames sent*/
|
||||
uint64_t mmc_tx_bcast_frames; /**< Number of Broadcast frames sent */
|
||||
uint64_t mmc_tx_mcast_frames; /**< Number of Multicast frames sent */
|
||||
uint64_t mmc_tx_deferred; /**< Number of Deferred frames sent */
|
||||
uint64_t mmc_tx_single_col; /**< Number of single collisions */
|
||||
uint64_t mmc_tx_multiple_col; /**< Number of multiple collisions */
|
||||
uint64_t mmc_tx_octets_gb; /**< Number of good/bad octets sent*/
|
||||
};
|
||||
|
||||
extern struct nss_dp_data_plane_ops nss_dp_gmac_ops;
|
||||
|
||||
#endif /* __NSS_DP_ARCH_H__ */
|
||||
53
feeds/ipq807x/qca-nss-dp/src/hal/arch/ipq60xx/nss_ipq60xx.c
Normal file
53
feeds/ipq807x/qca-nss-dp/src/hal/arch/ipq60xx/nss_ipq60xx.c
Normal file
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* Copyright (c) 2020, 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 "nss_dp_hal.h"
|
||||
#include "edma.h"
|
||||
|
||||
/*
|
||||
* nss_dp_hal_get_data_plane_ops()
|
||||
* Return the data plane ops for edma data plane.
|
||||
*/
|
||||
struct nss_dp_data_plane_ops *nss_dp_hal_get_data_plane_ops(void)
|
||||
{
|
||||
return &nss_dp_edma_ops;
|
||||
}
|
||||
|
||||
/*
|
||||
* nss_dp_hal_init()
|
||||
* Initialize EDMA and set gmac ops.
|
||||
*/
|
||||
bool nss_dp_hal_init(void)
|
||||
{
|
||||
nss_dp_hal_set_gmac_ops(&qcom_hal_ops, GMAC_HAL_TYPE_QCOM);
|
||||
nss_dp_hal_set_gmac_ops(&syn_hal_ops, GMAC_HAL_TYPE_SYN_XGMAC);
|
||||
|
||||
if (edma_init()) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
* nss_dp_hal_cleanup()
|
||||
* Cleanup EDMA and set gmac ops to NULL.
|
||||
*/
|
||||
void nss_dp_hal_cleanup(void)
|
||||
{
|
||||
nss_dp_hal_set_gmac_ops(NULL, GMAC_HAL_TYPE_QCOM);
|
||||
nss_dp_hal_set_gmac_ops(NULL, GMAC_HAL_TYPE_SYN_XGMAC);
|
||||
edma_cleanup(false);
|
||||
}
|
||||
34
feeds/ipq807x/qca-nss-dp/src/hal/arch/ipq60xx/nss_ipq60xx.h
Normal file
34
feeds/ipq807x/qca-nss-dp/src/hal/arch/ipq60xx/nss_ipq60xx.h
Normal file
@@ -0,0 +1,34 @@
|
||||
/*
|
||||
* Copyright (c) 2020, 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.
|
||||
*/
|
||||
|
||||
#ifndef __NSS_DP_ARCH_H__
|
||||
#define __NSS_DP_ARCH_H__
|
||||
|
||||
#define NSS_DP_HAL_MAX_PORTS 5
|
||||
#define NSS_DP_HAL_CPU_NUM 4
|
||||
#define NSS_DP_HAL_START_IFNUM 1
|
||||
#define NSS_DP_HAL_MAX_MTU_SIZE 9216
|
||||
#define NSS_DP_HAL_MAX_PACKET_LEN 65535
|
||||
#define NSS_DP_PREHEADER_SIZE 32
|
||||
|
||||
/**
|
||||
* nss_dp_hal_gmac_stats
|
||||
* The per-GMAC statistics structure.
|
||||
*/
|
||||
struct nss_dp_hal_gmac_stats {
|
||||
};
|
||||
|
||||
#endif /* __NSS_DP_ARCH_H__ */
|
||||
53
feeds/ipq807x/qca-nss-dp/src/hal/arch/ipq807x/nss_ipq807x.c
Normal file
53
feeds/ipq807x/qca-nss-dp/src/hal/arch/ipq807x/nss_ipq807x.c
Normal file
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* Copyright (c) 2020, 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 "nss_dp_hal.h"
|
||||
#include "edma.h"
|
||||
|
||||
/*
|
||||
* nss_dp_hal_get_data_plane_ops()
|
||||
* Return the data plane ops for edma data plane.
|
||||
*/
|
||||
struct nss_dp_data_plane_ops *nss_dp_hal_get_data_plane_ops(void)
|
||||
{
|
||||
return &nss_dp_edma_ops;
|
||||
}
|
||||
|
||||
/*
|
||||
* nss_dp_hal_init()
|
||||
* Initialize EDMA and set gmac ops.
|
||||
*/
|
||||
bool nss_dp_hal_init(void)
|
||||
{
|
||||
nss_dp_hal_set_gmac_ops(&qcom_hal_ops, GMAC_HAL_TYPE_QCOM);
|
||||
nss_dp_hal_set_gmac_ops(&syn_hal_ops, GMAC_HAL_TYPE_SYN_XGMAC);
|
||||
|
||||
if (edma_init()) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
* nss_dp_hal_cleanup()
|
||||
* Cleanup EDMA and set gmac ops to NULL.
|
||||
*/
|
||||
void nss_dp_hal_cleanup(void)
|
||||
{
|
||||
nss_dp_hal_set_gmac_ops(NULL, GMAC_HAL_TYPE_QCOM);
|
||||
nss_dp_hal_set_gmac_ops(NULL, GMAC_HAL_TYPE_SYN_XGMAC);
|
||||
edma_cleanup(false);
|
||||
}
|
||||
34
feeds/ipq807x/qca-nss-dp/src/hal/arch/ipq807x/nss_ipq807x.h
Normal file
34
feeds/ipq807x/qca-nss-dp/src/hal/arch/ipq807x/nss_ipq807x.h
Normal file
@@ -0,0 +1,34 @@
|
||||
/*
|
||||
* Copyright (c) 2020, 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.
|
||||
*/
|
||||
|
||||
#ifndef __NSS_DP_ARCH_H__
|
||||
#define __NSS_DP_ARCH_H__
|
||||
|
||||
#define NSS_DP_HAL_MAX_PORTS 6
|
||||
#define NSS_DP_HAL_CPU_NUM 4
|
||||
#define NSS_DP_HAL_START_IFNUM 1
|
||||
#define NSS_DP_HAL_MAX_MTU_SIZE 9216
|
||||
#define NSS_DP_HAL_MAX_PACKET_LEN 65535
|
||||
#define NSS_DP_PREHEADER_SIZE 32
|
||||
|
||||
/**
|
||||
* nss_dp_hal_gmac_stats
|
||||
* The per-GMAC statistics structure.
|
||||
*/
|
||||
struct nss_dp_hal_gmac_stats {
|
||||
};
|
||||
|
||||
#endif /* __NSS_DP_ARCH_H__ */
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user