diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index efc3cc25f..000000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,751 +0,0 @@ -version: 2 -jobs: - prepare: - machine: - image: ubuntu-1604:201903-01 - - working_directory: ~/ - - steps: - - run: - name: Prepare - command: | - sudo rm -rf /var/lib/apt/lists/lock - sudo apt-get update - sudo rm -rf /var/lib/apt/lists/lock - sudo apt-get install -yq build-essential git unzip ncurses-dev libz-dev libssl-dev python subversion gettext gawk wget curl rsync perl libelf-dev python3.5 libpython3.5-stdlib liblzma-dev - pyenv global 3.5.2 - - build_x86_64: - machine: - image: ubuntu-1604:201903-01 - - environment: - - OMR_VERSION: $CIRCLE_TAG - - OMR_TARGET: x86_64 - - OMR_KERNEL: 5.4 - - working_directory: ~/ - - steps: - - run: - name: cache - command: | - echo "cache 107 $OMR_KERNEL $OMR_TARGET" > /tmp/cache-target - echo "cache 108 $OMR_KERNEL $OMR_TARGET $OMR_VERSION" > /tmp/cache-version - - - restore_cache: - keys: - - cache-{{ checksum "/tmp/cache-version" }} - - cache-{{ checksum "/tmp/cache-target" }} - - - run: - name: Build toolchain - no_output_timeout: 50m - command: | - git clone https://github.com/ysurac/openmptcprouter || true - cd openmptcprouter - git checkout ${CIRCLE_BRANCH:-$CIRCLE_TAG} || true - git pull || true - export OMR_PATH="$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME/${CIRCLE_BRANCH:-$CIRCLE_TAG}" - export OMR_FEED_URL="$CIRCLE_REPOSITORY_URL" - export OMR_FEED_SRC="${CIRCLE_BRANCH:-$CIRCLE_TAG}" - sudo apt-get update - sudo apt-get install -yq libelf-dev - pyenv global 3.5.2 - sh build.sh prepare {tools,toolchain}/install -j2 - echo -e "$OMR_PRIVKEY" > ~/openmptcprouter/$OMR_TARGET/source/key-build - echo -e "$OMR_PUBKEY" > ~/openmptcprouter/$OMR_TARGET/source/key-build.pub - - - save_cache: - key: cache-{{ checksum "/tmp/cache-target" }} - paths: - - openmptcprouter - - - run: - name: Build - no_output_timeout: 50m - command: make IGNORE_ERRORS=m -C ~/openmptcprouter/$OMR_TARGET/source package/{compile,install,index} target/install -j2 - - - run: - name: Deploy - command: | - ssh -p ${OMR_DEPLOY_PORT:-22} deploy@$OMR_DEPLOY_HOST mkdir -p deploy/${CIRCLE_BRANCH:-release}/${CIRCLE_TAG:-$OMR_KERNEL}/$OMR_TARGET - rsync -av --delete-after ~/openmptcprouter/$OMR_TARGET/source/bin/ -e "ssh -q -p ${OMR_DEPLOY_PORT:-22}" deploy@$OMR_DEPLOY_HOST:deploy/${CIRCLE_BRANCH:-release}/${CIRCLE_TAG:-$OMR_KERNEL}/$OMR_TARGET - rm -rf ~/openmptcprouter/$OMR_TARGET/source/bin - - - save_cache: - key: cache-{{ checksum "/tmp/cache-version" }} - paths: - - openmptcprouter - - build_x86: - machine: - image: ubuntu-1604:201903-01 - - environment: - - OMR_VERSION: $CIRCLE_TAG - - OMR_TARGET: x86 - - OMR_KERNEL: 5.4 - - working_directory: ~/ - - steps: - - run: - name: cache - command: | - echo "cache 107 $OMR_KERNEL $OMR_TARGET" > /tmp/cache-target - echo "cache 108 $OMR_KERNEL $OMR_TARGET $OMR_VERSION" > /tmp/cache-version - - - restore_cache: - keys: - - cache-{{ checksum "/tmp/cache-version" }} - - cache-{{ checksum "/tmp/cache-target" }} - - - run: - name: Build toolchain - no_output_timeout: 40m - command: | - git clone https://github.com/ysurac/openmptcprouter || true - cd openmptcprouter - git checkout ${CIRCLE_BRANCH:-$CIRCLE_TAG} || true - git pull || true - export OMR_PATH="$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME/${CIRCLE_BRANCH:-$CIRCLE_TAG}" - export OMR_FEED_URL="$CIRCLE_REPOSITORY_URL" - export OMR_FEED_SRC="${CIRCLE_BRANCH:-$CIRCLE_TAG}" - pyenv global 3.5.2 - sh build.sh prepare {tools,toolchain}/install -j2 - echo -e "$OMR_PRIVKEY" > ~/openmptcprouter/$OMR_TARGET/source/key-build - echo -e "$OMR_PUBKEY" > ~/openmptcprouter/$OMR_TARGET/source/key-build.pub - - - save_cache: - key: cache-{{ checksum "/tmp/cache-target" }} - paths: - - openmptcprouter - - - run: - name: Build - no_output_timeout: 40m - command: make IGNORE_ERRORS=m -C ~/openmptcprouter/$OMR_TARGET/source package/{compile,install,index} target/install -j2 - - - run: - name: Deploy - command: | - ssh -p ${OMR_DEPLOY_PORT:-22} deploy@$OMR_DEPLOY_HOST mkdir -p deploy/${CIRCLE_BRANCH:-release}/${CIRCLE_TAG:-$OMR_KERNEL}/$OMR_TARGET - rsync -av --delete-after ~/openmptcprouter/$OMR_TARGET/source/bin/ -e "ssh -q -p ${OMR_DEPLOY_PORT:-22}" deploy@$OMR_DEPLOY_HOST:deploy/${CIRCLE_BRANCH:-release}/${CIRCLE_TAG:-$OMR_KERNEL}/$OMR_TARGET - rm -rf ~/openmptcprouter/$OMR_TARGET/source/bin - - - save_cache: - key: cache-{{ checksum "/tmp/cache-version" }} - paths: - - openmptcprouter - - build_rpi3: - machine: - image: ubuntu-1604:201903-01 - - environment: - - OMR_VERSION: $CIRCLE_TAG - - OMR_TARGET: rpi3 - - OMR_KERNEL: 5.4 - - working_directory: ~/ - - steps: - - run: - name: cache - command: | - echo "cache 107 $OMR_KERNEL $OMR_TARGET" > /tmp/cache-target - echo "cache 108 $OMR_KERNEL $OMR_TARGET $OMR_VERSION" > /tmp/cache-version - - - restore_cache: - keys: - - cache-{{ checksum "/tmp/cache-version" }} - - cache-{{ checksum "/tmp/cache-target" }} - - - run: - name: Build toolchain - no_output_timeout: 40m - command: | - git clone https://github.com/ysurac/openmptcprouter || true - cd openmptcprouter - git checkout ${CIRCLE_BRANCH:-$CIRCLE_TAG} || true - git pull || true - export OMR_PATH="$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME/${CIRCLE_BRANCH:-$CIRCLE_TAG}" - export OMR_FEED_URL="$CIRCLE_REPOSITORY_URL" - export OMR_FEED_SRC="${CIRCLE_BRANCH:-$CIRCLE_TAG}" - pyenv global 3.5.2 - sh build.sh prepare {tools,toolchain}/install -j2 - echo -e "$OMR_PRIVKEY" > ~/openmptcprouter/$OMR_TARGET/source/key-build - echo -e "$OMR_PUBKEY" > ~/openmptcprouter/$OMR_TARGET/source/key-build.pub - - - save_cache: - key: cache-{{ checksum "/tmp/cache-target" }} - paths: - - openmptcprouter - - - run: - name: Build - no_output_timeout: 40m - command: make IGNORE_ERRORS=m -C ~/openmptcprouter/$OMR_TARGET/source package/{compile,install,index} target/compile -j2 package/compile -j2 target/install -j2 - - - run: - name: Deploy - command: | - ssh -p ${OMR_DEPLOY_PORT:-22} deploy@$OMR_DEPLOY_HOST mkdir -p deploy/${CIRCLE_BRANCH:-release}/${CIRCLE_TAG:-$OMR_KERNEL}/$OMR_TARGET - rsync -av --delete-after ~/openmptcprouter/$OMR_TARGET/source/bin/ -e "ssh -q -p ${OMR_DEPLOY_PORT:-22}" deploy@$OMR_DEPLOY_HOST:deploy/${CIRCLE_BRANCH:-release}/${CIRCLE_TAG:-$OMR_KERNEL}/$OMR_TARGET - rm -rf ~/openmptcprouter/$OMR_TARGET/source/bin - - - save_cache: - key: cache-{{ checksum "/tmp/cache-version" }} - paths: - - openmptcprouter - - build_espressobin: - machine: - image: ubuntu-1604:201903-01 - - environment: - - OMR_VERSION: $CIRCLE_TAG - - OMR_TARGET: espressobin - - OMR_KERNEL: 5.4 - - working_directory: ~/ - - steps: - - run: - name: cache - command: | - echo "cache 107 $OMR_KERNEL $OMR_TARGET" > /tmp/cache-target - echo "cache 108 $OMR_KERNEL $OMR_TARGET $OMR_VERSION" > /tmp/cache-version - - - restore_cache: - keys: - - cache-{{ checksum "/tmp/cache-version" }} - - cache-{{ checksum "/tmp/cache-target" }} - - - run: - name: Build toolchain - no_output_timeout: 40m - command: | - git clone https://github.com/ysurac/openmptcprouter || true - cd openmptcprouter - git checkout ${CIRCLE_BRANCH:-$CIRCLE_TAG} || true - git pull || true - export OMR_PATH="$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME/${CIRCLE_BRANCH:-$CIRCLE_TAG}" - export OMR_FEED_URL="$CIRCLE_REPOSITORY_URL" - export OMR_FEED_SRC="${CIRCLE_BRANCH:-$CIRCLE_TAG}" - pyenv global 3.5.2 - sh build.sh prepare {tools,toolchain}/install -j2 - echo -e "$OMR_PRIVKEY" > ~/openmptcprouter/$OMR_TARGET/source/key-build - echo -e "$OMR_PUBKEY" > ~/openmptcprouter/$OMR_TARGET/source/key-build.pub - - - save_cache: - key: cache-{{ checksum "/tmp/cache-target" }} - paths: - - openmptcprouter - - - run: - name: Build - no_output_timeout: 40m - command: make IGNORE_ERRORS=m -C ~/openmptcprouter/$OMR_TARGET/source package/{compile,install,index} target/compile -j2 package/compile -j2 target/install -j2 - - - run: - name: Deploy - command: | - ssh -p ${OMR_DEPLOY_PORT:-22} deploy@$OMR_DEPLOY_HOST mkdir -p deploy/${CIRCLE_BRANCH:-release}/${CIRCLE_TAG:-$OMR_KERNEL}/$OMR_TARGET - rsync -av --delete-after ~/openmptcprouter/$OMR_TARGET/source/bin/ -e "ssh -q -p ${OMR_DEPLOY_PORT:-22}" deploy@$OMR_DEPLOY_HOST:deploy/${CIRCLE_BRANCH:-release}/${CIRCLE_TAG:-$OMR_KERNEL}/$OMR_TARGET - rm -rf ~/openmptcprouter/$OMR_TARGET/source/bin - - - save_cache: - key: cache-{{ checksum "/tmp/cache-version" }} - paths: - - openmptcprouter - - build_r2s: - machine: - image: ubuntu-1604:201903-01 - - environment: - - OMR_VERSION: $CIRCLE_TAG - - OMR_TARGET: r2s - - OMR_KERNEL: 5.4 - - working_directory: ~/ - - steps: - - run: - name: cache - command: | - echo "cache 107 $OMR_KERNEL $OMR_TARGET" > /tmp/cache-target - echo "cache 108 $OMR_KERNEL $OMR_TARGET $OMR_VERSION" > /tmp/cache-version - - - restore_cache: - keys: - - cache-{{ checksum "/tmp/cache-version" }} - - cache-{{ checksum "/tmp/cache-target" }} - - - run: - name: Build toolchain - no_output_timeout: 40m - command: | - git clone https://github.com/ysurac/openmptcprouter || true - cd openmptcprouter - git checkout ${CIRCLE_BRANCH:-$CIRCLE_TAG} || true - git pull || true - export OMR_PATH="$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME/${CIRCLE_BRANCH:-$CIRCLE_TAG}" - export OMR_FEED_URL="$CIRCLE_REPOSITORY_URL" - export OMR_FEED_SRC="${CIRCLE_BRANCH:-$CIRCLE_TAG}" - pyenv global 3.5.2 - sh build.sh prepare {tools,toolchain}/install -j2 - echo -e "$OMR_PRIVKEY" > ~/openmptcprouter/$OMR_TARGET/source/key-build - echo -e "$OMR_PUBKEY" > ~/openmptcprouter/$OMR_TARGET/source/key-build.pub - - - save_cache: - key: cache-{{ checksum "/tmp/cache-target" }} - paths: - - openmptcprouter - - - run: - name: Build - no_output_timeout: 40m - command: make IGNORE_ERRORS=m -C ~/openmptcprouter/$OMR_TARGET/source package/{compile,install,index} target/compile -j2 package/compile -j2 target/install -j2 - - - run: - name: Deploy - command: | - ssh -p ${OMR_DEPLOY_PORT:-22} deploy@$OMR_DEPLOY_HOST mkdir -p deploy/${CIRCLE_BRANCH:-release}/${CIRCLE_TAG:-$OMR_KERNEL}/$OMR_TARGET - rsync -av --delete-after ~/openmptcprouter/$OMR_TARGET/source/bin/ -e "ssh -q -p ${OMR_DEPLOY_PORT:-22}" deploy@$OMR_DEPLOY_HOST:deploy/${CIRCLE_BRANCH:-release}/${CIRCLE_TAG:-$OMR_KERNEL}/$OMR_TARGET - rm -rf ~/openmptcprouter/$OMR_TARGET/source/bin - - - save_cache: - key: cache-{{ checksum "/tmp/cache-version" }} - paths: - - openmptcprouter - - build_rpi4: - machine: - image: ubuntu-1604:201903-01 - - environment: - - OMR_VERSION: $CIRCLE_TAG - - OMR_TARGET: rpi4 - - OMR_KERNEL: 5.4 - - working_directory: ~/ - - steps: - - run: - name: cache - command: | - echo "cache 107 $OMR_KERNEL $OMR_TARGET" > /tmp/cache-target - echo "cache 108 $OMR_KERNEL $OMR_TARGET $OMR_VERSION" > /tmp/cache-version - - - restore_cache: - keys: - - cache-{{ checksum "/tmp/cache-version" }} - - cache-{{ checksum "/tmp/cache-target" }} - - - run: - name: Build toolchain - no_output_timeout: 40m - command: | - git clone https://github.com/ysurac/openmptcprouter || true - cd openmptcprouter - git checkout ${CIRCLE_BRANCH:-$CIRCLE_TAG} || true - git pull || true - export OMR_PATH="$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME/${CIRCLE_BRANCH:-$CIRCLE_TAG}" - export OMR_FEED_URL="$CIRCLE_REPOSITORY_URL" - export OMR_FEED_SRC="${CIRCLE_BRANCH:-$CIRCLE_TAG}" - pyenv global 3.5.2 - sh build.sh prepare {tools,toolchain}/install -j2 - echo -e "$OMR_PRIVKEY" > ~/openmptcprouter/$OMR_TARGET/source/key-build - echo -e "$OMR_PUBKEY" > ~/openmptcprouter/$OMR_TARGET/source/key-build.pub - - - save_cache: - key: cache-{{ checksum "/tmp/cache-target" }} - paths: - - openmptcprouter - - - run: - name: Build - no_output_timeout: 40m - command: make IGNORE_ERRORS=m -C ~/openmptcprouter/$OMR_TARGET/source package/{compile,install,index} target/compile -j2 package/compile -j2 target/install -j2 - - - run: - name: Deploy - command: | - ssh -p ${OMR_DEPLOY_PORT:-22} deploy@$OMR_DEPLOY_HOST mkdir -p deploy/${CIRCLE_BRANCH:-release}/${CIRCLE_TAG:-$OMR_KERNEL}/$OMR_TARGET - rsync -av --delete-after ~/openmptcprouter/$OMR_TARGET/source/bin/ -e "ssh -q -p ${OMR_DEPLOY_PORT:-22}" deploy@$OMR_DEPLOY_HOST:deploy/${CIRCLE_BRANCH:-release}/${CIRCLE_TAG:-$OMR_KERNEL}/$OMR_TARGET - rm -rf ~/openmptcprouter/$OMR_TARGET/source/bin - - - save_cache: - key: cache-{{ checksum "/tmp/cache-version" }} - paths: - - openmptcprouter - - build_rpi2: - machine: - image: ubuntu-1604:201903-01 - - environment: - - OMR_VERSION: $CIRCLE_TAG - - OMR_TARGET: rpi2 - - OMR_KERNEL: 5.4 - - working_directory: ~/ - - steps: - - run: - name: cache - command: | - echo "cache 107 $OMR_KERNEL $OMR_TARGET" > /tmp/cache-target - echo "cache 108 $OMR_KERNEL $OMR_TARGET $OMR_VERSION" > /tmp/cache-version - - - restore_cache: - keys: - - cache-{{ checksum "/tmp/cache-version" }} - - cache-{{ checksum "/tmp/cache-target" }} - - - run: - name: Build toolchain - no_output_timeout: 40m - command: | - git clone https://github.com/ysurac/openmptcprouter || true - cd openmptcprouter - git checkout ${CIRCLE_BRANCH:-$CIRCLE_TAG} || true - git pull || true - export OMR_PATH="$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME/${CIRCLE_BRANCH:-$CIRCLE_TAG}" - export OMR_FEED_URL="$CIRCLE_REPOSITORY_URL" - export OMR_FEED_SRC="${CIRCLE_BRANCH:-$CIRCLE_TAG}" - pyenv global 3.5.2 - sh build.sh prepare {tools,toolchain}/install -j2 - echo -e "$OMR_PRIVKEY" > ~/openmptcprouter/$OMR_TARGET/source/key-build - echo -e "$OMR_PUBKEY" > ~/openmptcprouter/$OMR_TARGET/source/key-build.pub - - - save_cache: - key: cache-{{ checksum "/tmp/cache-target" }} - paths: - - openmptcprouter - - - run: - name: Build - no_output_timeout: 40m - command: make IGNORE_ERRORS=m -C ~/openmptcprouter/$OMR_TARGET/source package/{compile,install,index} target/compile package/compile target/install -j2 - - - run: - name: Deploy - command: | - ssh -p ${OMR_DEPLOY_PORT:-22} deploy@$OMR_DEPLOY_HOST mkdir -p deploy/${CIRCLE_BRANCH:-release}/${CIRCLE_TAG:-$OMR_KERNEL}/$OMR_TARGET - rsync -av --delete-after ~/openmptcprouter/$OMR_TARGET/source/bin/ -e "ssh -q -p ${OMR_DEPLOY_PORT:-22}" deploy@$OMR_DEPLOY_HOST:deploy/${CIRCLE_BRANCH:-release}/${CIRCLE_TAG:-$OMR_KERNEL}/$OMR_TARGET - rm -rf ~/openmptcprouter/$OMR_TARGET/source/bin - - - save_cache: - key: cache-{{ checksum "/tmp/cache-version" }} - paths: - - openmptcprouter - - build_bpi-r2: - machine: - image: ubuntu-1604:201903-01 - - environment: - - OMR_VERSION: $CIRCLE_TAG - - OMR_TARGET: bpi-r2 - - OMR_KERNEL: 5.4 - - working_directory: ~/ - - steps: - - run: - name: cache - command: | - echo "cache 107 $OMR_KERNEL $OMR_TARGET" > /tmp/cache-target - echo "cache 108 $OMR_KERNEL $OMR_TARGET $OMR_VERSION" > /tmp/cache-version - - - restore_cache: - keys: - - cache-{{ checksum "/tmp/cache-version" }} - - cache-{{ checksum "/tmp/cache-target" }} - - - run: - name: Build toolchain - no_output_timeout: 40m - command: | - git clone https://github.com/ysurac/openmptcprouter || true - cd openmptcprouter - git checkout ${CIRCLE_BRANCH:-$CIRCLE_TAG} || true - git pull || true - export OMR_PATH="$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME/${CIRCLE_BRANCH:-$CIRCLE_TAG}" - export OMR_FEED_URL="$CIRCLE_REPOSITORY_URL" - export OMR_FEED_SRC="${CIRCLE_BRANCH:-$CIRCLE_TAG}" - pyenv global 3.5.2 - sh build.sh prepare {tools,toolchain}/install -j2 - echo -e "$OMR_PRIVKEY" > ~/openmptcprouter/$OMR_TARGET/source/key-build - echo -e "$OMR_PUBKEY" > ~/openmptcprouter/$OMR_TARGET/source/key-build.pub - - - save_cache: - key: cache-{{ checksum "/tmp/cache-target" }} - paths: - - openmptcprouter - - - run: - name: Build - no_output_timeout: 40m - command: | - sudo apt-get update - sudo apt-get -yq install swig2.0 - make IGNORE_ERRORS=m -C ~/openmptcprouter/$OMR_TARGET/source package/{compile,install,index} target/compile -j2 package/compile -j2 target/install -j2 - - - run: - name: Deploy - command: | - ssh -p ${OMR_DEPLOY_PORT:-22} deploy@$OMR_DEPLOY_HOST mkdir -p deploy/${CIRCLE_BRANCH:-release}/${CIRCLE_TAG:-$OMR_KERNEL}/$OMR_TARGET - rsync -av --delete-after ~/openmptcprouter/$OMR_TARGET/source/bin/ -e "ssh -q -p ${OMR_DEPLOY_PORT:-22}" deploy@$OMR_DEPLOY_HOST:deploy/${CIRCLE_BRANCH:-release}/${CIRCLE_TAG:-$OMR_KERNEL}/$OMR_TARGET - rm -rf ~/openmptcprouter/$OMR_TARGET/source/bin - - - save_cache: - key: cache-{{ checksum "/tmp/cache-version" }} - paths: - - openmptcprouter - - build_wrt3200acm: - machine: - image: ubuntu-1604:201903-01 - - environment: - - OMR_VERSION: $CIRCLE_TAG - - OMR_TARGET: wrt3200acm - - OMR_KERNEL: 5.4 - - working_directory: ~/ - - steps: - - run: - name: cache - command: | - echo "cache 107 $OMR_KERNEL $OMR_TARGET" > /tmp/cache-target - echo "cache 108 $OMR_KERNEL $OMR_TARGET $OMR_VERSION" > /tmp/cache-version - - - restore_cache: - keys: - - cache-{{ checksum "/tmp/cache-version" }} - - cache-{{ checksum "/tmp/cache-target" }} - - - run: - name: Build toolchain - no_output_timeout: 40m - command: | - git clone https://github.com/ysurac/openmptcprouter || true - cd openmptcprouter - git checkout ${CIRCLE_BRANCH:-$CIRCLE_TAG} || true - git pull || true - export OMR_PATH="$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME/${CIRCLE_BRANCH:-$CIRCLE_TAG}" - export OMR_FEED_URL="$CIRCLE_REPOSITORY_URL" - export OMR_FEED_SRC="${CIRCLE_BRANCH:-$CIRCLE_TAG}" - pyenv global 3.5.2 - sh build.sh prepare {tools,toolchain}/install -j2 - echo -e "$OMR_PRIVKEY" > ~/openmptcprouter/$OMR_TARGET/source/key-build - echo -e "$OMR_PUBKEY" > ~/openmptcprouter/$OMR_TARGET/source/key-build.pub - - - save_cache: - key: cache-{{ checksum "/tmp/cache-target" }} - paths: - - openmptcprouter - - - run: - name: Build - no_output_timeout: 40m - command: make IGNORE_ERRORS=m -C ~/openmptcprouter/$OMR_TARGET/source package/{compile,install,index} target/compile -j2 package/compile -j2 target/install -j2 - - - run: - name: Deploy - command: | - ssh -p ${OMR_DEPLOY_PORT:-22} deploy@$OMR_DEPLOY_HOST mkdir -p deploy/${CIRCLE_BRANCH:-release}/${CIRCLE_TAG:-$OMR_KERNEL}/$OMR_TARGET - rsync -av --delete-after ~/openmptcprouter/$OMR_TARGET/source/bin/ -e "ssh -q -p ${OMR_DEPLOY_PORT:-22}" deploy@$OMR_DEPLOY_HOST:deploy/${CIRCLE_BRANCH:-release}/${CIRCLE_TAG:-$OMR_KERNEL}/$OMR_TARGET - rm -rf ~/openmptcprouter/$OMR_TARGET/source/bin - - - save_cache: - key: cache-{{ checksum "/tmp/cache-version" }} - paths: - - openmptcprouter - - build_wrt32: - machine: - image: ubuntu-1604:201903-01 - - environment: - - OMR_VERSION: $CIRCLE_TAG - - OMR_KERNEL: 5.4 - - working_directory: ~/ - - steps: - - run: - name: cache - command: | - echo "cache 107 $OMR_KERNEL $OMR_TARGET" > /tmp/cache-target - echo "cache 108 $OMR_KERNEL $OMR_TARGET $OMR_VERSION" > /tmp/cache-version - - - restore_cache: - keys: - - cache-{{ checksum "/tmp/cache-version" }} - - cache-{{ checksum "/tmp/cache-target" }} - - - run: - name: Build toolchain wrt3200acm - no_output_timeout: 40m - command: | - git clone https://github.com/ysurac/openmptcprouter || true - cd openmptcprouter - git checkout ${CIRCLE_BRANCH:-$CIRCLE_TAG} || true - git pull || true - export OMR_PATH="$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME/${CIRCLE_BRANCH:-$CIRCLE_TAG}" - export OMR_FEED_URL="$CIRCLE_REPOSITORY_URL" - export OMR_FEED_SRC="${CIRCLE_BRANCH:-$CIRCLE_TAG}" - export OMR_TARGET="wrt3200acm" - pyenv global 3.5.2 - sh build.sh prepare {tools,toolchain}/install -j2 - echo -e "$OMR_PRIVKEY" > ~/openmptcprouter/wrt3200acm/source/key-build - echo -e "$OMR_PUBKEY" > ~/openmptcprouter/wrt3200acm/source/key-build.pub - - - save_cache: - key: cache-{{ checksum "/tmp/cache-target" }} - paths: - - openmptcprouter - - - run: - name: Build wrt3200acm - no_output_timeout: 40m - command: make IGNORE_ERRORS=m -C ~/openmptcprouter/wrt3200acm/source package/{compile,install,index} target/compile -j2 package/compile -j2 target/install -j2 - - - run: - name: Deploy wrt3200acm - command: | - ssh -p ${OMR_DEPLOY_PORT:-22} deploy@$OMR_DEPLOY_HOST mkdir -p deploy/${CIRCLE_BRANCH:-release}/${CIRCLE_TAG:-$OMR_KERNEL}/$OMR_TARGET - rsync -av --delete-after ~/openmptcprouter/wrt3200acm/source/bin/ -e "ssh -q -p ${OMR_DEPLOY_PORT:-22}" deploy@$OMR_DEPLOY_HOST:deploy/${CIRCLE_BRANCH:-release}/${CIRCLE_TAG:-$OMR_KERNEL}/wrt3200acm - rm -rf ~/openmptcprouter/wrt3200acm/source/bin - - - save_cache: - key: cache-{{ checksum "/tmp/cache-version" }} - paths: - - openmptcprouter - - - run: - name: Build toolchain wrt32x - no_output_timeout: 40m - command: | - cd ~/openmptcprouter/ - export OMR_PATH="$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME/${CIRCLE_BRANCH:-$CIRCLE_TAG}" - export OMR_FEED_URL="$CIRCLE_REPOSITORY_URL" - export OMR_FEED_SRC="${CIRCLE_BRANCH:-$CIRCLE_TAG}" - export OMR_TARGET="wrt32x" - ln -s wrt3200acm wrt32x - pyenv global 3.5.2 - sh build.sh prepare {tools,toolchain}/install -j2 - echo -e "$OMR_PRIVKEY" > ~/openmptcprouter/wrt32x/source/key-build - echo -e "$OMR_PUBKEY" > ~/openmptcprouter/wrt32x/source/key-build.pub - - - run: - name: Build wrt32x - no_output_timeout: 40m - command: make IGNORE_ERRORS=m -C ~/openmptcprouter/wrt32x/source package/{compile,install,index} target/compile -j2 package/compile -j2 target/install -j2 - - - run: - name: Deploy wrt32x - command: | - ssh -p ${OMR_DEPLOY_PORT:-22} deploy@$OMR_DEPLOY_HOST mkdir -p deploy/${CIRCLE_BRANCH:-release}/${CIRCLE_TAG:-$OMR_KERNEL}/$OMR_TARGET - rsync -av --delete-after ~/openmptcprouter/wrt32x/source/bin/ -e "ssh -q -p ${OMR_DEPLOY_PORT:-22}" deploy@$OMR_DEPLOY_HOST:deploy/${CIRCLE_BRANCH:-release}/${CIRCLE_TAG:-$OMR_KERNEL}/wrt32x - -workflows: - version: 2 - main: - jobs: - - prepare: - filters: - tags: - only: /.*/ - branches: - only: - - develop - - build_x86_64: - requires: - - prepare - filters: - tags: - only: /.*/ - branches: - only: - - develop - - build_x86: - requires: - - prepare - filters: - tags: - only: /.*/ - branches: - only: - - develop - - build_rpi4: - requires: - - prepare - filters: - tags: - only: /.*/ - branches: - only: - - develop - - build_rpi3: - requires: - - prepare - filters: - tags: - only: /.*/ - branches: - only: - - develop - - build_espressobin: - requires: - - prepare - filters: - tags: - only: /.*/ - branches: - only: - - develop - - build_r2s: - requires: - - prepare - filters: - tags: - only: /.*/ - branches: - only: - - develop - - build_rpi2: - requires: - - prepare - filters: - tags: - only: /.*/ - branches: - only: - - develop - - build_bpi-r2: - requires: - - prepare - filters: - tags: - only: /.*/ - branches: - only: - - develop - - build_wrt32: - requires: - - prepare - filters: - tags: - only: /.*/ - branches: - only: - - develop diff --git a/.gitignore b/.gitignore new file mode 100755 index 000000000..2d93d2114 --- /dev/null +++ b/.gitignore @@ -0,0 +1,29 @@ +*.o +.DS_Store +.*.swp +/env +/dl +/.config +/.config.old +/bin +/build_dir +/staging_dir +/tmp +/logs +/feeds +/feeds.conf +/files +/overlay +/package/feeds +/package/openwrt-packages +key-build* +*.orig +*.rej +*~ +.#* +*# +.emacs.desktop* +TAGS*~ +git-src +.git-credentials +/*.log diff --git a/luci-app-openmptcprouter/htdocs/luci-static/resources/computer.png b/luci-app-openmptcprouter/htdocs/luci-static/resources/computer.png index 4598c7cb6..f90e4789b 100755 Binary files a/luci-app-openmptcprouter/htdocs/luci-static/resources/computer.png and b/luci-app-openmptcprouter/htdocs/luci-static/resources/computer.png differ diff --git a/luci-app-openmptcprouter/htdocs/luci-static/resources/modem.svg b/luci-app-openmptcprouter/htdocs/luci-static/resources/modem.svg index 8a896252b..5826795ae 100755 --- a/luci-app-openmptcprouter/htdocs/luci-static/resources/modem.svg +++ b/luci-app-openmptcprouter/htdocs/luci-static/resources/modem.svg @@ -1,52 +1,3 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - + + diff --git a/luci-app-openmptcprouter/htdocs/luci-static/resources/openmptcprouter.png b/luci-app-openmptcprouter/htdocs/luci-static/resources/openmptcprouter.png index f4683f2c5..9a4b11123 100755 Binary files a/luci-app-openmptcprouter/htdocs/luci-static/resources/openmptcprouter.png and b/luci-app-openmptcprouter/htdocs/luci-static/resources/openmptcprouter.png differ diff --git a/luci-app-openmptcprouter/htdocs/luci-static/resources/server.png b/luci-app-openmptcprouter/htdocs/luci-static/resources/server.png index 78f61d672..f6ca87d5e 100755 Binary files a/luci-app-openmptcprouter/htdocs/luci-static/resources/server.png and b/luci-app-openmptcprouter/htdocs/luci-static/resources/server.png differ diff --git a/luci-app-openmptcprouter/root/etc/init.d/openmptcprouter b/luci-app-openmptcprouter/root/etc/init.d/openmptcprouter index 99d9061e9..41d595756 100755 --- a/luci-app-openmptcprouter/root/etc/init.d/openmptcprouter +++ b/luci-app-openmptcprouter/root/etc/init.d/openmptcprouter @@ -143,6 +143,9 @@ start_service() { uci -q batch <<-EOF > /dev/null del_list dhcp.@dnsmasq[0].server='127.0.0.1#5353' add_list dhcp.@dnsmasq[0].server='114.114.114.114' + add_list dhcp.@dnsmasq[0].server="223.5.5.5" + add_list dhcp.@dnsmasq[0].server="223.6.6.6" + add_list dhcp.@dnsmasq[0].server="180.76.76.76" set dhcp.@dnsmasq[0].dnsseccheckunsigned='0' delete dhcp.@dnsmasq[0].dnssec='1' commit dhcp @@ -151,6 +154,9 @@ start_service() { uci -q batch <<-EOF > /dev/null add_list dhcp.@dnsmasq[0].server='127.0.0.1#5353' del_list dhcp.@dnsmasq[0].server='114.114.114.114' + add_list dhcp.@dnsmasq[0].server="223.5.5.5" + add_list dhcp.@dnsmasq[0].server="223.6.6.6" + add_list dhcp.@dnsmasq[0].server="180.76.76.76" set dhcp.@dnsmasq[0].dnsseccheckunsigned='1' set dhcp.@dnsmasq[0].dnssec='1' commit dhcp diff --git a/luci-theme-argon/luasrc/view/themes/argon/footer.htm b/luci-theme-argon/luasrc/view/themes/argon/footer.htm index a4e1df4b2..f28850b93 100755 --- a/luci-theme-argon/luasrc/view/themes/argon/footer.htm +++ b/luci-theme-argon/luasrc/view/themes/argon/footer.htm @@ -20,7 +20,7 @@
- Powered by <%= ver.luciname %> (<%= ver.luciversion %>) / + Powered by openmptcprouter路由器特别定制优化版 官方支持群140215026<%= ver.luciname %> (<%= ver.luciversion %>) / ArgonTheme <%# vPKG_VERSION %> / <%= ver.distversion %> diff --git a/luci-theme-openmptcprouter/htdocs/luci-static/openmptcprouter/cascade.css b/luci-theme-openmptcprouter/htdocs/luci-static/openmptcprouter/cascade.css index facffacbf..46841fc95 100755 --- a/luci-theme-openmptcprouter/htdocs/luci-static/openmptcprouter/cascade.css +++ b/luci-theme-openmptcprouter/htdocs/luci-static/openmptcprouter/cascade.css @@ -17,7 +17,7 @@ * Props to Eric Meyer (meyerweb.com) for his CSS reset file. We're using an adapted version here that cuts out some of the reset HTML elements we will never need here (i.e., dfn, samp, etc). * ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- */ -* { + * { margin: 0; padding: 0; border: 0; @@ -768,7 +768,7 @@ header { } header a { - color: #bfbfbf; + color: #f9f9f9; text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); } @@ -786,8 +786,8 @@ header h3 { header h3 a, header .brand { float: left; display: block; - padding: 8px 20px 12px; - margin-left: -20px; + /* padding: 8px 20px 12px; */ + /* margin-left: -10px; */ color: #fff; font-size: 20px; font-weight: 200; @@ -799,14 +799,14 @@ header p { line-height: 40px; } + header .fill { - background-color: #0d6eff; + background-color: #000; background-repeat: repeat-x; - background-image: linear-gradient(to bottom, #0c5fdc, #0d6eff); + background-image: linear-gradient(to bottom, #6089d4, #6089d4); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25), inset 0 -1px 0 rgba(0, 0, 0, 0.1); padding: 0 5px; } - header div > ul, .nav { display: block; float: left; @@ -868,7 +868,7 @@ header div > ul .menu-dropdown, .nav .menu-dropdown, header div > ul .dropdown-menu, .nav .dropdown-menu { - background-color: #333; + background-color: #6089d4; } header div > ul .menu-dropdown a.menu, @@ -898,7 +898,7 @@ header div > ul .menu-dropdown li a, .nav .menu-dropdown li a, header div > ul .dropdown-menu li a, .nav .dropdown-menu li a { - color: #999; + color: #f9f9f9; text-shadow: 0 1px 0 rgba(0, 0, 0, 0.5); } diff --git a/luci-theme-openmptcprouter/htdocs/luci-static/openmptcprouter/favicon.png b/luci-theme-openmptcprouter/htdocs/luci-static/openmptcprouter/favicon.png index 7c3f3acb1..7ee777910 100755 Binary files a/luci-theme-openmptcprouter/htdocs/luci-static/openmptcprouter/favicon.png and b/luci-theme-openmptcprouter/htdocs/luci-static/openmptcprouter/favicon.png differ diff --git a/luci-theme-openmptcprouter/htdocs/luci-static/openmptcprouter/omr-logo-apple.png b/luci-theme-openmptcprouter/htdocs/luci-static/openmptcprouter/omr-logo-apple.png index 974d2e8a5..7ee777910 100755 Binary files a/luci-theme-openmptcprouter/htdocs/luci-static/openmptcprouter/omr-logo-apple.png and b/luci-theme-openmptcprouter/htdocs/luci-static/openmptcprouter/omr-logo-apple.png differ diff --git a/luci-theme-openmptcprouter/htdocs/luci-static/resources/openmptcprouter/images/omr-logo.png b/luci-theme-openmptcprouter/htdocs/luci-static/resources/openmptcprouter/images/omr-logo.png index f8584ac11..25260a684 100644 Binary files a/luci-theme-openmptcprouter/htdocs/luci-static/resources/openmptcprouter/images/omr-logo.png and b/luci-theme-openmptcprouter/htdocs/luci-static/resources/openmptcprouter/images/omr-logo.png differ diff --git a/luci-theme-openmptcprouter/luasrc/view/themes/openmptcprouter/footer.htm b/luci-theme-openmptcprouter/luasrc/view/themes/openmptcprouter/footer.htm index 2c3c4a07b..c700afc0b 100755 --- a/luci-theme-openmptcprouter/luasrc/view/themes/openmptcprouter/footer.htm +++ b/luci-theme-openmptcprouter/luasrc/view/themes/openmptcprouter/footer.htm @@ -8,7 +8,7 @@ <% local ver = require "luci.version" %>
diff --git a/luci-theme-openmptcprouter/luasrc/view/themes/openmptcprouter/header.htm b/luci-theme-openmptcprouter/luasrc/view/themes/openmptcprouter/header.htm index d45dd088c..459f654e4 100755 --- a/luci-theme-openmptcprouter/luasrc/view/themes/openmptcprouter/header.htm +++ b/luci-theme-openmptcprouter/luasrc/view/themes/openmptcprouter/header.htm @@ -27,7 +27,7 @@ - <%=striptags( (boardinfo.hostname or "?") .. ( (node and node.title) and ' - ' .. translate(node.title) or '')) %> - LuCI + <%=striptags( (boardinfo.hostname or "?") .. ( (node and node.title) and ' - ' .. translate(node.title) or '')) %> - system @@ -47,7 +47,7 @@
@@ -66,8 +66,8 @@ <%- end -%> <%- if current_omr_version ~= "" and latest_omr_version ~= "" and current_omr_version < latest_omr_version then -%>
-

<%=translatef("You have OpenMPTCProuter version %s and version %s is now available",current_omr_version,latest_omr_version)%>

- +

<%=translatef("You have openmptcprouter business version %s and version %s is now available",current_omr_version,latest_omr_version)%>

+
<%- end -%> diff --git a/openmptcprouter/files/etc/uci-defaults/1920-omr-network b/openmptcprouter/files/etc/uci-defaults/1920-omr-network deleted file mode 100644 index 4a4710df9..000000000 --- a/openmptcprouter/files/etc/uci-defaults/1920-omr-network +++ /dev/null @@ -1,301 +0,0 @@ -#!/bin/sh -. /lib/functions.sh - -_setup_macaddr() { - uci -q get "network.$1.macaddr" >/dev/null && return - uci -q set "network.$1.macaddr=$2" -} - -_setup_macvlan() { - uci -q get "network.$1_dev.ifname" >/dev/null && return - - # do not create macvlan for vlan - local _ifname - _ifname=$(uci -q get "network.$1.ifname") - case "$_ifname" in - eth*.*) return ;; - esac - - uci -q batch <<-EOF - set network.$1_dev=device - set network.$1_dev.name=$1 - set network.$1_dev.type=macvlan - set network.$1_dev.ifname=$_ifname - set network.$1.ifname=$1 - set network.$1.type=macvlan - set network.$1.masterintf=$_ifname - set macvlan.$1=macvlan - set macvlan.$1.name=$1 - set macvlan.$1.ifname=$_ifname - EOF - _macaddr=$(uci -q get "network.$1.macaddr") - _setup_macaddr "$1_dev" "${_macaddr:-auto$(date +%s)}" -} - -_setup_macvlan_update() { - uci -q get "network.$1_dev.ifname" >/dev/null || return - - uci -q batch <<-EOF - set macvlan.$1=macvlan - set macvlan.$1.ifname=$_ifname - commit macvlan - EOF -} - -_setup_mptcp_handover_to_on() { - if [ "$(uci -q get network.$1.multipath)" = "handover" ]; then - uci -q set network.$1.multipath=on - fi - if [ "$(uci -q get openmptcprouter.$1.multipath)" = "handover" ]; then - uci -q set openmptcprouter.$1.multipath=on - fi -} - -_setup_multipath_off() { - uci -q get "network.$1.multipath" >/dev/null && return - uci -q set "network.$1.multipath=off" -} - -_setup_wan_interface() { - uci -q batch <<-EOF - set network.$1=interface - set network.$1.ifname=$2 - set network.$1.proto=static - set network.$1.ip4table=wan - set network.$1.multipath=$3 - set network.$1.defaultroute=0 - commit network - add_list firewall.@zone[1].network=$1 - commit firewall - EOF - [ -n "$4" ] && uci -q set network.$1.type=$4 -} - -config_load network -config_foreach _setup_macvlan_update interface -config_foreach _setup_mptcp_handover_to_on interface - -if [ "$(uci -q show network.lan | grep multipath)" != "" ]; then - exit 0 -fi - -lanif="eth0" -if [ "$(grep rockchip /etc/os-release)" != "" ]; then - lanif="eth1" -elif [ -d /sys/class/net/lan0 -o -n "$(ip link | grep ' lan0')" ] && [ -d /sys/class/net/wan -o -n "$(ip link | grep ' wan@')" -o -n "$(ip link | grep ' wan:')" ]; then - lanif="wan" -elif [ -d /sys/class/net/lan1 -o -n "$(ip link | grep ' lan1')" ] && [ -d /sys/class/net/wan -o -n "$(ip link | grep ' wan@')" -o -n "$(ip link | grep ' wan:')" ]; then - lanif="wan" -elif [ -d /sys/class/net/lan ] || [ -n "$(ip link | grep ' lan')" ]; then - lanif="lan" -elif [ "$(swconfig list 2>&1 | grep switch0)" != "" ] && [ -d '/sys/class/net/eth1.5' ]; then - lanif="eth1.5" - uci -q batch <<-EOF - set network.@switch_vlan[0]=switch_vlan - set network.@switch_vlan[0].device='switch0' - set network.@switch_vlan[0].vlan=1 - set network.@switch_vlan[0].vid=1 - set network.@switch_vlan[0].ports='3 5t' - add network switch_vlan - set network.@switch_vlan[1].device='switch0' - set network.@switch_vlan[1].vlan=2 - set network.@switch_vlan[1].vid=2 - set network.@switch_vlan[1].ports='2 5t' - add network switch_vlan - set network.@switch_vlan[2].device='switch0' - set network.@switch_vlan[2].vlan=3 - set network.@switch_vlan[2].vid=3 - set network.@switch_vlan[2].ports='1 5t' - add network switch_vlan - set network.@switch_vlan[3].device='switch0' - set network.@switch_vlan[3].vlan=4 - set network.@switch_vlan[3].vid=4 - set network.@switch_vlan[3].ports='0 5t' - add network switch_vlan - set network.@switch_vlan[4].device='switch0' - set network.@switch_vlan[4].vlan=5 - set network.@switch_vlan[4].vid=5 - set network.@switch_vlan[4].ports='4 6t' - EOF -elif [ "$(swconfig list 2>&1 | grep switch0)" != "" ] && [ -d /sys/class/net/eth1 ]; then - lanif="eth1" -elif [ ! -d /sys/class/net/eth1 ] && [ -d /sys/class/net/eth0 ]; then - lanif="eth0" -fi -uci -q batch <<-EOF -delete network.lan.type -set network.lan=interface -set network.lan.proto=static -set network.lan.ipaddr=192.168.100.1 -set network.lan.netmask=255.255.255.0 -set network.lan.ifname=${lanif} -set network.lan.metric=2048 -set network.lan.ipv6=0 -set network.lan.delegate=0 -EOF - -uci -q batch <<-EOF -delete network.none -delete network.wan -delete network.if6rd -reorder network.loopback=0 -reorder network.globals=1 -reorder network.lan=2 -set network.globals.multipath=enable -EOF - -# Set the ip rule for the lan with a pref of 100 -uci -q show network.lan_rule >/dev/null || \ - uci -q batch <<-EOF - set network.lan_rule=rule - set network.lan_rule.lookup=lan - set network.lan_rule.priority=100 - EOF - -if [ "$(uci -q get network.vpn0.proto)" = "none" ]; then - uci -q delete network.vpn0 -fi - -config_load network -config_foreach _setup_multipath_off interface - -# Add the lan as a named routing table -if ! grep -s -q "lan" /etc/iproute2/rt_tables; then - echo "50 lan" >> /etc/iproute2/rt_tables -fi -uci -q set network.lan.ip4table='lan' - -#uci -q set "network.lan.ip6assign=64" - -# Create WAN interfaces -if [ "$(uci -q show network.wan1 | grep multipath)" = "" ] && [ -z "$(uci -q get network.wan1.multipath)" ]; then - if [ "$(grep rockchip /etc/os-release)" != "" ]; then - _setup_wan_interface wan1 eth0 master macvlan - _setup_wan_interface wan2 eth0 on macvlan - _setup_macvlan wan1 - _setup_macvlan wan2 - elif [ "$(swconfig list 2>&1 | grep switch0)" != "" ]; then - _setup_wan_interface wan1 eth0.1 master - _setup_wan_interface wan2 eth0.2 on - _setup_wan_interface wan3 eth0.3 on - _setup_wan_interface wan4 eth0.4 on - elif [ -d /sys/class/net/wan ] || [ -n "$(ip link | grep ' wan:')" ] || [ -n "$(ip link | grep ' wan@')" ]; then - if [ -d /sys/class/net/lan0 -o -n "$(ip link | grep ' lan0')" ] && [ -d /sys/class/net/lan1 -o -n "$(ip link | grep ' lan1')" ]; then - _setup_wan_interface wan1 lan0 master - _setup_wan_interface wan2 lan1 on - - _macaddr=$(uci -q get "network.lan0.macaddr") - _setup_macaddr "wan1" "${_macaddr:-$(dd if=/dev/urandom bs=1024 count=1 2>/dev/null | md5sum | sed -e 's/^\(..\)\(..\)\(..\)\(..\)\(..\)\(..\).*$/\1:\2:\3:\4:\5:\6/' -e 's/^\(.\)[13579bdf]/\10/')}" - _macaddr=$(uci -q get "network.lan1.macaddr") - _setup_macaddr "wan2" "${_macaddr:-$(dd if=/dev/urandom bs=1024 count=1 2>/dev/null | md5sum | sed -e 's/^\(..\)\(..\)\(..\)\(..\)\(..\)\(..\).*$/\1:\2:\3:\4:\5:\6/' -e 's/^\(.\)[13579bdf]/\10/')}" - if [ -d /sys/class/net/lan2 ] || [ -n "$(ip link | grep ' lan2')" ]; then - _setup_wan_interface wan3 lan2 on - _macaddr=$(uci -q get "network.lan2.macaddr") - _setup_macaddr "wan3" "${_macaddr:-$(dd if=/dev/urandom bs=1024 count=1 2>/dev/null | md5sum | sed -e 's/^\(..\)\(..\)\(..\)\(..\)\(..\)\(..\).*$/\1:\2:\3:\4:\5:\6/' -e 's/^\(.\)[13579bdf]/\10/')}" - if [ -d /sys/class/net/lan3 ] || [ -n "$(ip link | grep ' lan3')" ]; then - _setup_wan_interface wan4 lan3 on - _macaddr=$(uci -q get "network.lan3.macaddr") - _setup_macaddr "wan4" "${_macaddr:-$(dd if=/dev/urandom bs=1024 count=1 2>/dev/null | md5sum | sed -e 's/^\(..\)\(..\)\(..\)\(..\)\(..\)\(..\).*$/\1:\2:\3:\4:\5:\6/' -e 's/^\(.\)[13579bdf]/\10/')}" - fi - fi - elif [ -d /sys/class/net/lan1 -o -n "$(ip link | grep ' lan1')" ] && [ -d /sys/class/net/lan2 -o -n "$(ip link | grep ' lan2')" ]; then - _setup_wan_interface wan1 lan1 master - _setup_wan_interface wan2 lan2 on - - _macaddr=$(uci -q get "network.lan1.macaddr") - _setup_macaddr "wan1" "${_macaddr:-$(dd if=/dev/urandom bs=1024 count=1 2>/dev/null | md5sum | sed -e 's/^\(..\)\(..\)\(..\)\(..\)\(..\)\(..\).*$/\1:\2:\3:\4:\5:\6/' -e 's/^\(.\)[13579bdf]/\10/')}" - _macaddr=$(uci -q get "network.lan2.macaddr") - _setup_macaddr "wan2" "${_macaddr:-$(dd if=/dev/urandom bs=1024 count=1 2>/dev/null | md5sum | sed -e 's/^\(..\)\(..\)\(..\)\(..\)\(..\)\(..\).*$/\1:\2:\3:\4:\5:\6/' -e 's/^\(.\)[13579bdf]/\10/')}" - if [ -d /sys/class/net/lan3 ] || [ -n "$(ip link | grep ' lan3')" ]; then - _setup_wan_interface wan3 lan3 on - _macaddr=$(uci -q get "network.lan3.macaddr") - _setup_macaddr "wan3" "${_macaddr:-$(dd if=/dev/urandom bs=1024 count=1 2>/dev/null | md5sum | sed -e 's/^\(..\)\(..\)\(..\)\(..\)\(..\)\(..\).*$/\1:\2:\3:\4:\5:\6/' -e 's/^\(.\)[13579bdf]/\10/')}" - if [ -d /sys/class/net/lan4 ] || [ -n "$(ip link | grep ' lan4')" ]; then - _setup_wan_interface wan4 lan4 on - _macaddr=$(uci -q get "network.lan4.macaddr") - _setup_macaddr "wan4" "${_macaddr:-$(dd if=/dev/urandom bs=1024 count=1 2>/dev/null | md5sum | sed -e 's/^\(..\)\(..\)\(..\)\(..\)\(..\)\(..\).*$/\1:\2:\3:\4:\5:\6/' -e 's/^\(.\)[13579bdf]/\10/')}" - fi - fi - else - _setup_wan_interface wan1 wan master macvlan - _setup_wan_interface wan2 wan on macvlan - _setup_macvlan wan1 - _setup_macvlan wan2 - fi - elif [ -d /sys/class/net/wan1 ] || [ -n "$(ip link | grep ' wan1')" ]; then - if [ -d /sys/class/net/wan2 ] || [ -n "$(ip link | grep ' wan2')" ]; then - _setup_wan_interface wan1 wan1 master - _setup_wan_interface wan2 wan2 on - - _macaddr=$(uci -q get "network.wan1.macaddr") - _setup_macaddr "wan1" "${_macaddr:-$(dd if=/dev/urandom bs=1024 count=1 2>/dev/null | md5sum | sed -e 's/^\(..\)\(..\)\(..\)\(..\)\(..\)\(..\).*$/\1:\2:\3:\4:\5:\6/' -e 's/^\(.\)[13579bdf]/\10/')}" - _macaddr=$(uci -q get "network.wan2.macaddr") - _setup_macaddr "wan2" "${_macaddr:-$(dd if=/dev/urandom bs=1024 count=1 2>/dev/null | md5sum | sed -e 's/^\(..\)\(..\)\(..\)\(..\)\(..\)\(..\).*$/\1:\2:\3:\4:\5:\6/' -e 's/^\(.\)[13579bdf]/\10/')}" - - if [ -d /sys/class/net/wan3 ] || [ -n "$(ip link | grep ' wan3')" ]; then - _setup_wan_interface wan3 wan3 on - _macaddr=$(uci -q get "network.wan3.macaddr") - _setup_macaddr "wan3" "${_macaddr:-$(dd if=/dev/urandom bs=1024 count=1 2>/dev/null | md5sum | sed -e 's/^\(..\)\(..\)\(..\)\(..\)\(..\)\(..\).*$/\1:\2:\3:\4:\5:\6/' -e 's/^\(.\)[13579bdf]/\10/')}" - if [ -d /sys/class/net/wan4 ] || [ -n "$(ip link | grep ' wan4')" ]; then - _setup_wan_interface wan4 wan4 on - _macaddr=$(uci -q get "network.wan4.macaddr") - _setup_macaddr "wan4" "${_macaddr:-$(dd if=/dev/urandom bs=1024 count=1 2>/dev/null | md5sum | sed -e 's/^\(..\)\(..\)\(..\)\(..\)\(..\)\(..\).*$/\1:\2:\3:\4:\5:\6/' -e 's/^\(.\)[13579bdf]/\10/')}" - fi - fi - else - _setup_wan_interface wan1 wan1 master macvlan - _setup_wan_interface wan2 wan1 on macvlan - _setup_macvlan wan1 - _setup_macvlan wan2 - fi - elif [ -d /sys/class/net/eth1 ] || [ -n "$(ip link | grep ' eth1:')" ]; then - if [ -d /sys/class/net/eth2 ] || [ -n "$(ip link | grep ' eth2:')" ]; then - _setup_wan_interface wan1 eth1 master - _setup_wan_interface wan2 eth2 on - if [ -d /sys/class/net/eth3 ] || [ -n "$(ip link | grep ' eth3:')" ]; then - _setup_wan_interface wan3 eth3 on - fi - if [ -d /sys/class/net/eth4 ] || [ -n "$(ip link | grep ' eth4:')" ]; then - _setup_wan_interface wan4 eth4 on - fi - if [ -d /sys/class/net/eth5 ] || [ -n "$(ip link | grep ' eth5:')" ]; then - _setup_wan_interface wan5 eth5 on - fi - if [ -d /sys/class/net/eth6 ] || [ -n "$(ip link | grep ' eth6:')" ]; then - _setup_wan_interface wan6 eth6 on - fi - if [ -d /sys/class/net/eth7 ] || [ -n "$(ip link | grep ' eth7:')" ]; then - _setup_wan_interface wan7 eth7 on - fi - if [ -d /sys/class/net/eth8 ] || [ -n "$(ip link | grep ' eth8:')" ]; then - _setup_wan_interface wan8 eth8 on - fi - else - _setup_wan_interface wan1 eth1 master macvlan - _setup_wan_interface wan2 eth1 on macvlan - _setup_macvlan wan1 - _setup_macvlan wan2 - fi - elif [ -d /sys/class/net/eth0.1 ] && [ -d /sys/class/net/eth0.2 ]; then - _setup_wan_interface wan1 eth0.1 master - _setup_wan_interface wan2 eth0.2 on - else - _setup_wan_interface wan1 eth0 master macvlan - _setup_wan_interface wan2 eth0 on macvlan - _setup_macvlan wan1 - _setup_macvlan wan2 - fi - #uci -q batch <<-EOF - #add network route6 - #set network.@route6[-1].interface='lan' - #set network.@route6[-1].target='::/0' - #EOF -fi - -# Replace omrip to oip in config for old config -sed -i 's/omrip/oip/g' /etc/config/* - -uci -q commit macvlan -uci -q commit network -rm -f /tmp/luci-indexcache -exit 0