diff --git a/.github/labeler.yml b/.github/labeler.yml deleted file mode 100644 index 0910d37bd5..0000000000 --- a/.github/labeler.yml +++ /dev/null @@ -1,103 +0,0 @@ -# target/* -"target/airoha": - - "target/linux/airoha/**" -"target/apm821xx": - - "target/linux/apm821xx/**" -"target/archs38": - - "target/linux/archs38/**" -"target/armvirt": - - "target/linux/armvirt/**" -"target/at91": - - "target/linux/at91/**" -"target/ath25": - - "target/linux/ath25/**" -"target/ath79": - - "target/linux/ath79/**" -"target/bcm27xx": - - "target/linux/bcm27xx/**" -"target/bcm47xx": - - "target/linux/bcm47xx/**" -"target/bcm4908": - - "target/linux/bcm4908/**" -"target/bcm53xx": - - "target/linux/bcm53xx/**" -"target/bcm63xx": - - "target/linux/bcm63xx/**" -"target/bmips": - - "target/linux/bmips/**" -"target/gemini": - - "target/linux/gemini/**" -"target/imx": - - "target/linux/imx/**" -"target/ipq40xx": - - "target/linux/ipq40xx/**" -"target/ipq806x": - - "target/linux/ipq806x/**" -"target/kirkwood": - - "target/linux/kirkwood/**" -"target/lantiq": - - "target/linux/lantiq/**" -"target/layerscape": - - "target/linux/layerscape/**" -"target/malta": - - "target/linux/malta/**" -"target/mediatek": - - "target/linux/mediatek/**" -"target/mpc85xx": - - "target/linux/mpc85xx/**" -"target/mvebu": - - "target/linux/mvebu/**" -"target/mxs": - - "target/linux/mxs/**" -"target/octeon": - - "target/linux/octeon/**" -"target/octeontx": - - "target/linux/octeontx/**" -"target/omap": - - "target/linux/omap/**" -"target/oxnas": - - "target/linux/oxnas/**" -"target/pistachio": - - "target/linux/pistachio/**" -"target/qoriq": - - "target/linux/qoriq/**" -"target/ramips": - - "target/linux/ramips/**" -"target/realtek": - - "target/linux/realtek/**" -"target/rockchip": - - "target/linux/rockchip/**" -"target/sunxi": - - "target/linux/sunxi/**" -"target/tegra": - - "target/linux/tegra/**" -"target/uml": - - "target/linux/uml/**" -"target/x86": - - "target/linux/x86/**" -"target/zynq": - - "target/linux/zynq/**" -# target/imagebuilder -"target/imagebuilder": - - "target/imagebuilder/**" -# kernel -"kernel": - - "target/linux/generic/**" - - "target/linux/**/config-*" - - "target/linux/**/patches-*" - - "target/linux/**/files/**" - - "package/kernel/linux/**" -# core packages -"core packages": - - "package/**" -# build/scripts/tools -"build/scripts/tools": - - "include/**" - - "scripts/**" - - "tools/**" -# toolchain -"toolchain": - - "toolchain/**" -# GitHub/CI -"GitHub/CI": - - ".github/**" diff --git a/.github/pull_request_template b/.github/pull_request_template deleted file mode 100644 index a2d6bd185f..0000000000 --- a/.github/pull_request_template +++ /dev/null @@ -1,8 +0,0 @@ -Thanks for your contribution to OpenWrt! - -To help keep the codebase consistent and readable, -and to help people review your contribution, -we ask you to follow the rules you find in the wiki at this link -https://openwrt.org/submitting-patches - -Please remove this message before posting the pull request. diff --git a/.github/workflows/Dockerfile.tools b/.github/workflows/Dockerfile.tools deleted file mode 100644 index c2ae7dc896..0000000000 --- a/.github/workflows/Dockerfile.tools +++ /dev/null @@ -1,3 +0,0 @@ -FROM registry.gitlab.com/openwrt/buildbot/buildworker-3.4.1 - -COPY --chown=buildbot:buildbot tools.tar /tools.tar diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index ce8f30dd18..0000000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,361 +0,0 @@ -name: Build sub target - -on: - workflow_call: - inputs: - target: - required: true - type: string - testing: - type: boolean - build_toolchain: - type: boolean - include_feeds: - type: boolean - build_full: - type: boolean - build_all_modules: - type: boolean - build_all_kmods: - type: boolean - build_all_boards: - type: boolean - -permissions: - contents: read - -jobs: - setup_build: - name: Setup build - runs-on: ubuntu-latest - outputs: - owner_lc: ${{ steps.lower_owner.outputs.owner_lc }} - ccache_hash: ${{ steps.ccache_hash.outputs.ccache_hash }} - container_tag: ${{ steps.determine_tools_container.outputs.container_tag }} - - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Set lower case owner name - id: lower_owner - run: | - OWNER_LC=$(echo "${{ github.repository_owner }}" \ - | tr '[:upper:]' '[:lower:]') - echo "owner_lc=$OWNER_LC" >> $GITHUB_OUTPUT - - - name: Generate ccache hash - id: ccache_hash - run: | - CCACHE_HASH=$(md5sum include/kernel-* | awk '{ print $1 }' \ - | md5sum | awk '{ print $1 }') - echo "ccache_hash=$CCACHE_HASH" >> $GITHUB_OUTPUT - - # Per branch tools container tag - # By default stick to latest - # For official test targetting openwrt stable branch - # Get the branch or parse the tag and push dedicated tools containers - # For local test to use the correct container for stable release testing - # you need to use for the branch name a prefix of openwrt-[0-9][0-9].[0-9][0-9]- - - name: Determine tools container tag - id: determine_tools_container - run: | - CONTAINER_TAG=latest - if [ -n "${{ github.base_ref }}" ]; then - if echo "${{ github.base_ref }}" | grep -q -E '^openwrt-[0-9][0-9]\.[0-9][0-9]$'; then - CONTAINER_TAG="${{ github.base_ref }}" - fi - elif [ ${{ github.ref_type }} == "branch" ]; then - if echo "${{ github.ref_name }}" | grep -q -E '^openwrt-[0-9][0-9]\.[0-9][0-9]$'; then - CONTAINER_TAG=${{ github.ref_name }} - elif echo "${{ github.ref_name }}" | grep -q -E '^openwrt-[0-9][0-9]\.[0-9][0-9]-'; then - CONTAINER_TAG="$(echo ${{ github.ref_name }} | sed 's/^\(openwrt-[0-9][0-9]\.[0-9][0-9]\)-.*/\1/')" - fi - elif [ ${{ github.ref_type }} == "tag" ]; then - if echo "${{ github.ref_name }}" | grep -q -E '^v[0-9][0-9]\.[0-9][0-9]\..+'; then - CONTAINER_TAG=openwrt-"$(echo ${{ github.ref_name }} | sed 's/^v\([0-9][0-9]\.[0-9][0-9]\)\..\+/\1/')" - fi - fi - echo "Tools container to use tools:$CONTAINER_TAG" - echo "container_tag=$CONTAINER_TAG" >> $GITHUB_OUTPUT - - build: - name: Build with external toolchain - needs: setup_build - runs-on: ubuntu-latest - - container: ghcr.io/${{ needs.setup_build.outputs.owner_lc }}/tools:${{ needs.setup_build.outputs.container_tag }} - - permissions: - contents: read - packages: read - - steps: - - name: Checkout master directory - uses: actions/checkout@v3 - with: - path: openwrt - - - name: Checkout packages feed - if: inputs.include_feeds == true - uses: actions/checkout@v3 - with: - repository: openwrt/packages - path: openwrt/feeds/packages - - - name: Checkout luci feed - if: inputs.include_feeds == true - uses: actions/checkout@v3 - with: - repository: openwrt/luci - path: openwrt/feeds/luci - - - name: Checkout routing feed - if: inputs.include_feeds == true - uses: actions/checkout@v3 - with: - repository: openwrt/routing - path: openwrt/feeds/routing - - - name: Checkout telephony feed - if: inputs.include_feeds == true - uses: actions/checkout@v3 - with: - repository: openwrt/telephony - path: openwrt/feeds/telephony - - - name: Fix permission - run: | - chown -R buildbot:buildbot openwrt - - - name: Initialization environment - run: | - TARGET=$(echo ${{ inputs.target }} | cut -d "/" -f 1) - SUBTARGET=$(echo ${{ inputs.target }} | cut -d "/" -f 2) - echo "TARGET=$TARGET" >> "$GITHUB_ENV" - echo "SUBTARGET=$SUBTARGET" >> "$GITHUB_ENV" - - - name: Update & Install feeds - if: inputs.include_feeds == true - shell: su buildbot -c "sh -e {0}" - working-directory: openwrt - run: | - ./scripts/feeds update -a - ./scripts/feeds install -a - - - name: Parse toolchain file - if: inputs.build_toolchain == false - id: parse-toolchain - working-directory: openwrt - run: | - TOOLCHAIN_PATH=snapshots - - if [ -n "${{ github.base_ref }}" ]; then - if echo "${{ github.base_ref }}" | grep -q -E '^openwrt-[0-9][0-9]\.[0-9][0-9]$'; then - major_ver="$(echo ${{ github.base_ref }} | sed 's/^openwrt-/v/')" - fi - elif [ "${{ github.ref_type }}" = "branch" ]; then - if echo "${{ github.ref_name }}" | grep -q -E '^openwrt-[0-9][0-9]\.[0-9][0-9]$'; then - major_ver="$(echo ${{ github.ref_name }} | sed 's/^openwrt-/v/')" - elif echo "${{ github.ref_name }}" | grep -q -E '^openwrt-[0-9][0-9]\.[0-9][0-9]-'; then - major_ver="$(echo ${{ github.ref_name }} | sed 's/^openwrt-\([0-9][0-9]\.[0-9][0-9]\)-.*/v\1/')" - fi - elif [ "${{ github.ref_type }}" = "tag" ]; then - if echo "${{ github.ref_name }}" | grep -q -E '^v[0-9][0-9]\.[0-9][0-9]\..+'; then - major_ver="$(echo ${{ github.ref_name }} | sed 's/^\(v[0-9][0-9]\.[0-9][0-9]\)\..\+/\1/')" - fi - fi - - if [ -n "$major_ver" ]; then - git fetch --tags -f - latest_tag="$(git tag --sort=-creatordate -l $major_ver* | head -n1)" - if [ -n "$latest_tag" ]; then - TOOLCHAIN_PATH=releases/$(echo $latest_tag | sed 's/^v//') - fi - fi - - SUMS_FILE="https://downloads.cdn.openwrt.org/$TOOLCHAIN_PATH/targets/${{ env.TARGET }}/${{ env.SUBTARGET }}/sha256sums" - if curl $SUMS_FILE | grep -q ".*openwrt-toolchain.*tar.xz"; then - TOOLCHAIN_STRING="$( curl $SUMS_FILE | grep ".*openwrt-toolchain.*tar.xz")" - TOOLCHAIN_FILE=$(echo "$TOOLCHAIN_STRING" | sed -n -e 's/.*\(openwrt-toolchain.*\).tar.xz/\1/p') - TOOLCHAIN_SHA256=$(echo "$TOOLCHAIN_STRING" | cut -d ' ' -f 1) - - echo "toolchain-type=external_toolchain" >> $GITHUB_OUTPUT - elif curl $SUMS_FILE | grep -q ".*openwrt-sdk.*tar.xz"; then - TOOLCHAIN_STRING="$( curl $SUMS_FILE | grep ".*openwrt-sdk.*tar.xz")" - TOOLCHAIN_FILE=$(echo "$TOOLCHAIN_STRING" | sed -n -e 's/.*\(openwrt-sdk.*\).tar.xz/\1/p') - TOOLCHAIN_SHA256=$(echo "$TOOLCHAIN_STRING" | cut -d ' ' -f 1) - - echo "toolchain-type=external_sdk" >> $GITHUB_OUTPUT - fi - - echo "TOOLCHAIN_FILE=$TOOLCHAIN_FILE" >> "$GITHUB_ENV" - echo "TOOLCHAIN_SHA256=$TOOLCHAIN_SHA256" >> "$GITHUB_ENV" - echo "TOOLCHAIN_PATH=$TOOLCHAIN_PATH" >> "$GITHUB_ENV" - - - name: Cache external toolchain/sdk - if: inputs.build_toolchain == false - id: cache-external-toolchain - uses: actions/cache@v3 - with: - path: openwrt/${{ env.TOOLCHAIN_FILE }} - key: ${{ env.TOOLCHAIN_FILE }}-${{ steps.parse-toolchain.outputs.toolchain-type }}-${{ env.TOOLCHAIN_SHA256 }} - - - name: Cache ccache - uses: actions/cache@v3 - with: - path: openwrt/.ccache - key: ccache-kernel-${{ env.TARGET }}/${{ env.SUBTARGET }}-${{ needs.setup_build.outputs.ccache_hash }} - restore-keys: | - ccache-kernel-${{ env.TARGET }}/${{ env.SUBTARGET }}- - - - name: Download external toolchain/sdk - if: inputs.build_toolchain == false && steps.cache-external-toolchain.outputs.cache-hit != 'true' - shell: su buildbot -c "sh -e {0}" - working-directory: openwrt - run: | - wget -O - https://downloads.cdn.openwrt.org/${{ env.TOOLCHAIN_PATH }}/targets/${{ env.TARGET }}/${{ env.SUBTARGET }}/${{ env.TOOLCHAIN_FILE }}.tar.xz \ - | tar --xz -xf - - - - name: Extract prebuilt tools - shell: su buildbot -c "sh -e {0}" - working-directory: openwrt - run: ./scripts/ext-tools.sh --tools /tools.tar - - - name: Configure testing kernel - if: inputs.testing == true - shell: su buildbot -c "sh -e {0}" - working-directory: openwrt - run: | - echo CONFIG_TESTING_KERNEL=y >> .config - - - name: Configure all kernel modules - if: inputs.build_all_kmods == true - shell: su buildbot -c "sh -e {0}" - working-directory: openwrt - run: | - echo CONFIG_ALL_KMODS=y >> .config - - - name: Configure all modules - if: inputs.build_all_modules == true - shell: su buildbot -c "sh -e {0}" - working-directory: openwrt - run: | - echo CONFIG_ALL=y >> .config - - - name: Configure all boards - if: inputs.build_all_boards == true - shell: su buildbot -c "sh -e {0}" - working-directory: openwrt - run: | - echo CONFIG_TARGET_MULTI_PROFILE=y >> .config - echo CONFIG_TARGET_PER_DEVICE_ROOTFS=y >> .config - echo CONFIG_TARGET_ALL_PROFILES=y >> .config - - - name: Configure external toolchain - if: inputs.build_toolchain == false && steps.parse-toolchain.outputs.toolchain-type == 'external_toolchain' - shell: su buildbot -c "sh -e {0}" - working-directory: openwrt - run: | - echo CONFIG_DEVEL=y >> .config - echo CONFIG_AUTOREMOVE=y >> .config - echo CONFIG_CCACHE=y >> .config - - ./scripts/ext-toolchain.sh \ - --toolchain ${{ env.TOOLCHAIN_FILE }}/toolchain-* \ - --overwrite-config \ - --config ${{ env.TARGET }}/${{ env.SUBTARGET }} - - - name: Adapt external sdk to external toolchain format - if: inputs.build_toolchain == false && steps.parse-toolchain.outputs.toolchain-type == 'external_sdk' && steps.cache-external-toolchain.outputs.cache-hit != 'true' - shell: su buildbot -c "sh -e {0}" - working-directory: openwrt - run: | - TOOLCHAIN_DIR=${{ env.TOOLCHAIN_FILE }}/staging_dir/$(ls ${{ env.TOOLCHAIN_FILE }}/staging_dir | grep toolchain) - TOOLCHAIN_BIN=$TOOLCHAIN_DIR/bin - OPENWRT_DIR=$(pwd) - - # Find target name from toolchain info.mk - GNU_TARGET_NAME=$(cat $TOOLCHAIN_DIR/info.mk | grep TARGET_CROSS | sed 's/^TARGET_CROSS=\(.*\)-$/\1/') - - cd $TOOLCHAIN_BIN - - # Revert sdk wrapper scripts applied to all the bins - for app in $(find . -name "*.bin"); do - TARGET_APP=$(echo $app | sed 's/\.\/\.\(.*\)\.bin/\1/') - rm $TARGET_APP - mv .$TARGET_APP.bin $TARGET_APP - done - - # Setup the wrapper script in the sdk toolchain dir simulating an external toolchain build - cp $OPENWRT_DIR/target/toolchain/files/wrapper.sh $GNU_TARGET_NAME-wrapper.sh - for app in cc gcc g++ c++ cpp ld as ; do - [ -f $GNU_TARGET_NAME-$app ] && mv $GNU_TARGET_NAME-$app $GNU_TARGET_NAME-$app.bin - ln -sf $GNU_TARGET_NAME-wrapper.sh $GNU_TARGET_NAME-$app - done - - - name: Configure external toolchain with sdk - if: inputs.build_toolchain == false && steps.parse-toolchain.outputs.toolchain-type == 'external_sdk' - shell: su buildbot -c "sh -e {0}" - working-directory: openwrt - run: | - echo CONFIG_DEVEL=y >> .config - echo CONFIG_AUTOREMOVE=y >> .config - echo CONFIG_CCACHE=y >> .config - - ./scripts/ext-toolchain.sh \ - --toolchain ${{ env.TOOLCHAIN_FILE }}/staging_dir/toolchain-* \ - --overwrite-config \ - --config ${{ env.TARGET }}/${{ env.SUBTARGET }} - - - name: Configure internal toolchain - if: inputs.build_toolchain == true - shell: su buildbot -c "sh -e {0}" - working-directory: openwrt - run: | - echo CONFIG_DEVEL=y >> .config - echo CONFIG_AUTOREMOVE=y >> .config - echo CONFIG_CCACHE=y >> .config - - echo "CONFIG_TARGET_${{ env.TARGET }}=y" >> .config - echo "CONFIG_TARGET_${{ env.TARGET }}_${{ env.SUBTARGET }}=y" >> .config - - make defconfig - - - name: Show configuration - shell: su buildbot -c "sh -e {0}" - working-directory: openwrt - run: ./scripts/diffconfig.sh - - - name: Build tools - shell: su buildbot -c "sh -e {0}" - working-directory: openwrt - run: make tools/install -j$(nproc) BUILD_LOG=1 || ret=$? .github/workflows/scripts/show_build_failures.sh - - - name: Build toolchain - shell: su buildbot -c "sh -e {0}" - working-directory: openwrt - run: make toolchain/install -j$(nproc) BUILD_LOG=1 || ret=$? .github/workflows/scripts/show_build_failures.sh - - - name: Build Kernel - shell: su buildbot -c "sh -e {0}" - working-directory: openwrt - run: make target/compile -j$(nproc) BUILD_LOG=1 || ret=$? .github/workflows/scripts/show_build_failures.sh - - - name: Build Kernel Kmods - shell: su buildbot -c "sh -e {0}" - working-directory: openwrt - run: make package/linux/compile -j$(nproc) BUILD_LOG=1 || ret=$? .github/workflows/scripts/show_build_failures.sh - - - name: Build everything - if: inputs.build_full == true - shell: su buildbot -c "sh -e {0}" - working-directory: openwrt - run: make -j$(nproc) BUILD_LOG=1 || ret=$? .github/workflows/scripts/show_build_failures.sh - - - name: Upload logs - if: failure() - uses: actions/upload-artifact@v3 - with: - name: ${{ env.TARGET }}-${{ env.SUBTARGET }}-logs - path: "openwrt/logs" diff --git a/.github/workflows/check-kernel-patches.yml b/.github/workflows/check-kernel-patches.yml deleted file mode 100644 index e5b619064f..0000000000 --- a/.github/workflows/check-kernel-patches.yml +++ /dev/null @@ -1,131 +0,0 @@ -name: Refresh kernel for target - -on: - workflow_call: - inputs: - target: - required: true - type: string - testing: - type: boolean - -permissions: - contents: read - -jobs: - setup_build: - name: Setup build - runs-on: ubuntu-latest - outputs: - owner_lc: ${{ steps.lower_owner.outputs.owner_lc }} - container_tag: ${{ steps.determine_tools_container.outputs.container_tag }} - - steps: - - name: Set lower case owner name - id: lower_owner - run: | - OWNER_LC=$(echo "${{ github.repository_owner }}" \ - | tr '[:upper:]' '[:lower:]') - echo "owner_lc=$OWNER_LC" >> $GITHUB_OUTPUT - - # Per branch tools container tag - # By default stick to latest - # For official test targetting openwrt stable branch - # Get the branch or parse the tag and push dedicated tools containers - # For local test to use the correct container for stable release testing - # you need to use for the branch name a prefix of openwrt-[0-9][0-9].[0-9][0-9]- - - name: Determine tools container tag - id: determine_tools_container - run: | - CONTAINER_TAG=latest - if [ -n "${{ github.base_ref }}" ]; then - if echo "${{ github.base_ref }}" | grep -q -E '^openwrt-[0-9][0-9]\.[0-9][0-9]$'; then - CONTAINER_TAG="${{ github.base_ref }}" - fi - elif [ ${{ github.ref_type }} == "branch" ]; then - if echo "${{ github.ref_name }}" | grep -q -E '^openwrt-[0-9][0-9]\.[0-9][0-9]$'; then - CONTAINER_TAG=${{ github.ref_name }} - elif echo "${{ github.ref_name }}" | grep -q -E '^openwrt-[0-9][0-9]\.[0-9][0-9]-'; then - CONTAINER_TAG="$(echo ${{ github.ref_name }} | sed 's/^\(openwrt-[0-9][0-9]\.[0-9][0-9]\)-.*/\1/')" - fi - elif [ ${{ github.ref_type }} == "tag" ]; then - if echo "${{ github.ref_name }}" | grep -q -E '^v[0-9][0-9]\.[0-9][0-9]\..+'; then - CONTAINER_TAG=openwrt-"$(echo ${{ github.ref_name }} | sed 's/^v\([0-9][0-9]\.[0-9][0-9]\)\..\+/\1/')" - fi - fi - echo "Tools container to use tools:$CONTAINER_TAG" - echo "container_tag=$CONTAINER_TAG" >> $GITHUB_OUTPUT - - check-patch: - name: Check Kernel patches - needs: setup_build - runs-on: ubuntu-latest - - container: ghcr.io/${{ needs.setup_build.outputs.owner_lc }}/tools:${{ needs.setup_build.outputs.container_tag }} - - permissions: - contents: read - packages: read - - steps: - - name: Checkout master directory - uses: actions/checkout@v3 - with: - path: openwrt - - - name: Fix permission - run: | - chown -R buildbot:buildbot openwrt - - - name: Initialization environment - run: | - TARGET=$(echo ${{ inputs.target }} | cut -d "/" -f 1) - SUBTARGET=$(echo ${{ inputs.target }} | cut -d "/" -f 2) - echo "TARGET=$TARGET" >> "$GITHUB_ENV" - echo "SUBTARGET=$SUBTARGET" >> "$GITHUB_ENV" - - - name: Extract prebuilt tools - shell: su buildbot -c "sh -e {0}" - working-directory: openwrt - run: ./scripts/ext-tools.sh --tools /tools.tar - - - name: Configure testing kernel - if: inputs.testing == true - shell: su buildbot -c "sh -e {0}" - working-directory: openwrt - run: | - echo CONFIG_TESTING_KERNEL=y >> .config - - - name: Configure system - shell: su buildbot -c "sh -e {0}" - working-directory: openwrt - run: | - echo CONFIG_ALL_KMODS=y >> .config - echo CONFIG_DEVEL=y >> .config - echo CONFIG_AUTOREMOVE=y >> .config - echo CONFIG_CCACHE=y >> .config - - echo "CONFIG_TARGET_${{ env.TARGET }}=y" >> .config - echo "CONFIG_TARGET_${{ env.TARGET }}_${{ env.SUBTARGET }}=y" >> .config - - make defconfig - - - name: Build tools - shell: su buildbot -c "sh -e {0}" - working-directory: openwrt - run: make tools/quilt/compile -j$(nproc) BUILD_LOG=1 || ret=$? .github/workflows/scripts/show_build_failures.sh - - - name: Refresh Kernel patches - shell: su buildbot -c "sh -e {0}" - working-directory: openwrt - run: | - make target/linux/refresh V=s - - . .github/workflows/scripts/ci_helpers.sh - - if git diff --name-only --exit-code; then - success "Kernel patches for ${{ env.TARGET }}/${{ env.SUBTARGET }} seems ok" - else - err "Kernel patches for ${{ env.TARGET }}/${{ env.SUBTARGET }} require refresh. (run 'make target/linux/refresh' and force push this pr)" - exit 1 - fi diff --git a/.github/workflows/formal.yml b/.github/workflows/formal.yml deleted file mode 100644 index 8083c5832c..0000000000 --- a/.github/workflows/formal.yml +++ /dev/null @@ -1,73 +0,0 @@ -name: Test Formalities - -on: - pull_request: - -permissions: - contents: read - -jobs: - build: - name: Test Formalities - runs-on: ubuntu-latest - strategy: - fail-fast: false - - steps: - - uses: actions/checkout@v3 - with: - ref: ${{ github.event.pull_request.head.sha }} - fetch-depth: 0 - - - name: Determine branch name - run: | - BRANCH="${GITHUB_BASE_REF#refs/heads/}" - echo "Building for $BRANCH" - echo "BRANCH=$BRANCH" >> $GITHUB_ENV - - - name: Test formalities - run: | - source .github/workflows/scripts/ci_helpers.sh - - RET=0 - for commit in $(git rev-list HEAD ^origin/$BRANCH); do - info "=== Checking commit '$commit'" - if git show --format='%P' -s $commit | grep -qF ' '; then - err "Pull request should not include merge commits" - RET=1 - fi - - author="$(git show -s --format=%aN $commit)" - if echo $author | grep -q '\S\+\s\+\S\+'; then - success "Author name ($author) seems ok" - else - err "Author name ($author) need to be your real name 'firstname lastname'" - RET=1 - fi - - subject="$(git show -s --format=%s $commit)" - if echo "$subject" | grep -q -e '^[0-9A-Za-z,+/_\.-]\+: ' -e '^Revert '; then - success "Commit subject line seems ok ($subject)" - else - err "Commit subject line MUST start with ': ' ($subject)" - RET=1 - fi - - body="$(git show -s --format=%b $commit)" - sob="$(git show -s --format='Signed-off-by: %aN <%aE>' $commit)" - if echo "$body" | grep -qF "$sob"; then - success "Signed-off-by match author" - else - err "Signed-off-by is missing or doesn't match author (should be '$sob')" - RET=1 - fi - - if echo "$body" | grep -v "Signed-off-by:"; then - success "A commit message exists" - else - err "Missing commit message. Please describe your changes" - RET=1 - fi - done - - exit $RET diff --git a/.github/workflows/kernel.yml b/.github/workflows/kernel.yml deleted file mode 100644 index 0fd03749f3..0000000000 --- a/.github/workflows/kernel.yml +++ /dev/null @@ -1,85 +0,0 @@ -name: Build Kernel - -on: - pull_request: - paths: - - '.github/workflows/check-kernel-patches.yml' - - '.github/workflows/build.yml' - - '.github/workflows/kernel.yml' - - 'include/kernel*' - - 'package/kernel/**' - - 'target/linux/generic/**' - push: - paths: - - '.github/workflows/check-kernel-patches.yml' - - '.github/workflows/build.yml' - - '.github/workflows/kernel.yml' - - 'include/kernel*' - - 'package/kernel/**' - - 'target/linux/generic/**' - -permissions: - contents: read - -jobs: - determine_targets: - name: Set targets - runs-on: ubuntu-latest - outputs: - target: ${{ steps.find_targets.outputs.target }} - - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Set targets - id: find_targets - run: | - export TARGETS="$(perl ./scripts/dump-target-info.pl targets 2>/dev/null \ - | sort -u -t '/' -k1,1 \ - | awk '{ print $1 }')" - - JSON='[' - FIRST=1 - for TARGET in $TARGETS; do - [[ $FIRST -ne 1 ]] && JSON="$JSON"',' - JSON="$JSON"'"'"${TARGET}"'"' - FIRST=0 - done - JSON="$JSON"']' - - echo -e "\n---- targets ----\n" - echo "$JSON" - echo -e "\n---- targets ----\n" - - echo "target=$JSON" >> $GITHUB_OUTPUT - - build: - name: Build Kernel with external toolchain - needs: determine_targets - permissions: - contents: read - packages: read - strategy: - fail-fast: False - matrix: - target: ${{fromJson(needs.determine_targets.outputs.target)}} - uses: ./.github/workflows/build.yml - with: - target: ${{ matrix.target }} - build_all_kmods: true - - check-kernel-patches: - name: Check Kernel patches - needs: determine_targets - permissions: - contents: read - packages: read - strategy: - fail-fast: False - matrix: - target: ${{fromJson(needs.determine_targets.outputs.target)}} - uses: ./.github/workflows/check-kernel-patches.yml - with: - target: ${{ matrix.target }} - diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml deleted file mode 100644 index 5f82b88a50..0000000000 --- a/.github/workflows/labeler.yml +++ /dev/null @@ -1,33 +0,0 @@ -name: 'Pull Request Labeler' -on: - - pull_request_target - -permissions: - contents: read - -jobs: - labeler: - permissions: - contents: read # to determine modified files (actions/labeler) - pull-requests: write # to add labels to PRs (actions/labeler) - - name: Pull Request Labeler - runs-on: ubuntu-latest - steps: - - uses: actions/labeler@v4 - with: - repo-token: '${{ secrets.GITHUB_TOKEN }}' - - - name: Check Branch - id: check-branch - run: | - if echo "${{ github.base_ref }}" | grep -q -E 'openwrt-[0-9][0-9]\.[0-9][0-9]'; then - echo "release-tag=$(echo ${{ github.base_ref }} | sed 's/openwrt-/release\//')" >> $GITHUB_OUTPUT - fi - - - uses: buildsville/add-remove-label@v2.0.0 - if: ${{ steps.check-branch.outputs.release-tag }} - with: - token: ${{secrets.GITHUB_TOKEN}} - labels: ${{ steps.check-branch.outputs.release-tag }} - type: add diff --git a/.github/workflows/packages.yml b/.github/workflows/packages.yml deleted file mode 100644 index 94982ba65b..0000000000 --- a/.github/workflows/packages.yml +++ /dev/null @@ -1,43 +0,0 @@ -name: Build all core packages - -on: - pull_request: - paths: - - '.github/workflows/build.yml' - - '.github/workflows/packages.yml' - - 'config/**' - - 'include/**' - - 'package/**' - - 'target/linux/generic/**' - - 'toolchain/**' - push: - paths: - - '.github/workflows/build.yml' - - '.github/workflows/packages.yml' - - 'config/**' - - 'include/**' - - 'package/**' - - 'target/linux/generic/**' - - 'toolchain/**' - -permissions: - contents: read - -jobs: - build: - permissions: - contents: read - packages: read - strategy: - fail-fast: False - matrix: - include: - - target: malta/be - - target: x86/64 - uses: ./.github/workflows/build.yml - with: - target: ${{ matrix.target }} - build_all_kmods: true - build_all_modules: true - build_full: true - diff --git a/.github/workflows/scripts/ci_helpers.sh b/.github/workflows/scripts/ci_helpers.sh deleted file mode 100644 index 2f9daf81e2..0000000000 --- a/.github/workflows/scripts/ci_helpers.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/sh - -color_out() { - printf "\e[0;$1m%s\e[0;0m\n" "$2" -} - -success() { - color_out 32 "$1" -} - -info() { - color_out 36 "$1" -} - -err() { - color_out 31 "$1" -} - -warn() { - color_out 33 "$1" -} - -err_die() { - err "$1" - exit 1 -} diff --git a/.github/workflows/scripts/show_build_failures.sh b/.github/workflows/scripts/show_build_failures.sh deleted file mode 100755 index 14f699c93d..0000000000 --- a/.github/workflows/scripts/show_build_failures.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -original_exit_code="${ret:-1}" -log_dir_path="${1:-logs}" -context="${2:-10}" - -show_make_build_errors() { - grep -slr 'make\[[[:digit:]]\].*Error [[:digit:]]$' "$log_dir_path" | while IFS= read -r log_file; do - printf "====== Make errors from %s ======\n" "$log_file"; - grep -r -C"$context" 'make\[[[:digit:]]\].*Error [[:digit:]]$' "$log_file" ; - done -} - -show_make_build_errors -exit "$original_exit_code" diff --git a/.github/workflows/tools.yml b/.github/workflows/tools.yml deleted file mode 100644 index 304b5f7d62..0000000000 --- a/.github/workflows/tools.yml +++ /dev/null @@ -1,226 +0,0 @@ -name: Build host tools - -on: - pull_request: - paths: - - 'tools/**' - - '.github/workflows/tools.yml' - push: - paths: - - 'tools/**' - - '.github/workflows/tools.yml' - -permissions: - contents: read - -jobs: - build-macos-latest: - if: github.event_name != 'push' - runs-on: macos-latest - - steps: - - name: Checkout - uses: actions/checkout@v3 - with: - path: openwrt - - - name: Setup MacOS - run: | - echo "WORKPATH=/Volumes/OpenWrt" >> "$GITHUB_ENV" - hdiutil create -size 20g -type SPARSE -fs "Case-sensitive HFS+" -volname OpenWrt OpenWrt.sparseimage - hdiutil attach OpenWrt.sparseimage - mv "$GITHUB_WORKSPACE/openwrt" /Volumes/OpenWrt/ - - - name: Install required prereq on MacOS - working-directory: ${{ env.WORKPATH }}/openwrt - run: | - brew install \ - autoconf \ - automake \ - coreutils \ - diffutils \ - findutils \ - gawk \ - gettext \ - git-extras \ - gmp \ - gnu-getopt \ - gnu-sed \ - gnu-tar \ - grep \ - libidn2 \ - libunistring \ - m4 \ - make \ - mpfr \ - ncurses \ - openssl@1.1 \ - pcre \ - pkg-config \ - quilt \ - readline \ - wget \ - zstd - - echo "/bin" >> "$GITHUB_PATH" - echo "/sbin/Library/Apple/usr/bin" >> "$GITHUB_PATH" - echo "/usr/bin" >> "$GITHUB_PATH" - echo "/usr/local/bin" >> "$GITHUB_PATH" - echo "/usr/local/opt/coreutils/bin" >> "$GITHUB_PATH" - echo "/usr/local/opt/findutils/libexec/gnubin" >> "$GITHUB_PATH" - echo "/usr/local/opt/gettext/bin" >> "$GITHUB_PATH" - echo "/usr/local/opt/gnu-getopt/bin" >> "$GITHUB_PATH" - echo "/usr/local/opt/make/libexec/gnubin" >> "$GITHUB_PATH" - echo "/usr/local/opt/make/libexec/gnubin" >> "$GITHUB_PATH" - echo "/usr/sbin" >> "$GITHUB_PATH" - - - name: Make prereq - working-directory: ${{ env.WORKPATH }}/openwrt - run: make defconfig - - - name: Build tools MacOS - working-directory: ${{ env.WORKPATH }}/openwrt - run: make tools/install -j$(nproc) BUILD_LOG=1 || ret=$? .github/workflows/scripts/show_build_failures.sh - - - name: Upload logs - if: always() - uses: actions/upload-artifact@v3 - with: - name: macos-latest-logs - path: ${{ env.WORKPATH }}/openwrt/logs - - - name: Upload config - if: always() - uses: actions/upload-artifact@v3 - with: - name: macos-latest-config - path: ${{ env.WORKPATH }}/openwrt/.config - - build-linux-buildbot: - runs-on: ubuntu-latest - container: registry.gitlab.com/openwrt/buildbot/buildworker-3.4.1 - - steps: - - name: Checkout - uses: actions/checkout@v3 - with: - path: 'openwrt' - - - name: Fix permission - run: | - chown -R buildbot:buildbot openwrt - - - name: Set configs for tools container - if: github.event_name == 'push' - shell: su buildbot -c "sh -e {0}" - working-directory: openwrt - run: | - touch .config - echo CONFIG_DEVEL=y >> .config - echo CONFIG_AUTOREMOVE=y >> .config - echo CONFIG_CCACHE=y >> .config - - - name: Make prereq - shell: su buildbot -c "sh -e {0}" - working-directory: openwrt - run: make defconfig - - - name: Build tools BuildBot Container - shell: su buildbot -c "sh -e {0}" - working-directory: openwrt - run: make tools/install -j$(nproc) BUILD_LOG=1 || ret=$? .github/workflows/scripts/show_build_failures.sh - - - name: Upload logs - if: always() - uses: actions/upload-artifact@v3 - with: - name: linux-buildbot-logs - path: openwrt/logs - - - name: Upload config - if: always() - uses: actions/upload-artifact@v3 - with: - name: linux-buildbot-config - path: openwrt/.config - - - name: Archive prebuilt tools - if: github.event_name == 'push' - shell: su buildbot -c "sh -e {0}" - working-directory: openwrt - run: tar --mtime=now -cf tools.tar staging_dir/host build_dir/host dl - - - name: Upload prebuilt tools - if: github.event_name == 'push' - uses: actions/upload-artifact@v3 - with: - name: linux-buildbot-prebuilt-tools - path: openwrt/tools.tar - retention-days: 1 - - push-tools-container: - needs: build-linux-buildbot - runs-on: ubuntu-latest - if: github.event_name == 'push' - - permissions: - contents: read - packages: write - - steps: - - name: Set lower case owner name - env: - OWNER: ${{ github.repository_owner }} - run: | - echo "OWNER_LC=${OWNER,,}" >> "$GITHUB_ENV" - - # Per branch tools container tag - # By default stick to latest - # For official test targetting openwrt stable branch - # Get the branch or parse the tag and push dedicated tools containers - # Any branch that will match this pattern openwrt-[0-9][0-9].[0-9][0-9] - # will refresh the tools container with the matching tag. - # (example branch openwrt-22.03 -> tools:openwrt-22.03) - # (example branch openwrt-22.03-test -> tools:openwrt-22.03) - - name: Determine tools container tag - run: | - CONTAINER_TAG=latest - - if [ ${{ github.ref_type }} == "branch" ]; then - if echo "${{ github.ref_name }}" | grep -q -E 'openwrt-[0-9][0-9]\.[0-9][0-9]'; then - CONTAINER_TAG="$(echo ${{ github.ref_name }} | sed 's/^\(openwrt-[0-9][0-9]\.[0-9][0-9]\).*/\1/')" - fi - elif [ ${{ github.ref_type }} == "tag" ]; then - if echo "${{ github.ref_name }}" | grep -q -E 'v[0-9][0-9]\.[0-9][0-9]\..+'; then - CONTAINER_TAG=openwrt-"$(echo ${{ github.ref_name }} | sed 's/v\([0-9][0-9]\.[0-9][0-9]\)\..\+/\1/')" - fi - fi - - echo "Tools container to push tools:$CONTAINER_TAG" - echo "CONTAINER_TAG=$CONTAINER_TAG" >> "$GITHUB_ENV" - - - name: Checkout - uses: actions/checkout@v3 - with: - path: 'openwrt' - - - name: Download prebuilt tools from build job - uses: actions/download-artifact@v3 - with: - name: linux-buildbot-prebuilt-tools - path: openwrt - - - name: Login to GitHub Container Registry - uses: docker/login-action@v2 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Build and push - uses: docker/build-push-action@v3 - with: - context: openwrt - push: true - tags: ghcr.io/${{ env.OWNER_LC }}/tools:${{ env.CONTAINER_TAG }} - file: openwrt/.github/workflows/Dockerfile.tools diff --git a/README.md b/README.md index 051c2469fa..ae0a7a155f 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,32 @@ +编译命令如下: +- +1. 首先装好 Ubuntu 64bit,推荐 Ubuntu 18 LTS x64 + +2. 命令行输入 `sudo apt-get update` ,然后输入 +` +sudo apt-get -y install build-essential asciidoc binutils bzip2 curl gawk gettext git libncurses5-dev libz-dev patch python3.5 python2.7 unzip zlib1g-dev lib32gcc1 libc6-dev-i386 subversion flex uglifyjs git-core gcc-multilib p7zip p7zip-full msmtp libssl-dev texinfo libglib2.0-dev xmlto qemu-utils upx libelf-dev autoconf automake libtool autopoint device-tree-compiler g++-multilib antlr3 gperf +` + +3. `git clone -b 21.02 --single-branch https://github.com/Lienol/openwrt openwrt` 命令下载好源代码,然后 `cd openwrt` 进入目录 + +4. ```bash + ./scripts/feeds clean + ./scripts/feeds update -a + ./scripts/feeds install -a + make menuconfig + ``` + +5. `make -j8 download V=s` 下载dl库(国内请尽量全局科学上网) + + +6. 输入 `make -j1 V=s` (-j1 后面是线程数。第一次编译推荐用单线程)即可开始编译你要的固件了。 + +6. 编译完成后输出路径:openwrt/bin/targets + +你可以自由使用,但源码编译二次发布请注明我的 GitHub 仓库链接。谢谢合作! + + ----------------------------------------------------- + ![OpenWrt logo](include/logo.png) OpenWrt Project is a Linux operating system targeting embedded devices. Instead diff --git a/config/Config-images.in b/config/Config-images.in index 2921cd5bca..ffc30de278 100644 --- a/config/Config-images.in +++ b/config/Config-images.in @@ -68,7 +68,7 @@ menu "Target Images" config TARGET_ROOTFS_TARGZ bool "tar.gz" - default y if USES_TARGZ + default n if USES_TARGZ help Build a compressed tar archive of the root filesystem. @@ -76,7 +76,7 @@ menu "Target Images" menuconfig TARGET_ROOTFS_EXT4FS bool "ext4" - default y if USES_EXT4 + default n if USES_EXT4 help Build an ext4 root filesystem. @@ -225,7 +225,7 @@ menu "Target Images" config GRUB_TIMEOUT string "Seconds to wait before booting the default entry" depends on GRUB_IMAGES || GRUB_EFI_IMAGES - default "5" + default "0" help If you don't know, 5 seconds is a reasonable default. @@ -273,7 +273,7 @@ menu "Target Images" config TARGET_ROOTFS_PARTSIZE int "Root filesystem partition size (in MB)" depends on USES_ROOTFS_PART || TARGET_ROOTFS_EXT4FS || TARGET_omap || TARGET_sunxi || TARGET_uml - default 104 + default 160 help Select the root filesystem partition size. diff --git a/feeds.conf.default b/feeds.conf.default index f1827a3661..0b12106548 100644 --- a/feeds.conf.default +++ b/feeds.conf.default @@ -1,5 +1,7 @@ -src-git-full packages https://git.openwrt.org/feed/packages.git;openwrt-21.02 -src-git-full luci https://git.openwrt.org/project/luci.git;openwrt-21.02 -src-git-full routing https://git.openwrt.org/feed/routing.git;openwrt-21.02 -src-git-full telephony https://git.openwrt.org/feed/telephony.git;openwrt-21.02 +src-git packages https://github.com/Lienol/openwrt-packages.git;21.02 +src-git luci https://github.com/Lienol/openwrt-luci.git;21.02 +src-git routing https://github.com/openwrt/routing.git;openwrt-21.02 +src-git telephony https://github.com/openwrt/telephony.git;openwrt-21.02 #src-link custom /usr/src/openwrt/custom-feed +src-git lienol https://github.com/Lienol/openwrt-package.git;main +src-git other https://github.com/Lienol/openwrt-package.git;other diff --git a/include/target.mk b/include/target.mk index 7526224972..e06a8a3da4 100644 --- a/include/target.mk +++ b/include/target.mk @@ -25,6 +25,10 @@ DEFAULT_PACKAGES:=\ uci \ uclient-fetch \ urandom-seed \ + luci luci-compat wget-ssl curl \ + default-settings luci-app-upnp luci-app-wol luci-app-vlmcsd luci-app-ramfree \ + luci-app-ddns ddns-scripts-cloudflare ddns-scripts_aliyun ddns-scripts_dnspod \ + luci-app-timecontrol luci-app-control-timewol luci-app-control-webrestriction luci-app-control-weburl \ urngd ifneq ($(CONFIG_SELINUX),) @@ -43,11 +47,10 @@ DEFAULT_PACKAGES.nas:=\ mdadm # For router targets DEFAULT_PACKAGES.router:=\ - dnsmasq \ + dnsmasq-full \ firewall \ ip6tables \ iptables \ - kmod-ipt-offload \ odhcp6c \ odhcpd-ipv6only \ ppp \ diff --git a/package/default-settings/Makefile b/package/default-settings/Makefile new file mode 100644 index 0000000000..766d573491 --- /dev/null +++ b/package/default-settings/Makefile @@ -0,0 +1,49 @@ +# +# Copyright (C) 2016-2017 GitHub +# +# This is free software, licensed under the GNU General Public License v3. +# See /LICENSE for more information. + +include $(TOPDIR)/rules.mk + +PKG_NAME:=default-settings +PKG_VERSION:=1.1 +PKG_RELEASE:=52 +PKG_LICENSE:=GPLv3 +PKG_LICENSE_FILES:=LICENSE + +PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME) + +include $(INCLUDE_DIR)/package.mk + +define Package/default-settings + SECTION:=luci + CATEGORY:=LuCI + TITLE:=LuCI support for Default Settings + PKGARCH:=all + DEPENDS:=+luci-base +@LUCI_LANG_zh_Hans +endef + +define Package/default-settings/description + Language Support Packages. +endef + +define Build/Prepare + $(foreach po,$(wildcard ${CURDIR}/i18n/*.po), \ + po2lmo $(po) $(PKG_BUILD_DIR)/$(patsubst %.po,%.lmo,$(notdir $(po)));) +endef + +define Build/Configure +endef + +define Build/Compile +endef + +define Package/default-settings/install + $(INSTALL_DIR) $(1)/usr/lib/lua/luci/i18n + $(INSTALL_DIR) $(1)/etc/uci-defaults + $(INSTALL_DATA) $(PKG_BUILD_DIR)/*.lmo $(1)/usr/lib/lua/luci/i18n/ + $(INSTALL_BIN) ./files/zzz-default-settings $(1)/etc/uci-defaults/99-default-settings +endef + +$(eval $(call BuildPackage,default-settings)) diff --git a/package/default-settings/files/zzz-default-settings b/package/default-settings/files/zzz-default-settings new file mode 100644 index 0000000000..50bd941566 --- /dev/null +++ b/package/default-settings/files/zzz-default-settings @@ -0,0 +1,70 @@ +#!/bin/sh + +touch /etc/crontabs/root + +uci set luci.main.lang=zh_cn +#设置默认主题 +uci set luci.main.mediaurlbase=/luci-static/bootstrap +uci commit luci + +uci set system.@system[0].timezone=CST-8 +uci set system.@system[0].zonename=Asia/Shanghai +uci commit system + +uci set fstab.@global[0].anon_mount=1 +uci commit fstab + +ln -sf /sbin/ip /usr/bin/ip + +sed -i "s#21.02-SNAPSHOT#21.02.7#g" /etc/opkg/distfeeds.conf +sed -i '/lienol/d' /etc/opkg/distfeeds.conf +sed -i '/other/d' /etc/opkg/distfeeds.conf +#sed -i 's/downloads.openwrt.org/openwrt.proxy.ustclug.org/g' /etc/opkg/distfeeds.conf +#sed -i 's/http/https/g' /etc/opkg/distfeeds.conf +sed -i "s/# //g" /etc/opkg/distfeeds.conf + +#sed -i 's/root::0:0:99999:7:::/root:$1$V4UetPzk$CYXluq4wUazHjmCDBCqXF.:0:0:99999:7:::/g' /etc/shadow + +uci set dhcp.lan.ra='server' +uci -q del dhcp.lan.dhcpv6 +uci set dhcp.lan.dns_service='0' +uci set dhcp.lan.ra_management='1' +uci -q del dhcp.lan.ra_slaac +#uci set dhcp.@dnsmasq[0].localservice=0 +#uci set dhcp.@dnsmasq[0].nonwildcard=0 +uci commit dhcp + +#uci set network.lan.ipaddr='192.168.119.254' +#uci set network.lan.netmask='255.255.255.0' +#uci set network.lan.ip6assign='64' +#uci commit network + +sed -i '/option disabled/d' /etc/config/wireless +sed -i '/set wireless.radio${devidx}.disabled/d' /lib/wifi/mac80211.sh +wifi up + +sed -i '/DISTRIB_DESCRIPTION/d' /etc/openwrt_release +echo "DISTRIB_DESCRIPTION='OpenWrt 21.02-SNAPSHOT'" >> /etc/openwrt_release + +# 删除状态页不需显示的 +rm -rf /usr/lib/lua/luci/view/admin_status/index +#mv -f /usr/lib/lua/luci/view/admin_status/index /usr/lib/lua/luci/view/admin_status/index_backup 2>/dev/null + +sed -i 's#openwrt/luci#lienol/openwrt-luci#g' /usr/lib/lua/luci/view/themes/*/footer.htm + +#禁用某些可能会自启动且用不上的依赖包服务 +/etc/init.d/php7-fastcgi disable 2>/dev/null +/etc/init.d/php7-fpm disable 2>/dev/null +/etc/init.d/php8-fastcgi disable 2>/dev/null +/etc/init.d/php8-fpm disable 2>/dev/null +/etc/init.d/softethervpnbridge disable 2>/dev/null +/etc/init.d/softethervpnserver disable 2>/dev/null +/etc/init.d/softethervpnclient disable 2>/dev/null +/etc/init.d/haproxy disable 2>/dev/null +/etc/init.d/kcptun disable 2>/dev/null + +chmod 0755 /etc/init.d/* + +rm -rf /tmp/luci-*cache + +exit 0 diff --git a/package/default-settings/i18n/default.zh-cn.po b/package/default-settings/i18n/default.zh-cn.po new file mode 100644 index 0000000000..ea500f2681 --- /dev/null +++ b/package/default-settings/i18n/default.zh-cn.po @@ -0,0 +1,67 @@ +msgid "Processor" +msgstr "处理器" + +msgid "Architecture" +msgstr "架构" + +msgid "CPU Temperature" +msgstr "CPU温度" + +msgid "CPU Info" +msgstr "CPU信息" + +msgid "CPU Model" +msgstr "处理器型号" + +msgid "CPU frequency" +msgstr "CPU频率" + +msgid "RAM frequency" +msgstr "RAM频率" + +msgid "Flash Size" +msgstr "闪存大小" + +msgid "Free Memory" +msgstr "释放内存" + +msgid "RUNNING" +msgstr "运行中" + +msgid "NOT RUNNING" +msgstr "未运行" + +msgid "ZRam Settings" +msgstr "ZRam 设置" + +msgid "ZRam Compression Algorithm" +msgstr "ZRAM压缩算法" + +msgid "ZRam Compression Streams" +msgstr "ZRam 压缩数据流线程数" + +msgid "ZRam Size" +msgstr "ZRam 大小" + +msgid "Size of the ZRam device in megabytes" +msgstr "划分给ZRam 分区的内存大小(MB),推荐留空由系统自动管理" + +msgid "Number of parallel threads used for compression" +msgstr "用于压缩内存数据的CPU并发线程数" + +msgid "Swap" +msgstr "虚拟内存" + +msgid "Force 40MHz mode" +msgstr "强制40MHz频宽" + +msgid "" +"Always use 40MHz channels even if the secondary channel overlaps. Using this " +"option does not comply with IEEE 802.11n-2009!" +msgstr "强制启用40MHz频宽并忽略辅助信道重叠。此选项可能不兼容某些无线硬件导致无法启用!" + +msgid "Disassociate On Low Acknowledgement" +msgstr "弱信号剔除" + +msgid "Allow AP mode to disconnect STAs based on low ACK condition" +msgstr "允许AP模式基于低ACK条件判断剔除弱信号的客户端" diff --git a/package/default-settings/i18n/more.zh-cn.po b/package/default-settings/i18n/more.zh-cn.po new file mode 100644 index 0000000000..c602be14c4 --- /dev/null +++ b/package/default-settings/i18n/more.zh-cn.po @@ -0,0 +1,1037 @@ +msgid "" +msgstr "" +"Content-Type: text/plain; charset=UTF-8\n" +"Last-Translator: Hsing-Wang Liao \n" + +msgid "%d hour" +msgstr "%d 小时" + +msgid "%d minute" +msgstr "%d 分钟" + +msgid "%d minutes" +msgstr "%d 分钟" + +msgid "%d second" +msgstr "%d 秒" + +msgid "%d seconds" +msgstr "%d 秒" + +msgid "" +"Acceptable values: 1-100. This many Tracking IP addresses must respond for " +"the link to be deemed up" +msgstr "" +"取值范围: 1-100。这个设置项指定了当多少个 IP 地址能够连通时接口会被认为在线" + +msgid "Acceptable values: 1-1000. Defaults to 1 if not set" +msgstr "取值范围: 1-100。如果不填写,默认值为 1" + +msgid "Advanced" +msgstr "高级" + +msgid "Check IP rules" +msgstr "检查 IP 规则" + +msgid "Check routing table" +msgstr "检查路由表" + +msgid "Collecting data..." +msgstr "正在收集数据..." + +msgid "Configuration" +msgstr "配置" + +msgid "Currently Configured Interfaces" +msgstr "当前配置的接口" + +msgid "Currently Configured Members" +msgstr "当前配置的成员" + +msgid "Currently Configured Policies" +msgstr "当前配置的策略" + +msgid "Destination address" +msgstr "目标地址" + +msgid "Destination port" +msgstr "目标端口" + +msgid "Detailed Status" +msgstr "详细状态" + +msgid "Diagnostic Results" +msgstr "诊断结果" + +msgid "Diagnostics" +msgstr "诊断" + +msgid "Disabled" +msgstr "禁用" + +msgid "" +"Downed interface will be deemed up after this many successful ping tests" +msgstr "当 Ping 成功次数达到这个数值后,已经被认为离线的接口将会重新上线" + +msgid "Enabled" +msgstr "启用" + +msgid "Error collecting troubleshooting information" +msgstr "收集故障排除信息时出错" + +msgid "Errors" +msgstr "错误" + +msgid "Failure interval" +msgstr "故障检测间隔" + +msgid "Flush conntrack table" +msgstr "刷新连接跟踪表" + +msgid "Flush global firewall conntrack table on interface events" +msgstr "在接口事件触发时刷新全局防火墙连接跟踪表" + +msgid "Hotplug Script" +msgstr "Hotplug 脚本" + +msgid "Hotplug ifdown" +msgstr "Hotplug ifdown" + +msgid "Hotplug ifup" +msgstr "Hotplug ifup" + +msgid "IPset" +msgstr "IPset" + +msgid "IPv4" +msgstr "IPv4" + +msgid "IPv6" +msgstr "IPv6" + +msgid "Interface" +msgstr "接口" + +msgid "Interface Status" +msgstr "接口状态" + +msgid "Interface down" +msgstr "接口离线" + +msgid "Interface up" +msgstr "接口上线" + +msgid "Interface will be deemed down after this many failed ping tests" +msgstr "当 Ping 失败次数达到这个数值后接口会被认为离线" + +msgid "Interfaces" +msgstr "接口" + +msgid "Internet Protocol" +msgstr "互联网协议" + +msgid "Last 50 MWAN systemlog entries. Newest entries sorted at the top :" +msgstr "最近 50 条 MWAN 系统日志,最新条目排在顶部:" + +msgid "Last resort" +msgstr "备用成员" + +msgid "Load Balancing" +msgstr "负载均衡" + +msgid "Loading" +msgstr "载入中" + +msgid "MWAN Config" +msgstr "MWAN 配置文件" + +msgid "MWAN Detailed Status" +msgstr "MWAN 详细状态" + +msgid "MWAN Interface Configuration" +msgstr "MWAN 接口配置" + +msgid "MWAN Interface Configuration - %s" +msgstr "MWAN 接口配置 - %s" + +msgid "MWAN Interface Diagnostics" +msgstr "MWAN 接口诊断" + +msgid "MWAN Interface Live Status" +msgstr "MWAN 接口实时状态" + +msgid "MWAN Interface Systemlog" +msgstr "MWAN 接口系统日志" + +msgid "MWAN Member Configuration" +msgstr "MWAN 成员配置" + +msgid "MWAN Member Configuration - %s" +msgstr "MWAN 成员配置 - %s" + +msgid "MWAN Policy Configuration" +msgstr "MWAN 策略配置" + +msgid "MWAN Policy Configuration - %s" +msgstr "MWAN 策略配置 - %s" + +msgid "MWAN Rule Configuration" +msgstr "MWAN 规则配置" + +msgid "MWAN Rule Configuration - %s" +msgstr "MWAN 规则配置 - %s" + +msgid "MWAN Service Control" +msgstr "MWAN 服务控制" + +msgid "" +"MWAN supports up to 250 physical and/or logical interfaces
MWAN " +"requires that all interfaces have a unique metric configured in /etc/config/" +"network
Names must match the interface name found in /etc/config/" +"network (see advanced tab)
Names may contain characters A-Z, a-z, 0-9, " +"_ and no spaces
Interfaces may not share the same name as configured " +"members, policies or rules" +msgstr "" +"MWAN 支持最多 250 个物理或逻辑接口。
MWAN 要求所有接口必须在 /etc/" +"config/network 中设定唯一的网关跃点。
名称必须与 /etc/config/network 中" +"的接口名称匹配。(可查看“高级”选项卡)
名称允许包括A-Z、a-z、0-9、_ 但是" +"不能有空格。
接口不应该与成员、策略、规则中的任意一个设置项使用相同的名" +"称" + +msgid "" +"May be entered as a single or multiple port(s) (eg \"22\" or \"80,443\") or " +"as a portrange (eg \"1024:2048\") without quotes" +msgstr "" +"可以输入一个或多个端口(例如 \"22\" 或者 \"80,443\")或者是一个端口范围(例" +"如 \"1024:2048\")不含引号" + +msgid "Member" +msgstr "成员" + +msgid "Member used" +msgstr "使用的成员" + +msgid "Members" +msgstr "成员" + +msgid "" +"Members are profiles attaching a metric and weight to an MWAN interface
Names may contain characters A-Z, a-z, 0-9, _ and no spaces
Members " +"may not share the same name as configured interfaces, policies or rules" +msgstr "" +"“成员”用来设置每一个 MWAN 接口的跃点数(即接口优先级)和所占比重。
名称" +"允许包括 A-Z、 a-、0-9、_ 但是不能有空格。
成员不应该与接口、策略、规则" +"中的任意一个设置项使用相同的名称" + +msgid "Members assigned" +msgstr "分配的成员" + +msgid "Metric" +msgstr "跃点数" + +msgid "" +"Name of IPset rule. Requires IPset rule in /etc/dnsmasq.conf (eg \"ipset=/" +"youtube.com/youtube\")" +msgstr "" +"匹配 IPset 规则列表名称。需要先配置 /etc/dnsmasq.conf 中的 IPset 规则 (例如: " +"\"ipset=/youtube.com/youtube\")" + +msgid "Network Config" +msgstr "网络配置文件" + +msgid "No" +msgstr "否" + +msgid "No MWAN interfaces found" +msgstr "没有找到 MWAN 接口" + +msgid "No MWAN systemlog history found" +msgstr "没有在系统日志中找到 MWAN 历史信息" + +msgid "No detailed status information available" +msgstr "没有状态详细信息可用" + +msgid "No diagnostic results returned" +msgstr "没有返回诊断结果" + +msgid "No protocol specified" +msgstr "未指定协议" + +msgid "Offline" +msgstr "离线" + +msgid "Online (tracking active)" +msgstr "在线(追踪启用中)" + +msgid "Online (tracking off)" +msgstr "在线(追踪已关闭)" + +msgid "Overview" +msgstr "概况" + +msgid "Ping count" +msgstr "Ping 计数" + +msgid "Ping default gateway" +msgstr "Ping 默认网关" + +msgid "Ping interval" +msgstr "Ping 间隔" + +msgid "Ping interval during failure detection" +msgstr "故障检测期间的 Ping 间隔" + +msgid "Ping interval during failure recovering" +msgstr "故障恢复期间的 Ping 间隔" + +msgid "Ping size" +msgstr "Ping 大小" + +msgid "Ping timeout" +msgstr "Ping 超时" + +msgid "Ping tracking IP" +msgstr "Ping 跟踪 IP" + +msgid "Policies" +msgstr "策略" + +msgid "" +"Policies are profiles grouping one or more members controlling how MWAN " +"distributes traffic
Member interfaces with lower metrics are used " +"first. Interfaces with the same metric load-balance
Load-balanced " +"member interfaces distribute more traffic out those with higher weights
Names may contain characters A-Z, a-z, 0-9, _ and no spaces. Names must be " +"15 characters or less
Policies may not share the same name as " +"configured interfaces, members or rules" +msgstr "" +"“策略”把成员进行分组,告诉 MWAN 如何分配“规则”中使用这一策略的流量
拥有" +"较低跃点数的成员将会被优先使用。拥有相同跃点数的成员把流量进行负载均衡。
进行负载均衡的成员之间拥有较高比重的成员将会被分配到更多流量。
名称允许" +"包括A-Z、a-z、0-9、_ 但是不能有空格。名称应该在 15 个字符以内
策略不应该" +"与接口、成员、规则中的任意一个设置项使用相同的名称" + +msgid "Policy" +msgstr "策略" + +msgid "Policy assigned" +msgstr "分配的策略" + +msgid "Protocol" +msgstr "通信协议" + +msgid "Recovery interval" +msgstr "故障恢复间隔" + +msgid "Restart MWAN" +msgstr "重启 MWAN" + +msgid "Restore default hotplug script" +msgstr "恢复默认的 hotplug 脚本" + +msgid "Restore..." +msgstr "恢复..." + +msgid "Rule" +msgstr "规则" + +msgid "Rules" +msgstr "规则" + +msgid "" +"Rules specify which traffic will use a particular MWAN policy based on IP " +"address, port or protocol
Rules are matched from top to bottom. Rules " +"below a matching rule are ignored. Traffic not matching any rule is routed " +"using the main routing table
Traffic destined for known (other than " +"default) networks is handled by the main routing table. Traffic matching a " +"rule, but all WAN interfaces for that policy are down will be blackholed
Names may contain characters A-Z, a-z, 0-9, _ and no spaces
Rules may " +"not share the same name as configured interfaces, members or policies" +msgstr "" +"“规则”基于 IP 地址、协议、端口把流量划分到指定的“策略”中。
规则按照从上" +"到下的顺序进行匹配。除了第一条能够匹配一次通信的规则以外,其它规则将被忽略。" +"不匹配任何规则的通信将会由系统默认路由表进行。
来自已知的网络的转发流量" +"由系统默认路由表接手,然后 MWAN 从中匹配出相应的流量并转移到 MWAN 自己的路由" +"表。但是所有被划分到一个无法使用的策略的流量将会无法正常进行路由。
名称" +"允许包括A-Z、a-z、0-9、_ 但是不能有空格。
规则不应该与接口、成员、策略中" +"的任意一个设置项使用相同的名称" + +msgid "Seconds. Acceptable values: 1-1000000. Defaults to 600 if not set" +msgstr "单位为秒。接受的值: 1-1000000。留空则使用默认值 600 秒" + +msgid "Source address" +msgstr "源地址" + +msgid "Source port" +msgstr "源端口" + +msgid "Start MWAN" +msgstr "启动 MWAN" + +msgid "Sticky" +msgstr "粘滞模式" + +msgid "Sticky timeout" +msgstr "粘滞超时" + +msgid "Stop MWAN" +msgstr "停止 MWAN" + +msgid "Supports CIDR notation (eg \"192.168.100.0/24\") without quotes" +msgstr "支持 CIDR 记法(例如: \"192.168.100.0/24\")不含引号" + +msgid "There are currently %d of 250 supported interfaces configured" +msgstr "当前已配置 %d 个接口,最大支持 250 个" + +msgid "" +"This displays the metric assigned to this interface in /etc/config/network" +msgstr "这里显示了这个接口在 /etc/config/network 中配置的跃点数" + +msgid "" +"This hostname or IP address will be pinged to determine if the link is up or " +"down. Leave blank to assume interface is always online" +msgstr "通过 ping 此主机或 IP 地址来确定链路是否在线。留空则认为接口始终在线" + +msgid "This section allows you to modify the contents of /etc/config/mwan3" +msgstr "这里允许你修改 /etc/config/mwan3 的内容" + +msgid "This section allows you to modify the contents of /etc/config/network" +msgstr "这里允许你修改 /etc/config/network 的内容" + +msgid "This section allows you to modify the contents of /etc/config/wireless" +msgstr "这里允许你修改 /etc/config/wireless 的内容" + +msgid "" +"This section allows you to modify the contents of /etc/hotplug.d/iface/16-" +"mwancustom
This is useful for running system commands and/or scripts " +"based on interface ifup or ifdown hotplug events

Notes:
The " +"first line of the script must be "#!/bin/sh" without quotes
Lines beginning with # are comments and are not executed

Available variables:
$ACTION is the hotplug event (ifup, ifdown)
" +"$INTERFACE is the interface name (wan1, wan2, etc.)
$DEVICE is the " +"device name attached to the interface (eth0.1, eth1, etc.)" +msgstr "" +"这里允许你修改 /etc/hotplug.d/iface/16-mwancustom 的内容
这可以在接口 " +"ifup 或 ifdown Hotplug 事件时运行系统命令或脚本

注意:
脚本的" +"第一行必须是 "#!/bin/sh" 不含引号
以#开头的行是注释,不会执行" +"

可用变量:
$ACTION 是 Hotplug 事件(ifup, ifdown)
" +"$INTERFACE 是接口名称(wan1、wan2 等)
$DEVICE 是连接到接口的设备名称 " +"(eth0.1、eth1 等)" + +msgid "Tracking IP" +msgstr "追踪的 IP" + +msgid "Tracking hostname or IP address" +msgstr "追踪的主机或 IP 地址" + +msgid "Tracking reliability" +msgstr "追踪可靠性" + +msgid "Traffic Rules" +msgstr "流量规则" + +msgid "" +"Traffic from the same source IP address that previously matched this rule " +"within the sticky timeout period will use the same WAN interface" +msgstr "" +"来自相同源 IP 的流量,如果已经匹配过此规则并且在粘滞超时时间内,将会使用相同" +"的 WAN 接口" + +msgid "Troubleshooting" +msgstr "故障排除" + +msgid "Troubleshooting Data" +msgstr "故障排除数据" + +msgid "View the contents of /etc/protocols for protocol descriptions" +msgstr "请查看 /etc/protocols 获取可选协议详情" + +msgid "WARNING: %d interfaces are configured exceeding the maximum of 250!" +msgstr "警告: 已配置 %d 个接口,超过最大值 250!" + +msgid "" +"WARNING: Some policies have names exceeding the maximum of 15 characters!" +msgstr "警告: 某些策略的名称超过了 15 个字符!" + +msgid "" +"WARNING: some interfaces are configured incorrectly or not at all in /etc/" +"config/network!" +msgstr "警告: 某些接口配置不正确或未配置到 /etc/config/network!" + +msgid "" +"WARNING: some interfaces have a higher reliability requirement than there " +"are tracking IP addresses!" +msgstr "警告: 某些接口的追踪可靠性要求大于了追踪 IP 地址总数!" + +msgid "" +"WARNING: some interfaces have duplicate metrics configured in /etc/config/" +"network!" +msgstr "警告: 某些接口在 /etc/config/network 中配置了相同的跃点数!" + +msgid "" +"WARNING: some interfaces have no default route in the main routing table!" +msgstr "警告: 某些接口在主路由表中没有默认路由!" + +msgid "" +"WARNING: some interfaces have no metric configured in /etc/config/network!" +msgstr "警告: 某些接口没有在 /etc/config/network 中配置跃点数!" + +msgid "" +"WARNING: some rules have a port configured with no or improper protocol " +"specified! Please configure a specific protocol!" +msgstr "" +"警告: 某些规则指定了端口却没有配置或配置了不正确的协议,请重新指定协议!" + +msgid "" +"WARNING: this and other interfaces have duplicate metrics configured in /etc/" +"config/network!" +msgstr "警告: 此接口和其他接口在 /etc/config/network 中配置了相同的跃点数!" + +msgid "" +"WARNING: this interface has a higher reliability requirement than there are " +"tracking IP addresses!" +msgstr "警告: 此接口的追踪可靠性要求大于了追踪 IP 地址总数!" + +msgid "WARNING: this interface has no default route in the main routing table!" +msgstr "警告: 此接口在主路由表中没有默认路由!" + +msgid "" +"WARNING: this interface has no metric configured in /etc/config/network!" +msgstr "警告: 此接口没有在 /etc/config/network 中配置跃点数!" + +msgid "" +"WARNING: this interface is configured incorrectly or not at all in /etc/" +"config/network!" +msgstr "警告: 此接口配置不正确或未配置到 /etc/config/network!" + +msgid "" +"WARNING: this policy's name is %d characters exceeding the maximum of 15!" +msgstr "警告: 此策略的名称具有 %d 个字符,超过了 15 个字符!" + +msgid "" +"WARNING: this rule is incorrectly configured with no or improper protocol " +"specified! Please configure a specific protocol!" +msgstr "警告: 此规则没有配置或配置了不正确的协议,请重新指定协议!" + +msgid "Waiting for MWAN to %s..." +msgstr "等待 MWAN %s..." + +msgid "Waiting for diagnostic results..." +msgstr "等待诊断结果..." + +msgid "Weight" +msgstr "比重" + +msgid "" +"When all policy members are offline use this behavior for matched traffic" +msgstr "当所有策略成员都无法使用的时候,对使用该策略的流量使用这个操作" + +msgid "Wireless Config" +msgstr "无线配置" + +msgid "Yes" +msgstr "是" + +msgid "always" +msgstr "总是" + +msgid "blackhole (drop)" +msgstr "黑洞(丢弃)" + +msgid "default (use main routing table)" +msgstr "默认(使用主路由表)" + +msgid "ifdown" +msgstr "ifdown" + +msgid "ifup" +msgstr "ifup" + +msgid "never" +msgstr "从不" + +msgid "restart" +msgstr "" + +msgid "start" +msgstr "" + +msgid "stop" +msgstr "" + +msgid "unreachable (reject)" +msgstr "不可达(拒绝)" + +msgid "%d IPv4-only hosts" +msgstr "%d 个主机仅支持 IPv4" + +msgid "%d IPv6-only hosts" +msgstr "%d 个主机仅支持 IPv6" + +msgid "%d dual-stack hosts" +msgstr "%d 个双协议栈主机" + +msgid "%s and %s" +msgstr "%s 和 %s" + +msgid "%s, %s and %s" +msgstr "%s, %s 和 %s" + +msgid "-1 - Restart every last day of month" +msgstr "-1 - 每月的最后一天重新开始" + +msgid "-7 - Restart a week before end of month" +msgstr "-7 - 每月底前一周重新开始" + +msgid "1 - Restart every 1st of month" +msgstr "1 - 每月的第一天重新开始" + +msgid "10m - frequent commits at the expense of flash wear" +msgstr "10m - 频繁提交,闪存损耗的开销也增大" + +msgid "12h - compromise between risk of data loss and flash wear" +msgstr "12h - 平衡统计数据丢失的风险以及闪存使用寿命" + +msgid "24h - least flash wear at the expense of data loss risk" +msgstr "24h - 以数据丢失风险的代价换取最小的闪存损耗" + +msgid "30s - refresh twice per minute for reasonably current stats" +msgstr "30s - 每分钟刷新二次以获得较准确的当前统计值" + +msgid "5m - rarely refresh to avoid frequently clearing conntrack counters" +msgstr "5m - 较少刷新以避免频繁清除连接跟踪计数器" + +msgid "60s - commit minutely, useful for non-flash storage" +msgstr "60s - 每分钟提交,适用于非闪存类型存储" + +msgid "0 connections" +msgstr "连接:0" + +msgid "0 hosts" +msgstr "主机:0" + +msgid "0% IPv6 support rate among hosts" +msgstr "支持 IPv6 的主机比例:0%" + +msgid "0B total IPv6 download" +msgstr "IPv6 总下载量:0B" + +msgid "0% of the total traffic is IPv6" +msgstr "IPv6 流量比例:0%" + +msgid "0B total IPv6 upload" +msgstr "IPv6 总上传量:0B" + +msgid "0 cause the most connections" +msgstr "0 是连接数最多的协议" + +msgid "0 cause the most download" +msgstr "0 是下载量最大的协议" + +msgid "0 cause the most upload" +msgstr "0 是上传量最大的协议" + +msgid "0 different application protocols" +msgstr "0 种不同的应用层协议" + +msgid "0 download" +msgstr "下载:0" + +msgid "0 upload" +msgstr "上传:0" + +msgid "Accounting period" +msgstr "统计周期" + +msgid "Advanced Settings" +msgstr "高级设置" + +msgid "Application" +msgstr "应用层协议" + +msgid "Application Protocols" +msgstr "应用层协议" + +msgid "Backup" +msgstr "备份" + +msgid "Bandwidth Monitor" +msgstr "带宽监控" + +msgid "CSV, grouped by IP" +msgstr "CSV,按 IP 分组" + +msgid "CSV, grouped by MAC" +msgstr "CSV,按 MAC 分组" + +msgid "CSV, grouped by protocol" +msgstr "CSV,按协议分组" + +msgid "" +"Changing the accounting interval type will invalidate existing databases!" +"
Download backup." +msgstr "" +"更改统计周期类型会使现有数据库无效!
下载备份." + +msgid "" +"Choose \"Day of month\" to restart the accounting period monthly on a " +"specific date, e.g. every 3rd. Choose \"Fixed interval\" to restart the " +"accounting period exactly every N days, beginning at a given date." +msgstr "" +"选择“每月的某一天”来设置统计周期的重启时间,例如:每个月的第 3 天。选择“固定周" +"期”来设置从给定日期开始每 N 天重启统计周期。" + +msgid "Commit interval" +msgstr "提交间隔" + +msgid "Compress database" +msgstr "压缩数据库" + +msgid "Configuration" +msgstr "配置" + +msgid "Conn." +msgstr "连接" + +msgid "Connections" +msgstr "连接" + +msgid "Connections / Host" +msgstr "连接 / 主机" + +msgid "Database directory" +msgstr "数据库目录" + +msgid "" +"Database storage directory. One file per accounting period will be placed " +"into this directory." +msgstr "数据库存储目录。每个“统计周期”的文件将被放到这个目录中。" + +msgid "Day of month" +msgstr "每月的某一天" + +msgid "" +"Day of month to restart the accounting period. Use negative values to count " +"towards the end of month, e.g. \"-5\" to specify the 27th of July or the " +"24th of Februrary." +msgstr "" +"每个月重启统计周期的日期。使用负数表示从月底开始计算,例如:\"-5\" 可以表" +"示 7 月份的 27 号或者 2 月份的 24 号。" + +msgid "Display" +msgstr "显示" + +msgid "Down. (Bytes / Pkts.)" +msgstr "下载(字节 / 数据包)" + +msgid "Download (Bytes / Packets)" +msgstr "下载(字节 / 数据包)" + +msgid "Download / Application" +msgstr "下载 / 应用层协议" + +msgid "Download Database Backup" +msgstr "下载数据库备份" + +msgid "Dualstack enabled hosts" +msgstr "双协议栈主机" + +msgid "Due date" +msgstr "重置日期" + +msgid "Export" +msgstr "导出" + +msgid "Family" +msgstr "协议类型" + +msgid "Fixed interval" +msgstr "固定周期" + +msgid "Force reload…" +msgstr "强制重新加载..." + +msgid "General Settings" +msgstr "基本设置" + +msgid "Generate Backup" +msgstr "生成备份" + +msgid "Host" +msgstr "主机" + +msgid "Hostname: example.org" +msgstr "主机名:example.org" + +msgid "IPv4 vs. IPv6" +msgstr "IPv4 与 IPv6" + +msgid "IPv6" +msgstr "IPv6" + +msgid "Interval" +msgstr "周期" + +msgid "" +"Interval at which the temporary in-memory database is committed to the " +"persistent database directory." +msgstr "将内存中的临时数据库提交到持久性数据库目录的间隔时间。" + +msgid "" +"Interval at which traffic counters of still established connections are " +"refreshed from netlink information." +msgstr "从 netlink 信息中刷新“已建立连接”的流量计数器的间隔时间。" + +msgid "Invalid or empty backup archive" +msgstr "备份存档无效或为空" + +msgid "JSON dump" +msgstr "JSON 输出" + +msgid "Length of accounting interval in days." +msgstr "统计周期(天)。" + +msgid "Local interfaces" +msgstr "本地接口" + +msgid "Local subnets" +msgstr "本地子网" + +msgid "MAC" +msgstr "MAC" + +msgid "Maximum entries" +msgstr "最大条目" + +msgid "" +"Maximum number of accounting periods to keep, use zero to keep databases " +"forever." +msgstr "保留的统计周期数据库的最大数量,设置 0 表示不限制。" + +msgid "Netlink Bandwidth Monitor" +msgstr "网络带宽监视器" + +msgid "Netlink Bandwidth Monitor - Backup / Restore" +msgstr "网络带宽监视器 - 备份 / 恢复" + +msgid "Netlink Bandwidth Monitor - Configuration" +msgstr "网络带宽监视器 - 配置" + +msgid "No data recorded yet." +msgstr "暂无数据记录。" + +msgid "Only conntrack streams from or to any of these networks are counted." +msgstr "仅统计来自或目标为这些网络接口的连接流量。" + +msgid "Only conntrack streams from or to any of these subnets are counted." +msgstr "仅统计来自或目标为这些子网的连接流量。" + +msgid "Preallocate database" +msgstr "预分配数据库" + +msgid "Protocol" +msgstr "协议" + +msgid "Protocol Mapping" +msgstr "协议映射" + +msgid "" +"Protocol mappings to distinguish traffic types per host, one mapping per " +"line. The first value specifies the IP protocol, the second value the port " +"number and the third column is the name of the mapped protocol." +msgstr "" +"协议映射用于区分流量类型,每行一条。第一个值指定 IP 协议类型,第二个值是" +"端口号,第三个值是映射的协议名称。" + +msgid "Refresh interval" +msgstr "刷新间隔" + +msgid "Restore" +msgstr "恢复" + +msgid "Restore Database Backup" +msgstr "恢复数据库备份" + +msgid "Select accounting period:" +msgstr "选择统计周期:" + +msgid "Source IP" +msgstr "源 IP" + +msgid "Start date" +msgstr "起始日期" + +msgid "Start date of the first accounting period, e.g. begin of ISP contract." +msgstr "第一个统计周期的起始日期,例如:ISP 合约的起始日期。" + +msgid "Stored periods" +msgstr "储存周期" + +msgid "" +"The Netlink Bandwidth Monitor (nlbwmon) is a lightweight, efficient traffic " +"accounting program keeping track of bandwidth usage per host and protocol." +msgstr "" +"网络带宽监视器(nlbwmon)是一个轻量、高效的流量统计程序,可以统计每个主机和" +"协议的带宽使用情况。" + +msgid "The following database files have been restored: %s" +msgstr "以下数据库文件已恢复:%s" + +msgid "" +"The maximum amount of entries that should be put into the database, setting " +"the limit to 0 will allow databases to grow indefinitely." +msgstr "数据库中的最大条目数量, 设置为 0 将允许数据库无限增长。" + +msgid "Traffic / Host" +msgstr "流量 / 主机" + +msgid "Traffic Distribution" +msgstr "流量分布" + +msgid "Up. (Bytes / Pkts.)" +msgstr "上传(字节 / 数据包)" + +msgid "Upload (Bytes / Packets)" +msgstr "上传(字节 / 数据包)" + +msgid "Upload / Application" +msgstr "上传 / 应用层协议" + +msgid "Vendor: Example Corp." +msgstr "供应商: Example Corp." + +msgid "Warning" +msgstr "警告" + +msgid "" +"Whether to gzip compress archive databases. Compressing the database files " +"makes accessing old data slightly slower but helps to reduce storage " +"requirements." +msgstr "" +"是否使用 gzip 压缩数据库存档。压缩数据库文件会使访问旧数据稍微慢一些, 但有助" +"于减少存储占用空间。" + +msgid "" +"Whether to preallocate the maximum possible database size in memory. This is " +"mainly useful for memory constrained systems which might not be able to " +"satisfy memory allocation after longer uptime periods." +msgstr "" +"是否预先分配数据库最大可能占用的内存大小。这主要适用于内存较小系统,这些系统" +"在长时间运行之后可能无法满足数据库的内存需求。" + +msgid "no traffic" +msgstr "无流量数据" + +msgid "other" +msgstr "其他" + +msgid "Enable IGMP snooping" +msgstr "开启 IGMP snooping" + +msgid "Enables IGMP snooping on this bridge" +msgstr "在此桥接上启用 IGMP snooping 组播(多播)" + +msgid "" +msgstr "Content-Type: text/plain; charset=UTF-8" + +msgid "Action" +msgstr "动作" + +msgid "Advanced Reboot" +msgstr "双分区启动切换" + +msgid "Alternative" +msgstr "备选" + +msgid "Cancel" +msgstr "取消" + +msgid "Confirm" +msgstr "确定" + +msgid "Current" +msgstr "当前" + +msgid "Firmware/OS (Kernel)" +msgstr "固件/系统 (内核)" + +msgid "Partition" +msgstr "分区" + +msgid "Partitions" +msgstr "分区" + +msgid "Perform power off..." +msgstr "点击关机..." + +msgid "Power Off Device" +msgstr "关闭设备" + +msgid "Proceed" +msgstr "处理" + +msgid "Reboot Device to an Alternative Partition" +msgstr "重启设备到备选分区" + +msgid "Reboot to alternative partition..." +msgstr "重启到备选分区" + +msgid "Reboot to current partition" +msgstr "重启到当前分区" + +msgid "Rebooting..." +msgstr "正在重启..." + +msgid "Shutting down..." +msgstr "正在关闭..." + +msgid "Status" +msgstr "状态" + +msgid "" +"The system is rebooting now.
DO NOT POWER OFF THE DEVICE!
Wait a " +"few minutes before you try to reconnect. It might be necessary to renew the " +"address of your computer to reach the device again, depending on your " +"settings." +msgstr "" + +msgid "" +"The system is rebooting to an alternative partition now.
DO NOT POWER " +"OFF THE DEVICE!
Wait a few minutes before you try to reconnect. It " +"might be necessary to renew the address of your computer to reach the device " +"again, depending on your settings." +msgstr "" + +msgid "" +"The system is shutting down now.
DO NOT POWER OFF THE DEVICE!
It " +"might be necessary to renew the address of your computer to reach the device " +"again, depending on your settings." +msgstr "" + +msgid "" +"WARNING: An alternative partition might have its own settings and completely " +"different firmware.

As your network configuration and WiFi SSID/" +"password on alternative partition might be different, you might have to " +"adjust your computer settings to be able to access your device once it " +"reboots.

Please also be aware that alternative partition " +"firmware might not provide an easy way to switch active partition and boot " +"back to the currently active partition.

Click \"Proceed\" below " +"to reboot device to an alternative partition." +msgstr "" + +msgid "" +"WARNING: Power off might result in a reboot on a device which doesn't " +"support power off.

Click \"Proceed\" below to power off your " +"device." +msgstr "" + +msgid "Warning: There are unsaved changes that will get lost on reboot!" +msgstr "警告:某些设置没有保存,重启将导致丢失这些配置!" + +msgid "Warning: This system does not have two partitions!" +msgstr "警告:当前系统没有包括两个分区!" + +msgid "Warning: This system does not support powering off!" +msgstr "警告:本系统不支持软关机!" + diff --git a/package/default-settings/tools/po2lmo/Makefile b/package/default-settings/tools/po2lmo/Makefile new file mode 100644 index 0000000000..ad2c133207 --- /dev/null +++ b/package/default-settings/tools/po2lmo/Makefile @@ -0,0 +1,12 @@ + +INSTALL = install +PREFIX = /usr/bin + +po2lmo: src/po2lmo.o src/template_lmo.o + $(CC) $(LDFLAGS) -o src/po2lmo src/po2lmo.o src/template_lmo.o + +install: + $(INSTALL) -m 755 src/po2lmo $(PREFIX) + +clean: + $(RM) src/po2lmo src/*.o diff --git a/package/default-settings/tools/po2lmo/src/po2lmo b/package/default-settings/tools/po2lmo/src/po2lmo new file mode 100644 index 0000000000..134a59c27b Binary files /dev/null and b/package/default-settings/tools/po2lmo/src/po2lmo differ diff --git a/package/default-settings/tools/po2lmo/src/po2lmo.c b/package/default-settings/tools/po2lmo/src/po2lmo.c new file mode 100644 index 0000000000..0da792b680 --- /dev/null +++ b/package/default-settings/tools/po2lmo/src/po2lmo.c @@ -0,0 +1,247 @@ +/* + * lmo - Lua Machine Objects - PO to LMO conversion tool + * + * Copyright (C) 2009-2012 Jo-Philipp Wich + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "template_lmo.h" + +static void die(const char *msg) +{ + fprintf(stderr, "Error: %s\n", msg); + exit(1); +} + +static void usage(const char *name) +{ + fprintf(stderr, "Usage: %s input.po output.lmo\n", name); + exit(1); +} + +static void print(const void *ptr, size_t size, size_t nmemb, FILE *stream) +{ + if( fwrite(ptr, size, nmemb, stream) == 0 ) + die("Failed to write stdout"); +} + +static int extract_string(const char *src, char *dest, int len) +{ + int pos = 0; + int esc = 0; + int off = -1; + + for( pos = 0; (pos < strlen(src)) && (pos < len); pos++ ) + { + if( (off == -1) && (src[pos] == '"') ) + { + off = pos + 1; + } + else if( off >= 0 ) + { + if( esc == 1 ) + { + switch (src[pos]) + { + case '"': + case '\\': + off++; + break; + } + dest[pos-off] = src[pos]; + esc = 0; + } + else if( src[pos] == '\\' ) + { + dest[pos-off] = src[pos]; + esc = 1; + } + else if( src[pos] != '"' ) + { + dest[pos-off] = src[pos]; + } + else + { + dest[pos-off] = '\0'; + break; + } + } + } + + return (off > -1) ? strlen(dest) : -1; +} + +static int cmp_index(const void *a, const void *b) +{ + uint32_t x = ((const lmo_entry_t *)a)->key_id; + uint32_t y = ((const lmo_entry_t *)b)->key_id; + + if (x < y) + return -1; + else if (x > y) + return 1; + + return 0; +} + +static void print_uint32(uint32_t x, FILE *out) +{ + uint32_t y = htonl(x); + print(&y, sizeof(uint32_t), 1, out); +} + +static void print_index(void *array, int n, FILE *out) +{ + lmo_entry_t *e; + + qsort(array, n, sizeof(*e), cmp_index); + + for (e = array; n > 0; n--, e++) + { + print_uint32(e->key_id, out); + print_uint32(e->val_id, out); + print_uint32(e->offset, out); + print_uint32(e->length, out); + } +} + +int main(int argc, char *argv[]) +{ + char line[4096]; + char key[4096]; + char val[4096]; + char tmp[4096]; + int state = 0; + int offset = 0; + int length = 0; + int n_entries = 0; + void *array = NULL; + lmo_entry_t *entry = NULL; + uint32_t key_id, val_id; + + FILE *in; + FILE *out; + + if( (argc != 3) || ((in = fopen(argv[1], "r")) == NULL) || ((out = fopen(argv[2], "w")) == NULL) ) + usage(argv[0]); + + memset(line, 0, sizeof(key)); + memset(key, 0, sizeof(val)); + memset(val, 0, sizeof(val)); + + while( (NULL != fgets(line, sizeof(line), in)) || (state >= 2 && feof(in)) ) + { + if( state == 0 && strstr(line, "msgid \"") == line ) + { + switch(extract_string(line, key, sizeof(key))) + { + case -1: + die("Syntax error in msgid"); + case 0: + state = 1; + break; + default: + state = 2; + } + } + else if( state == 1 || state == 2 ) + { + if( strstr(line, "msgstr \"") == line || state == 2 ) + { + switch(extract_string(line, val, sizeof(val))) + { + case -1: + state = 4; + break; + default: + state = 3; + } + } + else + { + switch(extract_string(line, tmp, sizeof(tmp))) + { + case -1: + state = 2; + break; + default: + strcat(key, tmp); + } + } + } + else if( state == 3 ) + { + switch(extract_string(line, tmp, sizeof(tmp))) + { + case -1: + state = 4; + break; + default: + strcat(val, tmp); + } + } + + if( state == 4 ) + { + if( strlen(key) > 0 && strlen(val) > 0 ) + { + key_id = sfh_hash(key, strlen(key)); + val_id = sfh_hash(val, strlen(val)); + + if( key_id != val_id ) + { + n_entries++; + array = realloc(array, n_entries * sizeof(lmo_entry_t)); + entry = (lmo_entry_t *)array + n_entries - 1; + + if (!array) + die("Out of memory"); + + entry->key_id = key_id; + entry->val_id = val_id; + entry->offset = offset; + entry->length = strlen(val); + + length = strlen(val) + ((4 - (strlen(val) % 4)) % 4); + + print(val, length, 1, out); + offset += length; + } + } + + state = 0; + memset(key, 0, sizeof(key)); + memset(val, 0, sizeof(val)); + } + + memset(line, 0, sizeof(line)); + } + + print_index(array, n_entries, out); + + if( offset > 0 ) + { + print_uint32(offset, out); + fsync(fileno(out)); + fclose(out); + } + else + { + fclose(out); + unlink(argv[2]); + } + + fclose(in); + return(0); +} diff --git a/package/default-settings/tools/po2lmo/src/template_lmo.c b/package/default-settings/tools/po2lmo/src/template_lmo.c new file mode 100644 index 0000000000..27205a7228 --- /dev/null +++ b/package/default-settings/tools/po2lmo/src/template_lmo.c @@ -0,0 +1,328 @@ +/* + * lmo - Lua Machine Objects - Base functions + * + * Copyright (C) 2009-2010 Jo-Philipp Wich + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "template_lmo.h" + +/* + * Hash function from http://www.azillionmonkeys.com/qed/hash.html + * Copyright (C) 2004-2008 by Paul Hsieh + */ + +uint32_t sfh_hash(const char *data, int len) +{ + uint32_t hash = len, tmp; + int rem; + + if (len <= 0 || data == NULL) return 0; + + rem = len & 3; + len >>= 2; + + /* Main loop */ + for (;len > 0; len--) { + hash += sfh_get16(data); + tmp = (sfh_get16(data+2) << 11) ^ hash; + hash = (hash << 16) ^ tmp; + data += 2*sizeof(uint16_t); + hash += hash >> 11; + } + + /* Handle end cases */ + switch (rem) { + case 3: hash += sfh_get16(data); + hash ^= hash << 16; + hash ^= data[sizeof(uint16_t)] << 18; + hash += hash >> 11; + break; + case 2: hash += sfh_get16(data); + hash ^= hash << 11; + hash += hash >> 17; + break; + case 1: hash += *data; + hash ^= hash << 10; + hash += hash >> 1; + } + + /* Force "avalanching" of final 127 bits */ + hash ^= hash << 3; + hash += hash >> 5; + hash ^= hash << 4; + hash += hash >> 17; + hash ^= hash << 25; + hash += hash >> 6; + + return hash; +} + +uint32_t lmo_canon_hash(const char *str, int len) +{ + char res[4096]; + char *ptr, prev; + int off; + + if (!str || len >= sizeof(res)) + return 0; + + for (prev = ' ', ptr = res, off = 0; off < len; prev = *str, off++, str++) + { + if (isspace(*str)) + { + if (!isspace(prev)) + *ptr++ = ' '; + } + else + { + *ptr++ = *str; + } + } + + if ((ptr > res) && isspace(*(ptr-1))) + ptr--; + + return sfh_hash(res, ptr - res); +} + +lmo_archive_t * lmo_open(const char *file) +{ + int in = -1; + uint32_t idx_offset = 0; + struct stat s; + + lmo_archive_t *ar = NULL; + + if (stat(file, &s) == -1) + goto err; + + if ((in = open(file, O_RDONLY)) == -1) + goto err; + + if ((ar = (lmo_archive_t *)malloc(sizeof(*ar))) != NULL) + { + memset(ar, 0, sizeof(*ar)); + + ar->fd = in; + ar->size = s.st_size; + + fcntl(ar->fd, F_SETFD, fcntl(ar->fd, F_GETFD) | FD_CLOEXEC); + + if ((ar->mmap = mmap(NULL, ar->size, PROT_READ, MAP_SHARED, ar->fd, 0)) == MAP_FAILED) + goto err; + + idx_offset = ntohl(*((const uint32_t *) + (ar->mmap + ar->size - sizeof(uint32_t)))); + + if (idx_offset >= ar->size) + goto err; + + ar->index = (lmo_entry_t *)(ar->mmap + idx_offset); + ar->length = (ar->size - idx_offset - sizeof(uint32_t)) / sizeof(lmo_entry_t); + ar->end = ar->mmap + ar->size; + + return ar; + } + +err: + if (in > -1) + close(in); + + if (ar != NULL) + { + if ((ar->mmap != NULL) && (ar->mmap != MAP_FAILED)) + munmap(ar->mmap, ar->size); + + free(ar); + } + + return NULL; +} + +void lmo_close(lmo_archive_t *ar) +{ + if (ar != NULL) + { + if ((ar->mmap != NULL) && (ar->mmap != MAP_FAILED)) + munmap(ar->mmap, ar->size); + + close(ar->fd); + free(ar); + + ar = NULL; + } +} + + +lmo_catalog_t *_lmo_catalogs = NULL; +lmo_catalog_t *_lmo_active_catalog = NULL; + +int lmo_load_catalog(const char *lang, const char *dir) +{ + DIR *dh = NULL; + char pattern[16]; + char path[PATH_MAX]; + struct dirent *de = NULL; + + lmo_archive_t *ar = NULL; + lmo_catalog_t *cat = NULL; + + if (!lmo_change_catalog(lang)) + return 0; + + if (!dir || !(dh = opendir(dir))) + goto err; + + if (!(cat = malloc(sizeof(*cat)))) + goto err; + + memset(cat, 0, sizeof(*cat)); + + snprintf(cat->lang, sizeof(cat->lang), "%s", lang); + snprintf(pattern, sizeof(pattern), "*.%s.lmo", lang); + + while ((de = readdir(dh)) != NULL) + { + if (!fnmatch(pattern, de->d_name, 0)) + { + snprintf(path, sizeof(path), "%s/%s", dir, de->d_name); + ar = lmo_open(path); + + if (ar) + { + ar->next = cat->archives; + cat->archives = ar; + } + } + } + + closedir(dh); + + cat->next = _lmo_catalogs; + _lmo_catalogs = cat; + + if (!_lmo_active_catalog) + _lmo_active_catalog = cat; + + return 0; + +err: + if (dh) closedir(dh); + if (cat) free(cat); + + return -1; +} + +int lmo_change_catalog(const char *lang) +{ + lmo_catalog_t *cat; + + for (cat = _lmo_catalogs; cat; cat = cat->next) + { + if (!strncmp(cat->lang, lang, sizeof(cat->lang))) + { + _lmo_active_catalog = cat; + return 0; + } + } + + return -1; +} + +static lmo_entry_t * lmo_find_entry(lmo_archive_t *ar, uint32_t hash) +{ + unsigned int m, l, r; + uint32_t k; + + l = 0; + r = ar->length - 1; + + while (1) + { + m = l + ((r - l) / 2); + + if (r < l) + break; + + k = ntohl(ar->index[m].key_id); + + if (k == hash) + return &ar->index[m]; + + if (k > hash) + { + if (!m) + break; + + r = m - 1; + } + else + { + l = m + 1; + } + } + + return NULL; +} + +int lmo_translate(const char *key, int keylen, char **out, int *outlen) +{ + uint32_t hash; + lmo_entry_t *e; + lmo_archive_t *ar; + + if (!key || !_lmo_active_catalog) + return -2; + + hash = lmo_canon_hash(key, keylen); + + for (ar = _lmo_active_catalog->archives; ar; ar = ar->next) + { + if ((e = lmo_find_entry(ar, hash)) != NULL) + { + *out = ar->mmap + ntohl(e->offset); + *outlen = ntohl(e->length); + return 0; + } + } + + return -1; +} + +void lmo_close_catalog(const char *lang) +{ + lmo_archive_t *ar, *next; + lmo_catalog_t *cat, *prev; + + for (prev = NULL, cat = _lmo_catalogs; cat; prev = cat, cat = cat->next) + { + if (!strncmp(cat->lang, lang, sizeof(cat->lang))) + { + if (prev) + prev->next = cat->next; + else + _lmo_catalogs = cat->next; + + for (ar = cat->archives; ar; ar = next) + { + next = ar->next; + lmo_close(ar); + } + + free(cat); + break; + } + } +} diff --git a/package/default-settings/tools/po2lmo/src/template_lmo.h b/package/default-settings/tools/po2lmo/src/template_lmo.h new file mode 100644 index 0000000000..57f59aa56b --- /dev/null +++ b/package/default-settings/tools/po2lmo/src/template_lmo.h @@ -0,0 +1,92 @@ +/* + * lmo - Lua Machine Objects - General header + * + * Copyright (C) 2009-2012 Jo-Philipp Wich + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef _TEMPLATE_LMO_H_ +#define _TEMPLATE_LMO_H_ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#if (defined(__GNUC__) && defined(__i386__)) +#define sfh_get16(d) (*((const uint16_t *) (d))) +#else +#define sfh_get16(d) ((((uint32_t)(((const uint8_t *)(d))[1])) << 8)\ + +(uint32_t)(((const uint8_t *)(d))[0]) ) +#endif + + +struct lmo_entry { + uint32_t key_id; + uint32_t val_id; + uint32_t offset; + uint32_t length; +} __attribute__((packed)); + +typedef struct lmo_entry lmo_entry_t; + + +struct lmo_archive { + int fd; + int length; + uint32_t size; + lmo_entry_t *index; + char *mmap; + char *end; + struct lmo_archive *next; +}; + +typedef struct lmo_archive lmo_archive_t; + + +struct lmo_catalog { + char lang[6]; + struct lmo_archive *archives; + struct lmo_catalog *next; +}; + +typedef struct lmo_catalog lmo_catalog_t; + + +uint32_t sfh_hash(const char *data, int len); +uint32_t lmo_canon_hash(const char *data, int len); + +lmo_archive_t * lmo_open(const char *file); +void lmo_close(lmo_archive_t *ar); + + +extern lmo_catalog_t *_lmo_catalogs; +extern lmo_catalog_t *_lmo_active_catalog; + +int lmo_load_catalog(const char *lang, const char *dir); +int lmo_change_catalog(const char *lang); +int lmo_translate(const char *key, int keylen, char **out, int *outlen); +void lmo_close_catalog(const char *lang); + +#endif diff --git a/package/kernel/linux/files/sysctl-nf-conntrack.conf b/package/kernel/linux/files/sysctl-nf-conntrack.conf index 37baf5fd6f..4a3f8bfc61 100644 --- a/package/kernel/linux/files/sysctl-nf-conntrack.conf +++ b/package/kernel/linux/files/sysctl-nf-conntrack.conf @@ -3,7 +3,7 @@ net.netfilter.nf_conntrack_acct=1 net.netfilter.nf_conntrack_checksum=0 -net.netfilter.nf_conntrack_max=16384 +net.netfilter.nf_conntrack_max=65535 net.netfilter.nf_conntrack_tcp_timeout_established=7440 net.netfilter.nf_conntrack_udp_timeout=60 net.netfilter.nf_conntrack_udp_timeout_stream=180 diff --git a/target/linux/x86/Makefile b/target/linux/x86/Makefile index c78eac0094..14d45aae0b 100644 --- a/target/linux/x86/Makefile +++ b/target/linux/x86/Makefile @@ -17,7 +17,14 @@ KERNELNAME:=bzImage include $(INCLUDE_DIR)/target.mk -DEFAULT_PACKAGES += partx-utils mkf2fs e2fsprogs kmod-button-hotplug +DEFAULT_PACKAGES += partx-utils mkf2fs e2fsprogs kmod-button-hotplug \ +fdisk kmod-usb-hid kmod-ath5k kmod-ath9k kmod-ath9k-htc kmod-ath10k kmod-rt2800-usb kmod-e1000e kmod-igb kmod-igbvf kmod-igc kmod-ixgbe kmod-pcnet32 kmod-tulip kmod-vmxnet3 kmod-i40e kmod-i40evf kmod-8139cp kmod-8139too kmod-fs-f2fs \ +htop lm-sensors autocore automount autosamba ddns-scripts_aliyun ddns-scripts_dnspod ca-certificates \ +ath10k-firmware-qca988x ath10k-firmware-qca9888 ath10k-firmware-qca9984 brcmfmac-firmware-43602a1-pcie kmod-crypto-misc \ +alsa-utils kmod-ac97 kmod-sound-hda-core kmod-sound-hda-codec-realtek kmod-sound-hda-codec-via kmod-sound-via82xx kmod-usb-audio \ +kmod-usb-net kmod-usb-net-asix kmod-usb-net-asix-ax88179 kmod-usb-net-ipheth kmod-usb-net-rndis kmod-usb-net-rtl8150 kmod-usb-net-rtl8152 \ +curl \ +luci-app-usb-printer luci-app-vsftpd $(eval $(call BuildTarget))