author ZiMing Mo Mon, 25 Apr 2022 14:09:00 +0000 (22:09 +0800) committer ZiMing Mo Mon, 25 Apr 2022 14:13:01 +0000 (22:13 +0800)
Signed-off-by: ZiMing Mo <msylgj@immortalwrt.org>
318 files changed:

diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml
deleted file mode 100644 (file)
index 4d7a726..0000000
+++ /dev/null
@@ -1 +0,0 @@
-custom: [ 'https://openwrt.org/donate' ]
diff --git a/.github/pull_request_template b/.github/pull_request_template
deleted file mode 100644 (file)
index a2d6bd1..0000000
+++ /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/ci_helpers.sh b/.github/workflows/ci_helpers.sh
deleted file mode 100644 (file)
index 2f9daf8..0000000
+++ /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/formal.yml b/.github/workflows/formal.yml deleted file mode 100644 (file) index 5046b5a..0000000 +++ /dev/null @@ -1,70 +0,0 @@ -name: Test Formalities - -on: - pull_request: - -jobs: - build: - name: Test Formalities - runs-on: ubuntu-latest - strategy: - fail-fast: false - - steps: - - uses: actions/checkout@v2 - 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/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 '<area>: ' ($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/tools.yml b/.github/workflows/tools.yml deleted file mode 100644 (file) index be96783..0000000 +++ /dev/null @@ -1,144 +0,0 @@ -name: Build host tools - -on: - pull_request: - paths: - - 'tools/**' - - '.github/workflows/tools.yml' - -jobs: - build: - name: tools-${{ matrix.os }}
-    runs-on: ${{ matrix.os }} - strategy: - fail-fast: False - matrix: - os: - - ubuntu-latest - - macos-latest - steps: - - name: Checkout - uses: actions/checkout@v2 - with: - fetch-depth: 0 - path: openwrt - - - name: Setup MacOS - if:${{ matrix.os == 'macos-latest' }}
-        run: |
-          echo "WORKPATH=/Volumes/OpenWrt/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/
-          cd "$WORKPATH" - - 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"
-            pwd
-
-      - name: Setup Ubuntu
-        if: ${{ matrix.os == 'ubuntu-latest' }} - env: - DEBIAN_FRONTEND: noninteractive - run: | - sudo apt-get update - sudo apt-get -y install \ - build-essential \ - ccache \ - clang-12 \ - ecj \ - fastjar \ - file \ - g++ \ - gawk \ - gettext \ - git \ - java-propose-classpath \ - libelf-dev \ - libncurses-dev \ - libssl-dev \ - mkisofs \ - python3 \ - python3-dev \ - python3-distutils \ - python3-setuptools \ - qemu-utils \ - rsync \ - subversion \ - swig \ - unzip \ - wget \ - xsltproc \ - zlib1g-dev - echo "WORKPATH=$GITHUB_WORKSPACE/openwrt/" >> "$GITHUB_ENV" - cd "$WORKPATH"
-          pwd
-
-      - name: Make prereq
-        run: |
-          cd "$WORKPATH" - pwd - make defconfig - - - name: Build tools - run: | - cd "$WORKPATH"
-          make tools/install -j$(nproc) BUILD_LOG=1 - - - name: Move logs to GITHUB_WORKSPACE - if: always() - run: | - cp -r "$WORKPATH/logs" "$GITHUB_WORKSPACE" - cp -r "$WORKPATH/.config" "$GITHUB_WORKSPACE/config" - - - - name: Upload logs - if: always() - uses: actions/upload-artifact@v2 - with: - name:${{ matrix.os }}-logs
-          path: "logs"
-
-        if: always()
-        with:
-          name: {{ matrix.os }}-config - path: "config" diff --git a/CONTRIBUTED.md b/CONTRIBUTED.md new file mode 100644 (file) index 0000000..a0b7c63 --- /dev/null @@ -0,0 +1,52 @@ +# CONTRIBUTED + +## Thanks to +<a href="https://dlercloud.com/"><img src="https://user-images.githubusercontent.com/22235437/111103249-f9ec6e00-8588-11eb-9bfc-67cc55574555.png" width="183" height="52" border="0" alt="Dler Cloud"></a><br/> +<a href="https://www.jetbrains.com/"><img src="https://resources.jetbrains.com/storage/products/company/brand/logos/jb_square.png" width="120" height="120" border="0" alt="JetBrains Black Box Logo logo"></a><br/> +<a href="https://osdn.net/"><img src="https://osdn.net/sflogo.php?group_id=13647&type=2" width="125" height="39" border="0" alt="OSDN"></a> + +## The Source of Packages +### Based on: [openwrt/openwrt](https://github.com/openwrt/openwrt).<br/> +Package lean: [coolsnowwolf/lede](https://github.com/coolsnowwolf/lede).<br/> +Package ntlf9t: [jsda/packages2](https://github.com/jsda/packages2).<br/> +luci-app-serverchan source: [tty228/luci-app-serverchan](https://github.com/tty228/luci-app-serverchan).<br/> +OpenAppFilter source: [destan19/OpenAppFilter](https://github.com/destan19/OpenAppFilter).<br/> +luci-app-k3screenctrl source: [lwz322/luci-app-k3screenctrl](https://github.com/lwz322/luci-app-k3screenctrl).<br/> +phicomm-k3screenctrl source: [lwz322/k3screenctrl\_build](https://github.com/lwz322/k3screenctrl_build).<br/> +luci-app-smstool source: [f8q8/luci-app-smstool-master](https://github.com/f8q8/luci-app-smstool-master).<br/> +luci-app-airwhu source: [KyleRicardo/luci-app-airwhu](https://github.com/KyleRicardo/luci-app-airwhu).<br/> +Package Lienol: [Lienol/openwrt-package](https://github.com/Lienol/openwrt-package).<br/> +luci-app-bbr-mod source: [ntlf9t/luci-app-bbr-mod](https://github.com/ntlf9t/luci-app-bbr-mod).<br/> +Package Openwrt-BBR: [anshi233/Openwrt-BBR](https://github.com/anshi233/Openwrt-BBR).<br/> +simple-obfs source: [aa65535/openwrt-simple-obfs](https://github.com/aa65535/openwrt-simple-obfs).<br/> +v2ray-plugin source: [honwen/openwrt-v2ray-plugin](https://github.com/honwen/openwrt-v2ray-plugin).<br/> +Package zxlhhyccc: [zxlhhyccc/MY-lede](https://github.com/zxlhhyccc/MY-lede).<br/> +luci-theme-argon source: [jerrykuku/luci-theme-argon](https://github.com/jerrykuku/luci-theme-argon).<br/> +openwrt-chinadns-ng source: [pexcn/openwrt-chinadns-ng](https://github.com/pexcn/openwrt-chinadns-ng).<br/> +openwrt-udpspeeder source: [zhfreal/openwrt-UDPspeeder](https://github.com/zhfreal/openwrt-UDPspeeder).<br/> +luci-app-onliner source: [rufengsuixing/luci-app-onliner](https://github.com/rufengsuixing/luci-app-onliner).<br/> +luci-lib-docker source: [lisaac/luci-lib-docker](https://github.com/lisaac/luci-lib-docker).<br/> +openwrt-iptvhelper source: [riverscn/openwrt-iptvhelper](https://github.com/riverscn/openwrt-iptvhelper).<br> +luci-app-autoipsetadder source: [rufengsuixing/luci-app-autoipsetadder](https://github.com/rufengsuixing/luci-app-autoipsetadder).<br> +luci-app-adguardhome source: [rufengsuixing/luci-app-adguardhome](https://github.com/rufengsuixing/luci-app-adguardhome).<br/> +Rclone-OpenWrt source: [ElonH/Rclone-OpenWrt](https://github.com/ElonH/Rclone-OpenWrt).<br/> +luci-app-usb3disable source: [rufengsuixing/luci-app-usb3disable](https://github.com/rufengsuixing/luci-app-usb3disable).<br/> +lua-maxminddb source: [jerrykuku/lua-maxminddb](https://github.com/jerrykuku/lua-maxminddb).<br/> +package openwrt-mwol: [Mleaf/openwrt-mwol](https://github.com/Mleaf/openwrt-mwol).<br/> +package gargoyle: [ericpaulbishop/gargoyle](https://github.com/ericpaulbishop/gargoyle).<br/> +luci-app-qos-gargoyle source: [kuoruan/luci-app-qos-gargoyle](https://github.com/kuoruan/luci-app-qos-gargoyle).<br/> +luci-app-cupsd source: [F-Light/luci-app-cupsd](https://github.com/F-Light/luci-app-cupsd).<br/> +ootoc-OpenWRT source: [ElonH/ootoc-OpenWRT](https://github.com/ElonH/ootoc-OpenWRT).<br/> +r8168 source: [BROBIRD/openwrt-r8168](https://github.com/BROBIRD/openwrt-r8168).<br/> +MentoHUST source: [KyleRicardo/MentoHUST-OpenWrt-ipk](https://github.com/KyleRicardo/MentoHUST-OpenWrt-ipk).<br/> +luci-app-mentohust source: [BoringCat/luci-app-mentohust](https://github.com/BoringCat/luci-app-mentohust).<br/> +luci-app-minieap source: [BoringCat/luci-app-minieap](https://github.com/BoringCat/luci-app-minieap).<br/> +scutclient source: [scutclient/scutclient](https://github.com/scutclient/scutclient).<br/> +luci-app-scutclient source: [scutclient/luci-app-scutclient](https://github.com/scutclient/luci-app-scutclient).<br/> +MT-Wifi 5.0.4.0: [MeIsReallyBa/mt7615-dbdc-linux5.4](https://github.com/MeIsReallyBa/mt7615-dbdc-linux5.4).<br/> +node-request source: [jerrykuku/node-request](https://github.com/jerrykuku/node-request).<br/> +luci-app-jd-dailybonus source: [jerrykuku/luci-app-jd-dailybonus](https://github.com/jerrykuku/luci-app-jd-dailybonus).<br/> +luci-app-oled source: [NateLol/luci-app-oled](https://github.com/NateLol/luci-app-oled).<br/> +luci-app-beardropper source: [NateLol/natelol](https://github.com/NateLol/natelol).<br/> +luci-app-vssr source: [jerrykuku/luci-app-vssr](https://github.com/jerrykuku/luci-app-vssr).<br/> +luci-proto-minieap source: [ysc3839/luci-proto-minieap](https://github.com/ysc3839/luci-proto-minieap). index 4d90dc1..607adfc 100644 (file) @@ -36,37 +36,48 @@ your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. The precise terms and conditions for copying, distribution and modification follow. @@ -209,9 +220,62 @@ restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this @@ -302,15 +366,15 @@ free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least +state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. <one line to give the program's name and a brief idea of what it does.> Copyright (C) <year> <name of author> - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or + the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, @@ -325,11 +389,11 @@ the "copyright" line and a pointer to where the full notice is found. Also add information on how to contact you by electronic and paper mail. -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type show w'. + <program> Copyright (C) <year> <name of author> + This program comes with ABSOLUTELY NO WARRANTY; for details type show w'. This is free software, and you are welcome to redistribute it under certain conditions; type show c' for details. diff --git a/LICENSES/GPL-3.0 b/LICENSES/GPL-3.0 new file mode 100644 (file) index 0000000..f288702 --- /dev/null @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/> + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + <one line to give the program's name and a brief idea of what it does.> + Copyright (C) <year> <name of author> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <https://www.gnu.org/licenses/>. + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + <program> Copyright (C) <year> <name of author> + This program comes with ABSOLUTELY NO WARRANTY; for details type show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type show c' for details. + +The hypothetical commands show w' and show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +<https://www.gnu.org/licenses/>. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +<https://www.gnu.org/licenses/why-not-lgpl.html>. index 2eff292..f11a084 100644 (file) --- a/README.md +++ b/README.md -![OpenWrt logo](include/logo.png) +<img src="https://avatars.githubusercontent.com/u/53193414?s=200&v=4" alt="logo" width="200" height="200" align="right"> -OpenWrt Project is a Linux operating system targeting embedded devices. Instead -of trying to create a single, static firmware, OpenWrt provides a fully -writable filesystem with package management. This frees you from the -application selection and configuration provided by the vendor and allows you -to customize the device through the use of packages to suit any application. -For developers, OpenWrt is the framework to build an application without having -to build a complete firmware around it; for users this means the ability for -full customization, to use the device in ways never envisioned. +# Project ImmortalWrt -Sunshine! +ImmortalWrt is a fork of [OpenWrt](https://openwrt.org), with more packages ported, more devices supported, better performance, and special optimizations for mainland China users.<br/> +Compared the official one, we allow to use hacks or non-upstreamable patches / modifications to achieve our purpose. Source from anywhere. -## Development - -To build your own firmware you need a GNU/Linux, BSD or MacOSX system (case -sensitive filesystem required). Cygwin is unsupported because of the lack of a -case sensitive file system. - -### Requirements - -You need the following tools to compile OpenWrt, the package names vary between -distributions. A complete list with distribution specific packages is found in -the [Build System Setup](https://openwrt.org/docs/guide-developer/build-system/install-buildsystem) -documentation. - - -binutils bzip2 diff find flex gawk gcc-6+ getopt grep install libc-dev libz-dev -make4.1+ perl python3.6+ rsync subversion unzip which - - -### Quickstart - -1. Run ./scripts/feeds update -a to obtain all the latest package definitions - defined in feeds.conf / feeds.conf.default - -2. Run ./scripts/feeds install -a to install symlinks for all obtained - packages into package/feeds/ - -3. Run make menuconfig to select your preferred configuration for the - toolchain, target system & firmware packages. - -4. Run make to build your firmware. This will download all sources, build the - cross-compile toolchain and then cross-compile the GNU/Linux kernel & all chosen - applications for your target system. - -### Related Repositories +Default login address: http://192.168.1.1 or http://immortalwrt.lan, username: __root__, password: __password__. -The main repository uses multiple sub-repositories to manage packages of -different categories. All packages are installed via the OpenWrt package -manager called opkg. If you're looking to develop the web interface or port -packages to OpenWrt, please find the fitting repository below. - -* [LuCI Web Interface](https://github.com/openwrt/luci): Modern and modular - interface to control the device via a web browser. - -* [OpenWrt Packages](https://github.com/openwrt/packages): Community repository - of ported packages. - -* [OpenWrt Routing](https://github.com/openwrt/routing): Packages specifically - focused on (mesh) routing. +## Development +To build your own firmware you need a GNU/Linux, BSD or MacOSX system (case sensitive filesystem required). Cygwin is unsupported because of the lack of a case sensitive file system.<br/> + + ### Requirements + To build with this project, Ubuntu 18.04 LTS is preferred. And you need use the CPU based on AMD64 architecture, with at least 4GB RAM and 25 GB available disk space. Make sure the __Internet__ is accessible. + + The following tools are needed to compile ImmortalWrt, the package names vary between distributions. + + - Here is an example for Ubuntu users:<br/> + - Method 1: + <details> + <summary>Setup dependencies via APT</summary> + + bash + sudo apt update -y + sudo apt full-upgrade -y + sudo apt install -y ack antlr3 asciidoc autoconf automake autopoint binutils bison build-essential \ + bzip2 ccache cmake cpio curl device-tree-compiler ecj fastjar flex gawk gettext gcc-multilib g++-multilib \ + git gperf haveged help2man intltool lib32gcc1 libc6-dev-i386 libelf-dev libglib2.0-dev libgmp3-dev libltdl-dev \ + libmpc-dev libmpfr-dev libncurses5-dev libncursesw5 libncursesw5-dev libreadline-dev libssl-dev libtool lrzsz \ + mkisofs msmtp nano ninja-build p7zip p7zip-full patch pkgconf python2.7 python3 python3-pip python3-ply \ + python-docutils qemu-utils re2c rsync scons squashfs-tools subversion swig texinfo uglifyjs upx-ucl unzip \ + vim wget xmlto xxd zlib1g-dev +  + </details> + - Method 2: + bash + curl -s https://build-scripts.immortalwrt.eu.org/init_build_environment.sh | sudo bash +  + + - You can also download and use prebuilt container directly:<br/> + See #Quickstart - Build image via OPDE + + Note: + - For the for love of god please do __not__ use ROOT user to build your image. + - Using CPUs based on other architectures should be fine to compile ImmortalWrt, but more hacks are needed - No warranty at all. + - You must __not__ have spaces in PATH or in the work folders on the drive. + - If you're using Windows Subsystem for Linux (or WSL), removing Windows folders from PATH is required, please see [Build system setup WSL](https://openwrt.org/docs/guide-developer/build-system/wsl) documentation. + - Using macOS as the host build OS is __not__ recommended. No warranty at all. You can get tips from [Build system setup macOS](https://openwrt.org/docs/guide-developer/build-system/buildroot.exigence.macosx) documentation. + - For more details, please see [Build system setup](https://openwrt.org/docs/guide-developer/build-system/install-buildsystem) documentation. + + ### Quickstart + - Method 1: + 1. Run git clone -b <branch> --single-branch https://github.com/immortalwrt/immortalwrt to clone the source code. + 2. Run cd immortalwrt to enter source directory. + 3. Run ./scripts/feeds update -a to obtain all the latest package definitions defined in feeds.conf / feeds.conf.default + 4. Run ./scripts/feeds install -a to install symlinks for all obtained packages into package/feeds/ + 5. Run make menuconfig to select your preferred configuration for the toolchain, target system & firmware packages. + 6. Run make to build your firmware. This will download all sources, build the cross-compile toolchain and then cross-compile the GNU/Linux kernel & all chosen applications for your target system. + + - Method 2: + <details> + <summary>Build image via OPDE</summary> + + - Pull the prebuilt container: + bash + docker pull immortalwrt/opde:base + # docker run --rm -it immortalwrt/opde:base +  + + - For Linux User: + bash + git clone -b <branch> --single-branch https://github.com/immortalwrt/immortalwrt && cd immortalwrt + docker run --rm -it \ + -vPWD:/openwrt \
+          immortalwrt/opde:base zsh
+        ./scripts/feeds update -a && ./scripts/feeds install -a
+        
+
+      - For Windows User:
+        1. Create a volume 'immortalwrt' and clone ImmortalWrt source into volume.
+          bash
+          docker run --rm -it -v immortalwrt:/openwrt immortalwrt/opde:base git clone -b <branch> --single-branch https://github.com/immortalwrt/immortalwrt .
+          
+        2. Enter docker container and update feeds.
+          bash
+          docker run --rm -it -v immortalwrt:/openwrt immortalwrt/opde:base
+          ./scripts/feeds update -a && ./scripts/feeds install -a
+          
+        - Tips: ImmortalWrt source code can not be cloned into NTFS filesystem (symbol link problem during compilation), but docker volume is fine.
+
+      - Proxy Support:
+        bash
+        docker run --rm -it \
+          -e   all_proxy=http://example.com:1081 \
+          -e  http_proxy=http://example.com:1081 \
+          -e https_proxy=http://example.com:1081 \
+          -e   ALL_PROXY=http://example.com:1081 \
+          -e  HTTP_PROXY=http://example.com:1081 \
+          -e HTTPS_PROXY=http://example.com:1081 \
+          -v $PWD:/openwrt \ + immortalwrt/opde:base zsh +  + + > Recommand http rather socks5 protocol + > + > IP can not be localhost or 127.0.0.1 + + - For Windows User, binary is still in volume. It can be copied to outside via followed command: + bash + docker run --rm -v <D:\path\to\dir>:/dst -v openwrt:/openwrt -w /dst immortalwrt:base cp /openwrt/bin /dst +  + > Make sure D:\path\to\dir has been appended in [File Sharing](https://docs.docker.com/docker-for-windows/#file-sharing). + + </details> + + ### Related Repositories + The main repository uses multiple sub-repositories to manage packages of different categories. All packages are installed via the ImmortalWrt package manager called opkg. If you're looking to develop the web interface or port packages to ImmortalWrt, please find the fitting repository below. + - [LuCI Web Interface](https://github.com/immortalwrt/luci): Modern and modular interface to control the device via a web browser. + - [ImmortalWrt Packages](https://github.com/immortalwrt/packages): Community repository of ported packages. + - [OpenWrt Routing](https://github.com/openwrt/routing): Packages specifically focused on (mesh) routing. + - [CONTRIBUTED.md](https://github.com/immortalwrt/immortalwrt/blob/master/CONTRIBUTED.md): the 3rd-party packages we introduced. * [OpenWrt Video](https://github.com/openwrt/video): Packages specifically focused on display servers and clients (Xorg and Wayland). ## Support Information - For a list of supported devices see the [OpenWrt Hardware Database](https://openwrt.org/supported_devices) + ### Documentation + - [Quick Start Guide](https://openwrt.org/docs/guide-quick-start/start) + - [User Guide](https://openwrt.org/docs/guide-user/start) + - [Developer Documentation](https://openwrt.org/docs/guide-developer/start) + - [Technical Reference](https://openwrt.org/docs/techref/start) -### Documentation - -* [Quick Start Guide](https://openwrt.org/docs/guide-quick-start/start) -* [User Guide](https://openwrt.org/docs/guide-user/start) -* [Developer Documentation](https://openwrt.org/docs/guide-developer/start) -* [Technical Reference](https://openwrt.org/docs/techref/start) - -### Support Community - -* [Forum](https://forum.openwrt.org): For usage, projects, discussions and hardware advise. -* [Support Chat](https://webchat.oftc.net/#openwrt): Channel #openwrt on **oftc.net**. - -### Developer Community - -* [Bug Reports](https://bugs.openwrt.org): Report bugs in OpenWrt -* [Dev Mailing List](https://lists.openwrt.org/mailman/listinfo/openwrt-devel): Send patches -* [Dev Chat](https://webchat.oftc.net/#openwrt-devel): Channel #openwrt-devel on **oftc.net**. + ### Support Community + - Support Chat: group [@ctcgfw_openwrt_discuss](https://t.me/ctcgfw_openwrt_discuss) on [Telegram](https://telegram.org/). + - Support Chat: group [#immortalwrt](https://matrix.to/#/#immortalwrt:matrix.org) on [Matrix](https://matrix.org/). ## License - -OpenWrt is licensed under GPL-2.0 +ImmortalWrt is licensed under [GPL-3.0-only](https://spdx.org/licenses/GPL-3.0-only.html). index dcd7575..4dcb5ef 100644 (file) @@ -243,14 +243,14 @@ 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 "3" help If you don't know, 5 seconds is a reasonable default. config GRUB_TITLE string "Title for the menu entry in GRUB" depends on GRUB_IMAGES || GRUB_EFI_IMAGES - default "OpenWrt" + default "ImmortalWrt" help This is the title of the GRUB menu entry. If unspecified, it defaults to OpenWrt. @@ -259,24 +259,35 @@ menu "Target Images" bool "Build LiveCD image (ISO)" depends on TARGET_x86 depends on GRUB_IMAGES || GRUB_EFI_IMAGES + default y if BUILDBOT + + config QCOW2_IMAGES + bool "Build PVE/KVM image files (QCOW2)" + depends on TARGET_x86 + depends on GRUB_IMAGES || GRUB_EFI_IMAGES + select PACKAGE_kmod-e1000 + default y if BUILDBOT config VDI_IMAGES bool "Build VirtualBox image files (VDI)" depends on TARGET_x86 depends on GRUB_IMAGES || GRUB_EFI_IMAGES select PACKAGE_kmod-e1000 + default y if BUILDBOT config VMDK_IMAGES bool "Build VMware image files (VMDK)" depends on TARGET_x86 depends on GRUB_IMAGES || GRUB_EFI_IMAGES select PACKAGE_kmod-e1000 + default y if BUILDBOT config VHDX_IMAGES bool "Build Hyper-V image files (VHDX)" depends on TARGET_x86 depends on GRUB_IMAGES || GRUB_EFI_IMAGES select PACKAGE_kmod-e1000 + default y if BUILDBOT config TARGET_IMAGES_GZIP bool "GZip images" @@ -297,7 +308,8 @@ menu "Target Images" config TARGET_ROOTFS_PARTSIZE int "Root filesystem partition size (in MiB)" depends on USES_ROOTFS_PART || TARGET_ROOTFS_EXT4FS - default 104 + default 800 if BUILDBOT + default 160 help Select the root filesystem partition size. index 50ae67c..83f0219 100644 (file) @@ -1,7 +1,7 @@ -src-git-full packages https://git.openwrt.org/feed/packages.git -src-git-full luci https://git.openwrt.org/project/luci.git -src-git-full routing https://git.openwrt.org/feed/routing.git -src-git-full telephony https://git.openwrt.org/feed/telephony.git +src-git-full packages https://github.com/immortalwrt/packages.git +src-git-full luci https://github.com/immortalwrt/luci.git +src-git-full routing https://github.com/openwrt/routing.git +src-git-full telephony https://github.com/openwrt/telephony.git #src-git-full video https://github.com/openwrt/video.git #src-git-full targets https://github.com/openwrt/targets.git #src-git-full oldpackages http://git.openwrt.org/packages.git diff --git a/include/logo.png b/include/logo.png deleted file mode 100644 (file) index bb208dd..0000000 Binary files a/include/logo.png and /dev/null differ diff --git a/include/logo.svg b/include/logo.svg deleted file mode 100644 (file) index ff4b8ad..0000000 +++ /dev/null @@ -1,398 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<svg - xmlns:dc="http://purl.org/dc/elements/1.1/" - xmlns:cc="http://creativecommons.org/ns#" - xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" - xmlns:svg="http://www.w3.org/2000/svg" - xmlns="http://www.w3.org/2000/svg" - xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" - xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - width="2000mm" - height="595.20099mm" - viewBox="0 0 2000.0002 595.20098" - version="1.1" - id="svg971" - inkscape:version="1.0.1 (3bc2e813f5, 2020-09-07)" - sodipodi:docname="logo.svg"> - <defs - id="defs965"> - <clipPath - clipPathUnits="userSpaceOnUse" - id="clipPath78"> - <path - d="M 0,0 H 792 V 612 H 0 Z" - id="path76" /> - </clipPath> - <clipPath - clipPathUnits="userSpaceOnUse" - id="clipPath106"> - <path - d="M 0,0 H 792 V 612 H 0 Z" - id="path104" /> - </clipPath> - <clipPath - clipPathUnits="userSpaceOnUse" - id="clipPath130"> - <path - d="M 0,0 H 792 V 612 H 0 Z" - id="path128" /> - </clipPath> - <clipPath - clipPathUnits="userSpaceOnUse" - id="clipPath154"> - <path - d="M 0,0 H 792 V 612 H 0 Z" - id="path152" /> - </clipPath> - <clipPath - clipPathUnits="userSpaceOnUse" - id="clipPath174"> - <path - d="M 0,0 H 792 V 612 H 0 Z" - id="path172" /> - </clipPath> - <clipPath - clipPathUnits="userSpaceOnUse" - id="clipPath194"> - <path - d="M 0,0 H 792 V 612 H 0 Z" - id="path192" /> - </clipPath> - <clipPath - clipPathUnits="userSpaceOnUse" - id="clipPath214"> - <path - d="M 0,0 H 792 V 612 H 0 Z" - id="path212" /> - </clipPath> - </defs> - <sodipodi:namedview - id="base" - pagecolor="#ffffff" - bordercolor="#666666" - borderopacity="1.0" - inkscape:pageopacity="0.0" - inkscape:pageshadow="2" - inkscape:zoom="0.35" - inkscape:cx="1579.8791" - inkscape:cy="728.41283" - inkscape:document-units="mm" - inkscape:current-layer="layer1" - inkscape:document-rotation="0" - showgrid="false" - fit-margin-top="0" - fit-margin-left="0" - fit-margin-right="0" - fit-margin-bottom="0" - inkscape:window-width="1920" - inkscape:window-height="1016" - inkscape:window-x="0" - inkscape:window-y="0" - inkscape:window-maximized="1" /> - <metadata - id="metadata968"> - <rdf:RDF> - <cc:Work - rdf:about=""> - <dc:format>image/svg+xml</dc:format> - <dc:type - rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> - <dc:title></dc:title> - </cc:Work> - </rdf:RDF> - </metadata> - <g - inkscape:label="Layer 1" - inkscape:groupmode="layer" - id="layer1" - transform="translate(312.17635,44.559227)"> - <g - id="g72" - transform="matrix(12.354182,0,0,-12.354182,-1687.2697,4281.0797)"> - <g - id="g74" - clip-path="url(#clipPath78)"> - <g - id="g80" - transform="translate(173.1753,319.1396)"> - <path - d="m 0,0 c 0,-5.745 -4.627,-10.263 -10.545,-10.263 -5.918,0 -10.544,4.518 -10.544,10.263 0,5.771 4.626,10.367 10.544,10.367 C -4.627,10.367 0,5.771 0,0 m -3.685,0 c 0,3.995 -3.013,7.024 -6.86,7.024 -3.846,0 -6.859,-3.029 -6.859,-7.024 0,-3.995 3.013,-6.946 6.859,-6.946 3.847,0 6.86,2.95 6.86,6.946" - style="fill:#00ace2;fill-opacity:1;fill-rule:nonzero;stroke:none" - id="path82" /> - </g> - <g - id="g84" - transform="translate(189.0894,315.771)"> - <path - d="m 0,0 c 0,-4.099 -3.174,-6.894 -6.591,-6.894 -1.829,0 -3.308,0.523 -4.438,1.41 v -8.329 H -14.58 V 6.528 h 3.552 V 5.484 C -9.898,6.397 -8.419,6.92 -6.59,6.92 -3.174,6.92 0,4.1 0,0 m -3.443,0 c 0,2.402 -1.614,3.917 -3.766,3.917 -1.91,0 -3.82,-1.515 -3.82,-3.917 0,-2.402 1.91,-3.889 3.82,-3.889 2.152,-0.002 3.766,1.486 3.766,3.889" - style="fill:#00ace2;fill-opacity:1;fill-rule:nonzero;stroke:none" - id="path86" /> - </g> - <g - id="g88" - transform="translate(203.958,314.8574)"> - <path - d="m 0,0 h -10.222 c 0.349,-1.88 1.721,-3.029 3.362,-3.029 1.049,0 2.367,0.131 3.336,1.723 l 3.174,-0.652 c -1.183,-2.716 -3.577,-4.022 -6.51,-4.022 -3.793,0 -6.887,2.794 -6.887,6.894 0,4.099 3.094,6.918 6.94,6.918 3.578,0 6.671,-2.689 6.806,-6.659 z m -10.115,2.429 h 6.485 c -0.457,1.671 -1.749,2.402 -3.174,2.402 -1.347,0 -2.88,-0.784 -3.311,-2.402" - style="fill:#00ace2;fill-opacity:1;fill-rule:nonzero;stroke:none" - id="path90" /> - </g> - <g - id="g92" - transform="translate(218.446,317.2075)"> - <path - d="m 0,0 v -7.938 h -3.551 v 7.207 c 0,1.827 -1.076,3.055 -2.717,3.055 -2.017,0 -3.335,-1.306 -3.335,-4.492 v -5.77 h -3.551 v 13.03 h 3.55 V 3.917 c 1.049,1.018 2.447,1.566 4.223,1.566 C -2.152,5.483 0,3.238 0,0" - style="fill:#00ace2;fill-opacity:1;fill-rule:nonzero;stroke:none" - id="path94" /> - </g> - </g> - </g> - <g - id="g96" - transform="matrix(12.354182,0,0,-12.354182,1281.2351,460.31368)"> - <path - d="M 0,0 H -2.851 L -7.854,12.874 -12.885,0 h -2.824 l -6.699,19.846 h 3.82 l 4.492,-13.109 5.138,13.109 h 2.179 L -1.641,6.737 2.851,19.846 h 3.846 z" - style="fill:#00ace2;fill-opacity:1;fill-rule:nonzero;stroke:none" - id="path98" /> - </g> - <g - id="g100" - transform="matrix(12.354182,0,0,-12.354182,-1687.2697,4281.0797)"> - <g - id="g102" - clip-path="url(#clipPath106)"> - <g - id="g108" - transform="translate(255.7183,322.3774)"> - <path - d="m 0,0 -0.188,-3.316 h -0.78 c -3.282,0 -4.789,-1.959 -4.789,-5.588 v -4.204 h -3.551 v 13.03 h 3.551 V -2.35 c 0.996,1.515 2.556,2.454 4.816,2.454 0.349,0 0.618,0 0.941,-0.104" - style="fill:#00ace2;fill-opacity:1;fill-rule:nonzero;stroke:none" - id="path110" /> - </g> - <g - id="g112" - transform="translate(263.2698,314.0737)"> - <path - d="m 0,0 c 0,-1.279 0.619,-1.985 1.695,-1.985 0.618,0 1.533,0.262 2.234,0.627 L 4.952,-4.23 C 3.553,-4.961 2.584,-5.197 1.455,-5.197 c -3.201,0 -5.004,1.776 -5.004,4.937 v 5.665 h -2.879 v 2.821 h 2.879 v 4.726 l 3.55,1.045 V 8.226 H 5.193 V 5.405 H 0 Z" - style="fill:#00ace2;fill-opacity:1;fill-rule:nonzero;stroke:none" - id="path114" /> - </g> - </g> - </g> - <g - id="g116" - transform="matrix(12.354182,0,0,-12.354182,612.14009,549.73584)"> - <path - d="M 0,0 H -0.799 L -1.549,2 -2.304,0 H -3.1 l -1.224,3.689 h 1.02 l 0.635,-1.99 0.795,1.99 h 0.65 l 0.79,-1.99 0.64,1.99 h 1.02 z" - style="fill:#002843;fill-opacity:1;fill-rule:nonzero;stroke:none" - id="path118" /> - </g> - <g - id="g120" - transform="matrix(12.354182,0,0,-12.354182,674.30011,539.84385)"> - <path - d="m 0,0 h 0.785 v -0.801 h -2.53 V 0 h 0.785 v 2.083 h -0.785 v 0.805 h 2.53 V 2.083 H 0 Z" - style="fill:#002843;fill-opacity:1;fill-rule:nonzero;stroke:none" - id="path122" /> - </g> - <g - id="g124" - transform="matrix(12.354182,0,0,-12.354182,-1687.2697,4281.0797)"> - <g - id="g126" - clip-path="url(#clipPath130)"> - <g - id="g132" - transform="translate(196.9004,302.0308)"> - <path - d="M 0,0 -0.7,0.801 H -1.449 V 0 H -2.41 v 3.689 h 1.771 c 1,0 1.605,-0.573 1.605,-1.427 0,-0.549 -0.255,-0.991 -0.695,-1.238 L 1.206,0 Z m -0.675,1.602 c 0.4,0 0.73,0.262 0.73,0.66 0,0.388 -0.33,0.628 -0.73,0.628 H -1.449 V 1.604 Z" - style="fill:#002843;fill-opacity:1;fill-rule:nonzero;stroke:none" - id="path134" /> - </g> - </g> - </g> - <g - id="g136" - transform="matrix(12.354182,0,0,-12.354182,820.47493,549.73584)"> - <path - d="m 0,0 h -2.9 v 3.689 h 2.87 V 2.888 H -1.94 V 2.257 h 1.88 V 1.456 H -1.94 V 0.801 h 1.941 z" - style="fill:#002843;fill-opacity:1;fill-rule:nonzero;stroke:none" - id="path138" /> - </g> - <g - id="g140" - transform="matrix(12.354182,0,0,-12.354182,886.62894,549.73584)"> - <path - d="m 0,0 h -2.805 v 3.689 h 0.96 V 0.801 H 0 Z" - style="fill:#002843;fill-opacity:1;fill-rule:nonzero;stroke:none" - id="path142" /> - </g> - <g - id="g144" - transform="matrix(12.354182,0,0,-12.354182,953.79261,549.73584)"> - <path - d="m 0,0 h -2.9 v 3.689 h 2.87 V 2.888 H -1.94 V 2.257 h 1.88 V 1.456 H -1.94 V 0.801 H 0 Z" - style="fill:#002843;fill-opacity:1;fill-rule:nonzero;stroke:none" - id="path146" /> - </g> - <g - id="g148" - transform="matrix(12.354182,0,0,-12.354182,-1687.2697,4281.0797)"> - <g - id="g150" - clip-path="url(#clipPath154)"> - <g - id="g156" - transform="translate(219.3787,304.7295)"> - <path - d="m 0,0 -0.94,-0.185 c -0.08,0.374 -0.34,0.481 -0.565,0.481 -0.225,0 -0.41,-0.111 -0.41,-0.316 0,-0.146 0.08,-0.238 0.245,-0.286 l 0.74,-0.228 c 0.625,-0.199 0.965,-0.481 0.965,-1.058 0,-0.83 -0.75,-1.18 -1.495,-1.18 -0.825,0 -1.495,0.422 -1.59,1.126 l 0.985,0.194 c 0.08,-0.364 0.304,-0.519 0.635,-0.519 0.28,0 0.45,0.126 0.45,0.321 0,0.145 -0.08,0.247 -0.29,0.3 l -0.705,0.199 c -0.575,0.16 -0.965,0.447 -0.965,1.044 0,0.752 0.609,1.165 1.44,1.165 0.79,0 1.375,-0.369 1.5,-1.058" - style="fill:#002843;fill-opacity:1;fill-rule:nonzero;stroke:none" - id="path158" /> - </g> - <g - id="g160" - transform="translate(224.4026,304.7295)"> - <path - d="m 0,0 -0.94,-0.185 c -0.08,0.374 -0.34,0.481 -0.565,0.481 -0.225,0 -0.41,-0.111 -0.41,-0.316 0,-0.146 0.08,-0.238 0.245,-0.286 l 0.74,-0.228 c 0.625,-0.199 0.965,-0.481 0.965,-1.058 0,-0.83 -0.75,-1.18 -1.495,-1.18 -0.825,0 -1.495,0.422 -1.591,1.126 l 0.986,0.194 c 0.08,-0.364 0.304,-0.519 0.635,-0.519 0.28,0 0.45,0.126 0.45,0.321 0,0.145 -0.08,0.247 -0.29,0.3 l -0.705,0.2 c -0.575,0.16 -0.965,0.446 -0.965,1.044 0,0.752 0.608,1.165 1.44,1.165 C -0.71,1.058 -0.125,0.689 0,0" - style="fill:#002843;fill-opacity:1;fill-rule:nonzero;stroke:none" - id="path162" /> - </g> - </g> - </g> - <g - id="g164" - transform="matrix(12.354182,0,0,-12.354182,1170.9286,521.84896)"> - <path - d="M 0,0 H 1.785 V -0.801 H 0 V -2.257 H -0.96 V 1.432 H 1.915 V 0.631 H 0 Z" - style="fill:#002843;fill-opacity:1;fill-rule:nonzero;stroke:none" - id="path166" /> - </g> - <g - id="g168" - transform="matrix(12.354182,0,0,-12.354182,-1687.2697,4281.0797)"> - <g - id="g170" - clip-path="url(#clipPath174)"> - <g - id="g176" - transform="translate(238.2297,302.0308)"> - <path - d="M 0,0 -0.7,0.801 H -1.45 V 0 h -0.96 v 3.689 h 1.77 c 1,0 1.605,-0.573 1.605,-1.427 C 0.965,1.713 0.71,1.271 0.27,1.024 L 1.205,0 Z m -0.675,1.602 c 0.4,0 0.73,0.262 0.73,0.66 0,0.388 -0.33,0.628 -0.73,0.628 H -1.45 V 1.604 Z" - style="fill:#002843;fill-opacity:1;fill-rule:nonzero;stroke:none" - id="path178" /> - </g> - </g> - </g> - <g - id="g180" - transform="matrix(12.354182,0,0,-12.354182,1331.0682,549.73584)"> - <path - d="m 0,0 h -2.9 v 3.689 h 2.87 V 2.888 H -1.94 V 2.257 h 1.88 V 1.456 H -1.94 V 0.801 H 0 Z" - style="fill:#002843;fill-opacity:1;fill-rule:nonzero;stroke:none" - id="path182" /> - </g> - <g - id="g184" - transform="matrix(12.354182,0,0,-12.354182,1398.3947,549.73584)"> - <path - d="m 0,0 h -2.9 v 3.689 h 2.87 V 2.888 H -1.94 V 2.257 h 1.88 V 1.456 H -1.94 V 0.801 h 1.941 z" - style="fill:#002843;fill-opacity:1;fill-rule:nonzero;stroke:none" - id="path186" /> - </g> - <g - id="g188" - transform="matrix(12.354182,0,0,-12.354182,-1687.2697,4281.0797)"> - <g - id="g190" - clip-path="url(#clipPath194)"> - <g - id="g196" - transform="translate(254.0122,305.7197)"> - <path - d="M 0,0 C 1.21,0 2.01,-0.739 2.01,-1.844 2.01,-2.95 1.211,-3.689 0,-3.689 H -1.695 V 0 Z m -0.01,-2.888 c 0.655,0 1.055,0.417 1.055,1.044 0,0.626 -0.4,1.043 -1.055,1.043 h -0.723 v -2.087 z" - style="fill:#002843;fill-opacity:1;fill-rule:nonzero;stroke:none" - id="path198" /> - </g> - <g - id="g200" - transform="translate(262.0693,303.8706)"> - <path - d="m 0,0 c 0,-1.078 -0.91,-1.913 -2.03,-1.913 -1.12,0 -2.035,0.835 -2.035,1.913 0,1.077 0.91,1.917 2.035,1.917 C -0.905,1.917 0,1.073 0,0 m -0.965,0 c 0,0.606 -0.47,1.077 -1.066,1.077 -0.595,0 -1.065,-0.471 -1.065,-1.077 0,-0.607 0.47,-1.078 1.065,-1.078 0.596,0 1.066,0.466 1.066,1.078" - style="fill:#002843;fill-opacity:1;fill-rule:nonzero;stroke:none" - id="path202" /> - </g> - </g> - </g> - <g - id="g204" - transform="matrix(12.354182,0,0,-12.354182,1629.3552,549.73584)"> - <path - d="M 0,0 H -0.94 V 1.752 L -2.06,0.256 H -2.35 L -3.47,1.75 v -1.751 h -0.94 v 3.689 h 0.615 l 1.59,-2.17 1.59,2.17 H 0 Z" - style="fill:#002843;fill-opacity:1;fill-rule:nonzero;stroke:none" - id="path206" /> - </g> - <g - id="g208" - transform="matrix(12.354182,0,0,-12.354182,-1687.2697,4281.0797)"> - <g - id="g210" - clip-path="url(#clipPath214)"> - <g - id="g216" - transform="translate(271.6895,328.4058)"> - <path - d="M 0,0 -0.99,1.042 H -1.398 V 0 h -0.455 v 2.468 h 0.95 c 0.533,0 0.856,-0.296 0.856,-0.712 0.008,-0.283 -0.169,-0.54 -0.441,-0.642 L 0.569,0 Z m -0.903,1.441 c 0.267,0 0.405,0.137 0.405,0.315 0,0.179 -0.141,0.311 -0.405,0.311 H -1.398 V 1.44 Z" - style="fill:#00ace2;fill-opacity:1;fill-rule:nonzero;stroke:none" - id="path218" /> - </g> - <g - id="g220" - transform="translate(270.8284,327.209)"> - <path - d="m 0,0 c -1.307,0 -2.366,1.028 -2.367,2.296 0,1.269 1.059,2.298 2.366,2.298 1.307,0 2.366,-1.028 2.367,-2.296 V 2.297 C 2.365,1.029 1.306,0.002 0,0 m 0,4.269 c -1.122,0 -2.031,-0.883 -2.031,-1.972 0,-1.089 0.909,-1.971 2.031,-1.971 1.122,0 2.031,0.882 2.031,1.971 C 2.03,3.386 1.121,4.268 0,4.269 Z" - style="fill:#00ace2;fill-opacity:1;fill-rule:nonzero;stroke:none" - id="path222" /> - </g> - <g - id="g224" - transform="translate(130.3613,326.9673)"> - <path - d="m 0,0 c -1.713,0 -3.102,-1.348 -3.102,-3.011 0,-1.663 1.389,-3.011 3.102,-3.011 1.713,0 3.102,1.348 3.102,3.011 C 3.099,-1.35 1.712,-0.003 0,0" - style="fill:#00ace2;fill-opacity:1;fill-rule:nonzero;stroke:none" - id="path226" /> - </g> - <g - id="g228" - transform="translate(111.3059,342.4536)"> - <path - d="m 0,0 3.229,-3.134 c 4.051,3.933 9.653,6.36 15.826,6.36 6.174,0 11.776,-2.428 15.827,-6.36 L 38.111,0 C 33.236,4.732 26.494,7.682 19.055,7.682 11.617,7.682 4.875,4.732 0,0" - style="fill:#00ace2;fill-opacity:1;fill-rule:nonzero;stroke:none" - id="path230" /> - </g> - <g - id="g232" - transform="translate(117.1301,336.7998)"> - <path - d="m 0,0 3.229,-3.134 c 2.564,2.488 6.109,4.025 10.001,4.025 3.892,0 7.44,-1.537 10.004,-4.025 L 26.463,0 C 23.076,3.288 18.391,5.348 13.232,5.348 8.072,5.348 3.388,3.289 0,0" - style="fill:#00ace2;fill-opacity:1;fill-rule:nonzero;stroke:none" - id="path234" /> - </g> - <g - id="g236" - transform="translate(122.9229,331.1763)"> - <path - d="m 0,0 3.229,-3.134 c 2.326,2.253 6.093,2.253 8.419,0 L 14.877,0 C 12.905,1.915 10.228,2.988 7.438,2.98 4.558,2.98 1.93,1.844 0,0" - style="fill:#00ace2;fill-opacity:1;fill-rule:nonzero;stroke:none" - id="path238" /> - </g> - <g - id="g240" - transform="translate(141.8201,332.0371)"> - <path - d="m 0,0 c 1.709,-2.274 2.722,-5.07 2.722,-8.081 0,-7.589 -6.362,-13.766 -14.181,-13.766 -7.818,0 -14.18,6.177 -14.18,13.766 0,3.011 1.013,5.807 2.722,8.081 l -3.26,3.165 c -2.533,-3.103 -4.021,-7.006 -4.021,-11.246 0,-10.017 8.42,-18.19 18.739,-18.19 10.32,0 18.739,8.173 18.739,18.19 0,4.24 -1.519,8.143 -4.02,11.246 z" - style="fill:#002843;fill-opacity:1;fill-rule:nonzero;stroke:none" - id="path242" /> - </g> - </g> - </g> - </g> -</svg> index e49725f..e62d3ea 100644 (file) @@ -103,6 +103,10 @@$(eval $(call nf_add,IPT_PHYSDEV,CONFIG_NETFILTER_XT_MATCH_PHYSDEV,$(P_XT)xt_ph
$(eval$(call nf_add,IPT_FILTER,CONFIG_NETFILTER_XT_MATCH_STRING, $(P_XT)xt_string))$(eval $(call nf_add,IPT_FILTER,CONFIG_NETFILTER_XT_MATCH_BPF,$(P_XT)xt_bpf))

+# imq
+
+$(eval$(call nf_add,IPT_IMQ,CONFIG_IP_NF_TARGET_IMQ, $(P_V4)ipt_IMQ)) +$(eval $(call nf_add,IPT_IMQ,CONFIG_NETFILTER_XT_TARGET_IMQ,$(P_XT)xt_IMQ))

# ipopt

index a2c8b7b..968c6b3 100644 (file)
@@ -53,14 +53,26 @@ DEFAULT_PACKAGES.nas:=\
# For router targets
DEFAULT_PACKAGES.router:=\
-       dnsmasq \
+       dnsmasq-full \
firewall4 \
-       nftables \
-       odhcp6c \
-       odhcpd-ipv6only \
ppp \
ppp-mod-pppoe
+# For easy usage
+DEFAULT_PACKAGES.tweak:=\
+       autocore \
+       block-mount \
+       default-settings-chn \
+       iptables-nft \
+       ipv6helper \
+       kmod-nf-nathelper \
+       kmod-nf-nathelper-extra \
+       luci \
+       luci-app-cpufreq \
+       luci-app-turboacc \
+       luci-compat \
+       luci-lib-base \
+       luci-lib-fs \
+       luci-lib-ipkg

ifneq ($(DUMP),) all: dumpinfo @@ -93,6 +105,9 @@ else endif endif +# Add tweaked packages +# DEFAULT_PACKAGES +=$(DEFAULT_PACKAGES.tweak)
+
# Add device specific packages (here below to allow device type set from subtarget)
DEFAULT_PACKAGES += $(DEFAULT_PACKAGES.$(DEVICE_TYPE))

index f39e35c..8eea1f2 100644 (file)
@@ -29,26 +29,26 @@ VERSION_CODE:=$(call qstrip,$(CONFIG_VERSION_CODE))
VERSION_CODE:=$(if$(VERSION_CODE),$(VERSION_CODE),$(REVISION))

VERSION_REPO:=$(call qstrip,$(CONFIG_VERSION_REPO))
-VERSION_REPO:=$(if$(VERSION_REPO),$(VERSION_REPO),https://downloads.openwrt.org/snapshots) +VERSION_REPO:=$(if $(VERSION_REPO),$(VERSION_REPO),https://downloads.immortalwrt.org/snapshots)

VERSION_DIST:=$(call qstrip,$(CONFIG_VERSION_DIST))
-VERSION_DIST:=$(if$(VERSION_DIST),$(VERSION_DIST),OpenWrt) +VERSION_DIST:=$(if $(VERSION_DIST),$(VERSION_DIST),ImmortalWrt)
VERSION_DIST_SANITIZED:=$(call sanitize,$(VERSION_DIST))

VERSION_MANUFACTURER:=$(call qstrip,$(CONFIG_VERSION_MANUFACTURER))
-VERSION_MANUFACTURER:=$(if$(VERSION_MANUFACTURER),$(VERSION_MANUFACTURER),OpenWrt) +VERSION_MANUFACTURER:=$(if $(VERSION_MANUFACTURER),$(VERSION_MANUFACTURER),ImmortalWrt)

VERSION_MANUFACTURER_URL:=$(call qstrip,$(CONFIG_VERSION_MANUFACTURER_URL))
-VERSION_MANUFACTURER_URL:=$(if$(VERSION_MANUFACTURER_URL),$(VERSION_MANUFACTURER_URL),https://openwrt.org/) +VERSION_MANUFACTURER_URL:=$(if $(VERSION_MANUFACTURER_URL),$(VERSION_MANUFACTURER_URL),https://immortalwrt.org/)

VERSION_BUG_URL:=$(call qstrip,$(CONFIG_VERSION_BUG_URL))
-VERSION_BUG_URL:=$(if$(VERSION_BUG_URL),$(VERSION_BUG_URL),https://bugs.openwrt.org/) +VERSION_BUG_URL:=$(if $(VERSION_BUG_URL),$(VERSION_BUG_URL),https://github.com/immortalwrt/immortalwrt/issues)

VERSION_HOME_URL:=$(call qstrip,$(CONFIG_VERSION_HOME_URL))
-VERSION_HOME_URL:=$(if$(VERSION_HOME_URL),$(VERSION_HOME_URL),https://openwrt.org/) +VERSION_HOME_URL:=$(if $(VERSION_HOME_URL),$(VERSION_HOME_URL),https://immortalwrt.org/)

VERSION_SUPPORT_URL:=$(call qstrip,$(CONFIG_VERSION_SUPPORT_URL))
-VERSION_SUPPORT_URL:=$(if$(VERSION_SUPPORT_URL),$(VERSION_SUPPORT_URL),https://forum.openwrt.org/) +VERSION_SUPPORT_URL:=$(if $(VERSION_SUPPORT_URL),$(VERSION_SUPPORT_URL),https://github.com/immortalwrt/immortalwrt/discussions)

VERSION_PRODUCT:=$(call qstrip,$(CONFIG_VERSION_PRODUCT))
VERSION_PRODUCT:=$(if$(VERSION_PRODUCT),$(VERSION_PRODUCT),Generic) index 596fcf4..cf55d3c 100755 (executable) @@ -301,7 +301,7 @@ generate_static_system() { uci -q batch <<-EOF delete system.@system[0] add system system - set system.@system[-1].hostname='OpenWrt' + set system.@system[-1].hostname='ImmortalWrt' set system.@system[-1].timezone='UTC' set system.@system[-1].ttylogin='0' set system.@system[-1].log_size='64' @@ -311,10 +311,10 @@ generate_static_system() { set system.ntp='timeserver' set system.ntp.enabled='1' set system.ntp.enable_server='0' - add_list system.ntp.server='0.openwrt.pool.ntp.org' - add_list system.ntp.server='1.openwrt.pool.ntp.org' - add_list system.ntp.server='2.openwrt.pool.ntp.org' - add_list system.ntp.server='3.openwrt.pool.ntp.org' + add_list system.ntp.server='time1.apple.com' + add_list system.ntp.server='time1.google.com' + add_list system.ntp.server='time.cloudflare.com' + add_list system.ntp.server='pool.ntp.org' EOF if json_is_a system object; then index f3af3c0..1b6469c 100644 (file) @@ -1,8 +1,9 @@ - _______ ________ __ - | |.-----.-----.-----.| | | |.----.| |_ - | - || _ | -__| || | | || _|| _| - |_______|| __|_____|__|__||________||__| |____| - |__| W I R E L E S S F R E E D O M +.___ __ .__ +| | _____ _____ ____________/ |______ | | +| |/ \ / \ / _ \_ __ \ __\__ \ | | +| | Y Y \ Y Y ( <_> ) | \/| | / __ \| |__ +|___|__|_| /__|_| /\____/|__| |__| (____ /____/ + \/ \/ BE FREE AND UNAFRAID \/ ----------------------------------------------------- %D %V, %C ----------------------------------------------------- index 749d9e9..e2f668d 100755 (executable) @@ -33,6 +33,7 @@ boot() { touch /var/log/lastlog mkdir -p /tmp/resolv.conf.d touch /tmp/resolv.conf.d/resolv.conf.auto + ln -sf /tmp/resolv.conf.d/resolv.conf.auto /tmp/resolv.conf.auto ln -sf /tmp/resolv.conf.d/resolv.conf.auto /tmp/resolv.conf grep -q debugfs /proc/filesystems && /bin/mount -o noatime -t debugfs debugfs /sys/kernel/debug grep -q bpf /proc/filesystems && /bin/mount -o nosuid,nodev,noexec,noatime,mode=0700 -t bpf bpffs /sys/fs/bpf index 76b149b..283a62d 100644 (file) @@ -20,6 +20,19 @@ case "$TERM" in
;;
esac

+[ -x /bin/more ] || alias more='less'
+[ -x /usr/bin/vim ] && alias vi='vim' || alias vim='vi'
+
+alias l='ls -lF'
+alias la='ls -a'
+alias ll='ls -alF'
+alias ls='ls --color=auto'
+
+[ -z "$KSH_VERSION" -o \! -s /etc/mkshrc ] || . /etc/mkshrc + +[ -x /usr/bin/arp -o -x /sbin/arp ] || arp() { cat /proc/net/arp; } +[ -x /usr/bin/ldd ] || ldd() { LD_TRACE_LOADED_OBJECTS=1$*; }
+
[ -n "$FAILSAFE" ] || { for FILE in /etc/profile.d/*.sh; do [ -e "$FILE" ] && . "$FILE" index ac406bc..3e389ed 100644 (file) @@ -158,10 +158,10 @@ if VERSIONOPT config VERSION_DIST string prompt "Release distribution" - default "OpenWrt" + default "ImmortalWrt" help This is the name of the release distribution. - If unspecified, it defaults to OpenWrt. + If unspecified, it defaults to ImmortalWrt. config VERSION_NUMBER string @@ -183,7 +183,7 @@ if VERSIONOPT config VERSION_REPO string prompt "Release repository" - default "https://downloads.openwrt.org/snapshots" + default "https://downloads.immortalwrt.org/snapshots" help This is the repository address embedded in the image, it defaults to the trunk snapshot repo; the url may contain the following placeholders: diff --git a/package/boot/arm-trusted-firmware-rockchip-vendor/Makefile b/package/boot/arm-trusted-firmware-rockchip-vendor/Makefile new file mode 100644 (file) index 0000000..38e8c85 --- /dev/null @@ -0,0 +1,61 @@ +# SPDX-License-Identifier: GPL-2.0-only +# +# Copyright (C) 2021 ImmortalWrt.org + +include$(TOPDIR)/rules.mk
+
+PKG_NAME:=arm-trusted-firmware-rockchip-vendor
+PKG_RELEASE:=$(AUTORELEASE) + +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL=https://github.com/rockchip-linux/rkbin.git +PKG_SOURCE_DATE:=2021-06-01 +PKG_SOURCE_VERSION:=7d631e0d5b2d373b54d4533580d08fb9bd2eaad4 +PKG_MIRROR_HASH:=3a4794d1d00890401b032a573fca3121935ea036468a67228f203d68b007d916 + +PKG_MAINTAINER:=Tianling Shen <cnsztl@immortalwrt.org> + +MAKE_PATH:=$(PKG_NAME)
+
+include $(INCLUDE_DIR)/package.mk + +define Package/arm-trusted-firmware-rockchip-vendor + SECTION:=boot + CATEGORY:=Boot Loaders + TITLE:=ARM Trusted Firmware for Rockchip +endef + +define Package/arm-trusted-firmware-rk3328 +$(Package/arm-trusted-firmware-rockchip-vendor)
+    DEPENDS:=@TARGET_rockchip_armv8
+    VARIANT:=rk3328
+endef
+
+define Package/arm-trusted-firmware-rk3399
+    $(Package/arm-trusted-firmware-rockchip-vendor) + DEPENDS:=@TARGET_rockchip_armv8 + VARIANT:=rk3399 +endef + +define Build/Configure +$(SED) 's,(PKG_BUILD_DIR),$(PKG_BUILD_DIR),g'$(PKG_BUILD_DIR)/trust.ini
+       $(SED) 's,(VARIANT),$(BUILD_VARIANT),g' $(PKG_BUILD_DIR)/trust.ini +$(call Build/Configure/Default)
+endef
+
+define Build/Compile
+       $(CURDIR)/pack-firmware.sh build$(BUILD_VARIANT) '$(PKG_BUILD_DIR)' +endef + +define Build/InstallDev +$(CURDIR)/pack-firmware.sh install $(BUILD_VARIANT) '$(PKG_BUILD_DIR)' '$(STAGING_DIR_IMAGE)' +endef + +define Package/arm-trusted-firmware-rk3328/install +endef + +define Package/arm-trusted-firmware-rk3399/install +endef + +$(eval $(call BuildPackage,arm-trusted-firmware-rk3328)) +$(eval $(call BuildPackage,arm-trusted-firmware-rk3399)) diff --git a/package/boot/arm-trusted-firmware-rockchip-vendor/pack-firmware.sh b/package/boot/arm-trusted-firmware-rockchip-vendor/pack-firmware.sh new file mode 100755 (executable) index 0000000..6bc9faf --- /dev/null @@ -0,0 +1,41 @@ +#!/bin/bash +# Copyright (C) 2021 ImmortalWrt.org + +ACTION="$1"
+VARIANT="$2" +PKG_BUILD_DIR="$3"
+STAGING_DIR_IMAGE="$4" + +case "$VARIANT" in
+"rk3328")
+       ATF="rk33/rk322xh_bl31_v1.46.elf"
+       DDR="rk33/rk3328_ddr_333MHz_v1.17.bin"
+       ;;
+"rk3399")
+       ATF="rk33/rk3399_bl31_v1.35.elf"
+       DDR="rk33/rk3399_ddr_800MHz_v1.25.bin"
+       ;;
+*)
+       echo -e "Not compatible with your platform: $VARIANT." + exit 1 + ;; +esac + +set -x +if [ "$ACTION" == "build" ]; then
+       mkimage -n "$VARIANT" -T "rksd" -d "$PKG_BUILD_DIR/bin/$DDR" "$PKG_BUILD_DIR/$VARIANT-idbloader.bin" + cat "$PKG_BUILD_DIR/bin/$LOADER" >> "$PKG_BUILD_DIR/$VARIANT-idbloader.bin" + "$PKG_BUILD_DIR/tools/trust_merger" --replace "bl31.elf" "$PKG_BUILD_DIR/bin/$ATF" "$PKG_BUILD_DIR/trust.ini" +elif [ "$ACTION" == "install" ]; then
+       mkdir -p "$STAGING_DIR_IMAGE" + cp -fp "$PKG_BUILD_DIR/bin/$ATF" "$STAGING_DIR_IMAGE"/
+       cp -fp "$PKG_BUILD_DIR/tools/loaderimage" "$STAGING_DIR_IMAGE"/
+       cp -fp "$PKG_BUILD_DIR/$VARIANT-idbloader.bin" "$STAGING_DIR_IMAGE"/ + cp -fp "$PKG_BUILD_DIR/$VARIANT-trust.bin" "$STAGING_DIR_IMAGE"/
+else
+       echo -e "Unknown operation: $ACTION." + exit 1 +fi +set +x diff --git a/package/boot/arm-trusted-firmware-rockchip-vendor/src/trust.ini b/package/boot/arm-trusted-firmware-rockchip-vendor/src/trust.ini new file mode 100644 (file) index 0000000..17b0177 --- /dev/null @@ -0,0 +1,15 @@ +[VERSION] +MAJOR=1 +MINOR=0 +[BL30_OPTION] +SEC=0 +[BL31_OPTION] +SEC=1 +PATH=bl31.elf +ADDR=0x10000 +[BL32_OPTION] +SEC=0 +[BL33_OPTION] +SEC=0 +[OUTPUT] +PATH=$(PKG_BUILD_DIR)/$(VARIANT)-trust.bin index 9d0d2fc..493e221 100755 (executable) @@ -5,8 +5,7 @@ STOP=90 BOOT_IMAGE=/boot/vmlinuz -EXTRA_COMMANDS="status" -EXTRA_HELP=" status Print crashkernel status" +extra_command "status" "Print crashkernel status" verify_kdump() { local cfg="$1"
index b886ef0..41a0ccd 100644 (file)
@@ -24,15 +24,52 @@ endef

# RK3328 boards

+define U-Boot/nanopi-r2c-rk3328
+  BUILD_SUBTARGET:=armv8
+  NAME:=NanoPi R2C
+  BUILD_DEVICES:= \
+    friendlyarm_nanopi-r2c
+  DEPENDS:=+PACKAGE_u-boot-nanopi-r2c-rk3328:arm-trusted-firmware-rk3328
+  PKG_BUILD_DEPENDS:=arm-trusted-firmware-rockchip-vendor
+  ATF:=rk322xh_bl31_v1.46.elf
+  OF_PLATDATA:=$(1) + USE_RKBIN:=1 +endef + define U-Boot/nanopi-r2s-rk3328 BUILD_SUBTARGET:=armv8 NAME:=NanoPi R2S BUILD_DEVICES:= \ friendlyarm_nanopi-r2s - DEPENDS:=+PACKAGE_u-boot-nanopi-r2s-rk3328:arm-trusted-firmware-rockchip - PKG_BUILD_DEPENDS:=arm-trusted-firmware-rockchip - ATF:=rk3328_bl31.elf + DEPENDS:=+PACKAGE_u-boot-nanopi-r2s-rk3328:arm-trusted-firmware-rk3328 + PKG_BUILD_DEPENDS:=arm-trusted-firmware-rockchip-vendor + ATF:=rk322xh_bl31_v1.46.elf OF_PLATDATA:=$(1)
+  USE_RKBIN:=1
+endef
+
+define U-Boot/orangepi-r1-plus-rk3328
+  BUILD_SUBTARGET:=armv8
+  NAME:=Orange Pi R1 Plus
+  BUILD_DEVICES:= \
+    xunlong_orangepi-r1-plus
+  DEPENDS:=+PACKAGE_u-boot-orangepi-r1-plus-rk3328:arm-trusted-firmware-rk3328
+  PKG_BUILD_DEPENDS:=arm-trusted-firmware-rockchip-vendor
+  ATF:=rk322xh_bl31_v1.46.elf
+  OF_PLATDATA:=$(1) + USE_RKBIN:=1 +endef + +define U-Boot/orangepi-r1-plus-lts-rk3328 + BUILD_SUBTARGET:=armv8 + NAME:=Orange Pi R1 Plus LTS + BUILD_DEVICES:= \ + xunlong_orangepi-r1-plus-lts + DEPENDS:=+PACKAGE_u-boot-orangepi-r1-plus-lts-rk3328:arm-trusted-firmware-rk3328 + PKG_BUILD_DEPENDS:=arm-trusted-firmware-rockchip-vendor + ATF:=rk322xh_bl31_v1.46.elf + OF_PLATDATA:=$(1)
+  USE_RKBIN:=1
endef

@@ -43,9 +80,10 @@ define U-Boot/nanopi-r4s-rk3399
NAME:=NanoPi R4S
BUILD_DEVICES:= \
friendlyarm_nanopi-r4s
-  DEPENDS:=+PACKAGE_u-boot-nanopi-r4s-rk3399:arm-trusted-firmware-rockchip
-  PKG_BUILD_DEPENDS:=arm-trusted-firmware-rockchip
-  ATF:=rk3399_bl31.elf
+  DEPENDS:=+PACKAGE_u-boot-nanopi-r4s-rk3399:arm-trusted-firmware-rk3399
+  PKG_BUILD_DEPENDS:=arm-trusted-firmware-rockchip-vendor
+  ATF:=rk3399_bl31_v1.35.elf
+  USE_RKBIN:=1
endef

define U-Boot/rock-pi-4-rk3399
@@ -72,7 +110,10 @@ UBOOT_TARGETS := \
nanopi-r4s-rk3399 \
rock-pi-4-rk3399 \
rockpro64-rk3399 \
-  nanopi-r2s-rk3328
+  nanopi-r2c-rk3328 \
+  nanopi-r2s-rk3328 \
+  orangepi-r1-plus-rk3328 \
+  orangepi-r1-plus-lts-rk3328

UBOOT_CONFIGURE_VARS += USE_PRIVATE_LIBGCC=yes

@@ -97,8 +138,13 @@ endef

define Build/InstallDev
$(INSTALL_DIR)$(STAGING_DIR_IMAGE)
+ifneq ($(USE_RKBIN),) +$(STAGING_DIR_IMAGE)/loaderimage --pack --uboot $(PKG_BUILD_DIR)/u-boot-dtb.bin$(PKG_BUILD_DIR)/uboot.img 0x200000
+       $(CP)$(PKG_BUILD_DIR)/uboot.img $(STAGING_DIR_IMAGE)/$(BUILD_VARIANT)-uboot.img
+else
$(CP)$(PKG_BUILD_DIR)/idbloader.img $(STAGING_DIR_IMAGE)/$(BUILD_VARIANT)-idbloader.img
$(CP)$(PKG_BUILD_DIR)/u-boot.itb $(STAGING_DIR_IMAGE)/$(BUILD_VARIANT)-u-boot.itb
+endif
endef

define Package/u-boot/install/default
new file mode 100644 (file)
index 0000000..de94544
--- /dev/null
@@ -0,0 +1,172 @@
+--- a/arch/arm/dts/Makefile
++++ b/arch/arm/dts/Makefile
+@@ -109,6 +109,7 @@ dtb-$(CONFIG_ROCKCHIP_RK3308) += \ + dtb-$(CONFIG_ROCKCHIP_RK3328) += \
+       rk3328-evb.dtb \
+       rk3328-nanopi-r2s.dtb \
++      rk3328-orangepi-r1-plus.dtb \
+       rk3328-roc-cc.dtb \
+       rk3328-rock64.dtb \
+       rk3328-rock-pi-e.dtb
+--- /dev/null
++++ b/arch/arm/dts/rk3328-orangepi-r1-plus-u-boot.dtsi
+@@ -0,0 +1,1 @@
++#include "rk3328-nanopi-r2s-u-boot.dtsi"
+--- /dev/null
++++ b/arch/arm/dts/rk3328-orangepi-r1-plus.dts
+@@ -0,0 +1,38 @@
++#include "rk3328-nanopi-r2s.dts"
++
++/ {
++      model = "Xunlong Orange Pi R1 Plus";
++      compatible = "xunlong,orangepi-r1-plus", "rockchip,rk3328";
++};
++
++&lan_led {
++      label = "orangepi-r1-plus:green:lan";
++};
++
++&spi0 {
++      status = "okay";
++
++      flash@0 {
++              compatible = "jedec,spi-nor";
++              reg = <0>;
++              spi-max-frequency = <10000000>;
++      };
++};
++
++&sys_led {
++      gpios = <&gpio3 RK_PC5 GPIO_ACTIVE_HIGH>;
++      label = "orangepi-r1-plus:red:sys";
++};
++
++&sys_led_pin {
++      rockchip,pins = <3 RK_PC5 RK_FUNC_GPIO &pcfg_pull_none>;
++};
++
++&uart1 {
++      status = "okay";
++};
++
++&wan_led {
++      label = "orangepi-r1-plus:green:wan";
++};
+--- a/board/rockchip/evb_rk3328/MAINTAINERS
++++ b/board/rockchip/evb_rk3328/MAINTAINERS
+@@ -12,6 +12,13 @@ F:      configs/nanopi-r2s-rk3328_defconfig
+ F:      arch/arm/dts/rk3328-nanopi-r2s-u-boot.dtsi
+ F:      arch/arm/dts/rk3328-nanopi-r2s.dts
++ORANGEPI-R1-PLUS-RK3328
++M:      Shenzhen Xunlong Software CO.,Limited <zhao_steven@263.net>
++S:      Maintained
++F:      configs/orangepi-r1-plus-rk3328_defconfig
++F:      arch/arm/dts/rk3328-orangepi-r1-plus-u-boot.dtsi
++F:      arch/arm/dts/rk3328-orangepi-r1-plus.dts
++
+ ROC-RK3328-CC
+ M:      Loic Devulder <ldevulder@suse.com>
+ M:      Chen-Yu Tsai <wens@csie.org>
+--- /dev/null
++++ b/configs/orangepi-r1-plus-rk3328_defconfig
+@@ -0,0 +1,98 @@
++CONFIG_ARM=y
++CONFIG_ARCH_ROCKCHIP=y
++CONFIG_SYS_TEXT_BASE=0x00200000
++CONFIG_SPL_GPIO_SUPPORT=y
++CONFIG_ENV_OFFSET=0x3F8000
++CONFIG_ROCKCHIP_RK3328=y
++CONFIG_TPL_ROCKCHIP_COMMON_BOARD=y
++CONFIG_TPL_LIBCOMMON_SUPPORT=y
++CONFIG_TPL_LIBGENERIC_SUPPORT=y
++CONFIG_SPL_DRIVERS_MISC_SUPPORT=y
++CONFIG_NR_DRAM_BANKS=1
++CONFIG_DEBUG_UART_BASE=0xFF130000
++CONFIG_DEBUG_UART_CLOCK=24000000
++CONFIG_SYSINFO=y
++CONFIG_DEBUG_UART=y
++CONFIG_TPL_SYS_MALLOC_F_LEN=0x800
++# CONFIG_ANDROID_BOOT_IMAGE is not set
++CONFIG_FIT=y
++CONFIG_FIT_VERBOSE=y
++CONFIG_DEFAULT_FDT_FILE="rockchip/rk3328-orangepi-r1-plus.dtb"
++CONFIG_MISC_INIT_R=y
++# CONFIG_DISPLAY_CPUINFO is not set
++CONFIG_DISPLAY_BOARDINFO_LATE=y
++# CONFIG_SPL_RAW_IMAGE_SUPPORT is not set
++CONFIG_TPL_SYS_MALLOC_SIMPLE=y
++CONFIG_SPL_STACK_R=y
++CONFIG_SPL_I2C_SUPPORT=y
++CONFIG_SPL_POWER_SUPPORT=y
++CONFIG_SPL_ATF=y
++CONFIG_SPL_ATF_NO_PLATFORM_PARAM=y
++CONFIG_CMD_BOOTZ=y
++CONFIG_CMD_GPT=y
++CONFIG_CMD_MMC=y
++CONFIG_CMD_USB=y
++# CONFIG_CMD_SETEXPR is not set
++CONFIG_CMD_TIME=y
++CONFIG_SPL_OF_CONTROL=y
++CONFIG_TPL_OF_CONTROL=y
++CONFIG_DEFAULT_DEVICE_TREE="rk3328-orangepi-r1-plus"
++CONFIG_OF_SPL_REMOVE_PROPS="clock-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents"
++CONFIG_TPL_OF_PLATDATA=y
++CONFIG_ENV_IS_IN_MMC=y
++CONFIG_TPL_DM=y
++CONFIG_REGMAP=y
++CONFIG_SPL_REGMAP=y
++CONFIG_TPL_REGMAP=y
++CONFIG_SYSCON=y
++CONFIG_SPL_SYSCON=y
++CONFIG_TPL_SYSCON=y
++CONFIG_CLK=y
++CONFIG_SPL_CLK=y
++CONFIG_FASTBOOT_CMD_OEM_FORMAT=y
++CONFIG_ROCKCHIP_GPIO=y
++CONFIG_SYS_I2C_ROCKCHIP=y
++CONFIG_MMC_DW=y
++CONFIG_MMC_DW_ROCKCHIP=y
++CONFIG_SF_DEFAULT_SPEED=20000000
++CONFIG_DM_ETH=y
++CONFIG_ETH_DESIGNWARE=y
++CONFIG_GMAC_ROCKCHIP=y
++CONFIG_PINCTRL=y
++CONFIG_SPL_PINCTRL=y
++CONFIG_DM_PMIC=y
++CONFIG_PMIC_RK8XX=y
++CONFIG_SPL_DM_REGULATOR=y
++CONFIG_REGULATOR_PWM=y
++CONFIG_DM_REGULATOR_FIXED=y
++CONFIG_SPL_DM_REGULATOR_FIXED=y
++CONFIG_REGULATOR_RK8XX=y
++CONFIG_PWM_ROCKCHIP=y
++CONFIG_RAM=y
++CONFIG_SPL_RAM=y
++CONFIG_TPL_RAM=y
++CONFIG_DM_RESET=y
++CONFIG_BAUDRATE=1500000
++CONFIG_DEBUG_UART_SHIFT=2
++CONFIG_SYSRESET=y
++# CONFIG_TPL_SYSRESET is not set
++CONFIG_USB=y
++CONFIG_USB_XHCI_HCD=y
++CONFIG_USB_XHCI_DWC3=y
++CONFIG_USB_EHCI_HCD=y
++CONFIG_USB_EHCI_GENERIC=y
++CONFIG_USB_OHCI_HCD=y
++CONFIG_USB_OHCI_GENERIC=y
++CONFIG_USB_DWC2=y
++CONFIG_USB_DWC3=y
++CONFIG_SPL_TINY_MEMSET=y
++CONFIG_TPL_TINY_MEMSET=y
++CONFIG_ERRNO_STR=y
new file mode 100644 (file)
index 0000000..2e3dc17
--- /dev/null
@@ -0,0 +1,182 @@
+diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
+index d3e89ca3ba..d5f64ac432 100644
+--- a/arch/arm/dts/Makefile
++++ b/arch/arm/dts/Makefile
+@@ -108,6 +108,7 @@ dtb-$(CONFIG_ROCKCHIP_RK3308) += \ + dtb-$(CONFIG_ROCKCHIP_RK3328) += \
+       rk3328-evb.dtb \
++      rk3328-nanopi-r2c.dtb \
+       rk3328-nanopi-r2s.dtb \
+       rk3328-orangepi-r1-plus.dtb \
+       rk3328-roc-cc.dtb \
+diff --git a/arch/arm/dts/rk3328-nanopi-r2c-u-boot.dtsi b/arch/arm/dts/rk3328-nanopi-r2c-u-boot.dtsi
+new file mode 100644
+index 0000000000..c2e86d0f0e
+--- /dev/null
++++ b/arch/arm/dts/rk3328-nanopi-r2c-u-boot.dtsi
+@@ -0,0 +1,7 @@
++/*
++ * (C) Copyright 2018-2019 Rockchip Electronics Co., Ltd
++ * (C) Copyright 2021 Tianling Shen
++ */
++
++#include "rk3328-nanopi-r2s-u-boot.dtsi"
+diff --git a/arch/arm/dts/rk3328-nanopi-r2c.dts b/arch/arm/dts/rk3328-nanopi-r2c.dts
+new file mode 100644
+--- /dev/null
++++ b/arch/arm/dts/rk3328-nanopi-r2c.dts
+@@ -0,0 +1,47 @@
++/*
++ * Copyright (c) 2021 FriendlyElec Computer Tech. Co., Ltd.
++ * (http://www.friendlyarm.com)
++ *
++ * Copyright (c) 2021 Tianling Shen <cnsztl@immortalwrt.org>
++ */
++
++/dts-v1/;
++
++#include "rk3328-nanopi-r2s.dts"
++
++/ {
++      model = "FriendlyElec NanoPi R2C";
++      compatible = "friendlyarm,nanopi-r2c", "rockchip,rk3328";
++};
++
++&gmac2io {
++      phy-handle = <&yt8521s>;
++
++      mdio {
++              /delete-node/ ethernet-phy@1;
++
++              yt8521s: ethernet-phy@3 {
++                      compatible = "ethernet-phy-id0000.011a",
++                                   "ethernet-phy-ieee802.3-c22";
++                      reg = <3>;
++                      pinctrl-0 = <&eth_phy_reset_pin>;
++                      pinctrl-names = "default";
++                      reset-assert-us = <10000>;
++                      reset-deassert-us = <50000>;
++                      reset-gpios = <&gpio1 RK_PC2 GPIO_ACTIVE_LOW>;
++              };
++      };
++};
++
++&lan_led {
++      label = "nanopi-r2c:green:lan";
++};
++
++&sys_led {
++      label = "nanopi-r2c:red:sys";
++};
++
++&wan_led {
++      label = "nanopi-r2c:green:wan";
++};
+diff --git a/configs/nanopi-r2c-rk3328_defconfig b/configs/nanopi-r2c-rk3328_defconfig
+new file mode 100644
+index 0000000000..7bc7a3274f
+--- /dev/null
++++ b/configs/nanopi-r2c-rk3328_defconfig
+@@ -0,0 +1,98 @@
++CONFIG_ARM=y
++CONFIG_ARCH_ROCKCHIP=y
++CONFIG_SYS_TEXT_BASE=0x00200000
++CONFIG_SPL_GPIO_SUPPORT=y
++CONFIG_NR_DRAM_BANKS=1
++CONFIG_ENV_OFFSET=0x3F8000
++CONFIG_DEFAULT_DEVICE_TREE="rk3328-nanopi-r2c"
++CONFIG_ROCKCHIP_RK3328=y
++CONFIG_TPL_ROCKCHIP_COMMON_BOARD=y
++CONFIG_TPL_LIBCOMMON_SUPPORT=y
++CONFIG_TPL_LIBGENERIC_SUPPORT=y
++CONFIG_SPL_DRIVERS_MISC_SUPPORT=y
++CONFIG_DEBUG_UART_BASE=0xFF130000
++CONFIG_DEBUG_UART_CLOCK=24000000
++CONFIG_DEBUG_UART=y
++CONFIG_TPL_SYS_MALLOC_F_LEN=0x800
++# CONFIG_ANDROID_BOOT_IMAGE is not set
++CONFIG_FIT=y
++CONFIG_FIT_VERBOSE=y
++CONFIG_DEFAULT_FDT_FILE="rockchip/rk3328-nanopi-r2c.dtb"
++# CONFIG_DISPLAY_CPUINFO is not set
++CONFIG_DISPLAY_BOARDINFO_LATE=y
++CONFIG_MISC_INIT_R=y
++# CONFIG_SPL_RAW_IMAGE_SUPPORT is not set
++CONFIG_TPL_SYS_MALLOC_SIMPLE=y
++CONFIG_SPL_STACK_R=y
++CONFIG_SPL_I2C_SUPPORT=y
++CONFIG_SPL_POWER_SUPPORT=y
++CONFIG_SPL_ATF=y
++CONFIG_SPL_ATF_NO_PLATFORM_PARAM=y
++CONFIG_CMD_BOOTZ=y
++CONFIG_CMD_GPT=y
++CONFIG_CMD_MMC=y
++CONFIG_CMD_USB=y
++# CONFIG_CMD_SETEXPR is not set
++CONFIG_CMD_TIME=y
++CONFIG_SPL_OF_CONTROL=y
++CONFIG_TPL_OF_CONTROL=y
++CONFIG_OF_SPL_REMOVE_PROPS="clock-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents"
++CONFIG_TPL_OF_PLATDATA=y
++CONFIG_ENV_IS_IN_MMC=y
++CONFIG_TPL_DM=y
++CONFIG_REGMAP=y
++CONFIG_SPL_REGMAP=y
++CONFIG_TPL_REGMAP=y
++CONFIG_SYSCON=y
++CONFIG_SPL_SYSCON=y
++CONFIG_TPL_SYSCON=y
++CONFIG_CLK=y
++CONFIG_SPL_CLK=y
++CONFIG_FASTBOOT_CMD_OEM_FORMAT=y
++CONFIG_ROCKCHIP_GPIO=y
++CONFIG_SYS_I2C_ROCKCHIP=y
++CONFIG_MMC_DW=y
++CONFIG_MMC_DW_ROCKCHIP=y
++CONFIG_SF_DEFAULT_SPEED=20000000
++CONFIG_DM_ETH=y
++CONFIG_ETH_DESIGNWARE=y
++CONFIG_GMAC_ROCKCHIP=y
++CONFIG_PINCTRL=y
++CONFIG_SPL_PINCTRL=y
++CONFIG_DM_PMIC=y
++CONFIG_PMIC_RK8XX=y
++CONFIG_SPL_DM_REGULATOR=y
++CONFIG_REGULATOR_PWM=y
++CONFIG_DM_REGULATOR_FIXED=y
++CONFIG_SPL_DM_REGULATOR_FIXED=y
++CONFIG_REGULATOR_RK8XX=y
++CONFIG_PWM_ROCKCHIP=y
++CONFIG_RAM=y
++CONFIG_SPL_RAM=y
++CONFIG_TPL_RAM=y
++CONFIG_DM_RESET=y
++CONFIG_BAUDRATE=1500000
++CONFIG_DEBUG_UART_SHIFT=2
++CONFIG_SYSINFO=y
++CONFIG_SYSRESET=y
++# CONFIG_TPL_SYSRESET is not set
++CONFIG_USB=y
++CONFIG_USB_XHCI_HCD=y
++CONFIG_USB_XHCI_DWC3=y
++CONFIG_USB_EHCI_HCD=y
++CONFIG_USB_EHCI_GENERIC=y
++CONFIG_USB_OHCI_HCD=y
++CONFIG_USB_OHCI_GENERIC=y
++CONFIG_USB_DWC2=y
++CONFIG_USB_DWC3=y
++CONFIG_SPL_TINY_MEMSET=y
++CONFIG_TPL_TINY_MEMSET=y
++CONFIG_ERRNO_STR=y
new file mode 100644 (file)
index 0000000..2a065c5
--- /dev/null
@@ -0,0 +1,165 @@
+--- a/arch/arm/dts/Makefile
++++ b/arch/arm/dts/Makefile
+@@ -111,6 +111,7 @@ dtb-$(CONFIG_ROCKCHIP_RK3328) += \ + rk3328-nanopi-r2c.dtb \ + rk3328-nanopi-r2s.dtb \ + rk3328-orangepi-r1-plus.dtb \ ++ rk3328-orangepi-r1-plus-lts.dtb \ + rk3328-roc-cc.dtb \ + rk3328-rock64.dtb \ + rk3328-rock-pi-e.dtb +--- /dev/null ++++ b/arch/arm/dts/rk3328-orangepi-r1-plus-lts-u-boot.dtsi +@@ -0,0 +1 @@ ++#include "rk3328-orangepi-r1-plus-u-boot.dtsi" +--- /dev/null ++++ b/arch/arm/dts/rk3328-orangepi-r1-plus-lts.dts +@@ -0,0 +1,47 @@ ++// SPDX-License-Identifier: (GPL-2.0+ OR MIT) ++/* ++ * Copyright (c) 2016 Xunlong Software. Co., Ltd. ++ * (http://www.orangepi.org) ++ * ++ * Copyright (c) 2021 Tianling Shen <cnsztl@immortalwrt.org> ++ */ ++ ++#include "rk3328-orangepi-r1-plus.dts" ++ ++/ { ++ model = "Xunlong Orange Pi R1 Plus LTS"; ++ compatible = "xunlong,orangepi-r1-plus-lts", "rockchip,rk3328"; ++}; ++ ++&gmac2io { ++ phy-handle = <&yt8531c>; ++ tx_delay = <0x19>; ++ rx_delay = <0x05>; ++ ++ mdio { ++ /delete-node/ ethernet-phy@1; ++ ++ yt8531c: ethernet-phy@0 { ++ compatible = "ethernet-phy-id4f51.e91b", ++ "ethernet-phy-ieee802.3-c22"; ++ reg = <0>; ++ pinctrl-0 = <&eth_phy_reset_pin>; ++ pinctrl-names = "default"; ++ reset-assert-us = <15000>; ++ reset-deassert-us = <50000>; ++ reset-gpios = <&gpio1 RK_PC2 GPIO_ACTIVE_LOW>; ++ }; ++ }; ++}; ++ ++&lan_led { ++ label = "orangepi-r1-plus-lts:green:lan"; ++}; ++ ++&sys_led { ++ label = "orangepi-r1-plus-lts:red:sys"; ++}; ++ ++&wan_led { ++ label = "orangepi-r1-plus-lts:green:wan"; ++}; +--- /dev/null ++++ b/configs/orangepi-r1-plus-lts-rk3328_defconfig +@@ -0,0 +1,98 @@ ++CONFIG_ARM=y ++CONFIG_ARCH_ROCKCHIP=y ++CONFIG_SYS_TEXT_BASE=0x00200000 ++CONFIG_SPL_GPIO_SUPPORT=y ++CONFIG_ENV_OFFSET=0x3F8000 ++CONFIG_ROCKCHIP_RK3328=y ++CONFIG_TPL_ROCKCHIP_COMMON_BOARD=y ++CONFIG_TPL_LIBCOMMON_SUPPORT=y ++CONFIG_TPL_LIBGENERIC_SUPPORT=y ++CONFIG_SPL_DRIVERS_MISC_SUPPORT=y ++CONFIG_SPL_STACK_R_ADDR=0x600000 ++CONFIG_NR_DRAM_BANKS=1 ++CONFIG_DEBUG_UART_BASE=0xFF130000 ++CONFIG_DEBUG_UART_CLOCK=24000000 ++CONFIG_SYSINFO=y ++CONFIG_DEBUG_UART=y ++CONFIG_TPL_SYS_MALLOC_F_LEN=0x800 ++# CONFIG_ANDROID_BOOT_IMAGE is not set ++CONFIG_FIT=y ++CONFIG_FIT_VERBOSE=y ++CONFIG_SPL_LOAD_FIT=y ++CONFIG_DEFAULT_FDT_FILE="rockchip/rk3328-orangepi-r1-plus-lts.dtb" ++CONFIG_MISC_INIT_R=y ++# CONFIG_DISPLAY_CPUINFO is not set ++CONFIG_DISPLAY_BOARDINFO_LATE=y ++# CONFIG_SPL_RAW_IMAGE_SUPPORT is not set ++CONFIG_TPL_SYS_MALLOC_SIMPLE=y ++CONFIG_SPL_STACK_R=y ++CONFIG_SPL_I2C_SUPPORT=y ++CONFIG_SPL_POWER_SUPPORT=y ++CONFIG_SPL_ATF=y ++CONFIG_SPL_ATF_NO_PLATFORM_PARAM=y ++CONFIG_CMD_BOOTZ=y ++CONFIG_CMD_GPT=y ++CONFIG_CMD_MMC=y ++CONFIG_CMD_USB=y ++# CONFIG_CMD_SETEXPR is not set ++CONFIG_CMD_TIME=y ++CONFIG_SPL_OF_CONTROL=y ++CONFIG_TPL_OF_CONTROL=y ++CONFIG_DEFAULT_DEVICE_TREE="rk3328-orangepi-r1-plus-lts" ++CONFIG_OF_SPL_REMOVE_PROPS="clock-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents" ++CONFIG_TPL_OF_PLATDATA=y ++CONFIG_ENV_IS_IN_MMC=y ++CONFIG_SYS_RELOC_GD_ENV_ADDR=y ++CONFIG_NET_RANDOM_ETHADDR=y ++CONFIG_TPL_DM=y ++CONFIG_REGMAP=y ++CONFIG_SPL_REGMAP=y ++CONFIG_TPL_REGMAP=y ++CONFIG_SYSCON=y ++CONFIG_SPL_SYSCON=y ++CONFIG_TPL_SYSCON=y ++CONFIG_CLK=y ++CONFIG_SPL_CLK=y ++CONFIG_FASTBOOT_BUF_ADDR=0x800800 ++CONFIG_FASTBOOT_CMD_OEM_FORMAT=y ++CONFIG_ROCKCHIP_GPIO=y ++CONFIG_SYS_I2C_ROCKCHIP=y ++CONFIG_MMC_DW=y ++CONFIG_MMC_DW_ROCKCHIP=y ++CONFIG_SF_DEFAULT_SPEED=20000000 ++CONFIG_DM_ETH=y ++CONFIG_ETH_DESIGNWARE=y ++CONFIG_GMAC_ROCKCHIP=y ++CONFIG_PINCTRL=y ++CONFIG_SPL_PINCTRL=y ++CONFIG_DM_PMIC=y ++CONFIG_PMIC_RK8XX=y ++CONFIG_SPL_DM_REGULATOR=y ++CONFIG_REGULATOR_PWM=y ++CONFIG_DM_REGULATOR_FIXED=y ++CONFIG_SPL_DM_REGULATOR_FIXED=y ++CONFIG_REGULATOR_RK8XX=y ++CONFIG_PWM_ROCKCHIP=y ++CONFIG_RAM=y ++CONFIG_SPL_RAM=y ++CONFIG_TPL_RAM=y ++CONFIG_DM_RESET=y ++CONFIG_BAUDRATE=1500000 ++CONFIG_DEBUG_UART_SHIFT=2 ++CONFIG_SYSRESET=y ++# CONFIG_TPL_SYSRESET is not set ++CONFIG_USB=y ++CONFIG_USB_XHCI_HCD=y ++CONFIG_USB_XHCI_DWC3=y ++CONFIG_USB_EHCI_HCD=y ++CONFIG_USB_EHCI_GENERIC=y ++CONFIG_USB_OHCI_HCD=y ++CONFIG_USB_OHCI_GENERIC=y ++CONFIG_USB_DWC2=y ++CONFIG_USB_DWC3=y ++# CONFIG_USB_DWC3_GADGET is not set ++CONFIG_USB_GADGET=y ++CONFIG_USB_GADGET_DWC2_OTG=y ++CONFIG_SPL_TINY_MEMSET=y ++CONFIG_TPL_TINY_MEMSET=y ++CONFIG_ERRNO_STR=y diff --git a/package/boot/uboot-rockchip/src/of-platdata/nanopi-r2c-rk3328/dt-decl.h b/package/boot/uboot-rockchip/src/of-platdata/nanopi-r2c-rk3328/dt-decl.h new file mode 100644 (file) index 0000000..0919e4e --- /dev/null @@ -0,0 +1,23 @@ +/* + * DO NOT MODIFY + * + * Declares externs for all device/uclass instances. + * This was generated by dtoc from a .dtb (device tree binary) file. + */ + +#include <dm/device-internal.h> +#include <dm/uclass-internal.h> + +/* driver declarations - these allow DM_DRIVER_GET() to be used */ +extern U_BOOT_DRIVER(rockchip_rk3328_cru); +extern U_BOOT_DRIVER(rockchip_rk3328_dmc); +extern U_BOOT_DRIVER(rockchip_rk3288_dw_mshc); +extern U_BOOT_DRIVER(ns16550_serial); +extern U_BOOT_DRIVER(rockchip_rk3328_grf); + +/* uclass driver declarations - needed for DM_UCLASS_DRIVER_REF() */ +extern UCLASS_DRIVER(clk); +extern UCLASS_DRIVER(mmc); +extern UCLASS_DRIVER(ram); +extern UCLASS_DRIVER(serial); +extern UCLASS_DRIVER(syscon); diff --git a/package/boot/uboot-rockchip/src/of-platdata/nanopi-r2c-rk3328/dt-plat.c b/package/boot/uboot-rockchip/src/of-platdata/nanopi-r2c-rk3328/dt-plat.c new file mode 100644 (file) index 0000000..e5b330c --- /dev/null @@ -0,0 +1,155 @@ +/* + * DO NOT MODIFY + * + * Declares the U_BOOT_DRIVER() records and platform data. + * This was generated by dtoc from a .dtb (device tree binary) file. + */ + +/* Allow use of U_BOOT_DRVINFO() in this file */ +#define DT_PLAT_C + +#include <common.h> +#include <dm.h> +#include <dt-structs.h> + +/* + * driver_info declarations, ordered by 'struct driver_info' linker_list idx: + * + * idx driver_info driver + * --- -------------------- -------------------- + * 0: clock_controller_at_ff440000 rockchip_rk3328_cru + * 1: dmc rockchip_rk3328_dmc + * 2: mmc_at_ff500000 rockchip_rk3288_dw_mshc + * 3: serial_at_ff130000 ns16550_serial + * 4: syscon_at_ff100000 rockchip_rk3328_grf + * --- -------------------- -------------------- + */ + +/* + * Node /clock-controller@ff440000 index 0 + * driver rockchip_rk3328_cru parent None + */ +static struct dtd_rockchip_rk3328_cru dtv_clock_controller_at_ff440000 = { + .reg = {0xff440000, 0x1000}, + .rockchip_grf = 0x3a, +}; +U_BOOT_DRVINFO(clock_controller_at_ff440000) = { + .name = "rockchip_rk3328_cru", + .plat = &dtv_clock_controller_at_ff440000, + .plat_size = sizeof(dtv_clock_controller_at_ff440000), + .parent_idx = -1, +}; + +/* + * Node /dmc index 1 + * driver rockchip_rk3328_dmc parent None + */ +static struct dtd_rockchip_rk3328_dmc dtv_dmc = { + .reg = {0xff400000, 0x1000, 0xff780000, 0x3000, 0xff100000, 0x1000, 0xff440000, 0x1000, + 0xff720000, 0x1000, 0xff798000, 0x1000}, + .rockchip_sdram_params = {0x1, 0xa, 0x2, 0x1, 0x0, 0x0, 0x11, 0x0, + 0x11, 0x0, 0x0, 0x94291288, 0x0, 0x27, 0x462, 0x15, + 0x242, 0xff, 0x14d, 0x0, 0x1, 0x0, 0x0, 0x0, + 0x43049010, 0x64, 0x28003b, 0xd0, 0x20053, 0xd4, 0x220000, 0xd8, + 0x100, 0xdc, 0x40000, 0xe0, 0x0, 0xe4, 0x110000, 0xe8, + 0x420, 0xec, 0x400, 0xf4, 0xf011f, 0x100, 0x9060b06, 0x104, + 0x20209, 0x108, 0x505040a, 0x10c, 0x40400c, 0x110, 0x5030206, 0x114, + 0x3030202, 0x120, 0x3030b03, 0x124, 0x20208, 0x180, 0x1000040, 0x184, + 0x0, 0x190, 0x7030003, 0x198, 0x5001100, 0x1a0, 0xc0400003, 0x240, + 0x6000604, 0x244, 0x201, 0x250, 0xf00, 0x490, 0x1, 0xffffffff, + 0xffffffff, 0xffffffff, 0xffffffff, 0x4, 0xc, 0x28, 0xa, 0x2c, + 0x0, 0x30, 0x9, 0xffffffff, 0xffffffff, 0x77, 0x88, 0x79, + 0x79, 0x87, 0x97, 0x87, 0x78, 0x77, 0x78, 0x87, + 0x88, 0x87, 0x87, 0x77, 0x78, 0x78, 0x78, 0x78, + 0x78, 0x78, 0x78, 0x78, 0x78, 0x69, 0x9, 0x77, + 0x78, 0x77, 0x78, 0x77, 0x78, 0x77, 0x78, 0x77, + 0x79, 0x9, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, + 0x78, 0x78, 0x78, 0x69, 0x9, 0x77, 0x78, 0x77, + 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x79, 0x9, + 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, + 0x78, 0x69, 0x9, 0x77, 0x78, 0x77, 0x78, 0x77, + 0x78, 0x77, 0x78, 0x77, 0x79, 0x9, 0x78, 0x78, + 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x69, + 0x9, 0x77, 0x78, 0x77, 0x77, 0x77, 0x77, 0x77, + 0x77, 0x77, 0x79, 0x9}, +}; +U_BOOT_DRVINFO(dmc) = { + .name = "rockchip_rk3328_dmc", + .plat = &dtv_dmc, + .plat_size = sizeof(dtv_dmc), + .parent_idx = -1, +}; + +/* + * Node /mmc@ff500000 index 2 + * driver rockchip_rk3288_dw_mshc parent None + */ +static struct dtd_rockchip_rk3288_dw_mshc dtv_mmc_at_ff500000 = { + .bus_width = 0x4, + .cap_sd_highspeed = true, + .clocks = { + {0, {317}}, + {0, {33}}, + {0, {74}}, + {0, {78}},}, + .disable_wp = true, + .fifo_depth = 0x100, + .interrupts = {0x0, 0xc, 0x4}, + .max_frequency = 0x8f0d180, + .pinctrl_0 = {0x47, 0x48, 0x49, 0x4a}, + .pinctrl_names = "default", + .reg = {0xff500000, 0x4000}, + .sd_uhs_sdr104 = true, + .sd_uhs_sdr12 = true, + .sd_uhs_sdr25 = true, + .sd_uhs_sdr50 = true, + .u_boot_spl_fifo_mode = true, + .vmmc_supply = 0x4b, + .vqmmc_supply = 0x1e, +}; +U_BOOT_DRVINFO(mmc_at_ff500000) = { + .name = "rockchip_rk3288_dw_mshc", + .plat = &dtv_mmc_at_ff500000, + .plat_size = sizeof(dtv_mmc_at_ff500000), + .parent_idx = -1, +}; + +/* + * Node /serial@ff130000 index 3 + * driver ns16550_serial parent None + */ +static struct dtd_ns16550_serial dtv_serial_at_ff130000 = { + .clock_frequency = 0x16e3600, + .clocks = { + {0, {40}}, + {0, {212}},}, + .dma_names = {"tx", "rx"}, + .dmas = {0x10, 0x6, 0x10, 0x7}, + .interrupts = {0x0, 0x39, 0x4}, + .pinctrl_0 = 0x26, + .pinctrl_names = "default", + .reg = {0xff130000, 0x100}, + .reg_io_width = 0x4, + .reg_shift = 0x2, +}; +U_BOOT_DRVINFO(serial_at_ff130000) = { + .name = "ns16550_serial", + .plat = &dtv_serial_at_ff130000, + .plat_size = sizeof(dtv_serial_at_ff130000), + .parent_idx = -1, +}; + +/* + * Node /syscon@ff100000 index 4 + * driver rockchip_rk3328_grf parent None + */ +static struct dtd_rockchip_rk3328_grf dtv_syscon_at_ff100000 = { + .reg = {0xff100000, 0x1000}, +}; +U_BOOT_DRVINFO(syscon_at_ff100000) = { + .name = "rockchip_rk3328_grf", + .plat = &dtv_syscon_at_ff100000, + .plat_size = sizeof(dtv_syscon_at_ff100000), + .parent_idx = -1, +}; + diff --git a/package/boot/uboot-rockchip/src/of-platdata/nanopi-r2c-rk3328/dt-structs-gen.h b/package/boot/uboot-rockchip/src/of-platdata/nanopi-r2c-rk3328/dt-structs-gen.h new file mode 100644 (file) index 0000000..b1ff08a --- /dev/null @@ -0,0 +1,51 @@ +/* + * DO NOT MODIFY + * + * Defines the structs used to hold devicetree data. + * This was generated by dtoc from a .dtb (device tree binary) file. + */ + +#include <stdbool.h> +#include <linux/libfdt.h> +struct dtd_ns16550_serial { + fdt32_t clock_frequency; + struct phandle_1_arg clocks[2]; + const char * dma_names[2]; + fdt32_t dmas[4]; + fdt32_t interrupts[3]; + fdt32_t pinctrl_0; + const char * pinctrl_names; + fdt64_t reg[2]; + fdt32_t reg_io_width; + fdt32_t reg_shift; +}; +struct dtd_rockchip_rk3288_dw_mshc { + fdt32_t bus_width; + bool cap_sd_highspeed; + struct phandle_1_arg clocks[4]; + bool disable_wp; + fdt32_t fifo_depth; + fdt32_t interrupts[3]; + fdt32_t max_frequency; + fdt32_t pinctrl_0[4]; + const char * pinctrl_names; + fdt64_t reg[2]; + bool sd_uhs_sdr104; + bool sd_uhs_sdr12; + bool sd_uhs_sdr25; + bool sd_uhs_sdr50; + bool u_boot_spl_fifo_mode; + fdt32_t vmmc_supply; + fdt32_t vqmmc_supply; +}; +struct dtd_rockchip_rk3328_cru { + fdt64_t reg[2]; + fdt32_t rockchip_grf; +}; +struct dtd_rockchip_rk3328_dmc { + fdt64_t reg[12]; + fdt32_t rockchip_sdram_params[196]; +}; +struct dtd_rockchip_rk3328_grf { + fdt64_t reg[2]; +}; diff --git a/package/boot/uboot-rockchip/src/of-platdata/orangepi-r1-plus-lts-rk3328/dt-decl.h b/package/boot/uboot-rockchip/src/of-platdata/orangepi-r1-plus-lts-rk3328/dt-decl.h new file mode 100644 (file) index 0000000..75795aa --- /dev/null @@ -0,0 +1,24 @@ +/* + * DO NOT MODIFY + * + * Declares externs for all device/uclass instances. + * This was generated by dtoc from a .dtb (device tree binary) file. + */ + +#include <dm/device-internal.h> +#include <dm/uclass-internal.h> + +/* driver declarations - these allow DM_DRIVER_GET() to be used */ +extern U_BOOT_DRIVER(rockchip_rk3328_cru); +extern U_BOOT_DRIVER(rockchip_rk3328_dmc); +extern U_BOOT_DRIVER(rockchip_rk3288_dw_mshc); +extern U_BOOT_DRIVER(ns16550_serial); +extern U_BOOT_DRIVER(rockchip_rk3328_spi); +extern U_BOOT_DRIVER(rockchip_rk3328_grf); + +/* uclass driver declarations - needed for DM_UCLASS_DRIVER_REF() */ +extern UCLASS_DRIVER(clk); +extern UCLASS_DRIVER(mmc); +extern UCLASS_DRIVER(ram); +extern UCLASS_DRIVER(serial); +extern UCLASS_DRIVER(syscon); diff --git a/package/boot/uboot-rockchip/src/of-platdata/orangepi-r1-plus-lts-rk3328/dt-plat.c b/package/boot/uboot-rockchip/src/of-platdata/orangepi-r1-plus-lts-rk3328/dt-plat.c new file mode 100644 (file) index 0000000..c78728f --- /dev/null @@ -0,0 +1,175 @@ +/* + * DO NOT MODIFY + * + * Declares the U_BOOT_DRIVER() records and platform data. + * This was generated by dtoc from a .dtb (device tree binary) file. + */ + +/* Allow use of U_BOOT_DRVINFO() in this file */ +#define DT_PLAT_C + +#include <common.h> +#include <dm.h> +#include <dt-structs.h> + +/* + * driver_info declarations, ordered by 'struct driver_info' linker_list idx: + * + * idx driver_info driver + * --- -------------------- -------------------- + * 0: clock_controller_at_ff440000 rockchip_rk3328_cru + * 1: dmc rockchip_rk3328_dmc + * 2: mmc_at_ff500000 rockchip_rk3288_dw_mshc + * 3: serial_at_ff130000 ns16550_serial + * 4: spi_at_ff190000 rockchip_rk3328_spi + * 5: syscon_at_ff100000 rockchip_rk3328_grf + * --- -------------------- -------------------- + */ + +/* + * Node /clock-controller@ff440000 index 0 + * driver rockchip_rk3328_cru parent None + */ +static struct dtd_rockchip_rk3328_cru dtv_clock_controller_at_ff440000 = { + .reg = {0xff440000, 0x1000}, + .rockchip_grf = 0x3a, +}; +U_BOOT_DRVINFO(clock_controller_at_ff440000) = { + .name = "rockchip_rk3328_cru", + .plat = &dtv_clock_controller_at_ff440000, + .plat_size = sizeof(dtv_clock_controller_at_ff440000), + .parent_idx = -1, +}; + +/* + * Node /dmc index 1 + * driver rockchip_rk3328_dmc parent None + */ +static struct dtd_rockchip_rk3328_dmc dtv_dmc = { + .reg = {0xff400000, 0x1000, 0xff780000, 0x3000, 0xff100000, 0x1000, 0xff440000, 0x1000, + 0xff720000, 0x1000, 0xff798000, 0x1000}, + .rockchip_sdram_params = {0x1, 0xa, 0x2, 0x1, 0x0, 0x0, 0x11, 0x0, + 0x11, 0x0, 0x0, 0x94291288, 0x0, 0x27, 0x462, 0x15, + 0x242, 0xff, 0x14d, 0x0, 0x1, 0x0, 0x0, 0x0, + 0x43049010, 0x64, 0x28003b, 0xd0, 0x20053, 0xd4, 0x220000, 0xd8, + 0x100, 0xdc, 0x40000, 0xe0, 0x0, 0xe4, 0x110000, 0xe8, + 0x420, 0xec, 0x400, 0xf4, 0xf011f, 0x100, 0x9060b06, 0x104, + 0x20209, 0x108, 0x505040a, 0x10c, 0x40400c, 0x110, 0x5030206, 0x114, + 0x3030202, 0x120, 0x3030b03, 0x124, 0x20208, 0x180, 0x1000040, 0x184, + 0x0, 0x190, 0x7030003, 0x198, 0x5001100, 0x1a0, 0xc0400003, 0x240, + 0x6000604, 0x244, 0x201, 0x250, 0xf00, 0x490, 0x1, 0xffffffff, + 0xffffffff, 0xffffffff, 0xffffffff, 0x4, 0xc, 0x28, 0xa, 0x2c, + 0x0, 0x30, 0x9, 0xffffffff, 0xffffffff, 0x77, 0x88, 0x79, + 0x79, 0x87, 0x97, 0x87, 0x78, 0x77, 0x78, 0x87, + 0x88, 0x87, 0x87, 0x77, 0x78, 0x78, 0x78, 0x78, + 0x78, 0x78, 0x78, 0x78, 0x78, 0x69, 0x9, 0x77, + 0x78, 0x77, 0x78, 0x77, 0x78, 0x77, 0x78, 0x77, + 0x79, 0x9, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, + 0x78, 0x78, 0x78, 0x69, 0x9, 0x77, 0x78, 0x77, + 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x79, 0x9, + 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, + 0x78, 0x69, 0x9, 0x77, 0x78, 0x77, 0x78, 0x77, + 0x78, 0x77, 0x78, 0x77, 0x79, 0x9, 0x78, 0x78, + 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x69, + 0x9, 0x77, 0x78, 0x77, 0x77, 0x77, 0x77, 0x77, + 0x77, 0x77, 0x79, 0x9}, +}; +U_BOOT_DRVINFO(dmc) = { + .name = "rockchip_rk3328_dmc", + .plat = &dtv_dmc, + .plat_size = sizeof(dtv_dmc), + .parent_idx = -1, +}; + +/* + * Node /mmc@ff500000 index 2 + * driver rockchip_rk3288_dw_mshc parent None + */ +static struct dtd_rockchip_rk3288_dw_mshc dtv_mmc_at_ff500000 = { + .bus_width = 0x4, + .cap_sd_highspeed = true, + .clocks = { + {0, {317}}, + {0, {33}}, + {0, {74}}, + {0, {78}},}, + .disable_wp = true, + .fifo_depth = 0x100, + .interrupts = {0x0, 0xc, 0x4}, + .max_frequency = 0x8f0d180, + .pinctrl_0 = {0x47, 0x48, 0x49, 0x4a}, + .pinctrl_names = "default", + .reg = {0xff500000, 0x4000}, + .sd_uhs_sdr104 = true, + .sd_uhs_sdr12 = true, + .sd_uhs_sdr25 = true, + .sd_uhs_sdr50 = true, + .u_boot_spl_fifo_mode = true, + .vmmc_supply = 0x4b, + .vqmmc_supply = 0x1e, +}; +U_BOOT_DRVINFO(mmc_at_ff500000) = { + .name = "rockchip_rk3288_dw_mshc", + .plat = &dtv_mmc_at_ff500000, + .plat_size = sizeof(dtv_mmc_at_ff500000), + .parent_idx = -1, +}; + +/* + * Node /serial@ff130000 index 3 + * driver ns16550_serial parent None + */ +static struct dtd_ns16550_serial dtv_serial_at_ff130000 = { + .clock_frequency = 0x16e3600, + .clocks = { + {0, {40}}, + {0, {212}},}, + .dma_names = {"tx", "rx"}, + .dmas = {0x10, 0x6, 0x10, 0x7}, + .interrupts = {0x0, 0x39, 0x4}, + .pinctrl_0 = 0x26, + .pinctrl_names = "default", + .reg = {0xff130000, 0x100}, + .reg_io_width = 0x4, + .reg_shift = 0x2, +}; +U_BOOT_DRVINFO(serial_at_ff130000) = { + .name = "ns16550_serial", + .plat = &dtv_serial_at_ff130000, + .plat_size = sizeof(dtv_serial_at_ff130000), + .parent_idx = -1, +}; + +/* Node /spi@ff190000 index 4 */ +static struct dtd_rockchip_rk3328_spi dtv_spi_at_ff190000 = { + .clocks = { + {0, {32}}, + {0, {209}},}, + .dma_names = {"tx", "rx"}, + .dmas = {0x10, 0x8, 0x10, 0x9}, + .interrupts = {0x0, 0x31, 0x4}, + .pinctrl_0 = {0x2e, 0x2f, 0x30, 0x31}, + .pinctrl_names = "default", + .reg = {0xff190000, 0x1000}, +}; +U_BOOT_DRVINFO(spi_at_ff190000) = { + .name = "rockchip_rk3328_spi", + .plat = &dtv_spi_at_ff190000, + .plat_size = sizeof(dtv_spi_at_ff190000), + .parent_idx = -1, +}; + +/* + * Node /syscon@ff100000 index 5 + * driver rockchip_rk3328_grf parent None + */ +static struct dtd_rockchip_rk3328_grf dtv_syscon_at_ff100000 = { + .reg = {0xff100000, 0x1000}, +}; +U_BOOT_DRVINFO(syscon_at_ff100000) = { + .name = "rockchip_rk3328_grf", + .plat = &dtv_syscon_at_ff100000, + .plat_size = sizeof(dtv_syscon_at_ff100000), + .parent_idx = -1, +}; + diff --git a/package/boot/uboot-rockchip/src/of-platdata/orangepi-r1-plus-lts-rk3328/dt-structs-gen.h b/package/boot/uboot-rockchip/src/of-platdata/orangepi-r1-plus-lts-rk3328/dt-structs-gen.h new file mode 100644 (file) index 0000000..3d581e8 --- /dev/null @@ -0,0 +1,60 @@ +/* + * DO NOT MODIFY + * + * Defines the structs used to hold devicetree data. + * This was generated by dtoc from a .dtb (device tree binary) file. + */ + +#include <stdbool.h> +#include <linux/libfdt.h> +struct dtd_ns16550_serial { + fdt32_t clock_frequency; + struct phandle_1_arg clocks[2]; + const char * dma_names[2]; + fdt32_t dmas[4]; + fdt32_t interrupts[3]; + fdt32_t pinctrl_0; + const char * pinctrl_names; + fdt64_t reg[2]; + fdt32_t reg_io_width; + fdt32_t reg_shift; +}; +struct dtd_rockchip_rk3288_dw_mshc { + fdt32_t bus_width; + bool cap_sd_highspeed; + struct phandle_1_arg clocks[4]; + bool disable_wp; + fdt32_t fifo_depth; + fdt32_t interrupts[3]; + fdt32_t max_frequency; + fdt32_t pinctrl_0[4]; + const char * pinctrl_names; + fdt64_t reg[2]; + bool sd_uhs_sdr104; + bool sd_uhs_sdr12; + bool sd_uhs_sdr25; + bool sd_uhs_sdr50; + bool u_boot_spl_fifo_mode; + fdt32_t vmmc_supply; + fdt32_t vqmmc_supply; +}; +struct dtd_rockchip_rk3328_cru { + fdt64_t reg[2]; + fdt32_t rockchip_grf; +}; +struct dtd_rockchip_rk3328_dmc { + fdt64_t reg[12]; + fdt32_t rockchip_sdram_params[196]; +}; +struct dtd_rockchip_rk3328_grf { + fdt64_t reg[2]; +}; +struct dtd_rockchip_rk3328_spi { + struct phandle_1_arg clocks[2]; + const char * dma_names[2]; + fdt32_t dmas[4]; + fdt32_t interrupts[3]; + fdt32_t pinctrl_0[4]; + const char * pinctrl_names; + fdt64_t reg[2]; +}; diff --git a/package/boot/uboot-rockchip/src/of-platdata/orangepi-r1-plus-rk3328/dt-decl.h b/package/boot/uboot-rockchip/src/of-platdata/orangepi-r1-plus-rk3328/dt-decl.h new file mode 100644 (file) index 0000000..0919e4e --- /dev/null @@ -0,0 +1,23 @@ +/* + * DO NOT MODIFY + * + * Declares externs for all device/uclass instances. + * This was generated by dtoc from a .dtb (device tree binary) file. + */ + +#include <dm/device-internal.h> +#include <dm/uclass-internal.h> + +/* driver declarations - these allow DM_DRIVER_GET() to be used */ +extern U_BOOT_DRIVER(rockchip_rk3328_cru); +extern U_BOOT_DRIVER(rockchip_rk3328_dmc); +extern U_BOOT_DRIVER(rockchip_rk3288_dw_mshc); +extern U_BOOT_DRIVER(ns16550_serial); +extern U_BOOT_DRIVER(rockchip_rk3328_grf); + +/* uclass driver declarations - needed for DM_UCLASS_DRIVER_REF() */ +extern UCLASS_DRIVER(clk); +extern UCLASS_DRIVER(mmc); +extern UCLASS_DRIVER(ram); +extern UCLASS_DRIVER(serial); +extern UCLASS_DRIVER(syscon); diff --git a/package/boot/uboot-rockchip/src/of-platdata/orangepi-r1-plus-rk3328/dt-plat.c b/package/boot/uboot-rockchip/src/of-platdata/orangepi-r1-plus-rk3328/dt-plat.c new file mode 100644 (file) index 0000000..e5b330c --- /dev/null @@ -0,0 +1,155 @@ +/* + * DO NOT MODIFY + * + * Declares the U_BOOT_DRIVER() records and platform data. + * This was generated by dtoc from a .dtb (device tree binary) file. + */ + +/* Allow use of U_BOOT_DRVINFO() in this file */ +#define DT_PLAT_C + +#include <common.h> +#include <dm.h> +#include <dt-structs.h> + +/* + * driver_info declarations, ordered by 'struct driver_info' linker_list idx: + * + * idx driver_info driver + * --- -------------------- -------------------- + * 0: clock_controller_at_ff440000 rockchip_rk3328_cru + * 1: dmc rockchip_rk3328_dmc + * 2: mmc_at_ff500000 rockchip_rk3288_dw_mshc + * 3: serial_at_ff130000 ns16550_serial + * 4: syscon_at_ff100000 rockchip_rk3328_grf + * --- -------------------- -------------------- + */ + +/* + * Node /clock-controller@ff440000 index 0 + * driver rockchip_rk3328_cru parent None + */ +static struct dtd_rockchip_rk3328_cru dtv_clock_controller_at_ff440000 = { + .reg = {0xff440000, 0x1000}, + .rockchip_grf = 0x3a, +}; +U_BOOT_DRVINFO(clock_controller_at_ff440000) = { + .name = "rockchip_rk3328_cru", + .plat = &dtv_clock_controller_at_ff440000, + .plat_size = sizeof(dtv_clock_controller_at_ff440000), + .parent_idx = -1, +}; + +/* + * Node /dmc index 1 + * driver rockchip_rk3328_dmc parent None + */ +static struct dtd_rockchip_rk3328_dmc dtv_dmc = { + .reg = {0xff400000, 0x1000, 0xff780000, 0x3000, 0xff100000, 0x1000, 0xff440000, 0x1000, + 0xff720000, 0x1000, 0xff798000, 0x1000}, + .rockchip_sdram_params = {0x1, 0xa, 0x2, 0x1, 0x0, 0x0, 0x11, 0x0, + 0x11, 0x0, 0x0, 0x94291288, 0x0, 0x27, 0x462, 0x15, + 0x242, 0xff, 0x14d, 0x0, 0x1, 0x0, 0x0, 0x0, + 0x43049010, 0x64, 0x28003b, 0xd0, 0x20053, 0xd4, 0x220000, 0xd8, + 0x100, 0xdc, 0x40000, 0xe0, 0x0, 0xe4, 0x110000, 0xe8, + 0x420, 0xec, 0x400, 0xf4, 0xf011f, 0x100, 0x9060b06, 0x104, + 0x20209, 0x108, 0x505040a, 0x10c, 0x40400c, 0x110, 0x5030206, 0x114, + 0x3030202, 0x120, 0x3030b03, 0x124, 0x20208, 0x180, 0x1000040, 0x184, + 0x0, 0x190, 0x7030003, 0x198, 0x5001100, 0x1a0, 0xc0400003, 0x240, + 0x6000604, 0x244, 0x201, 0x250, 0xf00, 0x490, 0x1, 0xffffffff, + 0xffffffff, 0xffffffff, 0xffffffff, 0x4, 0xc, 0x28, 0xa, 0x2c, + 0x0, 0x30, 0x9, 0xffffffff, 0xffffffff, 0x77, 0x88, 0x79, + 0x79, 0x87, 0x97, 0x87, 0x78, 0x77, 0x78, 0x87, + 0x88, 0x87, 0x87, 0x77, 0x78, 0x78, 0x78, 0x78, + 0x78, 0x78, 0x78, 0x78, 0x78, 0x69, 0x9, 0x77, + 0x78, 0x77, 0x78, 0x77, 0x78, 0x77, 0x78, 0x77, + 0x79, 0x9, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, + 0x78, 0x78, 0x78, 0x69, 0x9, 0x77, 0x78, 0x77, + 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x79, 0x9, + 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, + 0x78, 0x69, 0x9, 0x77, 0x78, 0x77, 0x78, 0x77, + 0x78, 0x77, 0x78, 0x77, 0x79, 0x9, 0x78, 0x78, + 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x78, 0x69, + 0x9, 0x77, 0x78, 0x77, 0x77, 0x77, 0x77, 0x77, + 0x77, 0x77, 0x79, 0x9}, +}; +U_BOOT_DRVINFO(dmc) = { + .name = "rockchip_rk3328_dmc", + .plat = &dtv_dmc, + .plat_size = sizeof(dtv_dmc), + .parent_idx = -1, +}; + +/* + * Node /mmc@ff500000 index 2 + * driver rockchip_rk3288_dw_mshc parent None + */ +static struct dtd_rockchip_rk3288_dw_mshc dtv_mmc_at_ff500000 = { + .bus_width = 0x4, + .cap_sd_highspeed = true, + .clocks = { + {0, {317}}, + {0, {33}}, + {0, {74}}, + {0, {78}},}, + .disable_wp = true, + .fifo_depth = 0x100, + .interrupts = {0x0, 0xc, 0x4}, + .max_frequency = 0x8f0d180, + .pinctrl_0 = {0x47, 0x48, 0x49, 0x4a}, + .pinctrl_names = "default", + .reg = {0xff500000, 0x4000}, + .sd_uhs_sdr104 = true, + .sd_uhs_sdr12 = true, + .sd_uhs_sdr25 = true, + .sd_uhs_sdr50 = true, + .u_boot_spl_fifo_mode = true, + .vmmc_supply = 0x4b, + .vqmmc_supply = 0x1e, +}; +U_BOOT_DRVINFO(mmc_at_ff500000) = { + .name = "rockchip_rk3288_dw_mshc", + .plat = &dtv_mmc_at_ff500000, + .plat_size = sizeof(dtv_mmc_at_ff500000), + .parent_idx = -1, +}; + +/* + * Node /serial@ff130000 index 3 + * driver ns16550_serial parent None + */ +static struct dtd_ns16550_serial dtv_serial_at_ff130000 = { + .clock_frequency = 0x16e3600, + .clocks = { + {0, {40}}, + {0, {212}},}, + .dma_names = {"tx", "rx"}, + .dmas = {0x10, 0x6, 0x10, 0x7}, + .interrupts = {0x0, 0x39, 0x4}, + .pinctrl_0 = 0x26, + .pinctrl_names = "default", + .reg = {0xff130000, 0x100}, + .reg_io_width = 0x4, + .reg_shift = 0x2, +}; +U_BOOT_DRVINFO(serial_at_ff130000) = { + .name = "ns16550_serial", + .plat = &dtv_serial_at_ff130000, + .plat_size = sizeof(dtv_serial_at_ff130000), + .parent_idx = -1, +}; + +/* + * Node /syscon@ff100000 index 4 + * driver rockchip_rk3328_grf parent None + */ +static struct dtd_rockchip_rk3328_grf dtv_syscon_at_ff100000 = { + .reg = {0xff100000, 0x1000}, +}; +U_BOOT_DRVINFO(syscon_at_ff100000) = { + .name = "rockchip_rk3328_grf", + .plat = &dtv_syscon_at_ff100000, + .plat_size = sizeof(dtv_syscon_at_ff100000), + .parent_idx = -1, +}; + diff --git a/package/boot/uboot-rockchip/src/of-platdata/orangepi-r1-plus-rk3328/dt-structs-gen.h b/package/boot/uboot-rockchip/src/of-platdata/orangepi-r1-plus-rk3328/dt-structs-gen.h new file mode 100644 (file) index 0000000..b1ff08a --- /dev/null @@ -0,0 +1,51 @@ +/* + * DO NOT MODIFY + * + * Defines the structs used to hold devicetree data. + * This was generated by dtoc from a .dtb (device tree binary) file. + */ + +#include <stdbool.h> +#include <linux/libfdt.h> +struct dtd_ns16550_serial { + fdt32_t clock_frequency; + struct phandle_1_arg clocks[2]; + const char * dma_names[2]; + fdt32_t dmas[4]; + fdt32_t interrupts[3]; + fdt32_t pinctrl_0; + const char * pinctrl_names; + fdt64_t reg[2]; + fdt32_t reg_io_width; + fdt32_t reg_shift; +}; +struct dtd_rockchip_rk3288_dw_mshc { + fdt32_t bus_width; + bool cap_sd_highspeed; + struct phandle_1_arg clocks[4]; + bool disable_wp; + fdt32_t fifo_depth; + fdt32_t interrupts[3]; + fdt32_t max_frequency; + fdt32_t pinctrl_0[4]; + const char * pinctrl_names; + fdt64_t reg[2]; + bool sd_uhs_sdr104; + bool sd_uhs_sdr12; + bool sd_uhs_sdr25; + bool sd_uhs_sdr50; + bool u_boot_spl_fifo_mode; + fdt32_t vmmc_supply; + fdt32_t vqmmc_supply; +}; +struct dtd_rockchip_rk3328_cru { + fdt64_t reg[2]; + fdt32_t rockchip_grf; +}; +struct dtd_rockchip_rk3328_dmc { + fdt64_t reg[12]; + fdt32_t rockchip_sdram_params[196]; +}; +struct dtd_rockchip_rk3328_grf { + fdt64_t reg[2]; +}; diff --git a/package/emortal/autocore/Makefile b/package/emortal/autocore/Makefile new file mode 100644 (file) index 0000000..ff09fbc --- /dev/null @@ -0,0 +1,73 @@ +# SPDX-License-Identifier: GPL-3.0-only +# +# Copyright (C) 2020 Lean <coolsnowwolf@gmail.com> +# Copyright (C) 2021 ImmortalWrt.org + +include$(TOPDIR)/rules.mk
+
+PKG_NAME:=autocore
+PKG_FLAGS:=nonshared
+PKG_RELEASE:=$(COMMITCOUNT) + +PKG_CONFIG_DEPENDS:= \ + CONFIG_TARGET_bcm27xx \ + CONFIG_TARGET_bcm53xx + +include$(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/target.mk + +define Package/autocore-arm + TITLE:=ARM auto core script. + MAINTAINER:=CN_SZTL + DEPENDS:=@(arm||aarch64) \ + +TARGET_bcm27xx:bcm27xx-userland \ + +TARGET_bcm53xx:nvram + VARIANT:=arm +endef + +define Package/autocore-x86 + TITLE:=x86/x64 auto core loadbalance script. + MAINTAINER:=Lean / CN_SZTL + DEPENDS:=@TARGET_x86 +lm-sensors +ethtool + VARIANT:=x86 +endef + +define Build/Compile +endef + +define Package/autocore/install/Default +$(INSTALL_DIR) $(1)/etc +$(CP) ./files/generic/10_system.js $(1)/etc/rpcd_10_system.js +$(CP) ./files/generic/luci $(1)/etc/rpcd_luci + +$(INSTALL_DIR) $(1)/etc/uci-defaults +$(INSTALL_BIN) ./files/generic/090-cover-index_files $(1)/etc/uci-defaults/ + +$(INSTALL_DIR) $(1)/sbin +$(INSTALL_BIN) ./files/generic/cpuinfo $(1)/sbin/ +$(INSTALL_BIN) ./files/generic/ethinfo $(1)/sbin/ + +$(INSTALL_DIR) $(1)/usr/share/rpcd/acl.d +$(CP) ./files/generic/luci-mod-status-autocore.json $(1)/usr/share/rpcd/acl.d/ + +$(INSTALL_DIR) $(1)/www/luci-static/resources/view/status/include +$(INSTALL_DATA) ./files/generic/21_ethinfo.js $(1)/www/luci-static/resources/view/status/include/ +endef + +define Package/autocore-arm/install +$(call Package/autocore/install/Default,$(1)) + +ifneq ($(filter ipq% %mt7622, $(TARGETID)),) +$(INSTALL_BIN) ./files/arm/tempinfo $(1)/sbin/ +endif +endef + +define Package/autocore-x86/install +$(call Package/autocore/install/Default,$(1)) + +$(INSTALL_DIR) $(1)/etc/init.d +$(INSTALL_BIN) ./files/x86/autocore $(1)/etc/init.d/ +endef + +$(eval $(call BuildPackage,autocore-arm)) +$(eval $(call BuildPackage,autocore-x86)) diff --git a/package/emortal/autocore/files/arm/tempinfo b/package/emortal/autocore/files/arm/tempinfo new file mode 100755 (executable) index 0000000..22877a7 --- /dev/null @@ -0,0 +1,21 @@ +#!/bin/sh + +IEEE_PATH="/sys/class/ieee80211" +THERMAL_PATH="/sys/class/thermal" + +if grep -Eq "ipq40xx|ipq806x" "/etc/openwrt_release"; then + wifi_temp="$(awk '{printf("%.1f°C ", $0 / 1000)}' "$IEEE_PATH"/phy*/device/hwmon/hwmon*/temp1_input | awk '$1=$1')"
+else
+       wifi_temp="$(awk '{printf("%.1f°C ",$0 / 1000)}' "$IEEE_PATH"/phy*/hwmon*/temp1_input | awk '$1=$1')" +fi + +if grep -q "ipq40xx" "/etc/openwrt_release"; then + if [ -e "$IEEE_PATH/phy0/hwmon0/temp1_input" ]; then
+               mt76_temp=" $(awk -F ': ' '{print$2}' "$IEEE_PATH/phy0/hwmon0/temp1_input")°C" + fi + + echo -n "WiFi:${mt76_temp} ${wifi_temp}" +else + cpu_temp="$(awk '{printf("%.1f°C", $0 / 1000)}' "$THERMAL_PATH/thermal_zone0/temp")"
+       echo -n "CPU: ${cpu_temp}, WiFi:${wifi_temp}"
+fi
diff --git a/package/emortal/autocore/files/generic/090-cover-index_files b/package/emortal/autocore/files/generic/090-cover-index_files
new file mode 100755 (executable)
index 0000000..8480059
--- /dev/null
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+[ ! -f '/etc/rpcd_10_system.js' ] || \
+       mv -f '/etc/rpcd_10_system.js' '/www/luci-static/resources/view/status/include/10_system.js'
+[ ! -f '/etc/rpcd_luci' ] || \
+       mv -f '/etc/rpcd_luci' '/usr/libexec/rpcd/luci'
+/etc/init.d/rpcd restart
+
+exit 0
diff --git a/package/emortal/autocore/files/generic/10_system.js b/package/emortal/autocore/files/generic/10_system.js
new file mode 100644 (file)
index 0000000..0352649
--- /dev/null
@@ -0,0 +1,114 @@
+'use strict';
+'require baseclass';
+'require fs';
+'require rpc';
+
+var callSystemBoard = rpc.declare({
+       object: 'system',
+       method: 'board'
+});
+
+var callSystemInfo = rpc.declare({
+       object: 'system',
+       method: 'info'
+});
+
+var callCPUBench = rpc.declare({
+       object: 'luci',
+       method: 'getCPUBench'
+});
+
+var callCPUInfo = rpc.declare({
+       object: 'luci',
+       method: 'getCPUInfo'
+});
+
+var callCPUUsage = rpc.declare({
+       object: 'luci',
+       method: 'getCPUUsage'
+});
+
+var callTempInfo = rpc.declare({
+       object: 'luci',
+       method: 'getTempInfo'
+});
+
+return baseclass.extend({
+       title: _('System'),
+
+               return Promise.all([
+                       L.resolveDefault(callSystemBoard(), {}),
+                       L.resolveDefault(callSystemInfo(), {}),
+                       L.resolveDefault(callCPUBench(), {}),
+                       L.resolveDefault(callCPUInfo(), {}),
+                       L.resolveDefault(callCPUUsage(), {}),
+                       L.resolveDefault(callTempInfo(), {}),
+                       fs.lines('/usr/lib/lua/luci/version.lua')
+               ]);
+       },
+
+       render: function(data) {
+               var boardinfo   = data[0],
+                   systeminfo  = data[1],
+                   cpubench    = data[2],
+                   cpuinfo     = data[3],
+                   cpuusage    = data[4],
+                   tempinfo    = data[5],
+                   luciversion = data[6];
+
+               luciversion = luciversion.filter(function(l) {
+                       return l.match(/^\s*(luciname|luciversion)\s*=/);
+               }).map(function(l) {
+                       return l.replace(/^\s*\w+\s*=\s*['"]([^'"]+)['"].*$/, '$1');
+               }).join(' ');
+
+               var datestr = null;
+
+               if (systeminfo.localtime) {
+                       var date = new Date(systeminfo.localtime * 1000);
+
+                       datestr = '%04d-%02d-%02d %02d:%02d:%02d'.format(
+                               date.getUTCFullYear(),
+                               date.getUTCMonth() + 1,
+                               date.getUTCDate(),
+                               date.getUTCHours(),
+                               date.getUTCMinutes(),
+                               date.getUTCSeconds()
+                       );
+               }
+
+               var fields = [
+                       _('Hostname'),         boardinfo.hostname,
+                       _('Model'),            boardinfo.model + cpubench.cpubench,
+                       _('Architecture'),     cpuinfo.cpuinfo,
+                       _('Target Platform'),  (L.isObject(boardinfo.release) ? boardinfo.release.target : ''),
+                       _('Firmware Version'), (L.isObject(boardinfo.release) ? boardinfo.release.description + ' / ' : '') + (luciversion || ''),
+                       _('Kernel Version'),   boardinfo.kernel,
+                       _('Local Time'),       datestr,
+                       _('Uptime'),           systeminfo.uptime ? '%t'.format(systeminfo.uptime) : null,
+                       ) : null,
+                       _('CPU usage (%)'),    cpuusage.cpuusage
+               ];
+
+               if (tempinfo.tempinfo) {
+                       fields.splice(6, 0, _('Temperature'));
+                       fields.splice(7, 0, tempinfo.tempinfo);
+               }
+
+               var table = E('table', { 'class': 'table' });
+
+               for (var i = 0; i < fields.length; i += 2) {
+                       table.appendChild(E('tr', { 'class': 'tr' }, [
+                               E('td', { 'class': 'td left', 'width': '33%' }, [ fields[i] ]),
+                               E('td', { 'class': 'td left' }, [ (fields[i + 1] != null) ? fields[i + 1] : '?' ])
+                       ]));
+               }
+
+               return table;
+       }
+});
diff --git a/package/emortal/autocore/files/generic/21_ethinfo.js b/package/emortal/autocore/files/generic/21_ethinfo.js
new file mode 100644 (file)
index 0000000..fa89c4a
--- /dev/null
@@ -0,0 +1,60 @@
+'use strict';
+'require baseclass';
+'require rpc';
+
+var callLuciETHInfo = rpc.declare({
+       object: 'luci',
+       method: 'getETHInfo',
+       expect: { '': {} }
+});
+
+return L.Class.extend({
+       title: _('Ethernet Information'),
+
+               return Promise.all([
+                       L.resolveDefault(callLuciETHInfo(), {})
+               ]);
+       },
+
+       render: function(data) {
+               var ethinfo = Array.isArray(data[0].ethinfo) ? data[0].ethinfo : [];
+
+               var table = E('table', { 'class': 'table' }, [
+                       E('tr', { 'class': 'tr table-titles' }, [
+                               E('th', { 'class': 'th' }, _('Ethernet Name')),
+                               E('th', { 'class': 'th' }, _('Link Status')),
+                               E('th', { 'class': 'th' }, _('Speed')),
+                               E('th', { 'class': 'th' }, _('Duplex'))
+                       ])
+               ]);
+
+               cbi_update_table(table, ethinfo.map(function(info) {
+                       var exp1;
+                       var exp2;
+
+                       if (info.status == "yes")
+                       else if (info.status == "no")
+
+                       if (info.duplex == "Full")
+                               exp2 = _('Full Duplex');
+                       else if (info.duplex == "Half")
+                               exp2 = _('Half Duplex');
+                       else
+                               exp2 = _('-');
+
+                       return [
+                               info.name,
+                               exp1,
+                               info.speed,
+                               exp2
+                       ];
+               }));
+
+               return E([
+                       table
+               ]);
+       }
+});
diff --git a/package/emortal/autocore/files/generic/cpuinfo b/package/emortal/autocore/files/generic/cpuinfo
new file mode 100755 (executable)
index 0000000..e92c0af
--- /dev/null
@@ -0,0 +1,61 @@
+#!/bin/sh
+
+. /etc/openwrt_release
+
+CPUINFO_PATH="/proc/cpuinfo"
+CPUFREQ_PATH="/sys/devices/system/cpu/cpufreq"
+THERMAL_PATH="/sys/class/thermal"
+
+cpu_arch="$(awk -F ': ' '/model name/ {print$2}' "$CPUINFO_PATH" | head -n1)" +[ -n "${cpu_arch}" ] || cpu_arch="?"
+
+case "$DISTRIB_TARGET" in +"x86"/*) + cpu_cores="$(grep "core id" "$CPUINFO_PATH" | sort -u | wc -l)C$(grep -c "processor" "$CPUINFO_PATH")T" ;; +*) + cpu_cores="$(grep -c "processor" "$CPUINFO_PATH")" ;; +esac + +case "$DISTRIB_TARGET" in
+"bcm27xx"/*)
+       cpu_freq="$(($(vcgencmd measure_clock arm | awk -F '=' '{print $2}') / 1000000 ))Mhz" ;; +"bcm53xx"/*) + cpu_freq="$(nvram get clkfreq | awk -F ',' '{print $1}')MHz" ;; +"mvebu"/*) + cpu_freq="$(awk -F ': ' '/BogoMIPS/ {print $2}' "$CPUINFO_PATH" | head -n1)MHz" ;;
+"x86"/*)
+       cpu_freq="$(awk -F ': ' '/MHz/ {print$2}' "$CPUINFO_PATH" | head -n1)MHz" + ;; +*) + [ ! -e "$CPUFREQ_PATH/policy0/cpuinfo_cur_freq" ] || \
+               cpu_freq="$(awk '{printf("%.fMHz",$0 / 1000)}' "$CPUFREQ_PATH/policy0/cpuinfo_cur_freq")" + [ ! -e "$CPUFREQ_PATH/policy4/cpuinfo_cur_freq" ] || \
+               big_cpu_freq="$(awk '{printf("%.fMHz ",$0 / 1000)}' "$CPUFREQ_PATH/policy4/cpuinfo_cur_freq")" + ;; +esac + +case "$DISTRIB_TARGET" in
+"bcm27xx"/*)
+       cpu_temp="$(vcgencmd measure_temp | awk -F '=' '{print$2}' | awk -F "'" '{print $1}')°C" ;; +"x86"/*) + # Intel + cpu_temp="$(sensors "coretemp-*" 2>"/dev/null" | grep -E "(Package id |Core )" | grep -Eo "\+[0-9.]*°C" | head -n1 | tr -d "+")"
+       # AMD
+       [ -n "${cpu_temp}" ] || cpu_temp="$(sensors "k*temp-*" 2>"/dev/null" | awk '/Tdie/ {print $2}' | head -n1 | tr -d "+")" + ;; +*) + [ ! -e "$THERMAL_PATH/thermal_zone0/temp" ] || \
+               cpu_temp="$(awk '{printf("%.1f°C",$0 / 1000)}' "$THERMAL_PATH/thermal_zone0/temp")" + ;; +esac + +if [ -z "$big_cpu_freq$cpu_freq" ] && [ -n "$cpu_temp" ]; then
+       echo -n "$cpu_arch x$cpu_cores ($cpu_temp)" +elif [ -z "$cpu_temp" ] && [ -n "$big_cpu_freq$cpu_freq" ] || \
+               grep -Eq "ipq|mt7622" "/etc/openwrt_release"; then
+       echo -n "$cpu_arch x$cpu_cores ($big_cpu_freq$cpu_freq)"
+elif [ -n "$cpu_temp" ] && [ -n "$big_cpu_freq$cpu_freq" ]; then + echo -n "$cpu_arch x $cpu_cores ($big_cpu_freq$cpu_freq,${cpu_temp})"
+else
+       echo -n "$cpu_arch x$cpu_cores"
+fi
diff --git a/package/emortal/autocore/files/generic/ethinfo b/package/emortal/autocore/files/generic/ethinfo
new file mode 100755 (executable)
index 0000000..68f2917
--- /dev/null
@@ -0,0 +1,39 @@
+#!/usr/bin/lua
+-- Copyright (C) 2022 Tianling Shen <cnsztl@immortalwrt.org>
+
+local util = require "luci.util"
+local jsonc = require "luci.jsonc"
+
+local eth_info = {}
+local ifname, stat
+for ifname, stat in pairs(util.ubus("network.device", "status")) do
+        if ifname:match("^(eth%d+)$") == ifname then + local status, speed, duplex + + status = stat.carrier and "yes" or "no" + + if stat.speed:sub(1, 1) == "-" then + speed = "-" + else + speed = stat.speed:sub(1, -2) .. "Mb/s" + end + + if not stat.carrier then + duplex = "-" + elseif stat.speed:sub(-1) == "F" then + duplex = "Full" + else + duplex = "Half" + end + + eth_info[#eth_info+1] = { name = ifname, status = status, + speed = speed, duplex = duplex } + end +end + +table.sort(eth_info, + function(a, b) + return a.name < b.name + end) + +print(jsonc.stringify(eth_info)) diff --git a/package/emortal/autocore/files/generic/luci b/package/emortal/autocore/files/generic/luci new file mode 100755 (executable) index 0000000..1cf9bea --- /dev/null @@ -0,0 +1,748 @@ +#!/usr/bin/env lua + +local json = require "luci.jsonc" +local fs = require "nixio.fs" + +local function readfile(path) + local s = fs.readfile(path) + return s and (s:gsub("^%s+", ""):gsub("%s+$", ""))
+end
+
+local methods = {
+       getInitList = {
+               args = { name = "name" },
+               call = function(args)
+                       local sys = require "luci.sys"
+                       local _, name, scripts = nil, nil, {}
+                       for _, name in ipairs(args.name and { args.name } or sys.init.names()) do
+                               local index = sys.init.index(name)
+                               if index then
+                                       scripts[name] = { index = index, enabled = sys.init.enabled(name) }
+                               else
+                                       return { error = "No such init script" }
+                               end
+                       end
+                       return scripts
+               end
+       },
+
+       setInitAction = {
+               args = { name = "name", action = "action" },
+               call = function(args)
+                       local sys = require "luci.sys"
+                       if type(sys.init[args.action]) ~= "function" then
+                               return { error = "Invalid action" }
+                       end
+                       return { result = sys.init[args.action](args.name) }
+               end
+       },
+
+       getLocaltime = {
+               call = function(args)
+                       return { result = os.time() }
+               end
+       },
+
+       setLocaltime = {
+               args = { localtime = 0 },
+               call = function(args)
+                       local sys = require "luci.sys"
+                       local date = os.date("*t", args.localtime)
+                       if date then
+                               sys.call("date -s '%04d-%02d-%02d %02d:%02d:%02d' >/dev/null" %{ date.year, date.month, date.day, date.hour, date.min, date.sec })
+                               sys.call("/etc/init.d/sysfixtime restart >/dev/null")
+                       end
+                       return { result = args.localtime }
+               end
+       },
+
+       getTimezones = {
+               call = function(args)
+                       local util  = require "luci.util"
+                       local zones = require "luci.sys.zoneinfo"
+
+                       local res = util.ubus("uci", "get", {
+                               config = "system",
+                               section = "@system[0]",
+                               option = "zonename"
+                       })
+
+                       local result = {}
+                       local _, zone
+                       for _, zone in ipairs(zones.TZ) do
+                               result[zone[1]] = {
+                                       tzstring = zone[2],
+                                       active = (res and res.value == zone[1]) and true or nil
+                               }
+                       end
+                       return result
+               end
+       },
+
+       getLEDs = {
+               call = function()
+                       local iter   = fs.dir("/sys/class/leds")
+                       local result = { }
+
+                       if iter then
+                               local led
+                               for led in iter do
+                                       local m, s
+
+                                       result[led] = { triggers = {} }
+
+                                       for s in (s or ""):gmatch("%S+") do
+                                               m = s:match("^%[(.+)%]$") + result[led].triggers[#result[led].triggers+1] = m or s + result[led].active_trigger = m or result[led].active_trigger + end + + s = readfile("/sys/class/leds/"..led.."/brightness") + if s then + result[led].brightness = tonumber(s) + end + + s = readfile("/sys/class/leds/"..led.."/max_brightness") + if s then + result[led].max_brightness = tonumber(s) + end + end + end + + return result + end + }, + + getUSBDevices = { + call = function() + local fs = require "nixio.fs" + local iter = fs.glob("/sys/bus/usb/devices/[0-9]*/manufacturer") + local result = { } + + if iter then + result.devices = {} + + local p + for p in iter do + local id = p:match("/([^/]+)/manufacturer$")
+
+                                       result.devices[#result.devices+1] = {
+                                               id      = id,
+                                       }
+                               end
+                       end
+
+                       iter = fs.glob("/sys/bus/usb/devices/*/*-port[0-9]*")
+
+                       if iter then
+                               result.ports = {}
+
+                               local p
+                               for p in iter do
+                                       local port = p:match("([^/]+)$") + local link = fs.readlink(p.."/device") + + result.ports[#result.ports+1] = { + port = port, + device = link and fs.basename(link) + } + end + end + + return result + end + }, + + getConntrackHelpers = { + call = function() + local ok, fd = pcall(io.open, "/usr/share/fw3/helpers.conf", "r") + local rv = {} + + if not (ok and fd) then + ok, fd = pcall(io.open, "/usr/share/firewall4/helpers", "r") + end + + if ok and fd then + local entry + + while true do + local line = fd:read("*l") + if not line then + break + end + + if line:match("^%s*config%s") then + if entry then + rv[#rv+1] = entry + end + entry = {} + else + local opt, val = line:match("^%s*option%s+(%S+)%s+(%S.*)$")
+                                               if opt and val then
+                                                       opt = opt:gsub("^'(.+)'$", "%1"):gsub('^"(.+)"$', "%1")
+                                                       val = val:gsub("^'(.+)'$", "%1"):gsub('^"(.+)"$', "%1")
+                                                       entry[opt] = val
+                                               end
+                                       end
+                               end
+
+                               if entry then
+                                       rv[#rv+1] = entry
+                               end
+
+                               fd:close()
+                       end
+
+                       return { result = rv }
+               end
+       },
+
+       getFeatures = {
+               call = function()
+                       local fs = require "nixio.fs"
+                       local rv = {}
+                       local ok, fd
+
+                       rv.firewall      = fs.access("/sbin/fw3")
+                       rv.firewall4     = fs.access("/sbin/fw4")
+                       rv.opkg          = fs.access("/bin/opkg")
+                       rv.br2684ctl     = fs.access("/usr/sbin/br2684ctl")
+                       rv.swconfig      = fs.access("/sbin/swconfig")
+                       rv.odhcpd        = fs.access("/usr/sbin/odhcpd")
+                       rv.zram          = fs.access("/sys/class/zram-control")
+                       rv.ipv6          = fs.access("/proc/net/ipv6_route")
+                       rv.dropbear      = fs.access("/usr/sbin/dropbear")
+                       rv.cabundle      = fs.access("/etc/ssl/certs/ca-certificates.crt")
+                       rv.relayd        = fs.access("/usr/sbin/relayd")
+                       rv.dsl           = fs.access("/sbin/vdsl_cpe_control")
+
+                       local wifi_features = { "eap", "11n", "11ac", "11r", "acs", "sae", "owe", "suiteb192", "wep", "wps" }
+
+                       if fs.access("/usr/sbin/hostapd") then
+                               rv.hostapd = { cli = fs.access("/usr/sbin/hostapd_cli") }
+
+                               local _, feature
+                               for _, feature in ipairs(wifi_features) do
+                                       rv.hostapd[feature] =
+                                               (os.execute(string.format("/usr/sbin/hostapd -v%s >/dev/null 2>/dev/null", feature)) == 0)
+                               end
+                       end
+
+                       if fs.access("/usr/sbin/wpa_supplicant") then
+                               rv.wpasupplicant = { cli = fs.access("/usr/sbin/wpa_cli") }
+
+                               local _, feature
+                               for _, feature in ipairs(wifi_features) do
+                                       rv.wpasupplicant[feature] =
+                                               (os.execute(string.format("/usr/sbin/wpa_supplicant -v%s >/dev/null 2>/dev/null", feature)) == 0)
+                               end
+                       end
+
+                       ok, fd = pcall(io.popen, "dnsmasq --version 2>/dev/null")
+                       if ok then
+                               rv.dnsmasq = {}
+
+                               while true do
+                                       if not line then
+                                               break
+                                       end
+
+                                       local opts = line:match("^Compile time options: (.+)$") + if opts then + local opt + for opt in opts:gmatch("%S+") do + local no = opt:match("^no%-(%S+)$")
+                                                       rv.dnsmasq[string.lower(no or opt)] = not no
+                                               end
+                                               break
+                                       end
+                               end
+
+                               fd:close()
+                       end
+
+                       ok, fd = pcall(io.popen, "ipset --help 2>/dev/null")
+                       if ok then
+                               rv.ipset = {}
+
+                               local sets = false
+
+                               while true do
+                                       if not line then
+                                               break
+                                       elseif line:match("^Supported set types:") then
+                                               sets = true
+                                       elseif sets then
+                                               local set, ver = line:match("^%s+(%S+)%s+(%d+)")
+                                               if set and not rv.ipset[set] then
+                                                       rv.ipset[set] = tonumber(ver)
+                                               end
+                                       end
+                               end
+
+                               fd:close()
+                       end
+
+                       return rv
+               end
+       },
+
+       getSwconfigFeatures = {
+               args = { switch = "switch0" },
+               call = function(args)
+                       local util = require "luci.util"
+
+                       -- Parse some common switch properties from swconfig help output.
+                       local swc, err = io.popen("swconfig dev %s help 2>/dev/null" % util.shellquote(args.switch))
+                       if swc then
+                               local is_port_attr = false
+                               local is_vlan_attr = false
+                               local rv = {}
+
+                               while true do
+                                       if not line then break end
+
+                                       if line:match("^%s+%-%-vlan") then
+                                               is_vlan_attr = true
+
+                                       elseif line:match("^%s+%-%-port") then
+                                               is_vlan_attr = false
+                                               is_port_attr = true
+
+                                       elseif line:match("cpu @") then
+                                               rv.switch_title = line:match("^switch%d: %w+%((.-)%)")
+                                               rv.num_vlans    = tonumber(line:match("vlans: (%d+)")) or 16
+                                               rv.min_vid      = 1
+
+                                       elseif line:match(": pvid") or line:match(": tag") or line:match(": vid") then
+                                               if is_vlan_attr then rv.vid_option = line:match(": (%w+)") end
+
+                                       elseif line:match(": enable_vlan4k") then
+                                               rv.vlan4k_option = "enable_vlan4k"
+
+                                       elseif line:match(": enable_vlan") then
+                                               rv.vlan_option = "enable_vlan"
+
+                                       elseif line:match(": enable_learning") then
+                                               rv.learning_option = "enable_learning"
+
+                                       elseif line:match(": enable_mirror_rx") then
+                                               rv.mirror_option = "enable_mirror_rx"
+
+                                       elseif line:match(": max_length") then
+                                               rv.jumbo_option = "max_length"
+                                       end
+                               end
+
+                               swc:close()
+
+                               if not next(rv) then
+                                       return { error = "No such switch" }
+                               end
+
+                               return rv
+                       else
+                               return { error = err }
+                       end
+               end
+       },
+
+       getSwconfigPortState = {
+               args = { switch = "switch0" },
+               call = function(args)
+                       local util = require "luci.util"
+
+                       local swc, err = io.popen("swconfig dev %s show 2>/dev/null" % util.shellquote(args.switch))
+                       if swc then
+                               local ports = { }
+
+                               while true do
+                                       if not line or (line:match("^VLAN %d+:") and #ports > 0) then
+                                               break
+                                       end
+
+                                       local pnum = line:match("^Port (%d+):$") + if pnum then + port = { + port = tonumber(pnum), + duplex = false, + speed = 0, + link = false, + auto = false, + rxflow = false, + txflow = false + } + + ports[#ports+1] = port + end + + if port then + local m + + if line:match("full[%- ]duplex") then + port.duplex = true + end + + m = line:match(" speed:(%d+)") + if m then + port.speed = tonumber(m) + end + + m = line:match("(%d+) Mbps") + if m and port.speed == 0 then + port.speed = tonumber(m) + end + + m = line:match("link: (%d+)") + if m and port.speed == 0 then + port.speed = tonumber(m) + end + + if line:match("link: ?up") or line:match("status: ?up") then + port.link = true + end + + if line:match("auto%-negotiate") or line:match("link:.-auto") then + port.auto = true + end + + if line:match("link:.-rxflow") then + port.rxflow = true + end + + if line:match("link:.-txflow") then + port.txflow = true + end + end + end + + swc:close() + + if not next(ports) then + return { error = "No such switch" } + end + + return { result = ports } + else + return { error = err } + end + end + }, + + setPassword = { + args = { username = "root", password = "password" }, + call = function(args) + local util = require "luci.util" + return { + result = (os.execute("(echo %s; sleep 1; echo %s) | /bin/busybox passwd %s >/dev/null 2>&1" %{ + luci.util.shellquote(args.password), + luci.util.shellquote(args.password), + luci.util.shellquote(args.username) + }) == 0) + } + end + }, + + getBlockDevices = { + call = function() + local fs = require "nixio.fs" + + local block = io.popen("/sbin/block info", "r") + if block then + local rv = {} + + while true do + local ln = block:read("*l") + if not ln then + break + end + + local dev = ln:match("^/dev/(.-):") + if dev then + local s = tonumber((fs.readfile("/sys/class/block/" .. dev .."/size"))) + local e = { + dev = "/dev/" .. dev, + size = s and s * 512 + } + + local key, val = { } + for key, val in ln:gmatch([[(%w+)="(.-)"]]) do + e[key:lower()] = val + end + + rv[dev] = e + end + end + + block:close() + + return rv + else + return { error = "Unable to execute block utility" } + end + end + }, + + setBlockDetect = { + call = function() + return { result = (os.execute("/sbin/block detect > /etc/config/fstab") == 0) } + end + }, + + getMountPoints = { + call = function() + local fs = require "nixio.fs" + + local fd, err = io.open("/proc/mounts", "r") + if fd then + local rv = {} + + while true do + local ln = fd:read("*l") + if not ln then + break + end + + local device, mount, fstype, options, freq, pass = ln:match("^(%S*) (%S*) (%S*) (%S*) (%d+) (%d+)$")
+                                       if device and mount then
+                                               device = device:gsub("\$$%d+)", function(n) return string.char(tonumber(n, 8)) end) + mount = mount:gsub("\\(%d+)", function(n) return string.char(tonumber(n, 8)) end) + + local stat = fs.statvfs(mount) + if stat and stat.blocks > 0 then + rv[#rv+1] = { + device = device, + mount = mount, + size = stat.bsize * stat.blocks, + avail = stat.bsize * stat.bavail, + free = stat.bsize * stat.bfree + } + end + end + end + + fd:close() + + return { result = rv } + else + return { error = err } + end + end + }, + + getRealtimeStats = { + args = { mode = "interface", device = "eth0" }, + call = function(args) + local util = require "luci.util" + + local flags + if args.mode == "interface" then + flags = "-i %s" % util.shellquote(args.device) + elseif args.mode == "wireless" then + flags = "-r %s" % util.shellquote(args.device) + elseif args.mode == "conntrack" then + flags = "-c" + elseif args.mode == "load" then + flags = "-l" + else + return { error = "Invalid mode" } + end + + local fd, err = io.popen("luci-bwc %s" % flags, "r") + if fd then + local parse = json.new() + local done + + parse:parse("[") + + while true do + local ln = fd:read("*l") + if not ln then + break + end + + done, err = parse:parse((ln:gsub("%d+", "%1.0"))) + + if done then + err = "Unexpected JSON data" + end + + if err then + break + end + end + + fd:close() + + done, err = parse:parse("]") + + if err then + return { error = err } + elseif not done then + return { error = "Incomplete JSON data" } + else + return { result = parse:get() } + end + else + return { error = err } + end + end + }, + + getConntrackList = { + call = function() + local sys = require "luci.sys" + return { result = sys.net.conntrack() } + end + }, + + getProcessList = { + call = function() + local sys = require "luci.sys" + local res = {} + for _, v in pairs(sys.process.list()) do + res[#res + 1] = v + end + return { result = res } + end + }, + + getCPUBench = { + call = function() + local sys = require "luci.sys" + local cpubench = {} + + cpubench.cpubench = sys.exec("cat /etc/bench.log 2>/dev/null") + return cpubench + end + }, + + getCPUInfo = { + call = function() + local sys = require "luci.sys" + local cpuinfo = {} + + cpuinfo.cpuinfo = sys.exec("/sbin/cpuinfo") + + if (cpuinfo.cpuinfo == nil) or (cpuinfo.cpuinfo == "") then + cpuinfo.cpuinfo = "? x ? (2.33MHz, 2.33°C)" + end + + return cpuinfo + end + }, + + getCPUUsage = { + call = function() + local sys = require "luci.sys" + local cpuusage = {} + + cpuusage.cpuusage = sys.exec("top -n1 | awk '/^CPU/ {printf(\"%d%\", 100 - 8)}'") or "6%" + return cpuusage + end + }, + + getETHInfo = { + call = function() + local sys = require "luci.sys" + local rv = json.parse(sys.exec("/sbin/ethinfo")) or {} + + return { ethinfo = rv } + end + }, + + getOnlineUsers = { + call = function() + local sys = require "luci.sys" + local onlineusers = {} + + onlineusers.onlineusers = sys.exec("cat /proc/net/arp | grep 'br-lan' | grep '0x2' | wc -l") + return onlineusers + + end + }, + + getTempInfo = { + call = function() + local sys = require "luci.sys" + local tempinfo = {} + + tempinfo.tempinfo = sys.exec("/sbin/tempinfo 2>/dev/null") + return tempinfo + end + } +} + +local function parseInput() + local parse = json.new() + local done, err + + while true do + local chunk = io.read(4096) + if not chunk then + break + elseif not done and not err then + done, err = parse:parse(chunk) + end + end + + if not done then + print(json.stringify({ error = err or "Incomplete input" })) + os.exit(1) + end + + return parse:get() +end + +local function validateArgs(func, uargs) + local method = methods[func] + if not method then + print(json.stringify({ error = "Method not found" })) + os.exit(1) + end + + if type(uargs) ~= "table" then + print(json.stringify({ error = "Invalid arguments" })) + os.exit(1) + end + + uargs.ubus_rpc_session = nil + + local k, v + local margs = method.args or {} + for k, v in pairs(uargs) do + if margs[k] == nil or + (v ~= nil and type(v) ~= type(margs[k])) + then + print(json.stringify({ error = "Invalid arguments" })) + os.exit(1) + end + end + + return method +end + +if arg[1] == "list" then + local _, method, rv = nil, nil, {} + for _, method in pairs(methods) do rv[_] = method.args or {} end + print((json.stringify(rv):gsub(":%[%]", ":{}"))) +elseif arg[1] == "call" then + local args = parseInput() + local method = validateArgs(arg[2], args) + local result, code = method.call(args) + print((json.stringify(result):gsub("^%[%]", "{}"))) + os.exit(code or 0) +end diff --git a/package/emortal/autocore/files/generic/luci-mod-status-autocore.json b/package/emortal/autocore/files/generic/luci-mod-status-autocore.json new file mode 100644 (file) index 0000000..c9b930e --- /dev/null @@ -0,0 +1,10 @@ +{ + "luci-mod-status-autocore": { + "description": "Grant access to autocore", + "read": { + "ubus": { + "luci": [ "getCPUInfo", "getETHInfo", "getTempInfo" ] + } + } + } +} diff --git a/package/emortal/autocore/files/x86/autocore b/package/emortal/autocore/files/x86/autocore new file mode 100755 (executable) index 0000000..1fcb9dc --- /dev/null @@ -0,0 +1,39 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2017 lean <coolsnowwolf@gmail.com> + +START=99 + +start() { + rfc=4096 + threads="(grep -c "processor" "/proc/cpuinfo")" + + sysctl -w net.core.rps_sock_flow_entries="(( rfc * threads ))" + + for fileRps in /sys/class/net/eth*/queues/rx-*/rps_cpus + do + echo "threads" > "fileRps" + done + + for fileRfc in /sys/class/net/eth*/queues/rx-*/rps_flow_cnt + do + echo "rfc" > "fileRfc" + done + + uci set network.@globals[0].packet_steering="1" + uci commit network + + for i in (ip address | awk -F ': ' '/eth[0-9]+/ {print 2}' | xargs) + do + { + ethtool -K "i" rx-checksum on + ethtool -K "i" tx-checksum-ip-generic on || { + ethtool -K "i" tx-checksum-ipv4 on + ethtool -K "i" tx-checksum-ipv6 on + } + ethtool -K "i" tx-scatter-gather on + ethtool -K "i" gso on + ethtool -K "i" tso on + ethtool -K "i" ufo on + } + done +} >"/dev/null" 2>&1 diff --git a/package/emortal/automount/Makefile b/package/emortal/automount/Makefile new file mode 100644 (file) index 0000000..c2734c5 --- /dev/null @@ -0,0 +1,64 @@ +# +# Copyright (C) 2010-2011 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include (TOPDIR)/rules.mk + +PKG_NAME:=automount +PKG_FLAGS:=nonshared +PKG_RELEASE:=(COMMITCOUNT) + +PKG_CONFIG_DEPENDS:= \ + CONFIG_LINUX_5_4 \ + CONFIG_LINUX_5_10 \ + CONFIG_LINUX_5_15 \ + CONFIG_TARGET_ramips + +include (INCLUDE_DIR)/package.mk + +define Package/automount + TITLE:=Mount autoconfig hotplug script. + MAINTAINER:=Lean + DEPENDS:= \ + +block-mount \ + +kmod-usb-storage \ + +kmod-usb-storage-extras \ + +!TARGET_ramips:kmod-usb-storage-uas \ + +kmod-fs-ext4 \ + +!LINUX_5_4:kmod-fs-exfat \ + +LINUX_5_4:kmod-fs-exfat0 \ + +kmod-fs-vfat + +!LINUX_5_15:ntfs-3g + +LINUX_5_15:ntfs3-mount + PKGARCH:=all +endef + +define Package/ntfs3-mount + SECTION:=utils + CATEGORY:=Utilities + SUBMENU:=Filesystem + TITLE:=NTFS mount script for Paragon NTFS3 driver + DEPENDS:=+kmod-fs-ntfs3 + CONFLICTS:=ntfs-3g + VARIANT:=ntfs3-mount + PKGARCH:=all +endef + +define Build/Compile +endef + +define Package/automount/install + (INSTALL_DIR) (1)/etc/hotplug.d/block + (INSTALL_BIN) ./files/15-automount (1)/etc/hotplug.d/block/ +endef + +define Package/ntfs3-mount/install + (INSTALL_DIR) (1)/sbin + (INSTALL_BIN) ./files/mount.ntfs (1)/sbin +endef + +(eval (call BuildPackage,automount)) +(eval (call BuildPackage,ntfs3-mount)) diff --git a/package/emortal/automount/files/15-automount b/package/emortal/automount/files/15-automount new file mode 100755 (executable) index 0000000..bb222e8 --- /dev/null @@ -0,0 +1,27 @@ +#!/bin/sh + +# Copyright (C) 2015 OpenWrt.org + +# 0 yes blockdevice handles this - 1 no it is not there +blkdev=dirname DEVPATH +basename=basename blkdev +device=basename DEVPATH +skip=block info | grep -vE '(f2fs|kernel|squashfs)' | sed 's/\(.*$$: .*/\1/' | grep -q $device ; echo$?
+path=$DEVPATH + +if [$basename != "block" ] && [ -z "${device##sd*}" ] && [$skip -eq 1 ]; then
+       mntpnt=$device + case "$ACTION" in
+                       mkdir -p /mnt/$mntpnt + chmod 777 /mnt/$mntpnt
+                       # Try to be gentle on solid state devices
+                       mount -o rw,noatime,discard /dev/$device /mnt/$mntpnt
+                       ;;
+               remove)
+                       # Once the device is removed, the /dev entry disappear. We need mountpoint
+                       mountpoint=mount |grep /dev/$device | sed 's/.* on $$.*$$ type.*/\1/' + umount -l$mountpoint
+                       ;;
+       esac
+fi
diff --git a/package/emortal/automount/files/mount.ntfs b/package/emortal/automount/files/mount.ntfs
new file mode 100644 (file)
index 0000000..68b7a2e
--- /dev/null
@@ -0,0 +1,2 @@
+#!/bin/sh
+mount -t ntfs3 -o iocharset=utf8 "$@" diff --git a/package/emortal/autosamba/Makefile b/package/emortal/autosamba/Makefile new file mode 100644 (file) index 0000000..51701fc --- /dev/null @@ -0,0 +1,36 @@ +# +# Copyright (C) 2010-2011 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include$(TOPDIR)/rules.mk
+
+PKG_NAME:=autosamba
+PKG_VERSION:=1
+PKG_RELEASE:=12
+
+include $(INCLUDE_DIR)/package.mk + +define Package/autosamba + TITLE:=Samba autoconfig hotplug script. + MAINTAINER:=Lean + DEPENDS:=+luci-app-samba4 +wsdd2 + PKGARCH:=all +endef + +define Package/autosamba/description + A hotplug script to config Samba share automatically. +endef + +define Build/Compile + true +endef + +define Package/autosamba/install +$(INSTALL_DIR) $(1)/etc/hotplug.d/block +$(INSTALL_BIN) ./files/20-smb $(1)/etc/hotplug.d/block/20-smb +endef + +$(eval $(call BuildPackage,autosamba)) diff --git a/package/emortal/autosamba/files/20-smb b/package/emortal/autosamba/files/20-smb new file mode 100755 (executable) index 0000000..72e6faf --- /dev/null @@ -0,0 +1,104 @@ +#!/bin/sh +# +# D-Team Technology Co.,Ltd. ShenZhen +# 作者:Vic +# +# +# 警告:对着屏幕的哥们,我们允许你使用此脚本，但不允许你抹去作者的信息,请保留这段话。 +# +. /lib/functions.sh +. /lib/functions/service.sh + +global=0 +config_file="/etc/config/samba" + +wait_for_init() { + for i in seq 30 + do + [ -e /tmp/procd.done ] || { + sleep 1; continue; + } + return + done +} + +smb_handle() { + config_get path$1 path
+        if [  "$path" = "$2" ] ;then
+                global=1
+        fi
+}
+
+chk_en() {
+       config_get_bool autoshare $1 autoshare 1 + [$autoshare -eq 0 ] && exit
+}
+
+config_foreach chk_en samba
+
+device=basename $DEVPATH + +case "$ACTION" in
+
+        case "$device" in + sd*) ;; + md*) ;; + hd*);; + mmcblk*);; + *) return;; + esac + + path="/dev/$device"
+
+        wait_for_init
+
+        cat /proc/mounts | while read j
+        do
+                str=${j%% *} + if [ "$str" == $path ];then + strr=${j#* }
+                        target=${strr%% *} + global=0 + config_foreach smb_handle sambashare$target
+                                               name=${target#*/mnt/} + + if [$global -eq 0 ] ;then
+                                echo -e "\n\nconfig sambashare" >> $config_file + echo -e "\toption auto '1'" >>$config_file
+                                echo -e "\toption name '$name'" >>$config_file
+                                echo -e "\toption path '$target'" >>$config_file
+                                echo -e "\toption read_only 'no'" >> $config_file + echo -e "\toption guest_ok 'yes'" >>$config_file
+                                echo -e "\toption create_mask '0666'" >> $config_file + echo -e "\toption dir_mask '0777'" >>$config_file
+                                                               echo -e "\toption device '$device'" >>$config_file
+                               return
+                        fi
+                fi
+        done
+       ;;
+       remove)
+               i=0
+               while true
+               do
+
+                       dev=uci get samba.@sambashare[$i].device + [$? -ne 0 ] && break
+
+                       [ "$dev" = "$device" ] && {
+                               auto=uci get samba.@sambashare[$i].auto + [$auto = "1" ] && {
+                                       mount_dir=uci get samba.@sambashare[$i].name` + uci delete samba.@sambashare[$i]
+                                       uci commit
+                                       return
+                               }
+                       }
+                       let i+=1
+               done
+       ;;
+esac
diff --git a/package/emortal/default-settings/Makefile b/package/emortal/default-settings/Makefile
new file mode 100644 (file)
index 0000000..1fdde08
--- /dev/null
@@ -0,0 +1,56 @@
+#
+# Copyright (C) 2021 Lean <coolsnowwolf@gmail.com>
+#
+# <https://immortalwrt.org>
+#
+# 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:=$(COMMITCOUNT)
+
+
+include $(INCLUDE_DIR)/package.mk + +define Package/default-settings + SECTION:=luci + CATEGORY:=LuCI + TITLE:=LuCI support for Default Settings + PKGARCH:=all + DEPENDS:=+luci-lib-base +endef + +define Package/default-settings-chn +$(Package/default-settings)
+  TITLE+= (Optimize for CHN users)
+  DEPENDS:=+default-settings +@LUCI_LANG_zh_Hans
+endef
+
+define Build/Compile
+endef
+
+define Package/default-settings/install
+       $(INSTALL_DIR)$(1)/etc
+       $(INSTALL_DATA) ./files/openwrt_banner$(1)/etc/openwrt_banner
+
+       $(INSTALL_DIR)$(1)/etc/uci-defaults
+       $(INSTALL_BIN) ./files/99-default-settings$(1)/etc/uci-defaults/
+endef
+
+define Package/default-settings-chn/install
+       $(INSTALL_DIR)$(1)/etc/uci-defaults
+       $(INSTALL_BIN) ./files/99-default-settings-chinese$(1)/etc/uci-defaults/
+
+       $(INSTALL_DIR)$(1)/usr/lib/lua/luci/i18n
+       po2lmo ./i18n/default.zh_Hans.po $(1)/usr/lib/lua/luci/i18n/default.zh-cn.lmo + po2lmo ./i18n/more.zh_Hans.po$(1)/usr/lib/lua/luci/i18n/more.zh-cn.lmo
+endef
+
+$(eval$(call BuildPackage,default-settings))
+$(eval$(call BuildPackage,default-settings-chn))
diff --git a/package/emortal/default-settings/files/99-default-settings b/package/emortal/default-settings/files/99-default-settings
new file mode 100755 (executable)
index 0000000..e722a5f
--- /dev/null
@@ -0,0 +1,30 @@
+#!/bin/sh
+
+uci set luci.main.lang=auto
+uci commit luci
+
+uci set fstab.@global[0].anon_mount=1
+uci commit fstab
+
+rm -f /www/luci-static/resources/view/status/include/50_dsl.js
+rm -f /www/luci-static/resources/view/status/include/70_ddns.js
+rm -f /www/luci-static/resources/view/status/include/80_minidlna.js
+rm -f /www/luci-static/resources/view/status/include/80_upnp.js
+
+ln -sf /sbin/ip /usr/bin/ip
+
+[ -f '/bin/bash' ] && sed -i 's|root:x:0:0:root:/root:/bin/ash|root:x:0:0:root:/root:/bin/bash|g' /etc/passwd
+
+sed -i '/option disabled/d' /etc/config/wireless
+sed -i '/set wireless.radio${devidx}.disabled/d' /lib/wifi/mac80211.sh +wifi up + +sed -i '/log-facility/d' /etc/dnsmasq.conf +echo "log-facility=/dev/null" >> /etc/dnsmasq.conf + +rm -rf /tmp/luci-modulecache/ +rm -f /tmp/luci-indexcache + +mv /etc/openwrt_banner /etc/banner + +exit 0 diff --git a/package/emortal/default-settings/files/99-default-settings-chinese b/package/emortal/default-settings/files/99-default-settings-chinese new file mode 100755 (executable) index 0000000..4752d1f --- /dev/null @@ -0,0 +1,17 @@ +#!/bin/sh + +uci -q batch <<-EOF + set system.@system[0].timezone='CST-8' + set system.@system[0].zonename='Asia/Shanghai' + + delete system.ntp.server + add_list system.ntp.server='time1.cloud.tencent.com' + add_list system.ntp.server='ntp1.aliyun.com' + add_list system.ntp.server='ntp.ntsc.ac.cn' + add_list system.ntp.server='cn.ntp.org.cn' +EOF +uci commit system + +sed -i 's,downloads.immortalwrt.org,mirrors.vsean.net/openwrt,g' /etc/opkg/distfeeds.conf + +exit 0 diff --git a/package/emortal/default-settings/files/openwrt_banner b/package/emortal/default-settings/files/openwrt_banner new file mode 100644 (file) index 0000000..4344242 --- /dev/null @@ -0,0 +1,11 @@ +\e[0;1;34;94m┌────────────\e[0;34m────────────\e[0;37m─────────────\e[0;1;30;90m────────┐\e[0m +\e[0;1;34;94m│\e[0m \e[0;1;30;90m│\e[0m +\e[0;1;34;94m│\e[0m \e[0;1;34;94mmmmmm\e[0m \e[0;37mm\e[0m \e[0;1;30;90m""#\e[0m \e[0;34m│\e[0m +\e[0;1;34;94m│\e[0m \e[0;34m#\e[0m \e[0;34mmmmmm\e[0m \e[0;34mm\e[0;37mmmmm\e[0m \e[0;37mmmm\e[0m \e[0;37mm\e[0m\e[0;1;30;90mmm\e[0m \e[0;1;30;90mmm#mm\e[0m \e[0;1;30;90mmmm\e[0m \e[0;1;34;94m#\e[0m \e[0;34m│\e[0m +\e[0;37m│\e[0m \e[0;34m#\e[0m \e[0;37m#\e[0m \e[0;37m#\e[0m \e[0;37m#\e[0m \e[0;37m#\e[0m \e[0;37m#\e[0m \e[0;37m#\e[0m \e[0;37m#"\e[0m \e[0;1;30;90m"#\e[0m \e[0;1;30;90m#"\e[0m \e[0;1;30;90m"\e[0m \e[0;1;30;90m#\e[0m \e[0;1;34;94m"\e[0m \e[0;1;34;94m#\e[0m \e[0;1;34;94m#\e[0m \e[0;34m│\e[0m +\e[0;37m│\e[0m \e[0;37m#\e[0m \e[0;37m#\e[0m \e[0;37m#\e[0m \e[0;37m#\e[0m \e[0;37m#\e[0m \e[0;1;30;90m#\e[0m \e[0;1;30;90m#\e[0m \e[0;1;30;90m#\e[0m \e[0;1;30;90m#\e[0m \e[0;1;30;90m#\e[0m \e[0;1;34;94m#\e[0m \e[0;1;34;94mm"""#\e[0m \e[0;34m#\e[0m \e[0;1;34;94m│\e[0m +\e[0;37m│\e[0m \e[0;37mmm#mm\e[0m \e[0;1;30;90m#\e[0m \e[0;1;30;90m#\e[0m \e[0;1;30;90m#\e[0m \e[0;1;30;90m#\e[0m \e[0;1;30;90m#\e[0m \e[0;1;30;90m#\e[0m \e[0;1;30;90m"#\e[0;1;34;94mm#"\e[0m \e[0;1;34;94m#\e[0m \e[0;1;34;94m"m\e[0;34mm\e[0m \e[0;34m"mm"#\e[0m \e[0;34m"mm\e[0m \e[0;1;34;94m│\e[0m +\e[0;1;30;90m│\e[0m \e[0;37m│\e[0m +\e[0;1;30;90m│\e[0;34m───────────────────\e[0;1;34;94m────────────\e[0;37m──────────────│\e[0m +\e[0;1;30;90m│\e[0m \e[0;1;35;92mImmortalWrt\e[0m \e[0;1;35;92mSNAPSHOT\e[0m \e[0;37m│\e[0m +\e[0;1;34;94m└\e[0;1;34;94m─────────────\e[0;34m──────────────\e[0;1;30;90m───────────\e[0;37m───────┘\e[0m diff --git a/package/emortal/default-settings/i18n/default.zh_Hans.po b/package/emortal/default-settings/i18n/default.zh_Hans.po new file mode 100644 (file) index 0000000..388ed44 --- /dev/null @@ -0,0 +1,103 @@ +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 "Base Setting" +msgstr "基本设置" + +msgid "Log" +msgstr "日志" + +msgid "NAS" +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 "Ethernet Information" +msgstr "网口信息" + +msgid "Ethernet Name" +msgstr "网口名" + +msgid "Link Status" +msgstr "连接状态" + +msgid "Speed" +msgstr "速率" + +msgid "Duplex" +msgstr "双工模式" + +msgid "Link Up" +msgstr "已连接" + +msgid "Link Down" +msgstr "已断开" + +msgid "Full Duplex" +msgstr "全双工" + +msgid "Half Duplex" +msgstr "半双工" + +msgid "Allow AP mode to disconnect STAs based on low ACK condition" +msgstr "允许 AP 模式基于低 ACK 条件判断剔除弱信号的客户端" + +msgid "Temperature" +msgstr "温度" diff --git a/package/emortal/default-settings/i18n/more.zh_Hans.po b/package/emortal/default-settings/i18n/more.zh_Hans.po new file mode 100644 (file) index 0000000..c602be1 --- /dev/null @@ -0,0 +1,1037 @@ +msgid "" +msgstr "" +"Content-Type: text/plain; charset=UTF-8\n" +"Last-Translator: Hsing-Wang Liao <kuoruan@gmail.com>\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<br />MWAN " +"requires that all interfaces have a unique metric configured in /etc/config/" +"network<br />Names must match the interface name found in /etc/config/" +"network (see advanced tab)<br />Names may contain characters A-Z, a-z, 0-9, " +"_ and no spaces<br />Interfaces may not share the same name as configured " +"members, policies or rules" +msgstr "" +"MWAN 支持最多 250 个物理或逻辑接口。<br />MWAN 要求所有接口必须在 /etc/" +"config/network 中设定唯一的网关跃点。<br />名称必须与 /etc/config/network 中" +"的接口名称匹配。（可查看“高级”选项卡）<br />名称允许包括A-Z、a-z、0-9、_ 但是" +"不能有空格。<br />接口不应该与成员、策略、规则中的任意一个设置项使用相同的名" +"称" + +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<br /" +">Names may contain characters A-Z, a-z, 0-9, _ and no spaces<br />Members " +"may not share the same name as configured interfaces, policies or rules" +msgstr "" +"“成员”用来设置每一个 MWAN 接口的跃点数（即接口优先级）和所占比重。<br />名称" +"允许包括 A-Z、 a-、0-9、_ 但是不能有空格。<br />成员不应该与接口、策略、规则" +"中的任意一个设置项使用相同的名称" + +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<br />Member interfaces with lower metrics are used " +"first. Interfaces with the same metric load-balance<br />Load-balanced " +"member interfaces distribute more traffic out those with higher weights<br /" +">Names may contain characters A-Z, a-z, 0-9, _ and no spaces. Names must be " +"15 characters or less<br />Policies may not share the same name as " +"configured interfaces, members or rules" +msgstr "" +"“策略”把成员进行分组，告诉 MWAN 如何分配“规则”中使用这一策略的流量<br />拥有" +"较低跃点数的成员将会被优先使用。拥有相同跃点数的成员把流量进行负载均衡。<br /" +">进行负载均衡的成员之间拥有较高比重的成员将会被分配到更多流量。<br />名称允许" +"包括A-Z、a-z、0-9、_ 但是不能有空格。名称应该在 15 个字符以内<br />策略不应该" +"与接口、成员、规则中的任意一个设置项使用相同的名称" + +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<br />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<br />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<br /" +">Names may contain characters A-Z, a-z, 0-9, _ and no spaces<br />Rules may " +"not share the same name as configured interfaces, members or policies" +msgstr "" +"“规则”基于 IP 地址、协议、端口把流量划分到指定的“策略”中。<br />规则按照从上" +"到下的顺序进行匹配。除了第一条能够匹配一次通信的规则以外，其它规则将被忽略。" +"不匹配任何规则的通信将会由系统默认路由表进行。<br />来自已知的网络的转发流量" +"由系统默认路由表接手，然后 MWAN 从中匹配出相应的流量并转移到 MWAN 自己的路由" +"表。但是所有被划分到一个无法使用的策略的流量将会无法正常进行路由。<br />名称" +"允许包括A-Z、a-z、0-9、_ 但是不能有空格。<br />规则不应该与接口、成员、策略中" +"的任意一个设置项使用相同的名称" + +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<br />This is useful for running system commands and/or scripts " +"based on interface ifup or ifdown hotplug events<br /><br />Notes:<br />The " +"first line of the script must be &#34;#!/bin/sh&#34; without quotes<br /" +">Lines beginning with # are comments and are not executed<br /><br /" +">Available variables:<br />$ACTION is the hotplug event (ifup, ifdown)<br />"
+"$INTERFACE is the interface name (wan1, wan2, etc.)<br />$DEVICE is the "
+"device name attached to the interface (eth0.1, eth1, etc.)"
+msgstr ""
+"这里允许你修改 /etc/hotplug.d/iface/16-mwancustom 的内容<br />这可以在接口 "
+"ifup 或 ifdown Hotplug 事件时运行系统命令或脚本<br /><br />注意:<br />脚本的"
+"第一行必须是 &#34;#!/bin/sh&#34; 不含引号<br />以＃开头的行是注释，不会执行"
+"<br /><br />可用变量:<br />$ACTION 是 Hotplug 事件（ifup, ifdown）<br />" +"$INTERFACE 是接口名称（wan1、wan2 等）<br />\$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 "
+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 "
+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 a