├── .github
└── workflows
│ ├── Bulid_Wrt.yml
│ └── repo_Wrt.yml
├── Dockerfile
├── LICENSE
├── README.md
├── devices
├── armsr_armv8
│ ├── .config
│ ├── diy.sh
│ └── patches
│ │ ├── enable_wifi.patch
│ │ └── rootfs.patch
├── ath79_nand
│ ├── .config
│ └── diy.sh
├── bcm27xx_bcm2711
│ ├── .config
│ └── diy.sh
├── common
│ ├── .config
│ ├── diy.sh
│ ├── info.mk
│ ├── patches
│ │ ├── LINUX_VERSION.patch
│ │ ├── china_mirrors.patch.b
│ │ ├── compressed-memory.patch.b
│ │ ├── disable_flock.patch
│ │ ├── download.patch.b
│ │ ├── feeds.patch
│ │ ├── fix.patch
│ │ ├── imagebuilder.patch
│ │ ├── iptables.patch
│ │ ├── kernel-defaults.patch
│ │ ├── luci_mk.patch
│ │ ├── mt7922.patch
│ │ ├── netfilter.patch.b
│ │ ├── nginx-fancyindex.patch.bak
│ │ ├── package.patch
│ │ ├── rootfs.patch
│ │ ├── targets.patch
│ │ └── use_json_object_new_int64.patch.b
│ └── settings.ini
├── ipq40xx_generic
│ ├── .config
│ ├── diy.sh
│ └── patches
│ │ ├── ACRH17.patch
│ │ ├── cm520.patch
│ │ └── target.patch
├── ramips_mt7621
│ ├── .config
│ ├── diy.sh
│ └── patches
│ │ ├── 01-small_flash.patch
│ │ ├── 02-cr660x.patch
│ │ ├── 03-4a-breed-fix.patch
│ │ ├── jcg_q20-pb-boot.patch
│ │ ├── k2p_32m.patch
│ │ ├── luban.patch
│ │ ├── tblsection.patch
│ │ └── zte_e8820s.patch
├── rockchip_armv8
│ ├── .config
│ ├── README.md
│ ├── diy.sh
│ └── patches
│ │ ├── add_extra_CPU_FLAGS.patch
│ │ ├── fan.patch
│ │ ├── fix.patch
│ │ ├── pico3399.patch.b
│ │ ├── r6s.patch.b
│ │ └── uboot.revert.patch.b
├── rockchip_rk3588_bsp
│ ├── .config
│ ├── README.md
│ ├── diy.sh
│ ├── patches
│ │ ├── add_extra_CPU_FLAGS.patch
│ │ └── fix.patch
│ └── settings.ini
└── x86_64
│ ├── .config
│ ├── diy.sh
│ └── patches
│ ├── Intel_gpu.patch
│ ├── def_set_interfaces_lan_wan.patch
│ ├── image-commands.patch
│ └── image.patch
└── onekey
├── build.sh
└── rebuild.sh
/.github/workflows/Bulid_Wrt.yml:
--------------------------------------------------------------------------------
1 | #=================================================
2 | # https://github.com/P3TERX/Actions-OpenWrt
3 | # Description: Build OpenWrt using GitHub Actions
4 | # Lisence: MIT
5 | # Author: P3TERX
6 | # Blog: https://p3terx.com
7 | #=================================================
8 |
9 | name: Build OpenWrt
10 |
11 | on:
12 | repository_dispatch:
13 |
14 | env:
15 | REPO_TOKEN: ${{ secrets.REPO_TOKEN }}
16 | PPPOE_USERNAME: ${{ secrets.PPPOE_USERNAME }}
17 | PPPOE_PASSWD: ${{ secrets.PPPOE_PASSWD }}
18 | SCKEY: ${{ secrets.SCKEY }}
19 | TELEGRAM_TOKEN: ${{ secrets.TELEGRAM_TOKEN }}
20 | TELEGRAM_CHAT_ID: ${{ secrets.TELEGRAM_CHAT_ID }}
21 | SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
22 | PASSWORD: ${{ secrets.PASSWORD }}
23 | REMOTE_HOST: ${{ secrets.REMOTE_HOST }}
24 | REMOTE_PORT: ${{ secrets.REMOTE_PORT }}
25 | DOCKER_ID: ${{ secrets.DOCKER_ID }}
26 | DOCKER_PASSWD: ${{ secrets.DOCKER_PASSWD }}
27 | TZ: Asia/Shanghai
28 |
29 | jobs:
30 | build:
31 | runs-on: Ubuntu-22.04
32 |
33 | name: Build ${{matrix.target}}
34 | strategy:
35 | fail-fast: false
36 | matrix:
37 | target: ["${{ github.event.client_payload.target }}"]
38 |
39 | steps:
40 | - name: Checkout
41 | uses: actions/checkout@main
42 | with:
43 | fetch-depth: 0
44 |
45 | - name: Load Settings.ini
46 | run: |
47 | echo ${{matrix.target}}
48 | source "${GITHUB_WORKSPACE}/devices/common/settings.ini"
49 | if [ -f "devices/${{matrix.target}}/settings.ini" ]; then
50 | source "${GITHUB_WORKSPACE}/devices/${{matrix.target}}/settings.ini"
51 | fi
52 | echo "REPO_URL=${REPO_URL}" >> $GITHUB_ENV
53 | echo "REPO_BRANCH=${REPO_BRANCH}" >> $GITHUB_ENV
54 | echo "CONFIG_FILE=${CONFIG_FILE}" >> $GITHUB_ENV
55 | echo "DIY_SH=${DIY_SH}" >> $GITHUB_ENV
56 | echo "FREE_UP_DISK=${FREE_UP_DISK}" >> $GITHUB_ENV
57 | echo "UPLOAD_BIN_DIR_FOR_ARTIFACT=${UPLOAD_BIN_DIR_FOR_ARTIFACT}" >> $GITHUB_ENV
58 | echo "UPLOAD_FIRMWARE_FOR_ARTIFACT=${UPLOAD_FIRMWARE_FOR_ARTIFACT}" >> $GITHUB_ENV
59 | echo "UPLOAD_FIRMWARE_FOR_RELEASE=${UPLOAD_FIRMWARE_FOR_RELEASE}" >> $GITHUB_ENV
60 | echo "UPLOAD_FIRMWARE_TO_COWTRANSFER=${UPLOAD_FIRMWARE_TO_COWTRANSFER}" >> $GITHUB_ENV
61 | echo "UPLOAD_FIRMWARE_TO_WETRANSFER=${UPLOAD_FIRMWARE_TO_WETRANSFER}" >> $GITHUB_ENV
62 | sed -i "1a REPO_TOKEN=${{ secrets.REPO_TOKEN }}" ${GITHUB_WORKSPACE}/devices/common/diy.sh
63 | sed -i "1a TARGET=${{matrix.target}}" ${GITHUB_WORKSPACE}/devices/common/diy.sh
64 | if [ ${{matrix.target}} == "x86_64" ]; then
65 | echo "ARCH=linux/amd64" >> $GITHUB_ENV
66 | echo "MTARGET=x86_64" >> $GITHUB_ENV
67 | elif [[ ${{matrix.target}} == "armsr_armv8" ]]; then
68 | echo "MTARGET=aarch64_cortex-a53" >> $GITHUB_ENV
69 | elif [[ ${{matrix.target}} == "ramips_mt7621" ]]; then
70 | echo "MTARGET=mipsel_24kc" >> $GITHUB_ENV
71 | elif [[ ${{matrix.target}} == "ath79_nand" ]]; then
72 | echo "MTARGET=mips_24kc" >> $GITHUB_ENV
73 | elif [[ ${{matrix.target}} == "ipq40xx_generic" ]]; then
74 | echo "MTARGET=arm_cortex-a7_neon-vfpv4" >> $GITHUB_ENV
75 | else
76 | echo "ARCH=linux/arm64" >> $GITHUB_ENV
77 | if [[ ${{matrix.target}} == "bcm27xx_bcm2711" ]]; then
78 | echo "MTARGET=aarch64_cortex-a72" >> $GITHUB_ENV
79 | elif [[ ${{matrix.target}} == rockchip* ]]; then
80 | echo "MTARGET=aarch64_generic" >> $GITHUB_ENV
81 | fi
82 | fi
83 |
84 | - name: Initialization environment
85 | env:
86 | DEBIAN_FRONTEND: noninteractive
87 | run: |
88 | sudo -E apt-get -qq update
89 | sudo -E apt-get -qq install build-essential clang flex g++ gawk gcc-multilib gettext \
90 | git libncurses5-dev libssl-dev python3-distutils python3-pyelftools python3-setuptools \
91 | libpython3-dev rsync unzip zlib1g-dev swig aria2 jq subversion qemu-utils ccache rename \
92 | libelf-dev device-tree-compiler libgnutls28-dev coccinelle libgmp3-dev libmpc-dev
93 | sudo -E apt-get -qq purge azure-cli ghc* zulu* llvm* firefox powershell openjdk* dotnet* google* mysql* php* android*
94 | sudo rm -rf /etc/apt/sources.list.d/* /usr/share/dotnet /usr/local/lib/android /opt/ghc
95 | sudo -E apt-get -qq autoremove --purge
96 | sudo -E apt-get -qq clean
97 | sudo timedatectl set-timezone "$TZ"
98 | git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
99 | git config --global user.name "github-actions[bot]"
100 |
101 | - name: Get current date
102 | id: date
103 | run: |
104 | echo "date=$(date +'%m/%d_%Y_%H/%M')" >> $GITHUB_ENV
105 | echo "date2=$(date +'%m/%d %Y')" >> $GITHUB_ENV
106 | VERSION="$(echo "${{github.event.action}}" | grep -Eo " [0-9.]+" | sed -e 's/ //')" || true
107 | [ "$VERSION" ] && echo "VERSION=$VERSION" >> $GITHUB_ENV || echo "VERSION=$(date +'%m.%d')" >> $GITHUB_ENV
108 |
109 | - name: Clone source code
110 | run: |
111 | if [[ ! "${{ env.REPO_BRANCH }}" && "$REPO_URL" == "https://github.com/openwrt/openwrt" ]]; then
112 | REPO_BRANCH="$((curl -gs -H 'Content-Type: application/json' \
113 | -H "Authorization: Bearer ${{ secrets.REPO_TOKEN }}" \
114 | -X POST -d '{ "query": "query {repository(owner: \"openwrt\", name: \"openwrt\") {refs(refPrefix: \"refs/tags/\", last: 4, orderBy: {field: TAG_COMMIT_DATE, direction: ASC}) {edges {node {name}}}}}"}' https://api.github.com/graphql) | jq -r '.data.repository.refs.edges[].node.name' | grep v23 | tail -n 1)"
115 | git clone $REPO_URL -b $REPO_BRANCH openwrt
116 | elif [[ ! "${{ env.REPO_BRANCH }}" ]]; then
117 | git clone $REPO_URL openwrt
118 | else
119 | git clone $REPO_URL -b ${{ env.REPO_BRANCH }} openwrt
120 | echo "git clone $REPO_URL -b ${{ env.REPO_BRANCH }} openwrt"
121 | fi
122 |
123 | - name: Free up disk space
124 | env:
125 | DEBIAN_FRONTEND: noninteractive
126 | run: |
127 | sudo mkdir -p -m 777 /mnt/openwrt/dl /mnt/openwrt/bin /mnt/openwrt/staging_dir
128 | ln -sf /mnt/openwrt/dl openwrt/dl
129 | ln -sf /mnt/openwrt/bin openwrt/bin
130 | ln -sf /mnt/openwrt/staging_dir openwrt/staging_dir
131 |
132 | - name: Load custom configuration
133 | run: |
134 | cp -rf devices/common/. openwrt/
135 | cp -rf devices/${{matrix.target}}/. openwrt/
136 | cp -rf devices openwrt/
137 | cd openwrt
138 | cp -Rf ./diy/* ./ || true
139 | chmod +x devices/common/$DIY_SH
140 | /bin/bash "devices/common/$DIY_SH"
141 | cp -f devices/common/$CONFIG_FILE .config
142 | if [ -f "devices/${{matrix.target}}/$CONFIG_FILE" ]; then
143 | echo >> .config
144 | cat devices/${{matrix.target}}/$CONFIG_FILE >> .config
145 | fi
146 | if [ -f "devices/${{matrix.target}}/$DIY_SH" ]; then
147 | chmod +x devices/${{matrix.target}}/$DIY_SH
148 | echo "/bin/bash devices/${{matrix.target}}/$DIY_SH"
149 | /bin/bash "devices/${{matrix.target}}/$DIY_SH"
150 | fi
151 |
152 | - name: Apply patches
153 | run: |
154 | cd openwrt
155 | find "devices/common/patches" -type f ! -name 'china_mirrors.patch' -name '*.patch' ! -name '*.revert.patch' -print0 | sort -z | xargs -I % -t -0 -n 1 sh -c "cat '%' | patch -d './' -B --merge -p1 -E --forward"
156 | #git apply devices/common/patches/*.patch
157 | if [ -n "$(ls -A devices/${{matrix.target}}/patches 2>/dev/null)" ]; then
158 | if [ -n "$(ls -A devices/${{matrix.target}}/*.bin.patch 2>/dev/null)" ]; then
159 | git apply devices/${{matrix.target}}/patches/*.bin.patch
160 | fi
161 | find "devices/${{matrix.target}}/patches" -maxdepth 1 -type f -name '*.patch' ! -name '*.revert.patch' ! -name '*.bin.patch' -print0 | sort -z | xargs -I % -t -0 -n 1 sh -c "cat '%' | patch -d './' -B --merge -p1 -E --forward"
162 | find "devices/${{matrix.target}}/patches" -maxdepth 1 -type f -name '*.revert.patch' -print0 | sort -z | xargs -I % -t -0 -n 1 sh -c "cat '%' | patch -d './' -R -B --merge -p1 -E --forward"
163 | fi
164 | sed -i '$a \
165 | CONFIG_CPU_FREQ_GOV_POWERSAVE=y \
166 | CONFIG_CPU_FREQ_GOV_USERSPACE=y \
167 | CONFIG_CPU_FREQ_GOV_ONDEMAND=y \
168 | CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y \
169 | CONFIG_CRYPTO_CHACHA20_NEON=y \
170 | CONFIG_CRYPTO_CHACHA20POLY1305=y \
171 | CONFIG_FAT_DEFAULT_IOCHARSET="utf8" \
172 | ' `find target/linux -path "target/linux/*/config-*"`
173 |
174 | - name: Defconfig
175 | run: |
176 | cd openwrt
177 | make defconfig
178 | if [[ ! "${{matrix.target}}" =~ (armsr_armv8|bcm27xx_*|rockchip_*|x86_*) ]]; then
179 | sed -n '/# Wireless Drivers/,/# end of Wireless Drivers/p' .config | sed -e 's/=m/=n/' >>.config
180 | sed -i "s/\(kmod-qca.*\)=m/\1=n/" .config
181 | make defconfig
182 | fi
183 | cat .config
184 |
185 | - name: Download package
186 | id: package
187 | run: |
188 | cd openwrt
189 | make download -j$(($(nproc)+1)) &
190 | sleep 5
191 |
192 | - name: Cache
193 | uses: stupidloud/cachewrtbuild@main
194 | with:
195 | ccache: 'true'
196 | mixkey: ${{ matrix.target }}
197 | clean: ${{ contains(github.event.action, 'nocache') }}
198 | prefix: ${{ github.workspace }}/openwrt
199 |
200 | - name: Check space usage
201 | run: |
202 | shopt -s extglob
203 | cd openwrt
204 | if [[ -f staging_dir/*${{ env.MTARGET }}*/bin ]]; then
205 | rm -rf staging_dir/!(*${{ env.MTARGET }}*|host|hostpkg) build_dir/!(*${{ env.MTARGET }}*|host|hostpkg)
206 | fi
207 | df -hT
208 |
209 | - name: SSH connection to Actions
210 | uses: kenzok78/debugger-action@master
211 | if: contains(github.event.action, 'ssh')
212 |
213 | - name: Compile the firmware
214 | id: compile
215 | run: |
216 | shopt -s extglob
217 | cd openwrt
218 | echo -e "$(($(nproc)+1)) thread compile"
219 | make -j$(($(nproc)+1)) || make V=s &>build.log || (tail -50 build.log; curl -k --data chat_id="${{ env.TELEGRAM_CHAT_ID }}" --data "text=❌ OpenWrt ${{ env.VERSION }} ${{matrix.target}} 编译失败 😂" "https://api.telegram.org/bot${{ env.TELEGRAM_TOKEN }}/sendMessage";exit 1)
220 | sed -i "s/# CONFIG_IB is not set/CONFIG_IB=y/" .config
221 | rm -rf staging_dir/toolchain-*/bin/*openwrt-linux-musl-lto-dump
222 | rm -rf staging_dir/toolchain-*/initial
223 |
224 | - name: Organize files
225 | id: organize
226 | continue-on-error: true
227 | run: |
228 | shopt -s extglob
229 | mkdir -p firmware/${{matrix.target}}
230 | cd openwrt; kernel_v="$(make --file=info.mk kernel_version)"; cd -
231 | cp -rf openwrt/bin/targets/*/*/*{combined,sysupgrade}* ./firmware/${{matrix.target}}/ || true
232 | cd openwrt/bin/targets/*/*/
233 | mv -f profiles.json profiles.json.b || true
234 | cp $GITHUB_WORKSPACE/openwrt/.config ${{matrix.target}}.config || true
235 | cp $GITHUB_WORKSPACE/openwrt/build_dir/target-*/linux-*/linux-*/.config ${{matrix.target}}_kernel.config || true
236 | cd -
237 | rename -v "s/openwrt-/${{ env.VERSION }}-openwrt-/" ./firmware/*/* || true
238 | rename -v "s/friendlyarm_//" ./firmware/*/*gz || true
239 | rename -v "s/embedfire_//" ./firmware/*/*gz || true
240 | rename -v "s/xiaomi_redmi-router/redmi/" ./firmware/*/*bin || true
241 | Emoji=("🎉" "🤞" "✨" "🎁" "🎈" "🎄" "🎨" "💋" "🍓" "🍕" "🍉" "💐" "🌴" "🚀" "🛸" "🗽" "⛅" "🌈" "🔥" "⛄" "🐶" "🏅" "🦄" "🐤")
242 | echo "EMOJI=${Emoji[$[$RANDOM % ${#Emoji[@]}]]}" >> $GITHUB_ENV
243 | if [ ${{matrix.target}} == "x86_64" ]; then
244 | echo "DOCKERTAG=${{ secrets.DOCKER_ID }}/openwrt-nginx:latest" >> $GITHUB_ENV
245 | echo "NOTICE=请分配不少于1G的存储容量" >> $GITHUB_ENV
246 | fi
247 |
248 | - name: Deploy firmware to server
249 | uses: easingthemes/ssh-deploy@main
250 | if: env.SSH_PRIVATE_KEY && contains(github.event.action, 'toser')
251 | with:
252 | SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
253 | ARGS: "-avzr --exclude="
254 | SOURCE: firmware/
255 | REMOTE_HOST: ${{ secrets.REMOTE_HOST }}
256 | REMOTE_PORT: ${{ secrets.REMOTE_PORT }}
257 | REMOTE_USER: root
258 | TARGET: "/www/wwwroot/${{ secrets.REMOTE_HOST }}/firmware/"
259 |
260 | - name: Upload firmware for artifact
261 | uses: actions/upload-artifact@main
262 | continue-on-error: true
263 | if: env.UPLOAD_FIRMWARE_FOR_ARTIFACT == 'true'
264 | with:
265 | name: ${{ env.VERSION }}_${{matrix.target}}
266 | path: |
267 | openwrt/bin/targets/
268 |
269 | - name: Upload firmware to cowtransfer
270 | if: env.UPLOAD_FIRMWARE_TO_COWTRANSFER == 'true'
271 | continue-on-error: true
272 | run: |
273 | curl -fsSL git.io/file-transfer | sh
274 | cowurl=$(./transfer cow --block 2621440 -s --no-progress ${FIRMWARE})
275 | cowurl=$(echo $cowurl | grep -o -E "https[^ ]*")
276 | echo "COWURL=$cowurl" >> $GITHUB_ENV
277 | echo "Download Link: ${{ env.EMOJI }} $cowurl ${{ env.EMOJI }} 🚀"
278 |
279 | - name: Upload firmware to WeTransfer
280 | if: env.UPLOAD_FIRMWARE_TO_WETRANSFER == 'true' && ! contains(github.event.action, 'noup')
281 | continue-on-error: true
282 | run: |
283 | curl -fsSL git.io/file-transfer | sh
284 | wetrans=$(./transfer wet -s -p 16 --no-progress ${FIRMWARE})
285 | wetrans=$(echo $wetrans | grep -o -E "https[^ ]*")
286 | echo "WETRANS=$wetrans" >> $GITHUB_ENV
287 | echo "Download Link: ${{ env.EMOJI }} $wetrans ${{ env.EMOJI }} 🚀"
288 |
289 | - name: Create release
290 | id: create_release
291 | if: env.REPO_TOKEN && env.UPLOAD_FIRMWARE_FOR_RELEASE == 'true'
292 | continue-on-error: true
293 | run: |
294 | echo -e "定时更新,推送发布 🎈:\n" >> release.txt
295 | echo -e "[下载链接] (https://${{ secrets.REMOTE_HOST }}/firmware/${{matrix.target}}/)\n" >> release.txt
296 | [ ${{ env.WETRANS }} ] && echo -e "[WeTransfer] (${{ env.WETRANS }} 🗽)\n" >> release.txt
297 | [ ${{ env.COWURL }} ] && echo -e "[奶牛上传] (${{ env.COWURL }} 🐮)\n" >> release.txt
298 | [ ${{ env.NOTICE }} ] && echo -e "${{ env.NOTICE }}" >> release.txt || true
299 |
300 | - name: Upload firmware for release
301 | uses: softprops/action-gh-release@master
302 | continue-on-error: true
303 | if: env.REPO_TOKEN && env.UPLOAD_FIRMWARE_FOR_RELEASE == 'true'
304 | env:
305 | GITHUB_TOKEN: ${{ secrets.REPO_TOKEN }}
306 | with:
307 | files: "${{ env.FIRMWARE }}/*"
308 | name: ${{ env.date2 }} ${{matrix.target}} ${{ env.EMOJI }}
309 | tag_name: ${{ env.date }}_${{matrix.target}}
310 | body_path: release.txt
311 |
312 | - name: Set Up Docker Buildx
313 | uses: docker/setup-buildx-action@master
314 | if: env.DOCKER_ID && env.DOCKER_PASSWD
315 |
316 | - name: Login To DockerHub
317 | uses: docker/login-action@master
318 | if: env.DOCKER_ID && env.DOCKER_PASSWD
319 | with:
320 | username: ${{ secrets.DOCKER_ID }}
321 | password: ${{ secrets.DOCKER_PASSWD }}
322 |
323 | - name: Build and push docker image
324 | uses: docker/build-push-action@master
325 | continue-on-error: true
326 | if: env.DOCKER_ID && env.DOCKER_PASSWD && ! contains(github.event.action, 'noser') && github.event.client_payload.target == 'x86_64'
327 | with:
328 | platforms: ${{ env.ARCH }}
329 | file: Dockerfile
330 | context: .
331 | push: true
332 | tags: |
333 | ${{ secrets.DOCKER_ID }}/openwrt-nginx:${{ matrix.target }}
334 | ${{ env.DOCKERTAG }}
335 |
336 | - name: WeChat notification
337 | continue-on-error: true
338 | if: env.SCKEY
339 | run: |
340 | # [ steps.compile.outputs.status == 'success' ] && curl https://sctapi.ftqq.com/${{ secrets.SCKEY }}.send?text=🎉OpenWrt_${{ env.VERSION }}_${{matrix.target}}编译完成😋|| curl https://sctapi.ftqq.com/${{ secrets.SCKEY }}.send?text=❌OpenWrt_${{ env.VERSION }}_${{matrix.target}}编译失败😂
341 |
342 | - name: Telegram notification
343 | if: env.TELEGRAM_TOKEN && ! contains(github.event.action, 'notg')
344 | continue-on-error: true
345 | run: |
346 | curl -k --data chat_id="${{ env.TELEGRAM_CHAT_ID }}" --data "text=🎉 OpenWrt ${{ env.VERSION }} ${{matrix.target}} 编译成功 😋 https://${{ secrets.REMOTE_HOST }}/firmware/${{matrix.target}}/ ${{ env.COWURL }} ${{ env.WETRANS }} 🚀" "https://api.telegram.org/bot${{ env.TELEGRAM_TOKEN }}/sendMessage"
347 |
348 | - name: Delete workflow runs
349 | uses: Mattraks/delete-workflow-runs@main
350 | continue-on-error: true
351 | with:
352 | retain_days: 10
353 | keep_minimum_runs: 0
354 |
355 | - name: Remove old Releases
356 | uses: dev-drprasad/delete-older-releases@master
357 | continue-on-error: true
358 | if: env.UPLOAD_FIRMWARE_FOR_RELEASE == 'true' && !cancelled()
359 | with:
360 | keep_latest: 15
361 | delete_tags: true
362 | env:
363 | GITHUB_TOKEN: ${{ secrets.REPO_TOKEN }}
364 |
--------------------------------------------------------------------------------
/.github/workflows/repo_Wrt.yml:
--------------------------------------------------------------------------------
1 | #=================================================
2 | # https://github.com/P3TERX/Actions-OpenWrt
3 | # Description: Build OpenWrt using GitHub Actions
4 | # Lisence: MIT
5 | # Author: P3TERX
6 | # Blog: https://p3terx.com
7 | #=================================================
8 |
9 | name: Repo Dispatcher
10 |
11 | on:
12 | # push:
13 | # branches:
14 | # - master
15 | #schedule:
16 | # - cron: 30 18 * * *
17 | workflow_dispatch:
18 | inputs:
19 | param:
20 | description: 'parameter'
21 | required: false
22 | default: ''
23 |
24 | env:
25 | REPO_TOKEN: ${{ secrets.REPO_TOKEN }}
26 | TZ: Asia/Shanghai
27 |
28 | jobs:
29 | build:
30 | runs-on: Ubuntu-22.04
31 | steps:
32 | - name: Checkout
33 | uses: actions/checkout@main
34 |
35 | - name: cancel running workflows
36 | uses: styfle/cancel-workflow-action@main
37 | if: contains(${{ github.event.inputs.param }}, 'cw')
38 | with:
39 | workflow_id: all
40 | access_token: ${{ github.token }}
41 |
42 | - name: Delete workflow runs
43 | uses: Mattraks/delete-workflow-runs@main
44 | continue-on-error: true
45 | with:
46 | retain_days: 1
47 | keep_minimum_runs: 0
48 |
49 | - name: Load Settings.ini
50 | run: |
51 | source "${GITHUB_WORKSPACE}/devices/common/settings.ini"
52 | if [ -f "devices/${{matrix.target}}/settings.ini" ]; then
53 | source "${GITHUB_WORKSPACE}/devices/${{matrix.target}}/settings.ini"
54 | fi
55 | echo "REPO_URL=${REPO_URL}" >> $GITHUB_ENV
56 | echo "REPO_BRANCH=${REPO_BRANCH}" >> $GITHUB_ENV
57 |
58 | - name: Trigger Compile
59 | run: |
60 | sudo timedatectl set-timezone "$TZ"
61 | curl \
62 | -X POST https://api.github.com/repos/${{ github.repository }}/dispatches \
63 | -H "Accept: application/vnd.github.everest-preview+json" \
64 | -H "Authorization: token ${{ secrets.REPO_TOKEN }}" \
65 | -d '{"event_type": "x86_64 ${{ github.event.inputs.param }}", "client_payload": {"target": "x86_64"}}'
66 | curl \
67 | -X POST https://api.github.com/repos/${{ github.repository }}/dispatches \
68 | -H "Accept: application/vnd.github.everest-preview+json" \
69 | -H "Authorization: token ${{ secrets.REPO_TOKEN }}" \
70 | -d '{"event_type": "rockchip_armv8 ${{ github.event.inputs.param }}", "client_payload": {"target": "rockchip_armv8"}}'
71 | curl \
72 | -X POST https://api.github.com/repos/${{ github.repository }}/dispatches \
73 | -H "Accept: application/vnd.github.everest-preview+json" \
74 | -H "Authorization: token ${{ secrets.REPO_TOKEN }}" \
75 | -d '{"event_type": "rockchip_rk3588_bsp ${{ github.event.inputs.param }}", "client_payload": {"target": "rockchip_rk3588_bsp"}}'
76 | curl \
77 | -X POST https://api.github.com/repos/${{ github.repository }}/dispatches \
78 | -H "Accept: application/vnd.github.everest-preview+json" \
79 | -H "Authorization: token ${{ secrets.REPO_TOKEN }}" \
80 | -d '{"event_type": "bcm27xx_bcm2711 ${{ github.event.inputs.param }}", "client_payload": {"target": "bcm27xx_bcm2711"}}'
81 | curl \
82 | -X POST https://api.github.com/repos/${{ github.repository }}/dispatches \
83 | -H "Accept: application/vnd.github.everest-preview+json" \
84 | -H "Authorization: token ${{ secrets.REPO_TOKEN }}" \
85 | -d '{"event_type": "armsr_armv8 ${{ github.event.inputs.param }}", "client_payload": {"target": "armsr_armv8"}}'
86 | curl \
87 | -X POST https://api.github.com/repos/${{ github.repository }}/dispatches \
88 | -H "Accept: application/vnd.github.everest-preview+json" \
89 | -H "Authorization: token ${{ secrets.REPO_TOKEN }}" \
90 | -d '{"event_type": "ramips_mt7621 ${{ github.event.inputs.param }}", "client_payload": {"target": "ramips_mt7621"}}'
91 | curl \
92 | -X POST https://api.github.com/repos/${{ github.repository }}/dispatches \
93 | -H "Accept: application/vnd.github.everest-preview+json" \
94 | -H "Authorization: token ${{ secrets.REPO_TOKEN }}" \
95 | -d '{"event_type": "ipq40xx_generic ${{ github.event.inputs.param }}", "client_payload": {"target": "ipq40xx_generic"}}'
96 | curl \
97 | -X POST https://api.github.com/repos/${{ github.repository }}/dispatches \
98 | -H "Accept: application/vnd.github.everest-preview+json" \
99 | -H "Authorization: token ${{ secrets.REPO_TOKEN }}" \
100 | -d '{"event_type": "ath79_nand ${{ github.event.inputs.param }}", "client_payload": {"target": "ath79_nand"}}'
101 |
--------------------------------------------------------------------------------
/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM scratch
2 |
3 | MAINTAINER kenzok78 "https://github.com/kenzok78/Bulid_Wrt"
4 |
5 | ADD openwrt/bin/targets/*/*/*rootfs*.tar.gz /
6 |
7 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Apache License
2 | Version 2.0, January 2004
3 | http://www.apache.org/licenses/
4 |
5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6 |
7 | 1. Definitions.
8 |
9 | "License" shall mean the terms and conditions for use, reproduction,
10 | and distribution as defined by Sections 1 through 9 of this document.
11 |
12 | "Licensor" shall mean the copyright owner or entity authorized by
13 | the copyright owner that is granting the License.
14 |
15 | "Legal Entity" shall mean the union of the acting entity and all
16 | other entities that control, are controlled by, or are under common
17 | control with that entity. For the purposes of this definition,
18 | "control" means (i) the power, direct or indirect, to cause the
19 | direction or management of such entity, whether by contract or
20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
21 | outstanding shares, or (iii) beneficial ownership of such entity.
22 |
23 | "You" (or "Your") shall mean an individual or Legal Entity
24 | exercising permissions granted by this License.
25 |
26 | "Source" form shall mean the preferred form for making modifications,
27 | including but not limited to software source code, documentation
28 | source, and configuration files.
29 |
30 | "Object" form shall mean any form resulting from mechanical
31 | transformation or translation of a Source form, including but
32 | not limited to compiled object code, generated documentation,
33 | and conversions to other media types.
34 |
35 | "Work" shall mean the work of authorship, whether in Source or
36 | Object form, made available under the License, as indicated by a
37 | copyright notice that is included in or attached to the work
38 | (an example is provided in the Appendix below).
39 |
40 | "Derivative Works" shall mean any work, whether in Source or Object
41 | form, that is based on (or derived from) the Work and for which the
42 | editorial revisions, annotations, elaborations, or other modifications
43 | represent, as a whole, an original work of authorship. For the purposes
44 | of this License, Derivative Works shall not include works that remain
45 | separable from, or merely link (or bind by name) to the interfaces of,
46 | the Work and Derivative Works thereof.
47 |
48 | "Contribution" shall mean any work of authorship, including
49 | the original version of the Work and any modifications or additions
50 | to that Work or Derivative Works thereof, that is intentionally
51 | submitted to Licensor for inclusion in the Work by the copyright owner
52 | or by an individual or Legal Entity authorized to submit on behalf of
53 | the copyright owner. For the purposes of this definition, "submitted"
54 | means any form of electronic, verbal, or written communication sent
55 | to the Licensor or its representatives, including but not limited to
56 | communication on electronic mailing lists, source code control systems,
57 | and issue tracking systems that are managed by, or on behalf of, the
58 | Licensor for the purpose of discussing and improving the Work, but
59 | excluding communication that is conspicuously marked or otherwise
60 | designated in writing by the copyright owner as "Not a Contribution."
61 |
62 | "Contributor" shall mean Licensor and any individual or Legal Entity
63 | on behalf of whom a Contribution has been received by Licensor and
64 | subsequently incorporated within the Work.
65 |
66 | 2. Grant of Copyright License. Subject to the terms and conditions of
67 | this License, each Contributor hereby grants to You a perpetual,
68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69 | copyright license to reproduce, prepare Derivative Works of,
70 | publicly display, publicly perform, sublicense, and distribute the
71 | Work and such Derivative Works in Source or Object form.
72 |
73 | 3. Grant of Patent License. Subject to the terms and conditions of
74 | this License, each Contributor hereby grants to You a perpetual,
75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76 | (except as stated in this section) patent license to make, have made,
77 | use, offer to sell, sell, import, and otherwise transfer the Work,
78 | where such license applies only to those patent claims licensable
79 | by such Contributor that are necessarily infringed by their
80 | Contribution(s) alone or by combination of their Contribution(s)
81 | with the Work to which such Contribution(s) was submitted. If You
82 | institute patent litigation against any entity (including a
83 | cross-claim or counterclaim in a lawsuit) alleging that the Work
84 | or a Contribution incorporated within the Work constitutes direct
85 | or contributory patent infringement, then any patent licenses
86 | granted to You under this License for that Work shall terminate
87 | as of the date such litigation is filed.
88 |
89 | 4. Redistribution. You may reproduce and distribute copies of the
90 | Work or Derivative Works thereof in any medium, with or without
91 | modifications, and in Source or Object form, provided that You
92 | meet the following conditions:
93 |
94 | (a) You must give any other recipients of the Work or
95 | Derivative Works a copy of this License; and
96 |
97 | (b) You must cause any modified files to carry prominent notices
98 | stating that You changed the files; and
99 |
100 | (c) You must retain, in the Source form of any Derivative Works
101 | that You distribute, all copyright, patent, trademark, and
102 | attribution notices from the Source form of the Work,
103 | excluding those notices that do not pertain to any part of
104 | the Derivative Works; and
105 |
106 | (d) If the Work includes a "NOTICE" text file as part of its
107 | distribution, then any Derivative Works that You distribute must
108 | include a readable copy of the attribution notices contained
109 | within such NOTICE file, excluding those notices that do not
110 | pertain to any part of the Derivative Works, in at least one
111 | of the following places: within a NOTICE text file distributed
112 | as part of the Derivative Works; within the Source form or
113 | documentation, if provided along with the Derivative Works; or,
114 | within a display generated by the Derivative Works, if and
115 | wherever such third-party notices normally appear. The contents
116 | of the NOTICE file are for informational purposes only and
117 | do not modify the License. You may add Your own attribution
118 | notices within Derivative Works that You distribute, alongside
119 | or as an addendum to the NOTICE text from the Work, provided
120 | that such additional attribution notices cannot be construed
121 | as modifying the License.
122 |
123 | You may add Your own copyright statement to Your modifications and
124 | may provide additional or different license terms and conditions
125 | for use, reproduction, or distribution of Your modifications, or
126 | for any such Derivative Works as a whole, provided Your use,
127 | reproduction, and distribution of the Work otherwise complies with
128 | the conditions stated in this License.
129 |
130 | 5. Submission of Contributions. Unless You explicitly state otherwise,
131 | any Contribution intentionally submitted for inclusion in the Work
132 | by You to the Licensor shall be under the terms and conditions of
133 | this License, without any additional terms or conditions.
134 | Notwithstanding the above, nothing herein shall supersede or modify
135 | the terms of any separate license agreement you may have executed
136 | with Licensor regarding such Contributions.
137 |
138 | 6. Trademarks. This License does not grant permission to use the trade
139 | names, trademarks, service marks, or product names of the Licensor,
140 | except as required for reasonable and customary use in describing the
141 | origin of the Work and reproducing the content of the NOTICE file.
142 |
143 | 7. Disclaimer of Warranty. Unless required by applicable law or
144 | agreed to in writing, Licensor provides the Work (and each
145 | Contributor provides its Contributions) on an "AS IS" BASIS,
146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147 | implied, including, without limitation, any warranties or conditions
148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149 | PARTICULAR PURPOSE. You are solely responsible for determining the
150 | appropriateness of using or redistributing the Work and assume any
151 | risks associated with Your exercise of permissions under this License.
152 |
153 | 8. Limitation of Liability. In no event and under no legal theory,
154 | whether in tort (including negligence), contract, or otherwise,
155 | unless required by applicable law (such as deliberate and grossly
156 | negligent acts) or agreed to in writing, shall any Contributor be
157 | liable to You for damages, including any direct, indirect, special,
158 | incidental, or consequential damages of any character arising as a
159 | result of this License or out of the use or inability to use the
160 | Work (including but not limited to damages for loss of goodwill,
161 | work stoppage, computer failure or malfunction, or any and all
162 | other commercial damages or losses), even if such Contributor
163 | has been advised of the possibility of such damages.
164 |
165 | 9. Accepting Warranty or Additional Liability. While redistributing
166 | the Work or Derivative Works thereof, You may choose to offer,
167 | and charge a fee for, acceptance of support, warranty, indemnity,
168 | or other liability obligations and/or rights consistent with this
169 | License. However, in accepting such obligations, You may act only
170 | on Your own behalf and on Your sole responsibility, not on behalf
171 | of any other Contributor, and only if You agree to indemnify,
172 | defend, and hold each Contributor harmless for any liability
173 | incurred by, or claims asserted against, such Contributor by reason
174 | of your accepting any such warranty or additional liability.
175 |
176 | END OF TERMS AND CONDITIONS
177 |
178 | APPENDIX: How to apply the Apache License to your work.
179 |
180 | To apply the Apache License to your work, attach the following
181 | boilerplate notice, with the fields enclosed by brackets "[]"
182 | replaced with your own identifying information. (Don't include
183 | the brackets!) The text should be enclosed in the appropriate
184 | comment syntax for the file format. We also recommend that a
185 | file or class name and description of purpose be included on the
186 | same "printed page" as the copyright notice for easier
187 | identification within third-party archives.
188 |
189 | Copyright [yyyy] [name of copyright owner]
190 |
191 | Licensed under the Apache License, Version 2.0 (the "License");
192 | you may not use this file except in compliance with the License.
193 | You may obtain a copy of the License at
194 |
195 | http://www.apache.org/licenses/LICENSE-2.0
196 |
197 | Unless required by applicable law or agreed to in writing, software
198 | distributed under the License is distributed on an "AS IS" BASIS,
199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200 | See the License for the specific language governing permissions and
201 | limitations under the License.
202 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | ### Bulid_Wrt 官方源码
2 | [1]: https://img.shields.io/badge/license-GPLV2-brightgreen.svg
3 | [2]: /LICENSE
4 | [3]: https://img.shields.io/badge/PRs-welcome-brightgreen.svg
5 | [4]: https://github.com/kenzok8/Bulid_Wrt/pulls
6 | [5]: https://img.shields.io/badge/Issues-welcome-brightgreen.svg
7 | [6]: https://github.com/kenzok8/Bulid_Wrt/issues/new
8 | [7]: https://img.shields.io/github/v/release/hyird/Action-Openwrt
9 | [8]: https://github.com/kenzok8/Bulid_Wrt/releases
10 | [10]: https://img.shields.io/badge/Contact-telegram-blue
11 | [11]: https://t.me/joinchat/JjxmyRZZXJWb74I-sCrryA
12 | [12]: https://github.com/kenzok8/Bulid_Wrt/actions/workflows/Bulid_Wrt.yml/badge.svg
13 | [13]: https://github.com/kenzok8/Bulid_Wrt/actions
14 |
15 | [![license][1]][2]
16 | [](https://github.com/kenzok8/Bulid_Wrt/stargazers)
17 | [](https://github.com/kenzok8/Bulid_Wrt)
18 | [![PRs Welcome][3]][4]
19 | [![Issue Welcome][5]][6]
20 | [![AutoBuild][12]][13]
21 |
22 | Telegram
23 |
24 | ##### 源码来源:
25 | [](https://github.com/garypang13/OpenWrt)
26 | [](https://github.com/xiaorouji/openwrt-passwall)
27 | [](https://github.com/immortalwrt/immortalwrt)
28 | [](https://github.com/coolsnowwolf/lede)
29 | ##### 固件下载:
30 |
31 | [](https://github.com/kenzok8/Bulid_Wrt/releases/latest)
32 |
33 |
34 | ##### 固件下载链接
35 |
36 | - [openwrt ](https://op.dllkids.xyz/op/firmware/)
37 |
38 | ### 默认插件包含:
39 |
40 | + SSR Plus
41 | + openclash
42 | + 动态DDNS
43 | + UPNP 自动端口转发
44 | + 默认多个主题
45 | + 默认管理 IP: 192.168.1.252, 用户名 root,密码 password
46 |
47 | * 修改默认ip
48 |
49 | ```bash
50 | sed -i 's/192.168.1.1/192.168.3.1/g' package/base-files/files/bin/config_generate
51 | ```
52 | * 删除原主题
53 | ```bash
54 | rm -rf package/lean/luci-theme-argon
55 | ```
56 |
57 | * 添加新的主题
58 | ```bash
59 | git clone https://github.com/kenzok8/luci-theme-ifit.git package/lean/luci-theme-ifit
60 | ```
61 | * 添加常用软件包
62 | ```bash
63 | git clone https://github.com/kenzok8/openwrt-packages.git package/openwrt-packages
64 | ```
65 | * 删除默认密码
66 | ```bash
67 | sed -i "/CYXluq4wUazHjmCDBCqXF/d" package/lean/default-settings/files/zzz-default-settings
68 | ```
69 |
70 | * 取消bootstrap为默认主题
71 | ```bash
72 | sed -i '/set luci.main.mediaurlbase=\/luci-static\/bootstrap/d' feeds/luci/themes/luci-theme-bootstrap/root/etc/uci-defaults/30_luci-theme-bootstrap
73 | ```
74 |
--------------------------------------------------------------------------------
/devices/armsr_armv8/.config:
--------------------------------------------------------------------------------
1 | CONFIG_TARGET_armsr=y
2 | CONFIG_TARGET_armsr_armv8=y
3 | CONFIG_TARGET_armsr_armv8_DEVICE_generic=y
4 | CONFIG_PACKAGE_kmod-brcmfmac=y
5 | CONFIG_BRCMFMAC_SDIO=y
6 | CONFIG_TARGET_ROOTFS_TARGZ=y
7 |
8 | CONFIG_TARGET_ROOTFS_EXT4FS=y
9 | CONFIG_TARGET_ROOTFS_SQUASHFS=n
10 |
11 | CONFIG_PACKAGE_luci-ssl=n # uhttpd服务
12 | CONFIG_PACKAGE_luci-ssl-nginx=y # nginx
13 |
14 | CONFIG_PACKAGE_kmod-switch-ar8xxx=n
15 |
16 |
17 |
--------------------------------------------------------------------------------
/devices/armsr_armv8/diy.sh:
--------------------------------------------------------------------------------
1 |
2 |
3 | SHELL_FOLDER=$(dirname $(readlink -f "$0"))
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/devices/armsr_armv8/patches/enable_wifi.patch:
--------------------------------------------------------------------------------
1 | --- a/package/kernel/mac80211/files/lib/wifi/mac80211.sh
2 | +++ b/package/kernel/mac80211/files/lib/wifi/mac80211.sh
3 | @@ -213,5 +213,6 @@ detect_mac80211() {
4 | set wireless.default_${name}.encryption=none
5 | EOF
6 | uci -q commit wireless
7 | + wifi reload
8 | done
9 | }
10 |
--------------------------------------------------------------------------------
/devices/armsr_armv8/patches/rootfs.patch:
--------------------------------------------------------------------------------
1 | --- a/include/image.mk
2 | +++ b/include/image.mk
3 | @@ -728,8 +769,10 @@ endef
4 | define Device
5 | $(call Device/InitProfile,$(1))
6 | $(call Device/Init,$(1))
7 | + $(call Device/Init,$(PROFILE_SANITIZED))
8 | $(call Device/Default,$(1))
9 | $(call Device/$(1),$(1))
10 | + $(call Device/$(PROFILE_SANITIZED),$(1))
11 | $(call Device/Check,$(1))
12 | $(call Device/$(if $(DUMP),Dump,Build),$(1))
13 |
14 | --- a/include/image.mk
15 | +++ b/include/image.mk
16 | @@ -599,7 +599,7 @@ define Device/Build/kernel
17 | $$(_TARGET): $$(if $$(KERNEL_INSTALL),$(BIN_DIR)/$$(KERNEL_IMAGE))
18 | $(call Device/Export,$$(KDIR_KERNEL_IMAGE),$(1))
19 | $(BIN_DIR)/$$(KERNEL_IMAGE): $$(KDIR_KERNEL_IMAGE)
20 | - cp $$^ $$@
21 | + cp $(KDIR)/generic-kernel.bin $$@
22 | ifndef IB
23 | ifdef CONFIG_IB
24 | install: $$(KDIR_KERNEL_IMAGE)
25 |
26 | --- a/target/linux/armsr/image/Makefile
27 | +++ b/target/linux/armsr/image/Makefile
28 | @@ -81,10 +81,8 @@ define Device/efi-default
29 | IMAGE/combined.img.gz := grub-config efi | combined efi | grub-install efi | gzip | append-metadata
30 | IMAGE/combined.vmdk := grub-config efi | combined efi | grub-install efi | qemu-image vmdk
31 | ifeq ($(CONFIG_TARGET_IMAGES_GZIP),y)
32 | - IMAGES-y := rootfs.img.gz
33 | IMAGES-y += combined.img.gz
34 | else
35 | - IMAGES-y := rootfs.img
36 | IMAGES-y += combined.img
37 | endif
38 | ifeq ($(CONFIG_VMDK_IMAGES),y)
39 | @@ -116,4 +114,34 @@ define Device/generic
40 | endef
41 | TARGET_DEVICES += generic
42 |
43 | +define Device/box
44 | + DEVICE_TITLE := 电视盒子全系列 / N1
45 | + DEVICE_PACKAGES := perlbase-base perlbase-utf8 perlbase-time perlbase-xsloader perlbase-file btrfs-progs luci-app-amlogic kmod-brcmfmac wpad-basic-mbedtls iw fdisk lsblk automount -luci-app-attendedsysupgrade -luci-app-gpsysupgrade
46 | +endef
47 | +TARGET_DEVICES += box
48 | +
49 | +define Device/h28k
50 | + DEVICE_TITLE := Hlink H28K
51 | + DEVICE_PACKAGES := perlbase-base perlbase-utf8 perlbase-time perlbase-xsloader perlbase-file btrfs-progs luci-app-amlogic kmod-brcmfmac wpad-basic-mbedtls iw fdisk lsblk automount -luci-app-attendedsysupgrade -luci-app-gpsysupgrade
52 | +endef
53 | +TARGET_DEVICES += h28k
54 | +
55 | +define Image/Build
56 | + if [ "$(PROFILE_SANITIZED)" == "box" ]; then \
57 | + export BIN_DIR=$(BIN_DIR); \
58 | + export DATE=$(DATE); \
59 | + export MORE=$(MORE); \
60 | + export ROOTFS_PARTSIZE=$(shell echo $$(($(ROOTFS_PARTSIZE)/1024/1024))); \
61 | + cd /data/packit/amlogic-s9xxx-openwrt; \
62 | + . ~/packit/packit_amlogic.sh; \
63 | + elif [ "$(PROFILE_SANITIZED)" == "h28k" ]; then \
64 | + export BIN_DIR=$(BIN_DIR); \
65 | + export DATE=$(DATE); \
66 | + export PACKAGE_SOC=$(PROFILE_SANITIZED); \
67 | + export ROOTFS_MB=$(shell echo $$(($(ROOTFS_PARTSIZE)/1024/1024))); \
68 | + cd /data/packit/flippy-openwrt-actions; \
69 | + . ~/packit/packit_flippy.sh; \
70 | + fi
71 | +endef
72 | +
73 | $(eval $(call BuildImage))
74 |
--------------------------------------------------------------------------------
/devices/ath79_nand/.config:
--------------------------------------------------------------------------------
1 |
2 | CONFIG_TARGET_ath79=y
3 | CONFIG_TARGET_ath79_nand=y
4 | CONFIG_TARGET_MULTI_PROFILE=y
5 | CONFIG_TARGET_DEVICE_ath79_nand_DEVICE_glinet_gl-ar300m-nand=y
6 | CONFIG_TARGET_DEVICE_ath79_nand_DEVICE_glinet_gl-ar750s-nor-nand=y
7 | CONFIG_TARGET_DEVICE_ath79_nand_DEVICE_glinet_gl-e750=y
8 | CONFIG_TARGET_DEVICE_ath79_nand_DEVICE_glinet_gl-xe300=y
9 | CONFIG_TARGET_DEVICE_ath79_nand_DEVICE_netgear_r6100=y
10 | CONFIG_TARGET_DEVICE_ath79_nand_DEVICE_netgear_wndr3700-v4=y
11 | CONFIG_TARGET_DEVICE_ath79_nand_DEVICE_netgear_wndr4300=y
12 | CONFIG_TARGET_DEVICE_ath79_nand_DEVICE_netgear_wndr4300-v2=y
13 | CONFIG_TARGET_DEVICE_ath79_nand_DEVICE_netgear_wndr4300sw=y
14 | CONFIG_TARGET_DEVICE_ath79_nand_DEVICE_netgear_wndr4300tn=y
15 | CONFIG_TARGET_DEVICE_ath79_nand_DEVICE_netgear_wndr4500-v3=y
16 | CONFIG_TARGET_DEVICE_ath79_nand_DEVICE_linksys_ea4500-v3=y
17 | CONFIG_TARGET_DEVICE_ath79_nand_DEVICE_zte_mf286=y
18 | CONFIG_TARGET_DEVICE_ath79_nand_DEVICE_zte_mf281=y
19 |
20 | CONFIG_PACKAGE_luci-ssl=y # uhttpd服务
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/devices/ath79_nand/diy.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | shopt -s extglob
4 |
5 | SHELL_FOLDER=$(dirname $(readlink -f "$0"))
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/devices/bcm27xx_bcm2711/.config:
--------------------------------------------------------------------------------
1 |
2 | CONFIG_TARGET_bcm27xx=y
3 | CONFIG_TARGET_bcm27xx_bcm2711=y
4 | CONFIG_TARGET_bcm27xx_bcm2711_DEVICE_rpi-4=y
5 |
6 | CONFIG_PACKAGE_luci-ssl=n # uhttpd服务
7 | CONFIG_PACKAGE_luci-ssl-nginx=y # nginx
8 |
9 | CONFIG_PACKAGE_kmod-rtl8821cu=m
10 | CONFIG_PACKAGE_kmod-rtl88x2bu=m
11 |
12 | CONFIG_PACKAGE_kmod-of-mdio=n
13 |
14 |
--------------------------------------------------------------------------------
/devices/bcm27xx_bcm2711/diy.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | SHELL_FOLDER=$(dirname $(readlink -f "$0"))
4 |
5 |
6 |
7 | sed -i 's/DEFAULT_PACKAGES +=/DEFAULT_PACKAGES += fdisk lsblk kmod-usb-net-asix-ax88179 kmod-usb-net-rtl8152/' target/linux/bcm27xx/Makefile
8 | sed -i 's/ factory.img.gz / /' target/linux/bcm27xx/image/Makefile
9 |
10 |
--------------------------------------------------------------------------------
/devices/common/.config:
--------------------------------------------------------------------------------
1 |
2 | CONFIG_GRUB_TIMEOUT="0"
3 | CONFIG_GRUB_CONSOLE=n
4 | CONFIG_TARGET_ROOTFS_EXT4FS=n
5 |
6 | CONFIG_TARGET_ROOTFS_CPIOGZ=n
7 | CONFIG_LUCI_CSSTIDY=n
8 | CONFIG_GRUB_CONSOLE=n
9 | CONFIG_SIGNED_PACKAGES=n
10 | CONFIG_SIGNATURE_CHECK=n
11 |
12 | # 设置固件大小:
13 | CONFIG_TARGET_ROOTFS_PARTSIZE=1004
14 |
15 | CONFIG_ALL_NONSHARED=y
16 |
17 | CONFIG_IB=y
18 | CONFIG_IB_STANDALONE=y
19 | CONFIG_JSON_OVERVIEW_IMAGE_INFO=y
20 |
21 | CONFIG_FEED_telephony=n
22 |
23 | CONFIG_KERNEL_WERROR=n
24 |
25 | # IPv6支持:
26 | CONFIG_IPV6=y
27 |
28 | # Applications
29 |
30 |
31 | # Themes
32 |
33 | CONFIG_PACKAGE_luci-theme-argon=y
34 |
35 |
36 | # 其他需要安装的软件包:
37 |
38 | CONFIG_PACKAGE_dnsmasq=n
39 | CONFIG_PACKAGE_dnsmasq-full=y
40 | CONFIG_PACKAGE_dnsmasq_full_dhcp=y
41 | CONFIG_PACKAGE_dnsmasq_full_ipset=y
42 |
43 | CONFIG_NGINX_DAV=y
44 | CONFIG_PACKAGE_luci-base=y
45 | CONFIG_PACKAGE_luci-compat=y
46 | CONFIG_PACKAGE_luci-lib-ipkg=y
47 | CONFIG_LUCI_LANG_zh_Hans=y
48 | CONFIG_LUCI_LANG_en=y
49 | CONFIG_PACKAGE_coremark=y
50 | CONFIG_DEVEL=y
51 | CONFIG_CCACHE=n
52 | CONFIG_TOOLCHAINOPTS=y
53 | CONFIG_COREMARK_OPTIMIZE_O3=y
54 | CONFIG_COREMARK_ENABLE_MULTITHREADING=y
55 | CONFIG_COREMARK_NUMBER_OF_THREADS=16
56 | CONFIG_PACKAGE_zoneinfo-asia=y
57 | CONFIG_PACKAGE_my-default-settings=y
58 | CONFIG_PACKAGE_wget-ssl=y
59 | CONFIG_PACKAGE_curl=y
60 | CONFIG_PACKAGE_htop=y
61 | CONFIG_PACKAGE_nano=y
62 | CONFIG_XRAY_PROVIDE_V2RAY=y
63 | CONFIG_V2RAY_CORE_COMPRESS_UPX=n
64 | CONFIG_XRAY_CORE_COMPRESS_UPX=n
65 | CONFIG_PACKAGE_zram-swap=y
66 | CONFIG_PACKAGE_kmod-lib-lz4=y
67 | CONFIG_PACKAGE_kmod-lib-zstd=y
68 | CONFIG_NODEJS_14=y
69 |
70 | CONFIG_OPENSSL_OPTIMIZE_SPEED=y
71 | CONFIG_OPENSSL_PREFER_CHACHA_OVER_GCM=y
72 | CONFIG_OPENSSL_ENGINE_BUILTIN=y
73 | CONFIG_OPENSSL_ENGINE_BUILTIN_AFALG=y
74 | CONFIG_OPENSSL_ENGINE_BUILTIN_DEVCRYPTO=y
75 |
76 | CONFIG_BUSYBOX_CUSTOM=y
77 | CONFIG_BUSYBOX_CONFIG_FEATURE_XARGS_SUPPORT_REPL_STR=y
78 | CONFIG_BUSYBOX_CONFIG_FEATURE_CROND_SPECIAL_TIMES=y
79 | CONFIG_BUSYBOX_CONFIG_FEATURE_SYSLOG_INFO=y
80 |
81 | CONFIG_PACKAGE_bash=y
82 | CONFIG_PACKAGE_ca-bundle=y
83 |
84 | CONFIG_KERNEL_CGROUP_DEVICE=y
85 | CONFIG_KERNEL_CGROUP_FREEZER=y
86 | CONFIG_KERNEL_NET_CLS_CGROUP=y
87 | CONFIG_KERNEL_CGROUP_NET_PRIO=y
88 | CONFIG_KERNEL_MEMCG_SWAP_ENABLED=y
89 | CONFIG_KERNEL_CFQ_GROUP_IOSCHED=y
90 | CONFIG_KERNEL_CGROUP_PERF=y
91 | CONFIG_KERNEL_CGROUP_HUGETLB=y
92 | CONFIG_KERNEL_EXT4_FS_POSIX_ACL=y
93 | CONFIG_KERNEL_EXT4_FS_SECURITY=y
94 | CONFIG_KERNEL_BTRFS_FS_POSIX_ACL=y
95 |
96 | CONFIG_PACKAGE_kmod-drm-nouveau=n
97 | CONFIG_PACKAGE_kmod-rtl8821cu=n
98 | CONFIG_PACKAGE_kmod-rtl88x2bu=n
99 |
100 | CONFIG_PACKAGE_kmod-rtl8189es=n
101 |
102 | CONFIG_PACKAGE_kmod-sprd_pcie=n
103 |
104 | CONFIG_PACKAGE_kmod-pcie_mhi=n
105 |
106 | CONFIG_PACKAGE_kmod-mii=n
107 |
108 |
109 |
110 |
111 | CONFIG_IMAGEOPT=y
112 | CONFIG_VERSIONOPT=y
113 |
114 | CONFIG_VERSION_MANUFACTURER="kenzo'"
115 | CONFIG_VERSION_FILENAMES=n
116 | CONFIG_VERSION_CODE_FILENAMES=n
117 |
118 |
119 |
--------------------------------------------------------------------------------
/devices/common/diy.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | #=================================================
3 | shopt -s extglob
4 |
5 | sed -i '$a src-git jell https://github.com/kenzok8/jell.git;main' feeds.conf.default
6 | sed -i "/telephony/d" feeds.conf.default
7 |
8 | sed -i "s?targets/%S/packages?targets/%S/\$(LINUX_VERSION)?" include/feeds.mk
9 |
10 | sed -i '/ refresh_config();/d' scripts/feeds
11 |
12 | ./scripts/feeds update -a
13 | ./scripts/feeds install -a -p jell -f
14 | ./scripts/feeds install -a
15 |
16 | echo "$(date +"%s")" >version.date
17 | sed -i '/$(curdir)\/compile:/c\$(curdir)/compile: package/opkg/host/compile' package/Makefile
18 | sed -i 's/$(TARGET_DIR)) install/$(TARGET_DIR)) install --force-overwrite --force-depends/' package/Makefile
19 | sed -i "s/DEFAULT_PACKAGES:=/DEFAULT_PACKAGES:=luci-app-firewall luci-app-opkg luci-app-upnp luci-app-upnp luci-app-mosdns luci-app-openclash luci-app-ssr-plus \
20 | luci-app-wizard luci-base luci-compat luci-lib-ipkg luci-lib-fs \
21 | coremark wget-ssl curl autocore htop nano zram-swap kmod-lib-zstd kmod-tcp-bbr bash openssh-sftp-server block-mount resolveip ds-lite swconfig luci-app-fan /" include/target.mk
22 | sed -i "s/procd-ujail//" include/target.mk
23 |
24 | sed -i "s/^.*vermagic$/\techo '1' > \$(LINUX_DIR)\/.vermagic/" include/kernel-defaults.mk
25 |
26 |
27 | mv -f feeds/jell/r81* tmp/
28 |
29 | sed -i "s/192.168.1/192.168.1.251/" package/feeds/jell/base-files/files/bin/config_generate
30 | sed -i "s/192.168.1/192.168.1.251/" package/base-files/files/bin/config_generate
31 |
32 | (
33 | svn co https://github.com/coolsnowwolf/lede/trunk/target/linux/generic/hack-5.15 target/linux/generic/hack-5.15
34 | curl -sfL https://raw.githubusercontent.com/coolsnowwolf/lede/master/target/linux/generic/pending-5.15/613-netfilter_optional_tcp_window_check.patch -o target/linux/generic/pending-5.15/613-netfilter_optional_tcp_window_check.patch
35 | sed -i "s/CONFIG_WERROR=y/CONFIG_WERROR=n/" target/linux/generic/config-5.15
36 | ) &
37 |
38 | grep -q "23.05" include/version.mk && [ -d package/kernel/mt76 ] && {
39 | mkdir package/kernel/mt76/patches
40 | curl -sfL https://raw.githubusercontent.com/immortalwrt/immortalwrt/master/package/kernel/mt76/patches/0001-mt76-allow-VHT-rate-on-2.4GHz.patch -o package/kernel/mt76/patches/0001-mt76-allow-VHT-rate-on-2.4GHz.patch
41 | } || rm -rf devices/common/patches/mt7922.patch
42 |
43 | grep -q "1.8.8" package/network/utils/iptables/Makefile && {
44 | rm -rf package/network/utils/iptables
45 | svn co https://github.com/openwrt/openwrt/branches/openwrt-22.03/package/network/utils/iptables package/network/utils/iptables
46 | }
47 |
48 | grep -q 'PKG_RELEASE:=9' package/libs/openssl/Makefile && {
49 | sh -c "curl -sfL https://github.com/openwrt/openwrt/commit/a48d0bdb77eb93f7fba6e055dace125c72755b6a.patch | patch -d './' -p1 --forward"
50 | }
51 |
52 | sed -i "/wireless.\${name}.disabled/d" package/kernel/mac80211/files/lib/wifi/mac80211.sh
53 |
54 | sed -i "/BuildPackage,miniupnpd-iptables/d" feeds/packages/net/miniupnpd/Makefile
55 | sed -i 's/Os/O2/g' include/target.mk
56 | sed -i "/mediaurlbase/d" package/feeds/*/luci-theme*/root/etc/uci-defaults/*
57 | sed -i 's/=bbr/=cubic/' package/kernel/linux/files/sysctl-tcp-bbr.conf
58 |
59 | # find target/linux/x86 -name "config*" -exec bash -c 'cat kernel.conf >> "{}"' \;
60 | sed -i 's/max_requests 3/max_requests 20/g' package/network/services/uhttpd/files/uhttpd.config
61 | #rm -rf ./feeds/packages/lang/{golang,node}
62 | sed -i "s/tty\(0\|1\)::askfirst/tty\1::respawn/g" target/linux/*/base-files/etc/inittab
63 |
64 | sed -i '/echo "radio_config_id=${radio_md5sum}" >> $hostapd_conf_file/d' package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh
65 |
66 | date=`date +%m.%d`
67 | sed -i -e "/\(# \)\?REVISION:=/c\REVISION:=$date" -e '/VERSION_CODE:=/c\VERSION_CODE:=$(REVISION)' include/version.mk
68 |
69 | sed -i \
70 | -e "s/+\(luci\|luci-ssl\|uhttpd\)\( \|$\)/\2/" \
71 | -e "s/+nginx\( \|$\)/+nginx-ssl\1/" \
72 | -e 's/+python\( \|$\)/+python3/' \
73 | -e 's?../../lang?$(TOPDIR)/feeds/packages/lang?' \
74 | package/feeds/jell/*/Makefile
75 |
76 | (
77 | if [ -f sdk.tar.xz ]; then
78 | sed -i 's,$(STAGING_DIR_HOST)/bin/upx,upx,' package/feeds/jell/*/Makefile
79 | mkdir sdk
80 | tar -xJf sdk.tar.xz -C sdk
81 | cp -rf sdk/*/staging_dir/* ./staging_dir/
82 | rm -rf sdk.tar.xz sdk
83 | sed -i '/\(tools\|toolchain\)\/Makefile/d' Makefile
84 | if [ -f /usr/bin/python ]; then
85 | ln -sf /usr/bin/python staging_dir/host/bin/python
86 | else
87 | ln -sf /usr/bin/python3 staging_dir/host/bin/python
88 | fi
89 | ln -sf /usr/bin/python3 staging_dir/host/bin/python3
90 | fi
91 | ) &
92 |
--------------------------------------------------------------------------------
/devices/common/info.mk:
--------------------------------------------------------------------------------
1 | # SPDX-License-Identifier: GPL-2.0-only
2 | #
3 | # Copyright (C) 2007 OpenWrt.org
4 |
5 | TOPDIR:=${CURDIR}
6 | export OPENWRT_VERBOSE=s
7 |
8 | include rules.mk
9 | include $(INCLUDE_DIR)/target.mk
10 |
11 | kernel_version: FORCE
12 | @echo "$(LINUX_VERSION)"
13 |
--------------------------------------------------------------------------------
/devices/common/patches/LINUX_VERSION.patch:
--------------------------------------------------------------------------------
1 | --- a/Makefile
2 | +++ b/Makefile
3 | @@ -33,6 +33,7 @@ ifneq ($(OPENWRT_BUILD),1)
4 | include $(TOPDIR)/include/toplevel.mk
5 | else
6 | include rules.mk
7 | + include $(INCLUDE_DIR)/target.mk
8 | include $(INCLUDE_DIR)/depends.mk
9 | include $(INCLUDE_DIR)/subdir.mk
10 | include target/Makefile
11 | @@ -131,6 +132,9 @@ world: prepare $(target/stamp-compile) $(package/stamp-compile) $(package/stamp-
12 | $(_SINGLE)$(SUBMAKE) -r package/index
13 | $(_SINGLE)$(SUBMAKE) -r json_overview_image_info
14 | $(_SINGLE)$(SUBMAKE) -r checksum
15 | + cp -f $(BIN_DIR)/packages/Packages.manifest $(BIN_DIR)/
16 | + rm -rf $(BIN_DIR)/$(LINUX_VERSION)
17 | + mv -f $(BIN_DIR)/packages $(BIN_DIR)/$(LINUX_VERSION) 2>/dev/null
18 | ifneq ($(CONFIG_CCACHE),)
19 | $(STAGING_DIR_HOST)/bin/ccache -s
20 | endif
21 |
--------------------------------------------------------------------------------
/devices/common/patches/china_mirrors.patch.b:
--------------------------------------------------------------------------------
1 | --- a/scripts/download.pl
2 | +++ b/scripts/download.pl
3 | @@ -201,6 +201,10 @@ sub cleanup
4 | push @mirrors, "https://mirror.leaseweb.com/debian/$1";
5 | push @mirrors, "https://mirror.netcologne.de/debian/$1";
6 | } elsif ($mirror =~ /^\@APACHE\/(.+)$/) {
7 | + push @mirrors, "https://mirrors.tencent.com/apache/$1";
8 | + push @mirrors, "https://mirrors.aliyun.com/apache/$1";
9 | + push @mirrors, "https://mirrors.tuna.tsinghua.edu.cn/apache/$1";
10 | + push @mirrors, "https://mirrors.ustc.edu.cn/apache/$1";
11 | push @mirrors, "https://mirror.netcologne.de/apache.org/$1";
12 | push @mirrors, "https://mirror.aarnet.edu.au/pub/apache/$1";
13 | push @mirrors, "https://mirror.csclub.uwaterloo.ca/apache/$1";
14 | @@ -211,11 +215,35 @@ sub cleanup
15 | push @mirrors, "ftp://apache.cs.utah.edu/apache.org/$1";
16 | push @mirrors, "ftp://apache.mirrors.ovh.net/ftp.apache.org/dist/$1";
17 | } elsif ($mirror =~ /^\@GITHUB\/(.+)$/) {
18 | + my $dir = $1;
19 | + my $i = 0;
20 | + # replace the 2nd '/' with '@' for jsDelivr mirror
21 | + push @mirrors, "https://cdn.jsdelivr.net/gh/". $dir =~ s{\/}{++$i == 2 ? '@' : $&}ger;
22 | + push @mirrors, "https://raw.sevencdn.com/$dir";
23 | + push @mirrors, "https://raw.fastgit.org/$dir";
24 | + push @mirrors, "https://pd.zwc365.com/seturl/https://raw.githubusercontent.com/$dir";
25 | + push @mirrors, "https://ghproxy.com/https://raw.githubusercontent.com/$dir";
26 | + push @mirrors, "https://pd.zwc365.com/cfworker/https://raw.githubusercontent.com/$dir";
27 | # give github a few more tries (different mirrors)
28 | for (1 .. 5) {
29 | - push @mirrors, "https://raw.githubusercontent.com/$1";
30 | + push @mirrors, "https://raw.githubusercontent.com/$dir";
31 | }
32 | + } elsif ($mirror =~ /^\@GHCODELOAD\/(.+)$/) {
33 | + push @mirrors, "https://pd.zwc365.com/seturl/https://codeload.github.com/$1";
34 | + push @mirrors, "https://ghproxy.com/https://codeload.github.com/$1";
35 | + push @mirrors, "https://pd.zwc365.com/cfworker/https://codeload.github.com/$1";
36 | + push @mirrors, "https://codeload.github.com/$1";
37 | + } elsif ($mirror =~ /^\@GHREPO\/(.+)$/) {
38 | + push @mirrors, "https://pd.zwc365.com/seturl/https://github.com/$1";
39 | + push @mirrors, "https://github.com.cnpmjs.org/$1";
40 | + push @mirrors, "https://ghproxy.com/https://github.com/$1";
41 | + push @mirrors, "https://hub.fastgit.org/$1";
42 | + push @mirrors, "https://github.com/$1";
43 | } elsif ($mirror =~ /^\@GNU\/(.+)$/) {
44 | + push @mirrors, "https://mirrors.tencent.com/gnu/$1";
45 | + push @mirrors, "https://mirrors.tuna.tsinghua.edu.cn/gnu/$1";
46 | + push @mirrors, "https://mirrors.cqu.edu.cn/gnu/$1";
47 | + push @mirrors, "https://mirrors.ustc.edu.cn/gnu/$1";
48 | push @mirrors, "https://mirror.csclub.uwaterloo.ca/gnu/$1";
49 | push @mirrors, "https://mirror.netcologne.de/gnu/$1";
50 | push @mirrors, "http://ftp.kddilabs.jp/GNU/gnu/$1";
51 | @@ -240,6 +268,8 @@ sub cleanup
52 | push @extra, "$extra[0]/longterm/v$1";
53 | }
54 | foreach my $dir (@extra) {
55 | + push @mirrors, "https://mirrors.cqu.edu.cn/kernel/$dir";
56 | + push @mirrors, "https://mirrors.ustc.edu.cn/kernel.org/$dir";
57 | push @mirrors, "https://cdn.kernel.org/pub/$dir";
58 | push @mirrors, "https://download.xs4all.nl/ftp.kernel.org/pub/$dir";
59 | push @mirrors, "https://mirrors.mit.edu/kernel/$dir";
60 | @@ -250,6 +280,7 @@ sub cleanup
61 | }
62 | } elsif ($mirror =~ /^\@GNOME\/(.+)$/) {
63 | push @mirrors, "https://download.gnome.org/sources/$1";
64 | + push @mirrors, "https://mirrors.ustc.edu.cn/gnome/sources/$1";
65 | push @mirrors, "https://mirror.csclub.uwaterloo.ca/gnome/sources/$1";
66 | push @mirrors, "http://ftp.acc.umu.se/pub/GNOME/sources/$1";
67 | push @mirrors, "http://ftp.kaist.ac.kr/gnome/sources/$1";
68 | @@ -263,6 +294,7 @@ sub cleanup
69 | }
70 | }
71 |
72 | +unshift @mirrors, "http://182.140.223.146";
73 | push @mirrors, 'https://sources.cdn.openwrt.org';
74 | push @mirrors, 'https://sources.openwrt.org';
75 | push @mirrors, 'https://mirror2.openwrt.org/sources';
76 | @@ -296,4 +328,3 @@ sub cleanup
77 | }
78 |
79 | $SIG{INT} = \&cleanup;
80 | -
81 |
--------------------------------------------------------------------------------
/devices/common/patches/compressed-memory.patch.b:
--------------------------------------------------------------------------------
1 | --- a/package/kernel/linux/modules/crypto.mk
2 | +++ b/package/kernel/linux/modules/crypto.mk
3 | @@ -809,3 +809,18 @@ endef
4 |
5 | $(eval $(call KernelPackage,crypto-xts))
6 |
7 | +
8 | +define KernelPackage/crypto-zstd
9 | + TITLE:=zstd compression CryptoAPI module
10 | + DEPENDS:=+kmod-lib-zstd +kmod-crypto-acompress
11 | + KCONFIG:=CONFIG_CRYPTO_ZSTD
12 | + FILES:=$(LINUX_DIR)/crypto/zstd.ko
13 | + AUTOLOAD:=$(call AutoLoad,09,zstd)
14 | + $(call AddDepends/crypto)
15 | +endef
16 | +
17 | +define KernelPackage/crypto-zstd/description
18 | + Kernel module for the CryptoAPI to support Zstandard
19 | +endef
20 | +
21 | +$(eval $(call KernelPackage,crypto-zstd))
22 |
23 | --- a/package/kernel/linux/modules/lib.mk
24 | +++ b/package/kernel/linux/modules/lib.mk
25 | @@ -166,6 +166,27 @@ endef
26 | $(eval $(call KernelPackage,lib-lz4))
27 |
28 |
29 | +define KernelPackage/lib-lz4hc
30 | + SUBMENU:=$(LIB_MENU)
31 | + TITLE:=LZ4HC support
32 | + DEPENDS:=+kmod-lib-lz4 +kmod-crypto-acompress
33 | + HIDDEN:=1
34 | + KCONFIG:= \
35 | + CONFIG_CRYPTO_LZ4HC \
36 | + CONFIG_LZ4HC_COMPRESS
37 | + FILES:= \
38 | + $(LINUX_DIR)/crypto/lz4hc.ko \
39 | + $(LINUX_DIR)/lib/lz4/lz4hc_compress.ko
40 | + AUTOLOAD:=$(call AutoProbe,lz4hc lz4hc_compress)
41 | +endef
42 | +
43 | +define KernelPackage/lib-lz4hc/description
44 | + Kernel module for LZ4HC compression/decompression support
45 | +endef
46 | +
47 | +$(eval $(call KernelPackage,lib-lz4hc))
48 | +
49 | +
50 | define KernelPackage/lib-raid6
51 | SUBMENU:=$(LIB_MENU)
52 | TITLE:=RAID6 algorithm support
53 |
54 | --- a/package/kernel/linux/modules/other.mk
55 | +++ b/package/kernel/linux/modules/other.mk
56 | @@ -869,6 +869,85 @@ endef
57 | $(eval $(call KernelPackage,zram))
58 |
59 |
60 | +define KernelPackage/zsmalloc
61 | + SUBMENU:=$(OTHER_MENU)
62 | + TITLE:=ZSMALLOC support
63 | + DEPENDS:=+kmod-crypto-deflate \
64 | + +kmod-lib-lz4 \
65 | + @!PACKAGE_kmod-zram
66 | + KCONFIG:= \
67 | + CONFIG_ZSMALLOC \
68 | + CONFIG_ZSMALLOC_STAT=n
69 | + FILES:= $(LINUX_DIR)/mm/zsmalloc.ko
70 | + AUTOLOAD:=$(call AutoLoad,19,zsmalloc)
71 | +endef
72 | +
73 | +define KernelPackage/zsmalloc/description
74 | + Special purpose memory allocator for compressed memory pages
75 | +endef
76 | +
77 | +define KernelPackage/zsmalloc/config
78 | + if PACKAGE_kmod-zsmalloc
79 | + config KERNEL_PGTABLE_MAPPING
80 | + bool "zsmalloc: enable CONFIG_PGTABLE_MAPPING"
81 | + default y if arm
82 | + default n
83 | + help
84 | + Enable CONFIG_PGTABLE_MAPPING in the kernel for faster memory
85 | + allocations when using ZSMALLOC, in some architectures. Enabled
86 | + by default for the ARM architecture because it may be a huge
87 | + performance boost.
88 | + endif
89 | +endef
90 | +
91 | +$(eval $(call KernelPackage,zsmalloc))
92 | +
93 | +
94 | +define KernelPackage/zram-writeback
95 | + SUBMENU:=$(OTHER_MENU)
96 | + TITLE:=zram with writeback support
97 | + DEPENDS:=+kmod-zsmalloc
98 | + KCONFIG:= \
99 | + CONFIG_ZRAM \
100 | + CONFIG_ZRAM_DEBUG=n \
101 | + CONFIG_ZRAM_MEMORY_TRACKING=n \
102 | + CONFIG_ZRAM_WRITEBACK=y
103 | + FILES:= \
104 | + $(LINUX_DIR)/drivers/block/zram/zram.ko
105 | + AUTOLOAD:=$(call AutoLoad,20,zram)
106 | +endef
107 | +
108 | +define KernelPackage/zram-writeback/description
109 | + Compressed RAM disk with support for page writeback
110 | +endef
111 | +
112 | +$(eval $(call KernelPackage,zram-writeback))
113 | +
114 | +
115 | +define KernelPackage/zswap
116 | + SUBMENU:=$(OTHER_MENU)
117 | + TITLE:=zswap compressed swapping cache
118 | + DEPENDS:=+kmod-zsmalloc
119 | + KCONFIG:= \
120 | + CONFIG_FRONTSWAP=y \
121 | + CONFIG_Z3FOLD \
122 | + CONFIG_ZBUD \
123 | + CONFIG_ZPOOL \
124 | + CONFIG_ZSWAP=y
125 | + FILES:= \
126 | + $(LINUX_DIR)/mm/z3fold.ko \
127 | + $(LINUX_DIR)/mm/zbud.ko \
128 | + $(LINUX_DIR)/mm/zpool.ko
129 | + AUTOLOAD:=$(call AutoLoad,20,z3fold zbud zpool)
130 | +endef
131 | +
132 | +define KernelPackage/zswap/description
133 | + Compressed swap cache and compressed memory allocator support
134 | +endef
135 | +
136 | +$(eval $(call KernelPackage,zswap))
137 | +
138 | +
139 | define KernelPackage/pps
140 | SUBMENU:=$(OTHER_MENU)
141 | TITLE:=PPS support
142 |
--------------------------------------------------------------------------------
/devices/common/patches/disable_flock.patch:
--------------------------------------------------------------------------------
1 | --- a/package/system/procd/files/procd.sh
2 | +++ b/package/system/procd/files/procd.sh
3 | @@ -50,11 +50,2 @@
4 | local service_name="$(basename ${basescript:-$initscript})"
5 | -
6 | - flock -n 1000 &> /dev/null
7 | - if [ "$?" != "0" ]; then
8 | - exec 1000>"$IPKG_INSTROOT/var/lock/procd_${service_name}.lock"
9 | - flock 1000
10 | - if [ "$?" != "0" ]; then
11 | - logger "warning: procd flock for $service_name failed"
12 | - fi
13 | - fi
14 | }
15 |
--------------------------------------------------------------------------------
/devices/common/patches/download.patch.b:
--------------------------------------------------------------------------------
1 | --- a/scripts/download.pl
2 | +++ b/scripts/download.pl
3 | @@ -82,11 +82,11 @@ ($)
4 | }
5 |
6 | return $have_curl
7 | - ? (qw(curl -f --connect-timeout 20 --retry 5 --location),
8 | + ? (qw(curl -f --connect-timeout 5 --retry 3 -m 30 --location),
9 | $check_certificate ? () : '--insecure',
10 | shellwords($ENV{CURL_OPTIONS} || ''),
11 | $url)
--------------------------------------------------------------------------------
/devices/common/patches/feeds.patch:
--------------------------------------------------------------------------------
1 | --- a/include/feeds.mk
2 | +++ b/include/feeds.mk
3 | @@ -6,7 +6,7 @@
4 | -include $(TMP_DIR)/.packageauxvars
5 |
6 | FEEDS_INSTALLED:=$(notdir $(wildcard $(TOPDIR)/package/feeds/*))
7 | -FEEDS_AVAILABLE:=$(sort $(FEEDS_INSTALLED) $(shell $(SCRIPT_DIR)/feeds list -n 2>/dev/null))
8 | +FEEDS_AVAILABLE:=$(shell $(SCRIPT_DIR)/feeds list -n 2>/dev/null)
9 |
10 | PACKAGE_SUBDIRS=$(PACKAGE_DIR)
11 | ifneq ($(CONFIG_PER_FEED_REPO),)
12 |
13 |
--------------------------------------------------------------------------------
/devices/common/patches/fix.patch:
--------------------------------------------------------------------------------
1 | --- a/include/image.mk
2 | +++ b/include/image.mk
3 | @@ -300,6 +300,44 @@ ifdef CONFIG_TARGET_ROOTFS_TARGZ
4 | endef
5 | endif
6 |
7 | +define Device/Build/targz
8 | + $$(_TARGET): $(if $(CONFIG_JSON_OVERVIEW_IMAGE_INFO), \
9 | + $(BUILD_DIR)/json_info_files/$$(ROOTFSTZ).json, \
10 | + $(BIN_DIR)/$$(ROOTFSTZ))
11 | +
12 | + $(call Device/Export,$(BUILD_DIR)/json_info_files/$$(ROOTFSTZ).json,$(1))
13 | +
14 | + $(BUILD_DIR)/json_info_files/$$(ROOTFSTZ).json: $(BIN_DIR)/$$(ROOTFSTZ)
15 | + @mkdir -p $$(shell dirname $$@)
16 | + DEVICE_ID="$(1)" \
17 | + SOURCE_DATE_EPOCH=$(SOURCE_DATE_EPOCH) \
18 | + FILE_NAME="$$(notdir $$^)" \
19 | + FILE_DIR="$(BIN_DIR)" \
20 | + FILE_TYPE="rootfs" \
21 | + FILE_FILESYSTEM="rootfs" \
22 | + DEVICE_IMG_PREFIX="$$(DEVICE_IMG_PREFIX)" \
23 | + DEVICE_VENDOR="$$(DEVICE_VENDOR)" \
24 | + DEVICE_MODEL="$$(DEVICE_MODEL)" \
25 | + DEVICE_VARIANT="$$(DEVICE_VARIANT)" \
26 | + DEVICE_ALT0_VENDOR="$$(DEVICE_ALT0_VENDOR)" \
27 | + DEVICE_ALT0_MODEL="$$(DEVICE_ALT0_MODEL)" \
28 | + DEVICE_ALT0_VARIANT="$$(DEVICE_ALT0_VARIANT)" \
29 | + DEVICE_ALT1_VENDOR="$$(DEVICE_ALT1_VENDOR)" \
30 | + DEVICE_ALT1_MODEL="$$(DEVICE_ALT1_MODEL)" \
31 | + DEVICE_ALT1_VARIANT="$$(DEVICE_ALT1_VARIANT)" \
32 | + DEVICE_ALT2_VENDOR="$$(DEVICE_ALT2_VENDOR)" \
33 | + DEVICE_ALT2_MODEL="$$(DEVICE_ALT2_MODEL)" \
34 | + DEVICE_ALT2_VARIANT="$$(DEVICE_ALT2_VARIANT)" \
35 | + DEVICE_TITLE="$$(DEVICE_TITLE)" \
36 | + DEVICE_PACKAGES="$$(DEVICE_PACKAGES)" \
37 | + TARGET="$(BOARD)" \
38 | + SUBTARGET="$(if $(SUBTARGET),$(SUBTARGET),generic)" \
39 | + VERSION_NUMBER="$(VERSION_NUMBER)" \
40 | + VERSION_CODE="$(VERSION_CODE)" \
41 | + SUPPORTED_DEVICES="$$(SUPPORTED_DEVICES)" \
42 | + $(TOPDIR)/scripts/json_add_image_info.py $$@
43 | +endef
44 | +
45 | ifdef CONFIG_TARGET_ROOTFS_CPIOGZ
46 | define Image/Build/cpiogz
47 | ( cd $(TARGET_DIR); find . | $(STAGING_DIR_HOST)/bin/cpio -o -H newc -R 0:0 | gzip -9n >$(BIN_DIR)/$(IMG_ROOTFS).cpio.gz )
48 | @@ -367,6 +405,7 @@ define Device/Init
49 | DEVICE_IMG_PREFIX := $(IMG_PREFIX)-$(1)
50 | DEVICE_IMG_NAME = $$(DEVICE_IMG_PREFIX)-$$(1)-$$(2)
51 | IMAGE_SIZE :=
52 | + ROOTFSTZ = $$(DEVICE_IMG_PREFIX)-rootfs.tar.gz
53 | KERNEL_PREFIX = $$(DEVICE_IMG_PREFIX)
54 | KERNEL_SUFFIX := -kernel.bin
55 | KERNEL_INITRAMFS_SUFFIX = $$(KERNEL_SUFFIX)
56 | @@ -568,7 +607,7 @@ define Device/Build/kernel
57 | endef
58 |
59 | define Device/Build/image
60 | - GZ_SUFFIX := $(if $(filter %dtb %gz,$(2)),,$(if $(and $(findstring ext4,$(1)),$(CONFIG_TARGET_IMAGES_GZIP)),.gz))
61 | + GZ_SUFFIX := $(if $(filter %dtb %gz,$(2)),,$(if $(and $(findstring ext4,$(1)),$(findstring img,$(2)),$(CONFIG_TARGET_IMAGES_GZIP)),.gz))
62 | $$(_TARGET): $(if $(CONFIG_JSON_OVERVIEW_IMAGE_INFO), \
63 | $(BUILD_DIR)/json_info_files/$(call DEVICE_IMG_NAME,$(1),$(2)).json, \
64 | $(BIN_DIR)/$(call DEVICE_IMG_NAME,$(1),$(2))$$(GZ_SUFFIX))
65 | @@ -606,6 +645,7 @@ define Device/Build/image
66 | FILE_TYPE=$(word 1,$(subst ., ,$(2))) \
67 | FILE_FILESYSTEM="$(1)" \
68 | DEVICE_IMG_PREFIX="$(DEVICE_IMG_PREFIX)" \
69 | + KERNEL_INITRAMFS_IMAGE="$(subst $(IMG_PREFIX_EXTRA),,$(KERNEL_INITRAMFS_IMAGE))" \
70 | DEVICE_VENDOR="$(DEVICE_VENDOR)" \
71 | DEVICE_MODEL="$(DEVICE_MODEL)" \
72 | DEVICE_VARIANT="$(DEVICE_VARIANT)" \
73 | @@ -678,6 +718,8 @@ define Device/Build
74 | $(if $(CONFIG_TARGET_ROOTFS_INITRAMFS),$(call Device/Build/initramfs,$(1)))
75 | $(call Device/Build/kernel,$(1))
76 |
77 | + $(if $(CONFIG_TARGET_ROOTFS_TARGZ),$(call Device/Build/targz,$(PROFILE_SANITIZED)))
78 | +
79 | $$(eval $$(foreach compile,$$(COMPILE), \
80 | $$(call Device/Build/compile,$$(compile),$(1))))
81 |
82 |
83 | --- a/scripts/json_overview_image_info.py
84 | +++ b/scripts/json_overview_image_info.py
85 | @@ -47,7 +47,7 @@ def get_initial_output(image_info):
86 |
87 |
88 | if output:
89 | - default_packages, output["arch_packages"] = run(
90 | + default_packages, output["arch_packages"], output["kernel_version"] = run(
91 | [
92 | "make",
93 | "--no-print-directory",
94 | @@ -55,6 +55,7 @@ def get_initial_output(image_info):
95 | "target/linux/",
96 | "val.DEFAULT_PACKAGES",
97 | "val.ARCH_PACKAGES",
98 | + "val.LINUX_VERSION",
99 | ],
100 | stdout=PIPE,
101 | stderr=PIPE,
102 |
103 | --- a/scripts/json_add_image_info.py
104 | +++ b/scripts/json_add_image_info.py
105 | @@ -55,6 +55,7 @@ def get_titles():
106 | "profiles": {
107 | device_id: {
108 | "image_prefix": getenv("DEVICE_IMG_PREFIX"),
109 | + "image_initramfs": getenv("KERNEL_INITRAMFS_IMAGE"),
110 | "images": [
111 | {
112 | "type": getenv("FILE_TYPE"),
113 |
--------------------------------------------------------------------------------
/devices/common/patches/imagebuilder.patch:
--------------------------------------------------------------------------------
1 | --- a/target/imagebuilder/Makefile
2 | +++ b/target/imagebuilder/Makefile
3 | @@ -38,13 +38,16 @@ $(BIN_DIR)/$(IB_NAME).tar.xz: clean
4 | ./files/repositories.conf \
5 | $(TMP_DIR)/.targetinfo \
6 | $(TMP_DIR)/.packageinfo \
7 | - $(PKG_BUILD_DIR)/
8 | + $(TOPDIR)/files \
9 | + $(PKG_BUILD_DIR)/ || true
10 |
11 | -ifeq ($(CONFIG_IB_STANDALONE),)
12 | echo '## Remote package repositories' >> $(PKG_BUILD_DIR)/repositories.conf
13 | $(call FeedSourcesAppend,$(PKG_BUILD_DIR)/repositories.conf)
14 | $(VERSION_SED_SCRIPT) $(PKG_BUILD_DIR)/repositories.conf
15 | -endif
16 | + $(SED) 's/^src\/gz \(.*\) https.*ai\/\(.*packages.*\)/src \1 file:\/\/www\/wwwroot\/op.supes.top\/\2/' $(PKG_BUILD_DIR)/repositories.conf
17 | + $(SED) 's/^src\/gz \(.*\) https.*ai\/\(.*targets.*\)/src \1 file:\/\/www\/wwwroot\/op.supes.top\/\2/' $(PKG_BUILD_DIR)/repositories.conf
18 | + $(SED) 's/\/kiddin9//' $(PKG_BUILD_DIR)/repositories.conf
19 | + $(SED) '/openwrt_core/d' $(PKG_BUILD_DIR)/repositories.conf
20 |
21 | $(INSTALL_DIR) $(PKG_BUILD_DIR)/packages
22 | # create an empty package index so `opkg` doesn't report an error
23 |
24 | --- a/target/imagebuilder/files/Makefile
25 | +++ b/target/imagebuilder/files/Makefile
26 | @@ -135,17 +135,32 @@ BUILD_PACKAGES:=$(filter-out $(filter -%,$(BUILD_PACKAGES)) $(patsubst -%,%,$(fi
27 | PACKAGES:=
28 |
29 | _call_image: staging_dir/host/.prereq-build
30 | + [ "$(DATE)" ] && DATE="$(DATE)" || DATE="`date +'%m.%d.%Y'`"; \
31 | + mkdir -p $(USER_FILES)/etc/uci-defaults || true; \
32 | + echo -e " \
33 | + sed -i \"s/[0-9]\+.[0-9]\+.[0-9]\{4\}/$$DATE/\" /etc/openwrt_release \n \
34 | + sed -i \"s/DISTRIB_ID=.*/DISTRIB_ID='$(ROOTFS_PARTSIZE)'/\" /etc/openwrt_release \n \
35 | + sed -i \"s/OpenWrt .* by/OpenWrt $$DATE by/\" /etc/banner \n \
36 | + echo \"$$DATE\" >/etc/openwrt_version \n \
37 | + "> $(USER_FILES)/etc/uci-defaults/99-version; \
38 | echo 'Building images for $(BOARD)$(if $($(USER_PROFILE)_NAME), - $($(USER_PROFILE)_NAME))'
39 | echo 'Packages: $(BUILD_PACKAGES)'
40 | echo
41 | rm -rf $(TARGET_DIR) $(TARGET_DIR_ORIG)
42 | mkdir -p $(TARGET_DIR) $(BIN_DIR) $(TMP_DIR) $(DL_DIR)
43 | + if [[ "$(USER_PROFILE)" =~ (DEVICE_phicomm_k2p|DEVICE_asus_rt-n56u-b1|DEVICE_thunder_timecloud|DEVICE_youku_yk-l2|DEVICE_youhua_wr1200js|DEVICE_oraybox_x3a|DEVICE_netgear_wndr3700-v5|DEVICE_xiaomi_mi-router-4a-gigabit|DEVICE_xiaomi_mi-router-4a-gigabit-v2|DEVICE_xiaomi_mi-router-3g-v2|DEVICE_jcg_y2|DEVICE_glinet_gl-mt300a|DEVICE_glinet_gl-mt750|DEVICE_hiwifi_hc5661|DEVICE_hiwifi_hc5761|DEVICE_hiwifi_hc5861|DEVICE_lenovo_newifi-y1|DEVICE_lenovo_newifi-y1s|DEVICE_xiaomi_miwifi-mini|DEVICE_youku_yk-l1c|DEVICE_jdcloud_luban|DEVICE_zte_e8820v2) || "$(TARGETID)" == "ramips/mt76x8" ]]; then \
44 | + echo "src/gz openwrt_smflash https://dl.openwrt.ai/packages/small_flash" >>$(TOPDIR)/repositories.conf; \
45 | + else \
46 | + sed -i "/smflash/d" $(TOPDIR)/repositories.conf; \
47 | + fi
48 | $(MAKE) package_reload
49 | $(MAKE) package_install
50 | $(MAKE) -s prepare_rootfs
51 | $(MAKE) -s build_image
52 | $(MAKE) -s json_overview_image_info
53 | $(MAKE) -s checksum
54 | + rm -rf $(KERNEL_BUILD_DIR)/tmp
55 | + rm -rf $(KERNEL_BUILD_DIR)/root.*
56 |
57 | _call_manifest: FORCE
58 | rm -rf $(TARGET_DIR)
59 | @@ -186,7 +201,17 @@ package_install: FORCE
60 | @echo Installing packages...
61 | $(OPKG) install $(firstword $(wildcard $(LINUX_DIR)/libc_*.ipk $(PACKAGE_DIR)/libc_*.ipk))
62 | $(OPKG) install $(firstword $(wildcard $(LINUX_DIR)/kernel_*.ipk $(PACKAGE_DIR)/kernel_*.ipk))
63 | - $(OPKG) install $(BUILD_PACKAGES)
64 | + for p in $(BUILD_PACKAGES); do \
65 | + if [[ $$p == luci-app-* && "`$(OPKG) list | grep luci-i18n-\`echo $$p | cut -d - -f 3-\`-zh-cn`" ]]; then \
66 | + packages+="luci-i18n-`echo $$p | cut -d - -f 3-`-zh-cn "; \
67 | + fi \
68 | + done; \
69 | + if [[ "`echo "$(BUILD_PACKAGES)" | grep "usb"`" ]]; then \
70 | + packages+="automount "; \
71 | + fi; \
72 | + $(OPKG) install --force-overwrite --force-checksum --force-depends $(BUILD_PACKAGES) luci-i18n-base-zh-cn luci-i18n-base-en; \
73 | + $(OPKG) install $$packages || true
74 | + $(OPKG) install --force-overwrite --force-checksum --force-depends --force-maintainer --force-reinstall my-default-settings
75 |
76 | prepare_rootfs: FORCE
77 | @echo
78 | @@ -200,12 +225,15 @@ prepare_rootfs: FORCE
79 | ) \
80 | )
81 | $(call prepare_rootfs,$(TARGET_DIR),$(USER_FILES),$(DISABLED_SERVICES))
82 | + if [[ "$(USER_PROFILE)" =~ (DEVICE_phicomm_k2p|DEVICE_asus_rt-n56u-b1|DEVICE_thunder_timecloud|DEVICE_youku_yk-l2|DEVICE_youhua_wr1200js|DEVICE_oraybox_x3a|DEVICE_netgear_wndr3700-v5|DEVICE_xiaomi_mi-router-4a-gigabit|DEVICE_xiaomi_mi-router-3g-v2|DEVICE_jcg_y2|DEVICE_glinet_gl-mt300a|DEVICE_glinet_gl-mt750|DEVICE_hiwifi_hc5661|DEVICE_hiwifi_hc5761|DEVICE_hiwifi_hc5861|DEVICE_lenovo_newifi-y1|DEVICE_lenovo_newifi-y1s|DEVICE_xiaomi_miwifi-mini|DEVICE_youku_yk-l1c|DEVICE_jdcloud_luban) || "$(TARGETID)" == "ramips/mt76x8" ]]; then \
83 | + echo "src/gz openwrt_smflash https://dl.openwrt.ai/packages/mipsel_24kc/small_flash" >>$(BUILD_DIR)/root-ramips/etc/opkg/distfeeds.conf; \
84 | + fi
85 |
86 | build_image: FORCE
87 | @echo
88 | @echo Building images...
89 | rm -rf $(BUILD_DIR)/json_info_files/
90 | - $(NO_TRACE_MAKE) -C target/linux/$(BOARD)/image install TARGET_BUILD=1 IB=1 EXTRA_IMAGE_NAME="$(EXTRA_IMAGE_NAME)" \
91 | + nice -n 19 $(NO_TRACE_MAKE) -C target/linux/$(BOARD)/image install TARGET_BUILD=1 IB=1 EXTRA_IMAGE_NAME="$(EXTRA_IMAGE_NAME)" \
92 | $(if $(USER_PROFILE),PROFILE="$(USER_PROFILE)")
93 |
94 | $(BIN_DIR)/profiles.json: FORCE
--------------------------------------------------------------------------------
/devices/common/patches/iptables.patch:
--------------------------------------------------------------------------------
1 | --- a/package/network/utils/iptables/Makefile
2 | +++ b/package/network/utils/iptables/Makefile
3 | @@ -111,7 +111,6 @@ define Package/arptables-nft
4 | $(call Package/iptables/Default)
5 | DEPENDS:=+kmod-nft-arp +xtables-nft +kmod-arptables
6 | TITLE:=ARP firewall administration tool nft
7 | - PROVIDES:=arptables
8 | ALTERNATIVES:=\
9 | 300:/usr/sbin/arptables:/usr/sbin/xtables-nft-multi \
10 | 300:/usr/sbin/arptables-restore:/usr/sbin/xtables-nft-multi \
11 | @@ -122,7 +121,6 @@ define Package/ebtables-nft
12 | $(call Package/iptables/Default)
13 | DEPENDS:=+kmod-nft-bridge +xtables-nft +kmod-ebtables
14 | TITLE:=Bridge firewall administration tool nft
15 | - PROVIDES:=ebtables
16 | ALTERNATIVES:=\
17 | 300:/usr/sbin/ebtables:/usr/sbin/xtables-nft-multi \
18 | 300:/usr/sbin/ebtables-restore:/usr/sbin/xtables-nft-multi \
19 | @@ -133,7 +131,6 @@ define Package/iptables-nft
20 | $(call Package/iptables/Default)
21 | TITLE:=IP firewall administration tool nft
22 | DEPENDS:=+kmod-ipt-core +xtables-nft
23 | - PROVIDES:=iptables
24 | ALTERNATIVES:=\
25 | 300:/usr/sbin/iptables:/usr/sbin/xtables-nft-multi \
26 | 300:/usr/sbin/iptables-restore:/usr/sbin/xtables-nft-multi \
27 | @@ -486,7 +483,6 @@ define Package/ip6tables-nft
28 | $(call Package/iptables/Default)
29 | DEPENDS:=@IPV6 +kmod-ip6tables +xtables-nft
30 | TITLE:=IP firewall administration tool nft
31 | - PROVIDES:=ip6tables
32 | ALTERNATIVES:=\
33 | 300:/usr/sbin/ip6tables:/usr/sbin/xtables-nft-multi \
34 | 300:/usr/sbin/ip6tables-restore:/usr/sbin/xtables-nft-multi \
--------------------------------------------------------------------------------
/devices/common/patches/kernel-defaults.patch:
--------------------------------------------------------------------------------
1 | --- a/include/kernel-defaults.mk
2 | +++ b/include/kernel-defaults.mk
3 | @@ -127,6 +127,7 @@ endef
4 |
5 | define Kernel/CompileModules/Default
6 | rm -f $(LINUX_DIR)/vmlinux $(LINUX_DIR)/System.map
7 | + +$(KERNEL_MAKE) olddefconfig
8 | +$(KERNEL_MAKE) $(if $(KERNELNAME),$(KERNELNAME),all) modules
9 | # If .config did not change, use the previous timestamp to avoid package rebuilds
10 | cmp -s $(LINUX_DIR)/.config $(LINUX_DIR)/.config.modules.save && \
11 |
--------------------------------------------------------------------------------
/devices/common/patches/luci_mk.patch:
--------------------------------------------------------------------------------
1 | --- a/feeds/luci/luci.mk
2 | +++ b/feeds/luci/luci.mk
3 | @@ -82,7 +82,7 @@ define findrev
4 | set -- $$(git log -1 --format="%ct %h" --abbrev=7 -- $(if $(1),. ':(exclude)po',po)); \
5 | if [ -n "$$1" ]; then
6 | secs="$$(($$1 % 86400))"; \
7 | - yday="$$(date --utc --date="@$$1" "+%y.%j")"; \
8 | + yday="$$(date --utc --date="@$$(($$1 + 365*24*60*60))" "+%y.%j")"; \
9 | printf 'git-%s.%05d-%s' "$$yday" "$$secs" "$$2"; \
10 | else \
11 | echo "unknown"; \
12 | @@ -207,9 +207,20 @@ define Package/$(PKG_NAME)/install
13 | $(call Build/Install/Default)
14 | $(CP) $(PKG_INSTALL_DIR)/* $(1)/
15 | endif
16 | + ifneq ($(wildcard ${CURDIR}/po),)
17 | + $(INSTALL_DIR) $(1)/etc/uci-defaults
18 | + echo "uci set luci.languages.zh_cn='$(LUCI_LANG.zh_Hans)'; uci commit luci" \
19 | + > $(1)/etc/uci-defaults/luci-i18n-$(LUCI_BASENAME)-zh-cn
20 | + $(INSTALL_DIR) $(1)$(LUCI_LIBRARYDIR)/i18n
21 | + $(foreach po,$(wildcard ${CURDIR}/po/zh_Hans/*.po), \
22 | + po2lmo $(po) \
23 | + $(1)$(LUCI_LIBRARYDIR)/i18n/$(basename $(notdir $(po))).zh-cn.lmo;)
24 | + endif
25 | +
26 | endef
27 |
28 | ifndef Package/$(PKG_NAME)/postinst
29 | +ifneq ($(wildcard ${CURDIR}/htdocs/luci-static/resources/view),)
30 | define Package/$(PKG_NAME)/postinst
31 | [ -n "$${IPKG_INSTROOT}" ] || { \
32 | rm -f /tmp/luci-indexcache.*
33 | @@ -218,6 +229,16 @@ define Package/$(PKG_NAME)/postinst
34 | exit 0
35 | }
36 | endef
37 | +else
38 | +define Package/$(PKG_NAME)/postinst
39 | +[ -n "$${IPKG_INSTROOT}" ] || {$(foreach script,$(LUCI_DEFAULTS),
40 | + (. /etc/uci-defaults/$(script)) && rm -f /etc/uci-defaults/$(script))
41 | + rm -f /tmp/luci-indexcache.*
42 | + rm -rf /tmp/luci-modulecache/
43 | + exit 0
44 | +}
45 | +endef
46 | +endif
47 | endif
48 |
49 | # some generic macros that can be used by all packages
50 | @@ -334,5 +355,5 @@ define LuciTranslation
51 |
52 | endef
53 |
54 | -$(foreach lang,$(LUCI_LANGUAGES),$(if $(LUCI_LANG.$(lang)),$(eval $(call LuciTranslation,$(firstword $(LUCI_LC_ALIAS.$(lang)) $(lang)),$(lang)))))
55 | +# $(foreach lang,$(LUCI_LANGUAGES),$(if $(LUCI_LANG.$(lang)),$(eval $(call LuciTranslation,$(firstword $(LUCI_LC_ALIAS.$(lang)) $(lang)),$(lang)))))
56 | $(foreach pkg,$(LUCI_BUILD_PACKAGES),$(eval $(call BuildPackage,$(pkg))))
57 |
--------------------------------------------------------------------------------
/devices/common/patches/mt7922.patch:
--------------------------------------------------------------------------------
1 | --- a/package/kernel/mt76/Makefile
2 | +++ b/package/kernel/mt76/Makefile
3 | @@ -262,6 +262,12 @@ define KernelPackage/mt7921-firmware
4 | TITLE:=MediaTek MT7921 firmware
5 | endef
6 |
7 | +define KernelPackage/mt7922-firmware
8 | + $(KernelPackage/mt76-default)
9 | + DEPENDS+=+kmod-mt7921-common
10 | + TITLE:=MediaTek MT7922 firmware
11 | +endef
12 | +
13 | define KernelPackage/mt792x-common
14 | $(KernelPackage/mt76-default)
15 | TITLE:=MediaTek MT792x wireless driver common code
16 | @@ -555,6 +561,14 @@ define KernelPackage/mt7921-firmware/install
17 | $(1)/lib/firmware/mediatek
18 | endef
19 |
20 | +define KernelPackage/mt7922-firmware/install
21 | + $(INSTALL_DIR) $(1)/lib/firmware/mediatek
22 | + cp \
23 | + $(PKG_BUILD_DIR)/firmware/WIFI_MT7922_patch_mcu_1_1_hdr.bin \
24 | + $(PKG_BUILD_DIR)/firmware/WIFI_RAM_CODE_MT7922_1.bin \
25 | + $(1)/lib/firmware/mediatek
26 | +endef
27 | +
28 | define Package/mt76-test/install
29 | mkdir -p $(1)/usr/sbin
30 | $(INSTALL_BIN) $(PKG_BUILD_DIR)/tools/mt76-test $(1)/usr/sbin
31 | @@ -588,6 +602,7 @@ $(eval $(call KernelPackage,mt7916-firmware))
32 | $(eval $(call KernelPackage,mt7981-firmware))
33 | $(eval $(call KernelPackage,mt7986-firmware))
34 | $(eval $(call KernelPackage,mt7921-firmware))
35 | +$(eval $(call KernelPackage,mt7922-firmware))
36 | $(eval $(call KernelPackage,mt792x-common))
37 | $(eval $(call KernelPackage,mt792x-usb))
38 | $(eval $(call KernelPackage,mt7921-common))
39 |
--------------------------------------------------------------------------------
/devices/common/patches/netfilter.patch.b:
--------------------------------------------------------------------------------
1 | --- a/package/kernel/linux/modules/netfilter.mk
2 | +++ b/package/kernel/linux/modules/netfilter.mk
3 | @@ -458,15 +458,100 @@
4 | $(eval $(call KernelPackage,ipt-nat))
5 |
6 | +define KernelPackage/ipt-cgroup
7 | + SUBMENU:=$(NF_MENU)
8 | + TITLE:=cgroup netfilter module
9 | + KCONFIG:=$(KCONFIG_IPT_CGROUP)
10 | + FILES:=$(LINUX_DIR)/net/netfilter/*cgroup*.$(LINUX_KMOD_SUFFIX)
11 | + AUTOLOAD:=$(call AutoLoad,$(notdir $(IPT_CGROUP-m)))
12 | + DEPENDS:= kmod-ipt-core
13 | +endef
14 |
15 | +$(eval $(call KernelPackage,ipt-cgroup))
16 | +
17 | +define KernelPackage/ipt-cgroup/description
18 | + Kernel support for cgroup netfilter module
19 | + Include:
20 | + - cgroup
21 | +endef
22 | +
23 | define KernelPackage/ipt-raw
24 | TITLE:=Netfilter IPv4 raw table support
25 | KCONFIG:=CONFIG_IP_NF_RAW
26 | FILES:=$(LINUX_DIR)/net/ipv4/netfilter/iptable_raw.ko
27 | AUTOLOAD:=$(call AutoProbe,iptable_raw)
28 | $(call AddDepends/ipt)
29 | endef
30 |
31 | $(eval $(call KernelPackage,ipt-raw))
32 | +
33 | +
34 | +define KernelPackage/ipt-imq
35 | + TITLE:=Intermediate Queueing support
36 | + KCONFIG:= \
37 | + CONFIG_IMQ \
38 | + CONFIG_IMQ_BEHAVIOR_BA=y \
39 | + CONFIG_IMQ_NUM_DEVS=2 \
40 | + CONFIG_NETFILTER_XT_TARGET_IMQ
41 | + FILES:= \
42 | + $(LINUX_DIR)/drivers/net/imq.$(LINUX_KMOD_SUFFIX) \
43 | + $(foreach mod,$(IPT_IMQ-m),$(LINUX_DIR)/net/$(mod).$(LINUX_KMOD_SUFFIX))
44 | + AUTOLOAD:=$(call AutoProbe,$(notdir imq $(IPT_IMQ-m)))
45 | + $(call AddDepends/ipt)
46 | +endef
47 | +
48 | +define KernelPackage/ipt-imq/description
49 | + Kernel support for Intermediate Queueing devices
50 | +endef
51 | +
52 | +$(eval $(call KernelPackage,ipt-imq))
53 | +
54 | +
55 | +define KernelPackage/ipt-bandwidth
56 | + SUBMENU:=$(NF_MENU)
57 | + TITLE:=bandwidth
58 | + KCONFIG:=$(KCONFIG_IPT_BANDWIDTH)
59 | + FILES:=$(LINUX_DIR)/net/ipv4/netfilter/*bandwidth*.$(LINUX_KMOD_SUFFIX)
60 | + AUTOLOAD:=$(call AutoLoad,$(notdir $(IPT_BANDWIDTH-m)))
61 | + DEPENDS:=@!LINUX_5_4 kmod-ipt-core
62 | +endef
63 | +
64 | +$(eval $(call KernelPackage,ipt-bandwidth))
65 | +
66 | +
67 | +define KernelPackage/ipt-timerange
68 | + SUBMENU:=$(NF_MENU)
69 | + TITLE:=timerange
70 | + KCONFIG:=$(KCONFIG_IPT_TIMERANGE)
71 | + FILES:=$(LINUX_DIR)/net/ipv4/netfilter/*timerange*.$(LINUX_KMOD_SUFFIX)
72 | + AUTOLOAD:=$(call AutoLoad,$(notdir $(IPT_TIMERANGE-m)))
73 | + DEPENDS:=@!LINUX_5_4 kmod-ipt-core
74 | +endef
75 | +
76 | +$(eval $(call KernelPackage,ipt-timerange))
77 | +
78 | +
79 | +define KernelPackage/ipt-webmon
80 | + SUBMENU:=$(NF_MENU)
81 | + TITLE:=webmon
82 | + KCONFIG:=$(KCONFIG_IPT_WEBMON)
83 | + FILES:=$(LINUX_DIR)/net/ipv4/netfilter/*webmon*.$(LINUX_KMOD_SUFFIX)
84 | + AUTOLOAD:=$(call AutoLoad,$(notdir $(IPT_WEBMON-m)))
85 | + DEPENDS:=@!LINUX_5_4 kmod-ipt-core
86 | +endef
87 | +
88 | +$(eval $(call KernelPackage,ipt-webmon))
89 | +
90 | +
91 | +define KernelPackage/ipt-weburl
92 | + SUBMENU:=$(NF_MENU)
93 | + TITLE:=weburl
94 | + KCONFIG:=$(KCONFIG_IPT_WEBURL)
95 | + FILES:=$(LINUX_DIR)/net/ipv4/netfilter/*weburl*.$(LINUX_KMOD_SUFFIX)
96 | + AUTOLOAD:=$(call AutoLoad,$(notdir $(IPT_WEBURL-m)))
97 | + DEPENDS:=@!LINUX_5_4 kmod-ipt-core
98 | +endef
99 | +
100 | +$(eval $(call KernelPackage,ipt-weburl))
101 |
102 |
103 | define KernelPackage/ipt-raw6
104 |
105 | --- a/include/netfilter.mk
106 | +++ b/include/netfilter.mk
107 | @@ -111,3 +111,14 @@
108 |
109 | +# imq
110 | +
111 | +$(eval $(call nf_add,IPT_IMQ,CONFIG_IP_NF_TARGET_IMQ, $(P_V4)ipt_IMQ))
112 | +$(eval $(call nf_add,IPT_IMQ,CONFIG_NETFILTER_XT_TARGET_IMQ, $(P_XT)xt_IMQ))
113 | +
114 | +# gargoyle-qos
115 | +
116 | +$(eval $(call nf_add,IPT_BANDWIDTH,CONFIG_IP_NF_MATCH_BANDWIDTH, $(P_V4)ipt_bandwidth))
117 | +$(eval $(call nf_add,IPT_TIMERANGE,CONFIG_IP_NF_MATCH_TIMERANGE, $(P_V4)ipt_timerange))
118 | +$(eval $(call nf_add,IPT_WEBMON,CONFIG_IP_NF_MATCH_WEBMON, $(P_V4)ipt_webmon))
119 | +$(eval $(call nf_add,IPT_WEBURL,CONFIG_IP_NF_MATCH_WEBURL, $(P_V4)ipt_weburl))
120 |
121 | # ipopt
122 | @@ -151,3 +162,6 @@
123 | $(eval $(call nf_add,IPT_FLOW,CONFIG_NETFILTER_XT_TARGET_FLOWOFFLOAD, $(P_XT)xt_FLOWOFFLOAD))
124 | +
125 | +# cgroup
126 | +$(eval $(call nf_add,IPT_CGROUP,CONFIG_NETFILTER_XT_MATCH_CGROUP, $(P_XT)xt_cgroup))
127 |
128 | # IPv6
129 |
130 | --- a/package/network/utils/iptables/Makefile
131 | +++ b/package/network/utils/iptables/Makefile
132 | @@ -170,3 +170,49 @@
133 | endef
134 |
135 | +define Package/iptables-mod-cgroup
136 | +$(call Package/iptables/Module, +kmod-ipt-cgroup)
137 | + TITLE:=cgroup extension
138 | + endef
139 | +
140 | +define Package/iptables-mod-cgroup/description
141 | +iptables extension for cgroup support.
142 | +
143 | + Matches:
144 | + - cgroup
145 | +
146 | +endef
147 | +
148 | +define Package/iptables-mod-imq
149 | +$(call Package/iptables/Module, +kmod-ipt-imq)
150 | + TITLE:=IMQ support
151 | +endef
152 | +
153 | +define Package/iptables-mod-imq/description
154 | +iptables extension for IMQ support.
155 | +
156 | + Targets:
157 | + - IMQ
158 | +
159 | +endef
160 | +
161 | +define Package/iptables-mod-bandwidth
162 | +$(call Package/iptables/Module, +kmod-ipt-bandwidth)
163 | + TITLE:=bandwidth option extensions
164 | +endef
165 | +
166 | +define Package/iptables-mod-timerange
167 | +$(call Package/iptables/Module, +kmod-ipt-timerange)
168 | + TITLE:=timerange option extensions
169 | +endef
170 | +
171 | +define Package/iptables-mod-webmon
172 | +$(call Package/iptables/Module, +kmod-ipt-webmon)
173 | + TITLE:=webmon option extensions
174 | +endef
175 | +
176 | +define Package/iptables-mod-weburl
177 | +$(call Package/iptables/Module, +kmod-ipt-weburl)
178 | + TITLE:=weburl option extensions
179 | +endef
180 | +
181 | define Package/iptables-mod-ipopt
182 | @@ -666,2 +712,8 @@
183 | $(eval $(call BuildPlugin,iptables-mod-filter,$(IPT_FILTER-m)))
184 | +$(eval $(call BuildPlugin,iptables-mod-cgroup,$(IPT_CGROUP-m)))
185 | +$(eval $(call BuildPlugin,iptables-mod-imq,$(IPT_IMQ-m)))
186 | +$(eval $(call BuildPlugin,iptables-mod-bandwidth,$(IPT_BANDWIDTH-m)))
187 | +$(eval $(call BuildPlugin,iptables-mod-timerange,$(IPT_TIMERANGE-m)))
188 | +$(eval $(call BuildPlugin,iptables-mod-webmon,$(IPT_WEBMON-m)))
189 | +$(eval $(call BuildPlugin,iptables-mod-weburl,$(IPT_WEBURL-m)))
190 | $(eval $(call BuildPlugin,iptables-mod-ipopt,$(IPT_IPOPT-m)))
191 |
192 |
--------------------------------------------------------------------------------
/devices/common/patches/nginx-fancyindex.patch.bak:
--------------------------------------------------------------------------------
1 | --- package/feeds/packages/nginx/Makefile
2 | +++ package/feeds/packages/nginx/Makefile
3 | @@ -28,6 +28,7 @@ PKG_CONFIG_DEPENDS := \
4 | CONFIG_NGINX_DAV \
5 | CONFIG_NGINX_FLV \
6 | CONFIG_NGINX_UBUS \
7 | + CONFIG_NGINX_FANCYINDEX \
8 | CONFIG_NGINX_STUB_STATUS \
9 | CONFIG_NGINX_HTTP_CHARSET \
10 | CONFIG_NGINX_HTTP_GZIP \
11 | @@ -242,6 +243,9 @@ ifneq ($(BUILD_VARIANT),all-module)
12 | ifeq ($(CONFIG_NGINX_UBUS),y)
13 | ADDITIONAL_MODULES += --add-module=$(PKG_BUILD_DIR)/nginx-ubus-module
14 | endif
15 | + ifeq ($(CONFIG_NGINX_FANCYINDEX),y)
16 | + ADDITIONAL_MODULES += --with-http_addition_module --add-module=$(PKG_BUILD_DIR)/nginx-fancyindex-module
17 | + endif
18 | ifeq ($(CONFIG_NGINX_HTTP_AUTH_REQUEST),y)
19 | ADDITIONAL_MODULES += --with-http_auth_request_module
20 | endif
21 | @@ -398,6 +402,7 @@ define Build/Prepare
22 | $(Prepare/nginx-ts)
23 | $(Prepare/nginx-dav-ext-module)
24 | $(Prepare/nginx-ubus-module)
25 | + $(Prepare/nginx-fancyindex-module)
26 | endef
27 |
28 |
29 | @@ -545,6 +550,22 @@ ifeq ($(CONFIG_NGINX_UBUS),y)
30 | endef
31 | endif
32 |
33 | +ifeq ($(CONFIG_NGINX_FANCYINDEX),y)
34 | + define Download/nginx-fancyindex-module
35 | + VERSION:=56934db14ccfb89d6cb452ea1b4c76225c89b8c1
36 | + SUBDIR:=nginx-fancyindex-module
37 | + FILE:=ngx-fancyindex-$$(VERSION).tar.xz
38 | + URL:=https://github.com/aperezdc/ngx-fancyindex.git
39 | + PROTO:=git
40 | + endef
41 | + $(eval $(call Download,nginx-fancyindex-module))
42 | +
43 | + define Prepare/nginx-fancyindex-module
44 | + $(eval $(Download/nginx-fancyindex-module))
45 | + xzcat $(DL_DIR)/$(FILE) | tar -C $(PKG_BUILD_DIR) $(TAR_OPTIONS)
46 | + endef
47 | +endif
48 | +
49 | # TODO: remove after a transition period (together with pkg nginx-util):
50 | # It is for smoothly substituting nginx and nginx-mod-luci-ssl (by nginx-ssl
51 | # respectively nginx-mod-luci). Add above commented PROVIDES when removing.
52 |
53 | --- package/feeds/packages/nginx/Config_ssl.in
54 | +++ package/feeds/packages/nginx/Config_ssl.in
55 | @@ -36,6 +36,13 @@ config NGINX_STUB_STATUS
56 | Enable the stub status module which gives some status from the server.
57 | default n
58 |
59 | +config NGINX_FANCYINDEX
60 | + bool
61 | + prompt "Enable FANCYINDEX module"
62 | + help
63 | + Enable FANCYINDEX module.
64 | + default y
65 | +
66 | config NGINX_HTTP_CHARSET
67 | bool
68 | prompt "Enable HTTP charset module"
69 |
--------------------------------------------------------------------------------
/devices/common/patches/package.patch:
--------------------------------------------------------------------------------
1 | --- a/include/package.mk
2 | +++ b/include/package.mk
3 | @@ -354,3 +354,11 @@ dist:
4 |
5 | distcheck:
6 | $(Build/DistCheck)
7 | +
8 | +ifndef Package/$(PKG_NAME)/conffiles
9 | +define Package/$(PKG_NAME)/conffiles
10 | +/etc/config/
11 | +/etc/$(PKG_NAME)/
12 | +endef
13 | +endif
14 | +
15 |
--------------------------------------------------------------------------------
/devices/common/patches/rootfs.patch:
--------------------------------------------------------------------------------
1 | --- a/include/rootfs.mk
2 | +++ b/include/rootfs.mk
3 | @@ -73,7 +73,6 @@ define prepare_rootfs
4 | ret=$$?; \
5 | if [ $$ret -ne 0 ]; then \
6 | echo "postinst script $$script has failed with exit code $$ret" >&2; \
7 | - exit 1; \
8 | fi; \
9 | done; \
10 | for script in ./etc/init.d/*; do \
11 |
--------------------------------------------------------------------------------
/devices/common/patches/targets.patch:
--------------------------------------------------------------------------------
1 | --- a/include/target.mk
2 | +++ b/include/target.mk
3 | @@ -53,10 +53,10 @@ DEFAULT_PACKAGES.nas:=\
4 | mdadm
5 | # For router targets
6 | DEFAULT_PACKAGES.router:=\
7 | - dnsmasq \
8 | - firewall4 \
9 | - nftables \
10 | - kmod-nft-offload \
11 | + dnsmasq-full \
12 | + firewall \
13 | + kmod-ipt-nat \
14 | + kmod-ipt-nat6 \
15 | odhcp6c \
16 | odhcpd-ipv6only \
17 | ppp \
18 | @@ -93,6 +93,18 @@ else
19 | endif
20 | endif
21 |
22 | +ifneq ($(CONFIG_SMALL_FLASH),)
23 | +DEFAULT_PACKAGES+=-coremark -htop -bash -openssh-sftp-server
24 | +endif
25 | +
26 | +ifeq ($(ARCH),arm)
27 | +DEFAULT_PACKAGES+=luci-app-cpufreq
28 | +endif
29 | +
30 | +ifeq ($(ARCH),aarch64)
31 | +DEFAULT_PACKAGES+=luci-app-cpufreq
32 | +endif
33 | +
34 | # Add device specific packages (here below to allow device type set from subtarget)
35 | DEFAULT_PACKAGES += $(DEFAULT_PACKAGES.$(DEVICE_TYPE))
36 |
37 |
--------------------------------------------------------------------------------
/devices/common/patches/use_json_object_new_int64.patch.b:
--------------------------------------------------------------------------------
1 | --- a/package/feeds/luci/luci-lib-jsonc/src/jsonc.c
2 | +++ b/package/feeds/luci/luci-lib-jsonc/src/jsonc.c
3 | @@ -366,9 +366,7 @@
4 | case LUA_TNUMBER:
5 | nd = lua_tonumber(L, index);
6 | - ni = lua_tointeger(L, index);
7 | -
8 | - if (nd == ni)
9 | - return json_object_new_int(nd);
10 | -
11 | + if(nd >= INT64_MIN && nd <= INT64_MAX)
12 | + return json_object_new_int64(nd);
13 | + else
14 | return json_object_new_double(nd);
15 |
16 |
--------------------------------------------------------------------------------
/devices/common/settings.ini:
--------------------------------------------------------------------------------
1 | REPO_URL="https://github.com/openwrt/openwrt"
2 | REPO_BRANCH=""
3 | CONFIG_FILE=".config"
4 | DIY_SH="diy.sh"
5 | FREE_UP_DISK="false"
6 | UPLOAD_BIN_DIR_FOR_ARTIFACT="false"
7 | UPLOAD_FIRMWARE_FOR_ARTIFACT="true"
8 | UPLOAD_FIRMWARE_FOR_RELEASE="false"
9 | UPLOAD_FIRMWARE_TO_COWTRANSFER="false"
10 | UPLOAD_FIRMWARE_TO_WETRANSFER="true"
11 |
--------------------------------------------------------------------------------
/devices/ipq40xx_generic/.config:
--------------------------------------------------------------------------------
1 |
2 | CONFIG_TARGET_ipq40xx=y
3 | CONFIG_TARGET_ipq40xx_generic=y
4 | CONFIG_TARGET_MULTI_PROFILE=y
5 | CONFIG_TARGET_DEVICE_ipq40xx_generic_DEVICE_asus_rt-ac42u=y
6 | CONFIG_TARGET_DEVICE_ipq40xx_generic_DEVICE_asus_rt-ac58u=y
7 | CONFIG_TARGET_DEVICE_ipq40xx_generic_DEVICE_p2w_r619ac-128m=y
8 | CONFIG_TARGET_DEVICE_ipq40xx_generic_DEVICE_p2w_r619ac-64m=y
9 | CONFIG_TARGET_DEVICE_ipq40xx_generic_DEVICE_zte_mf286d=y
10 | CONFIG_TARGET_DEVICE_ipq40xx_generic_DEVICE_glinet_gl-b1300=y
11 | CONFIG_TARGET_DEVICE_ipq40xx_generic_DEVICE_glinet_gl-a1300=y
12 | CONFIG_TARGET_DEVICE_ipq40xx_generic_DEVICE_glinet_gl-s1300-emmc=y
13 | CONFIG_TARGET_DEVICE_ipq40xx_generic_DEVICE_linksys_ea6350v3=y
14 | CONFIG_TARGET_DEVICE_ipq40xx_generic_DEVICE_glinet_gl-ap1300=y
15 | CONFIG_TARGET_DEVICE_ipq40xx_generic_DEVICE_linksys_ea8300=y
16 | CONFIG_TARGET_DEVICE_ipq40xx_generic_DEVICE_linksys_mr8300=y
17 | CONFIG_TARGET_DEVICE_ipq40xx_generic_DEVICE_mobipromo_cm520-79f=y
18 | CONFIG_TARGET_DEVICE_ipq40xx_generic_DEVICE_zte_mf289f=y
19 |
20 | CONFIG_PACKAGE_luci-ssl=y # uhttpd服务
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/devices/ipq40xx_generic/diy.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | shopt -s extglob
4 |
5 | SHELL_FOLDER=$(dirname $(readlink -f "$0"))
6 |
7 | #sh -c "curl -sfL https://patch-diff.githubusercontent.com/raw/openwrt/openwrt/pull/10778.patch | git apply -p1"
8 |
9 |
10 |
--------------------------------------------------------------------------------
/devices/ipq40xx_generic/patches/ACRH17.patch:
--------------------------------------------------------------------------------
1 | --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-rt-ac42u.dts
2 | +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-rt-ac42u.dts
3 | @@ -225,38 +225,13 @@
4 | #size-cells = <1>;
5 |
6 | partition@0 {
7 | - label = "SBL1";
8 | - reg = <0x00000000 0x00080000>;
9 | - read-only;
10 | - };
11 | - partition@80000 {
12 | - label = "MIBIB";
13 | - reg = <0x00080000 0x00080000>;
14 | - read-only;
15 | - };
16 | - partition@100000 {
17 | - label = "QSEE";
18 | - reg = <0x00100000 0x00100000>;
19 | - read-only;
20 | - };
21 | - partition@200000 {
22 | - label = "CDT";
23 | - reg = <0x00200000 0x00080000>;
24 | - read-only;
25 | - };
26 | - partition@280000 {
27 | - label = "APPSBL";
28 | - reg = <0x00280000 0x00140000>;
29 | - read-only;
30 | - };
31 | - partition@3C0000 {
32 | - label = "APPSBLENV";
33 | - reg = <0x003C0000 0x00040000>;
34 | + label = "Bootloader";
35 | + reg = <0x000000000000 0x000000400000>;
36 | read-only;
37 | };
38 | partition@400000 {
39 | - label = "ubi";
40 | - reg = <0x00400000 0x07C00000>;
41 | + label = "UBI_DEV";
42 | + reg = <0x000000400000 0x000007C00000>;
43 | };
44 | };
45 | };
--------------------------------------------------------------------------------
/devices/ipq40xx_generic/patches/cm520.patch:
--------------------------------------------------------------------------------
1 | --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-cm520-79f.dts
2 | +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-cm520-79f.dts
3 | @@ -9,6 +9,10 @@
4 | model = "MobiPromo CM520-79F";
5 | compatible = "mobipromo,cm520-79f";
6 |
7 | + chosen {
8 | + bootargs-append = " ubi.block=0,1 root=/dev/ubiblock0_1";
9 | + };
10 | +
11 | aliases {
12 | led-boot = &led_sys;
13 | led-failsafe = &led_sys;
14 | @@ -218,65 +222,8 @@
15 | #size-cells = <1>;
16 |
17 | partition@0 {
18 | - label = "SBL1";
19 | - reg = <0x0 0x100000>;
20 | - read-only;
21 | - };
22 | -
23 | - partition@100000 {
24 | - label = "MIBIB";
25 | - reg = <0x100000 0x100000>;
26 | - read-only;
27 | - };
28 | -
29 | - partition@200000 {
30 | - label = "BOOTCONFIG";
31 | - reg = <0x200000 0x100000>;
32 | - };
33 | -
34 | - partition@300000 {
35 | - label = "QSEE";
36 | - reg = <0x300000 0x100000>;
37 | - read-only;
38 | - };
39 | -
40 | - partition@400000 {
41 | - label = "QSEE_1";
42 | - reg = <0x400000 0x100000>;
43 | - read-only;
44 | - };
45 | -
46 | - partition@500000 {
47 | - label = "CDT";
48 | - reg = <0x500000 0x80000>;
49 | - read-only;
50 | - };
51 | -
52 | - partition@580000 {
53 | - label = "CDT_1";
54 | - reg = <0x580000 0x80000>;
55 | - read-only;
56 | - };
57 | -
58 | - partition@600000 {
59 | - label = "BOOTCONFIG1";
60 | - reg = <0x600000 0x80000>;
61 | - };
62 | -
63 | - partition@680000 {
64 | - label = "APPSBLENV";
65 | - reg = <0x680000 0x80000>;
66 | - };
67 | -
68 | - partition@700000 {
69 | - label = "APPSBL";
70 | - reg = <0x700000 0x200000>;
71 | - read-only;
72 | - };
73 | -
74 | - partition@900000 {
75 | - label = "APPSBL_1";
76 | - reg = <0x900000 0x200000>;
77 | + label = "Bootloader";
78 | + reg = <0x0 0xb00000>;
79 | read-only;
80 | };
81 |
82 | @@ -306,7 +253,7 @@
83 | };
84 |
85 | partition@b80000 {
86 | - label = "ubi";
87 | + label = "rootfs";
88 | reg = <0xb80000 0x7480000>;
89 | };
90 | };
--------------------------------------------------------------------------------
/devices/ipq40xx_generic/patches/target.patch:
--------------------------------------------------------------------------------
1 | --- a/target/linux/ipq40xx/image/generic.mk
2 | +++ b/target/linux/ipq40xx/image/generic.mk
3 | @@ -694,7 +694,7 @@ TARGET_DEVICES += meraki_mr33
4 | define Device/mobipromo_cm520-79f
5 | $(call Device/FitzImage)
6 | $(call Device/UbiFit)
7 | - DEVICE_VENDOR := MobiPromo
8 | + DEVICE_VENDOR := MobiPromo星际宝盒
9 | DEVICE_MODEL := CM520-79F
10 | SOC := qcom-ipq4019
11 | BLOCKSIZE := 128k
12 | @@ -834,7 +834,7 @@ TARGET_DEVICES += openmesh_a62
13 | define Device/p2w_r619ac
14 | $(call Device/FitzImage)
15 | $(call Device/UbiFit)
16 | - DEVICE_VENDOR := P&W
17 | + DEVICE_VENDOR := P&W竞斗云
18 | DEVICE_MODEL := R619AC
19 | SOC := qcom-ipq4019
20 | DEVICE_DTS_CONFIG := config@10
--------------------------------------------------------------------------------
/devices/ramips_mt7621/.config:
--------------------------------------------------------------------------------
1 |
2 | CONFIG_TARGET_ramips=y
3 | CONFIG_TARGET_ramips_mt7621=y
4 | CONFIG_TARGET_MULTI_PROFILE=y
5 | CONFIG_TARGET_ROOTFS_INITRAMFS=y
6 | CONFIG_TARGET_DEVICE_ramips_mt7621_DEVICE_xiaomi_mi-router-cr660x=y
7 | CONFIG_TARGET_DEVICE_ramips_mt7621_DEVICE_xiaomi_mi-router-3g=y
8 | CONFIG_TARGET_DEVICE_ramips_mt7621_DEVICE_xiaomi_mi-router-3-pro=y
9 | CONFIG_TARGET_DEVICE_ramips_mt7621_DEVICE_xiaomi_mi-router-4=y
10 | CONFIG_TARGET_DEVICE_ramips_mt7621_DEVICE_xiaomi_mi-router-4a-gigabit=y
11 | CONFIG_TARGET_DEVICE_ramips_mt7621_DEVICE_xiaomi_mi-router-4a-gigabit-v2=y
12 | CONFIG_TARGET_DEVICE_ramips_mt7621_DEVICE_xiaomi_redmi-router-ac2100=y
13 | CONFIG_TARGET_DEVICE_ramips_mt7621_DEVICE_xiaomi_mi-router-ac2100=y
14 | CONFIG_TARGET_DEVICE_ramips_mt7621_DEVICE_xiaoyu_xy-c5=y
15 | CONFIG_TARGET_DEVICE_ramips_mt7621_DEVICE_lenovo_newifi-d1=y
16 | CONFIG_TARGET_DEVICE_ramips_mt7621_DEVICE_d-team_newifi-d2=y
17 | CONFIG_TARGET_DEVICE_ramips_mt7621_DEVICE_jdcloud_re-sp-01b=y
18 | CONFIG_TARGET_DEVICE_ramips_mt7621_DEVICE_glinet_gl-mt1300=y
19 | CONFIG_TARGET_DEVICE_ramips_mt7621_DEVICE_phicomm_k2p=y
20 | CONFIG_TARGET_DEVICE_ramips_mt7621_DEVICE_phicomm_k2p-32m=y
21 | CONFIG_TARGET_DEVICE_ramips_mt7621_DEVICE_asus_rt-ac85p=y
22 | CONFIG_TARGET_DEVICE_ramips_mt7621_DEVICE_netgear_r6220=y
23 | CONFIG_TARGET_DEVICE_ramips_mt7621_DEVICE_netgear_r6260=y
24 | CONFIG_TARGET_DEVICE_ramips_mt7621_DEVICE_netgear_r6700-v2=y
25 | CONFIG_TARGET_DEVICE_ramips_mt7621_DEVICE_netgear_r6800=y
26 | CONFIG_TARGET_DEVICE_ramips_mt7621_DEVICE_netgear_r6850=y
27 | CONFIG_TARGET_DEVICE_ramips_mt7621_DEVICE_netgear_r6900-v2=y
28 | CONFIG_TARGET_DEVICE_ramips_mt7621_DEVICE_netgear_r7450=y
29 | CONFIG_TARGET_DEVICE_ramips_mt7621_DEVICE_netgear_wndr3700-v5=y
30 | CONFIG_TARGET_DEVICE_ramips_mt7621_DEVICE_oraybox_x3a=y
31 | CONFIG_TARGET_DEVICE_ramips_mt7621_DEVICE_thunder_timecloud=y
32 | CONFIG_TARGET_DEVICE_ramips_mt7621_DEVICE_ubnt_edgerouter-x-sfp=y
33 | CONFIG_TARGET_DEVICE_ramips_mt7621_DEVICE_ubnt_edgerouter-x=y
34 | CONFIG_TARGET_DEVICE_ramips_mt7621_DEVICE_xiaomi_mi-router-3g-v2=y
35 | CONFIG_TARGET_DEVICE_ramips_mt7621_DEVICE_youhua_wr1200js=y
36 | CONFIG_TARGET_DEVICE_ramips_mt7621_DEVICE_youku_yk-l2=y
37 | CONFIG_TARGET_DEVICE_ramips_mt7621_DEVICE_jcg_y2=y
38 | CONFIG_TARGET_DEVICE_ramips_mt7621_DEVICE_jcg_q20=y
39 | CONFIG_TARGET_DEVICE_ramips_mt7621_DEVICE_hiwifi_hc5962=y
40 | CONFIG_TARGET_DEVICE_ramips_mt7621_DEVICE_asus_rt-n56u-b1=y
41 | CONFIG_TARGET_DEVICE_ramips_mt7621_DEVICE_gehua_ghl-r-001=y
42 | CONFIG_TARGET_DEVICE_ramips_mt7621_DEVICE_raisecom_msg1500-x-00=y
43 | CONFIG_TARGET_DEVICE_ramips_mt7621_DEVICE_zte_e8820s=y
44 | CONFIG_TARGET_DEVICE_ramips_mt7621_DEVICE_zte_e8820v2=y
45 | CONFIG_TARGET_DEVICE_ramips_mt7621_DEVICE_linksys_ea7500-v2=y
46 | CONFIG_TARGET_DEVICE_ramips_mt7621_DEVICE_linksys_ea8100-v1=y
47 | CONFIG_TARGET_DEVICE_ramips_mt7621_DEVICE_linksys_ea8100-v2=y
48 | CONFIG_TARGET_DEVICE_ramips_mt7621_DEVICE_linksys_ea7300-v1=y
49 | CONFIG_TARGET_DEVICE_ramips_mt7621_DEVICE_linksys_ea7300-v2=y
50 | CONFIG_TARGET_DEVICE_ramips_mt7621_DEVICE_linksys_ea6350-v4=y
51 | CONFIG_TARGET_DEVICE_ramips_mt7621_DEVICE_linksys_e5600=y
52 | CONFIG_TARGET_DEVICE_ramips_mt7621_DEVICE_jdcloud_luban=y
53 | CONFIG_TARGET_DEVICE_ramips_mt7621_DEVICE_h3c_tx1800-plus=y
54 | CONFIG_TARGET_DEVICE_ramips_mt7621_DEVICE_h3c_tx1801-plus=y
55 | CONFIG_TARGET_DEVICE_ramips_mt7621_DEVICE_h3c_tx1806=y
56 | CONFIG_TARGET_DEVICE_ramips_mt7621_DEVICE_zbtlink_zbt-wg3526-32m=y
57 |
58 | CONFIG_PACKAGE_luci-ssl=y # uhttpd服务
59 |
--------------------------------------------------------------------------------
/devices/ramips_mt7621/diy.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | shopt -s extglob
4 |
5 | SHELL_FOLDER=$(dirname $(readlink -f "$0"))
6 |
7 |
8 | sed -i "s/DEVICE_MODEL := HC5962$/DEVICE_MODEL := HC5962 \/ B70/" target/linux/ramips/image/mt7621.mk
9 |
10 | sh -c "curl -sfL https://github.com/openwrt/openwrt/commit/2e6d19ee32399e37c7545aefc57d41541a406d55.patch | patch -d './' -p1 --forward" || true
11 |
--------------------------------------------------------------------------------
/devices/ramips_mt7621/patches/01-small_flash.patch:
--------------------------------------------------------------------------------
1 | From f4b61c1960aa885d7de2953a36d9efacbf6e5406 Mon Sep 17 00:00:00 2001
2 | From: kiddin9 <48883331+kiddin9@users.noreply.github.com>
3 | Date: Sat, 27 May 2023 03:53:49 +0800
4 | Subject: [PATCH] Update mt7621.mk
5 |
6 | Signed-off-by: kiddin9 <48883331+kiddin9@users.noreply.github.com>
7 | ---
8 | target/linux/ramips/image/mt7621.mk | 18 +++++++++---------
9 | 1 file changed, 9 insertions(+), 9 deletions(-)
10 |
11 | diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk
12 | index 2697f84bf7684..df8c7d233cf1e 100644
13 | --- a/target/linux/ramips/image/mt7621.mk
14 | +++ b/target/linux/ramips/image/mt7621.mk
15 | @@ -330,7 +330,7 @@ define Device/asus_rt-n56u-b1
16 | DEVICE_VARIANT := B1
17 | IMAGE_SIZE := 16064k
18 | DEVICE_PACKAGES := kmod-mt7603 kmod-mt76x2 kmod-usb3 \
19 | - kmod-usb-ledtrig-usbport -uboot-envtools
20 | + kmod-usb-ledtrig-usbport -uboot-envtools wpad-mini -wpad-basic-mbedtls -coremark -htop -bash -openssh-sftp-server
21 | endef
22 | TARGET_DEVICES += asus_rt-n56u-b1
23 |
24 | @@ -1327,7 +1327,7 @@ define Device/jcg_y2
25 | JCG_MAXSIZE := 16064k
26 | DEVICE_VENDOR := JCG
27 | DEVICE_MODEL := Y2
28 | - DEVICE_PACKAGES := kmod-mt7615-firmware kmod-usb3 -uboot-envtools
29 | + DEVICE_PACKAGES := kmod-mt7615-firmware kmod-usb3 -uboot-envtools wpad-mini -wpad-basic-mbedtls -coremark -htop -bash -openssh-sftp-server
30 | endef
31 | TARGET_DEVICES += jcg_y2
32 |
33 | @@ -1784,7 +1784,7 @@ define Device/netgear_wndr3700-v5
34 | SERCOMM_SWVER := 0x1054
35 | SERCOMM_PAD := 320k
36 | DEVICE_PACKAGES := kmod-mt7603 kmod-mt76x2 kmod-usb3 \
37 | - kmod-usb-ledtrig-usbport -uboot-envtools
38 | + kmod-usb-ledtrig-usbport -uboot-envtools wpad-mini -wpad-basic-mbedtls -coremark -htop -bash -openssh-sftp-server
39 | SUPPORTED_DEVICES += wndr3700v5
40 | endef
41 | TARGET_DEVICES += netgear_wndr3700-v5
42 | @@ -1812,7 +1812,7 @@ define Device/oraybox_x3a
43 | IMAGE_SIZE := 15360k
44 | DEVICE_VENDOR := OrayBox
45 | DEVICE_MODEL := X3A
46 | - DEVICE_PACKAGES := kmod-mt7615-firmware -uboot-envtools
47 | + DEVICE_PACKAGES := kmod-mt7615-firmware -uboot-envtools wpad-mini -wpad-basic-mbedtls -coremark -htop -bash -openssh-sftp-server
48 | endef
49 | TARGET_DEVICES += oraybox_x3a
50 |
51 | @@ -1824,7 +1824,7 @@ define Device/phicomm_k2p
52 | DEVICE_ALT0_VENDOR := Phicomm
53 | DEVICE_ALT0_MODEL := KE 2P
54 | SUPPORTED_DEVICES += k2p
55 | - DEVICE_PACKAGES := kmod-mt7615-firmware -uboot-envtools
56 | + DEVICE_PACKAGES := kmod-mt7615-firmware -uboot-envtools wpad-mini -wpad-basic-mbedtls -coremark -htop -bash -openssh-sftp-server
57 | endef
58 | TARGET_DEVICES += phicomm_k2p
59 |
60 | @@ -1988,7 +1988,7 @@ define Device/thunder_timecloud
61 | IMAGE_SIZE := 16064k
62 | DEVICE_VENDOR := Thunder
63 | DEVICE_MODEL := Timecloud
64 | - DEVICE_PACKAGES := kmod-usb3 -wpad-basic-mbedtls -uboot-envtools
65 | + DEVICE_PACKAGES := kmod-usb3 -wpad-basic-mbedtls -uboot-envtools -bash -openssh-sftp-server -coremark -htop
66 | SUPPORTED_DEVICES += timecloud
67 | endef
68 | TARGET_DEVICES += thunder_timecloud
69 | @@ -2445,11 +2445,11 @@ TARGET_DEVICES += xiaomi_mi-router-3g
70 | define Device/xiaomi_mi-router-3g-v2
71 | $(Device/dsa-migration)
72 | $(Device/uimage-lzma-loader)
73 | - IMAGE_SIZE := 14848k
74 | + IMAGE_SIZE := 16064k
75 | DEVICE_VENDOR := Xiaomi
76 | DEVICE_MODEL := Mi Router 3G
77 | DEVICE_VARIANT := v2
78 | - DEVICE_PACKAGES := kmod-mt7603 kmod-mt76x2 -uboot-envtools
79 | + DEVICE_PACKAGES := kmod-mt7603 kmod-mt76x2 -uboot-envtools wpad-mini -wpad-basic-mbedtls -coremark -htop -bash -openssh-sftp-server
80 | SUPPORTED_DEVICES += xiaomi,mir3g-v2
81 | endef
82 | TARGET_DEVICES += xiaomi_mi-router-3g-v2
83 | @@ -2479,23 +2479,23 @@ TARGET_DEVICES += xiaomi_mi-router-4
84 | define Device/xiaomi_mi-router-4a-gigabit
85 | $(Device/dsa-migration)
86 | $(Device/uimage-lzma-loader)
87 | - IMAGE_SIZE := 14848k
88 | + IMAGE_SIZE := 16064k
89 | DEVICE_VENDOR := Xiaomi
90 | DEVICE_MODEL := Mi Router 4A
91 | DEVICE_VARIANT := Gigabit Edition
92 | - DEVICE_PACKAGES := kmod-mt7603 kmod-mt76x2 -uboot-envtools
93 | + DEVICE_PACKAGES := kmod-mt7603 kmod-mt76x2 -uboot-envtools wpad-mini -wpad-basic-mbedtls -coremark -htop -bash -openssh-sftp-server
94 | endef
95 | TARGET_DEVICES += xiaomi_mi-router-4a-gigabit
96 |
97 | define Device/xiaomi_mi-router-4a-gigabit-v2
98 | $(Device/dsa-migration)
99 | $(Device/uimage-lzma-loader)
100 | - IMAGE_SIZE := 14784k
101 | + IMAGE_SIZE := 16064k
102 | DEVICE_VENDOR := Xiaomi
103 | DEVICE_MODEL := Mi Router 4A
104 | DEVICE_VARIANT := Gigabit Edition v2
105 | DEVICE_PACKAGES := kmod-mt7603 kmod-mt7615e kmod-mt7663-firmware-ap \
106 | - -uboot-envtools
107 | + -uboot-envtools wpad-mini -wpad-basic-mbedtls -coremark -htop -bash -openssh-sftp-server
108 | endef
109 | TARGET_DEVICES += xiaomi_mi-router-4a-gigabit-v2
110 |
111 | @@ -2570,7 +2570,7 @@ define Device/youhua_wr1200js
112 | DEVICE_VENDOR := YouHua
113 | DEVICE_MODEL := WR1200JS
114 | DEVICE_PACKAGES := kmod-mt7603 kmod-mt76x2 kmod-usb3 \
115 | - kmod-usb-ledtrig-usbport -uboot-envtools
116 | + kmod-usb-ledtrig-usbport -uboot-envtools wpad-mini -wpad-basic-mbedtls -coremark -htop -bash -openssh-sftp-server
117 | endef
118 | TARGET_DEVICES += youhua_wr1200js
119 |
120 | @@ -2580,7 +2580,7 @@ define Device/youku_yk-l2
121 | DEVICE_VENDOR := Youku
122 | DEVICE_MODEL := YK-L2
123 | DEVICE_PACKAGES := kmod-mt7603 kmod-mt76x2 kmod-usb3 \
124 | - kmod-usb-ledtrig-usbport -uboot-envtools
125 | + kmod-usb-ledtrig-usbport -uboot-envtools wpad-mini -wpad-basic-mbedtls -coremark -htop -bash -openssh-sftp-server
126 | UIMAGE_MAGIC := 0x12291000
127 | UIMAGE_NAME := 400000000000000000003000
128 | endef
--------------------------------------------------------------------------------
/devices/ramips_mt7621/patches/02-cr660x.patch:
--------------------------------------------------------------------------------
1 | --- a/target/linux/ramips/image/mt7621.mk
2 | +++ b/target/linux/ramips/image/mt7621.mk
3 | @@ -157,6 +157,65 @@ define Device/nand
4 | IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
5 | endef
6 |
7 | +define Device/phicomm_k2p-32m
8 | + IMAGE_SIZE := 32128k
9 | + DEVICE_VENDOR := Phicomm
10 | + DEVICE_MODEL := K2P
11 | + DEVICE_VARIANT := 32M
12 | + SUPPORTED_DEVICES += k2p-32M
13 | + DEVICE_PACKAGES := kmod-mt7615e kmod-mt7615-firmware
14 | +endef
15 | +TARGET_DEVICES += phicomm_k2p-32m
16 | +
17 | +define Device/jdcloud_re-sp-01b
18 | + $(Device/dsa-migration)
19 | + $(Device/uimage-lzma-loader)
20 | + IMAGE_SIZE := 32448k
21 | + DEVICE_VENDOR := JDCloud
22 | + DEVICE_MODEL := RE-SP-01B
23 | + DEVICE_PACKAGES := kmod-fs-ext4 kmod-mt7603 kmod-mt7615e kmod-mt7615-firmware kmod-sdhci-mt7620 kmod-usb3
24 | + endef
25 | + TARGET_DEVICES += jdcloud_re-sp-01b
26 | +
27 | +define Device/jdcloud_luban
28 | + $(Device/dsa-migration)
29 | + $(Device/uimage-lzma-loader)
30 | + IMAGE_SIZE := 15808k
31 | + DEVICE_VENDOR := JDCloud
32 | + DEVICE_MODEL := Luban 鲁班
33 | + DEVICE_PACKAGES += kmod-mt7915e uboot-envtools kmod-mmc kmod-sdhci kmod-sdhci-mt7620 kmod-fs-ext4 wpad-mini -wpad-basic-mbedtls -coremark -htop -bash -openssh-sftp-server
34 | +endef
35 | +TARGET_DEVICES += jdcloud_luban
36 | +
37 | +define Device/zte_e8820s
38 | + $(Device/dsa-migration)
39 | + $(Device/uimage-lzma-loader)
40 | + BLOCKSIZE := 128k
41 | + PAGESIZE := 2048
42 | + KERNEL_SIZE := 4096k
43 | + UBINIZE_OPTS := -E 5
44 | + IMAGE_SIZE := 130304k
45 | + IMAGES += factory.bin
46 | + IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
47 | + IMAGE/factory.bin := append-kernel | pad-to $$(KERNEL_SIZE) | append-ubi | \
48 | + check-size
49 | + DEVICE_VENDOR := ZTE
50 | + DEVICE_MODEL := E8820S
51 | + DEVICE_PACKAGES := kmod-mt7603 kmod-mt76x2 kmod-usb3 uboot-envtools
52 | +endef
53 | +TARGET_DEVICES += zte_e8820s
54 | +
55 | +define Device/zte_e8820v2
56 | + $(Device/dsa-migration)
57 | + $(Device/uimage-lzma-loader)
58 | + IMAGE_SIZE := 16064k
59 | + DEVICE_VENDOR := ZTE
60 | + DEVICE_MODEL := E8820V2
61 | + DEVICE_PACKAGES := kmod-mt7603 kmod-mt76x2 kmod-usb2 \
62 | + kmod-usb-ledtrig-usbport wpad-mini -wpad-basic-mbedtls -coremark -htop -bash -openssh-sftp-server
63 | +endef
64 | +TARGET_DEVICES += zte_e8820v2
65 | +
66 | define Device/adslr_g7
67 | $(Device/dsa-migration)
68 | IMAGE_SIZE := 16064k
69 | @@ -2427,7 +2486,6 @@ define Device/xiaomi_nand_separate
70 | $(Device/nand)
71 | $(Device/uimage-lzma-loader)
72 | DEVICE_VENDOR := Xiaomi
73 | - IMAGES += kernel1.bin rootfs0.bin
74 | IMAGE/kernel1.bin := append-kernel
75 | IMAGE/rootfs0.bin := append-ubi | check-size
76 | endef
77 | @@ -2511,30 +2569,14 @@ define Device/xiaomi_mi-router-cr660x
78 | $(Device/nand)
79 | $(Device/uimage-lzma-loader)
80 | DEVICE_VENDOR := Xiaomi
81 | + DEVICE_MODEL := Mi Router CR660X / TR60X
82 | IMAGE_SIZE := 128512k
83 | - IMAGES += firmware.bin
84 | - IMAGE/firmware.bin := append-kernel | pad-to $$(KERNEL_SIZE) | append-ubi | \
85 | + IMAGES += factory.bin
86 | + IMAGE/factory.bin := append-kernel | pad-to $$(KERNEL_SIZE) | append-ubi | \
87 | check-size
88 | DEVICE_PACKAGES += kmod-mt7915-firmware
89 | endef
90 | -
91 | -define Device/xiaomi_mi-router-cr6606
92 | - $(Device/xiaomi_mi-router-cr660x)
93 | - DEVICE_MODEL := Mi Router CR6606
94 | -endef
95 | -TARGET_DEVICES += xiaomi_mi-router-cr6606
96 | -
97 | -define Device/xiaomi_mi-router-cr6608
98 | - $(Device/xiaomi_mi-router-cr660x)
99 | - DEVICE_MODEL := Mi Router CR6608
100 | -endef
101 | -TARGET_DEVICES += xiaomi_mi-router-cr6608
102 | -
103 | -define Device/xiaomi_mi-router-cr6609
104 | - $(Device/xiaomi_mi-router-cr660x)
105 | - DEVICE_MODEL := Mi Router CR6609
106 | -endef
107 | -TARGET_DEVICES += xiaomi_mi-router-cr6609
108 | +TARGET_DEVICES += xiaomi_mi-router-cr660x
109 |
110 | define Device/xiaomi_redmi-router-ac2100
111 | $(Device/xiaomi_nand_separate)
112 |
113 | --- /dev/null
114 | +++ b/target/linux/ramips/dts/mt7621_xiaomi_mi-router-cr660x.dts
115 | @@ -0,0 +1,8 @@
116 | +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
117 | +
118 | +#include "mt7621_xiaomi_mi-router-cr660x.dtsi"
119 | +
120 | +/ {
121 | + compatible = "xiaomi,mi-router-cr660x", "mediatek,mt7621-soc";
122 | + model = "Xiaomi Mi Router CR6606 / CR6608 / CR6609";
123 | +};
124 |
125 | --- a/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds
126 | +++ b/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds
127 | @@ -131,9 +131,7 @@ tplink,tl-wpa8631p-v3)
128 | xiaomi,mi-router-ac2100)
129 | ucidef_set_led_netdev "wan-blue" "WAN (blue)" "blue:wan" "wan"
130 | ;;
131 | -xiaomi,mi-router-cr6606|\
132 | -xiaomi,mi-router-cr6608|\
133 | -xiaomi,mi-router-cr6609)
134 | +xiaomi,mi-router-cr660x)
135 | ucidef_set_led_netdev "internet" "Internet" "blue:net" "wan"
136 | ;;
137 | xiaomi,redmi-router-ac2100)
138 |
139 | --- a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network
140 | +++ b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network
141 | @@ -48,9 +48,7 @@ ramips_setup_interfaces()
142 | sim,simax1800t|\
143 | xiaomi,mi-router-3-pro|\
144 | xiaomi,mi-router-ac2100|\
145 | - xiaomi,mi-router-cr6606|\
146 | - xiaomi,mi-router-cr6608|\
147 | - xiaomi,mi-router-cr6609|\
148 | + xiaomi,mi-router-cr660x|\
149 | xiaomi,redmi-router-ac2100|\
150 | zyxel,wsm20)
151 | ucidef_set_interfaces_lan_wan "lan1 lan2 lan3" "wan"
152 | @@ -68,6 +66,7 @@ ramips_setup_interfaces()
153 | iptime,a3002mesh|\
154 | jcg,q20|\
155 | lenovo,newifi-d1|\
156 | + jdcloud,re-sp-01b|\
157 | mikrotik,routerboard-m33g|\
158 | mts,wg430223|\
159 | oraybox,x3a|\
160 |
161 | --- a/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh
162 | +++ b/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh
163 | @@ -109,9 +109,8 @@ platform_do_upgrade() {
164 | xiaomi,mi-router-3-pro|\
165 | xiaomi,mi-router-4|\
166 | xiaomi,mi-router-ac2100|\
167 | - xiaomi,mi-router-cr6606|\
168 | - xiaomi,mi-router-cr6608|\
169 | - xiaomi,mi-router-cr6609|\
170 | + xiaomi,mi-router-cr660x|\
171 | + zte,e8820s|\
172 | xiaomi,redmi-router-ac2100|\
173 | zyxel,nwa50ax|\
174 | zyxel,nwa55axe)
175 |
176 | --- a/package/boot/uboot-envtools/files/ramips
177 | +++ b/package/boot/uboot-envtools/files/ramips
178 | @@ -73,9 +73,7 @@ zyxel,nr7101)
179 | ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x1000" "0x80000"
180 | ;;
181 | bolt,arion|\
182 | -xiaomi,mi-router-cr6606|\
183 | -xiaomi,mi-router-cr6608|\
184 | -xiaomi,mi-router-cr6609)
185 | +xiaomi,mi-router-cr660x)
186 | ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x10000" "0x20000"
187 | ;;
188 | esac
189 |
190 | --- /dev/null
191 | +++ b/target/linux/ramips/dts/mt7621_jdcloud_re-sp-01b.dts
192 | @@ -0,0 +1,150 @@
193 | +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
194 | +
195 | +#include "mt7621.dtsi"
196 | +
197 | +#include
198 | +#include
199 | +
200 | +/ {
201 | + compatible = "jdcloud,re-sp-01b", "mediatek,mt7621-soc";
202 | + model = "JDCloud RE-SP-01B";
203 | +
204 | + aliases {
205 | + led-boot = &led_red;
206 | + led-failsafe = &led_red;
207 | + led-running = &led_green;
208 | + led-upgrade = &led_blue;
209 | + label-mac-device = &gmac0;
210 | + };
211 | +
212 | + chosen {
213 | + bootargs = "console=ttyS0,115200";
214 | + };
215 | +
216 | + keys {
217 | + compatible = "gpio-keys";
218 | +
219 | + reset {
220 | + label = "reset";
221 | + gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
222 | + linux,code = ;
223 | + };
224 | + };
225 | +
226 | + leds {
227 | + compatible = "gpio-leds";
228 | +
229 | + led_red: red {
230 | + label = "red:sys";
231 | + gpios = <&gpio 6 GPIO_ACTIVE_LOW>;
232 | + panic-indicator;
233 | + };
234 | +
235 | + led_green: green {
236 | + label = "green:sys";
237 | + gpios = <&gpio 8 GPIO_ACTIVE_LOW>;
238 | + };
239 | +
240 | + led_blue: blue {
241 | + label = "blue:sys";
242 | + gpios = <&gpio 12 GPIO_ACTIVE_LOW>;
243 | + };
244 | + };
245 | +};
246 | +
247 | +&sdhci {
248 | + status = "okay";
249 | +};
250 | +
251 | +&spi0 {
252 | + status = "okay";
253 | +
254 | + flash@0 {
255 | + compatible = "jedec,spi-nor";
256 | + reg = <0>;
257 | + spi-max-frequency = <50000000>;
258 | +
259 | + partitions {
260 | + compatible = "fixed-partitions";
261 | + #address-cells = <1>;
262 | + #size-cells = <1>;
263 | +
264 | + partition@0 {
265 | + label = "u-boot";
266 | + reg = <0x0 0x30000>;
267 | + read-only;
268 | + };
269 | +
270 | + config: partition@30000 {
271 | + label = "config";
272 | + reg = <0x30000 0x10000>;
273 | + read-only;
274 | + };
275 | +
276 | + factory: partition@40000 {
277 | + label = "factory";
278 | + reg = <0x40000 0x10000>;
279 | + read-only;
280 | + };
281 | +
282 | + partition@50000 {
283 | + compatible = "denx,uimage";
284 | + label = "firmware";
285 | + reg = <0x50000 0x1fb0000>;
286 | + };
287 | + };
288 | + };
289 | +};
290 | +
291 | +&gmac0 {
292 | + mtd-mac-address-ascii = <&config 0x4429>;
293 | +};
294 | +
295 | +&switch0 {
296 | + ports {
297 | + port@0 {
298 | + status = "okay";
299 | + label = "wan";
300 | + };
301 | +
302 | + port@1 {
303 | + status = "okay";
304 | + label = "lan1";
305 | + };
306 | +
307 | + port@2 {
308 | + status = "okay";
309 | + label = "lan2";
310 | + };
311 | + };
312 | +};
313 | +
314 | +&pcie {
315 | + status = "okay";
316 | +};
317 | +
318 | +&pcie0 {
319 | + wifi@0,0 {
320 | + reg = <0x0000 0 0 0 0>;
321 | + mtd-mac-address-ascii = <&config 0x4429>;
322 | + mediatek,mtd-eeprom = <&factory 0x0>;
323 | + };
324 | +};
325 | +
326 | +&pcie1 {
327 | + wifi@0,0 {
328 | + reg = <0x0000 0 0 0 0>;
329 | + mtd-mac-address-ascii = <&config 0x4429>;
330 | + mtd-mac-address-increment = <0x80>;
331 | + mtd-mac-address-increment-byte = <3>;
332 | + mediatek,mtd-eeprom = <&factory 0x8000>;
333 | + ieee80211-freq-limit = <5000000 6000000>;
334 | + };
335 | +};
336 | +
337 | +&state_default {
338 | + gpio {
339 | + groups = "uart2", "uart3", "wdt";
340 | + function = "gpio";
341 | + };
342 | +};
343 |
--------------------------------------------------------------------------------
/devices/ramips_mt7621/patches/03-4a-breed-fix.patch:
--------------------------------------------------------------------------------
1 | --- a/target/linux/ramips/dts/mt7621_xiaomi_mi-router-4a-common.dtsi
2 | +++ b/target/linux/ramips/dts/mt7621_xiaomi_mi-router-4a-common.dtsi
3 | @@ -54,40 +54,16 @@
4 | read-only;
5 | };
6 |
7 | - partition@40000 {
8 | - label = "Bdata";
9 | - reg = <0x40000 0x10000>;
10 | - read-only;
11 | - };
12 | -
13 | - factory: partition@50000 {
14 | + factory: partition@40000 {
15 | label = "factory";
16 | - reg = <0x50000 0x10000>;
17 | - read-only;
18 | - };
19 | -
20 | - partition@60000 {
21 | - label = "crash";
22 | - reg = <0x60000 0x10000>;
23 | - read-only;
24 | - };
25 | -
26 | - partition@70000 {
27 | - label = "cfg_bak";
28 | - reg = <0x70000 0x10000>;
29 | - read-only;
30 | - };
31 | -
32 | - partition@80000 {
33 | - label = "overlay";
34 | - reg = <0x80000 0x100000>;
35 | + reg = <0x40000 0x10000>;
36 | read-only;
37 | };
38 |
39 | - firmware: partition@180000 {
40 | + partition@50000 {
41 | compatible = "denx,uimage";
42 | label = "firmware";
43 | - reg = <0x180000 0xe80000>;
44 | + reg = <0x50000 0xfb0000>;
45 | };
46 | };
47 | };
--------------------------------------------------------------------------------
/devices/ramips_mt7621/patches/jcg_q20-pb-boot.patch:
--------------------------------------------------------------------------------
1 | --- a/target/linux/ramips/dts/mt7621_jcg_q20.dts
2 | +++ b/target/linux/ramips/dts/mt7621_jcg_q20.dts
3 | @@ -50,22 +50,6 @@
4 | linux,code = ;
5 | };
6 | };
7 | -
8 | - ubi-concat {
9 | - compatible = "mtd-concat";
10 | - devices = <&ubiconcat0 &ubiconcat1>;
11 | -
12 | - partitions {
13 | - compatible = "fixed-partitions";
14 | - #address-cells = <1>;
15 | - #size-cells = <1>;
16 | -
17 | - partition@0 {
18 | - label = "ubi";
19 | - reg = <0x0 0x5900000>;
20 | - };
21 | - };
22 | - };
23 | };
24 |
25 | &nand {
26 | @@ -79,12 +63,18 @@
27 | partition@0 {
28 | label = "Bootloader";
29 | reg = <0x0 0x80000>;
30 | - read-only;
31 | };
32 |
33 | partition@80000 {
34 | - label = "Config";
35 | - reg = <0x80000 0x80000>;
36 | + label = "Nvram";
37 | + reg = <0x80000 0x40000>;
38 | + read-only;
39 | + };
40 | +
41 | + partition@c0000 {
42 | + label = "Bdata";
43 | + reg = <0xc0000 0x40000>;
44 | + read-only;
45 | };
46 |
47 | factory: partition@100000 {
48 | @@ -94,40 +84,26 @@
49 | };
50 |
51 | partition@180000 {
52 | - label = "kernel";
53 | - reg = <0x180000 0x400000>;
54 | - };
55 | -
56 | - ubiconcat0: partition@580000 {
57 | - label = "ubiconcat0";
58 | - reg = <0x580000 0x1c00000>;
59 | - };
60 | -
61 | - partition@2180000 {
62 | - label = "firmware_backup";
63 | - reg = <0x2180000 0x2000000>;
64 | - };
65 | -
66 | - partition@4180000 {
67 | - label = "rootfs_data_back";
68 | - reg = <0x4180000 0x80000>;
69 | + label = "crash";
70 | + reg = <0x180000 0x40000>;
71 | read-only;
72 | };
73 |
74 | - partition@4200000 {
75 | - label = "nvram_config";
76 | - reg = <0x4200000 0x80000>;
77 | + partition@1c0000 {
78 | + label = "crash_log";
79 | + reg = <0x1c0000 0x40000>;
80 | read-only;
81 | };
82 |
83 | - ubiconcat1: partition@4280000 {
84 | - label = "ubiconcat1";
85 | - reg = <0x4280000 0x3d00000>;
86 | + partition@200000 {
87 | + label = "kernel";
88 | + reg = <0x200000 0x400000>;
89 | };
90 |
91 | - /*
92 | - * last 512 KiB are for the bad block table
93 | - */
94 | + partition@600000 {
95 | + label = "ubi";
96 | + reg = <0x600000 0x7980000>;
97 | + };
98 | };
99 | };
100 |
--------------------------------------------------------------------------------
/devices/ramips_mt7621/patches/k2p_32m.patch:
--------------------------------------------------------------------------------
1 | diff --git a/target/linux/ramips/dts/mt7621_phicomm_k2p.dts b/target/linux/ramips/dts/mt7621_phicomm_k2p.dtsi
2 | similarity index 94%
3 | rename from target/linux/ramips/dts/mt7621_phicomm_k2p.dts
4 | rename to target/linux/ramips/dts/mt7621_phicomm_k2p.dtsi
5 | index b18d12608acc7..8f72ac2a48280 100644
6 | --- a/target/linux/ramips/dts/mt7621_phicomm_k2p.dts
7 | +++ b/target/linux/ramips/dts/mt7621_phicomm_k2p.dtsi
8 | @@ -4,9 +4,6 @@
9 | #include
10 |
11 | / {
12 | - compatible = "phicomm,k2p", "mediatek,mt7621-soc";
13 | - model = "Phicomm K2P";
14 | -
15 | aliases {
16 | led-boot = &led_blue;
17 | led-failsafe = &led_blue;
18 | @@ -47,7 +44,7 @@
19 | &spi0 {
20 | status = "okay";
21 |
22 | - flash@0 {
23 | + flash: flash@0 {
24 | compatible = "jedec,spi-nor";
25 | reg = <0>;
26 | spi-max-frequency = <50000000>;
27 | @@ -81,10 +78,9 @@
28 | read-only;
29 | };
30 |
31 | - partition@a0000 {
32 | + firmware: partition@a0000 {
33 | compatible = "denx,uimage";
34 | label = "firmware";
35 | - reg = <0xa0000 0xf60000>;
36 | };
37 | };
38 | };
39 | diff --git a/target/linux/ramips/dts/mt7621_phicomm_k2p.dts b/target/linux/ramips/dts/mt7621_phicomm_k2p.dts
40 | new file mode 100644
41 | index 0000000000000..5bad6f2d9562d
42 | --- /dev/null
43 | +++ b/target/linux/ramips/dts/mt7621_phicomm_k2p.dts
44 | @@ -0,0 +1,10 @@
45 | +#include "mt7621_phicomm_k2p.dtsi"
46 | +
47 | +/ {
48 | + compatible = "phicomm,k2p", "mediatek,mt7621-soc";
49 | + model = "Phicomm K2P";
50 | +};
51 | +
52 | +&firmware {
53 | + reg = <0xa0000 0x1f60000>;
54 | +};
55 | diff --git a/target/linux/ramips/dts/mt7621_phicomm_k2p-32m.dts b/target/linux/ramips/dts/mt7621_phicomm_k2p-32m.dts
56 | new file mode 100644
57 | index 0000000000000..5bad6f2d9562d
58 | --- /dev/null
59 | +++ b/target/linux/ramips/dts/mt7621_phicomm_k2p-32m.dts
60 | @@ -0,0 +1,14 @@
61 | +#include "mt7621_phicomm_k2p.dtsi"
62 | +
63 | +/ {
64 | + compatible = "phicomm,k2p-32m", "mediatek,mt7621-soc";
65 | + model = "Phicomm K2P (32M)";
66 | +};
67 | +
68 | +&firmware {
69 | + reg = <0xa0000 0x1f60000>;
70 | +};
71 | +
72 | +&flash {
73 | + broken-flash-reset;
74 | +};
75 | --- a/target/linux/ramips/mt7621/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac
76 | +++ b/target/linux/ramips/mt7621/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac
77 | @@ -28,7 +28,8 @@ case "$board" in
78 | > /sys${DEVPATH}/macaddress
79 | ;;
80 | dlink,dir-853-r1|\
81 | - phicomm,k2p)
82 | + phicomm,k2p|\
83 | + phicomm,k2p-32m)
84 | if [ "$PHYNBR" = "0" ]; then
85 | base_mac=$(macaddr_add "$(mtd_get_mac_binary factory 0x4)" -1)
86 | macaddr_setbit_la "$base_mac" > /sys${DEVPATH}/macaddress
87 |
--------------------------------------------------------------------------------
/devices/ramips_mt7621/patches/luban.patch:
--------------------------------------------------------------------------------
1 | diff --git a/target/linux/ramips/dts/mt7621_jdcloud_luban.dts b/target/linux/ramips/dts/mt7621_jdcloud_luban.dts
2 | new file mode 100644
3 | index 0000000..ed1ebed
4 | --- /dev/null
5 | +++ b/target/linux/ramips/dts/mt7621_jdcloud_luban.dts
6 | @@ -0,0 +1,171 @@
7 | +#include "mt7621.dtsi"
8 | +
9 | +#include
10 | +#include
11 | +
12 | +/ {
13 | + compatible = "jdcloud,luban", "mediatek,mt7621-soc";
14 | + model = "JDCloud luban";
15 | +
16 | + aliases {
17 | + led-boot = &led_r1;
18 | + led-failsafe = &led_r1;
19 | + led-running = &led_g1;
20 | + led-upgrade = &led_b1;
21 | + label-mac-device = &gmac0;
22 | + };
23 | +
24 | + chosen {
25 | + bootargs = "console=ttyS0,115200n8";
26 | + };
27 | +
28 | + leds {
29 | + compatible = "gpio-leds";
30 | +
31 | + led_r1: led_r1 {
32 | + label = "led_r1";
33 | + gpios = <&gpio 6 GPIO_ACTIVE_LOW>;
34 | + default-state = "on";
35 | + };
36 | +
37 | + led_b1: led_b1 {
38 | + label = "led_b1";
39 | + gpios = <&gpio 7 GPIO_ACTIVE_LOW>;
40 | + };
41 | +
42 | + led_g1: led_g1 {
43 | + label = "led_g1";
44 | + gpios = <&gpio 8 GPIO_ACTIVE_LOW>;
45 | + };
46 | + };
47 | +
48 | + keys {
49 | + compatible = "gpio-keys";
50 | +
51 | + reset {
52 | + label = "reset";
53 | + gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
54 | + linux,code = ;
55 | + };
56 | +
57 | + wps {
58 | + label = "wps";
59 | + gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
60 | + linux,code = ;
61 | + };
62 | + };
63 | +};
64 | +
65 | +&spi0 {
66 | + status = "okay";
67 | +
68 | + flash@0 {
69 | + compatible = "jedec,spi-nor";
70 | + reg = <0>;
71 | + spi-max-frequency = <10000000>;
72 | + broken-flash-reset;
73 | +
74 | + partitions {
75 | + compatible = "fixed-partitions";
76 | + #address-cells = <1>;
77 | + #size-cells = <1>;
78 | +
79 | + partition@0 {
80 | + label = "u-boot";
81 | + reg = <0x0 0x40000>;
82 | + read-only;
83 | + };
84 | +
85 | + partition@40000 {
86 | + label = "u-boot-env";
87 | + reg = <0x40000 0x10000>;
88 | + read-only;
89 | + };
90 | +
91 | + factory: partition@50000 {
92 | + label = "factory";
93 | + reg = <0x50000 0x40000>;
94 | + read-only;
95 | + };
96 | +
97 | + partition@90000 {
98 | + compatible = "denx,uimage";
99 | + label = "firmware";
100 | + reg = <0x90000 0xf70000>;
101 | + };
102 | + };
103 | + };
104 | +};
105 | +
106 | +&state_default {
107 | + gpio {
108 | + groups = "i2c", "uart2", "uart3";
109 | + function = "gpio";
110 | + };
111 | +};
112 | +
113 | +&sdhci {
114 | + status = "okay";
115 | +};
116 | +
117 | +&gmac0 {
118 | + nvmem-cells = <&macaddr_factory_3fff4>;
119 | + nvmem-cell-names = "mac-address";
120 | +};
121 | +
122 | +&switch0 {
123 | + ports {
124 | + port@0 {
125 | + status = "okay";
126 | + label = "lan4";
127 | + };
128 | +
129 | + port@1 {
130 | + status = "okay";
131 | + label = "lan3";
132 | + };
133 | +
134 | + port@2 {
135 | + status = "okay";
136 | + label = "lan2";
137 | + };
138 | +
139 | + port@3 {
140 | + status = "okay";
141 | + label = "lan1";
142 | + };
143 | +
144 | + port@4 {
145 | + status = "okay";
146 | + label = "wan";
147 | + nvmem-cells = <&macaddr_factory_3fffa>;
148 | + nvmem-cell-names = "mac-address";
149 | + };
150 | + };
151 | +};
152 | +
153 | +&pcie {
154 | + status = "okay";
155 | +};
156 | +
157 | +&pcie1 {
158 | + wifi@0,0 {
159 | + compatible = "mediatek,mt76";
160 | + reg = <0x0000 0 0 0 0>;
161 | + mediatek,mtd-eeprom = <&factory 0x0>;
162 | + };
163 | +};
164 | +
165 | +&factory {
166 | + compatible = "nvmem-cells";
167 | + #address-cells = <1>;
168 | + #size-cells = <1>;
169 | +
170 | + macaddr_factory_3fff4: macaddr@3fff4 {
171 | + reg = <0x3fff4 0x6>;
172 | + };
173 | +
174 | + macaddr_factory_3fffa: macaddr@3fffa {
175 | + reg = <0x3fffa 0x6>;
176 | + };
177 | +};
178 |
--------------------------------------------------------------------------------
/devices/ramips_mt7621/patches/tblsection.patch:
--------------------------------------------------------------------------------
1 | --- a/package/feeds/luci/luci-compat/luasrc/view/cbi/tblsection.htm
2 | +++ b/package/feeds/luci/luci-compat/luasrc/view/cbi/tblsection.htm
3 | @@ -123,6 +123,7 @@ <%=self.title%>
4 |
5 | local isempty, section, i, k = true, nil, nil
6 | for i, k in ipairs(self:cfgsections()) do
7 | + if i <= 100 then
8 | isempty = false
9 | section = k
10 |
11 | @@ -165,6 +166,8 @@ <%=self.title%>
12 |
13 | <%- end -%>
14 |
15 | + <%- i=i+1 -%>
16 | + <%- end -%>
17 | <%- end -%>
18 |
19 | <%- if isempty then -%>
20 |
--------------------------------------------------------------------------------
/devices/ramips_mt7621/patches/zte_e8820s.patch:
--------------------------------------------------------------------------------
1 | diff --git a/target/linux/ramips/dts/mt7621_zte_e8820s.dts b/target/linux/ramips/dts/mt7621_zte_e8820s.dts
2 | new file mode 100644
3 | index 000000000000..5a0012441509
4 | --- /dev/null
5 | +++ b/target/linux/ramips/dts/mt7621_zte_e8820s.dts
6 | @@ -0,0 +1,188 @@
7 | +#include "mt7621.dtsi"
8 | +
9 | +#include
10 | +#include
11 | +
12 | +/ {
13 | + compatible = "zte,e8820s", "mediatek,mt7621-soc";
14 | + model = "ZTE E8820S";
15 | +
16 | + aliases {
17 | + led-boot = &led_sys;
18 | + led-failsafe = &led_sys;
19 | + led-running = &led_sys;
20 | + led-upgrade = &led_sys;
21 | + };
22 | +
23 | + leds {
24 | + compatible = "gpio-leds";
25 | +
26 | + led_sys: sys {
27 | + label = "white:sys";
28 | + gpios = <&gpio 3 GPIO_ACTIVE_LOW>;
29 | + };
30 | +
31 | + };
32 | +
33 | + keys {
34 | + compatible = "gpio-keys";
35 | +
36 | + reset {
37 | + label = "reset";
38 | + gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
39 | + linux,code = ;
40 | + };
41 | +
42 | + wps {
43 | + label = "wps";
44 | + gpios = <&gpio 8 GPIO_ACTIVE_LOW>;
45 | + linux,code = ;
46 | + };
47 | +
48 | + wifi {
49 | + label = "wifi";
50 | + gpios = <&gpio 10 GPIO_ACTIVE_LOW>;
51 | + linux,code = ;
52 | + };
53 | + };
54 | +};
55 | +
56 | +&nand {
57 | + status = "okay";
58 | +
59 | + partitions {
60 | + compatible = "fixed-partitions";
61 | + #address-cells = <1>;
62 | + #size-cells = <1>;
63 | +
64 | + partition@0 {
65 | + label = "u-boot";
66 | + reg = <0x0 0x80000>;
67 | + read-only;
68 | + };
69 | +
70 | + partition@80000 {
71 | + label = "u-boot-env";
72 | + reg = <0x80000 0x80000>;
73 | + read-only;
74 | + };
75 | +
76 | + factory: partition@100000 {
77 | + label = "factory";
78 | + reg = <0x100000 0x40000>;
79 | + read-only;
80 | + };
81 | +
82 | + partition@140000 {
83 | + label = "kernel";
84 | + reg = <0x140000 0x400000>;
85 | + };
86 | +
87 | + partition@540000 {
88 | + label = "ubi";
89 | + reg = <0x540000 0x7A00000>;
90 | + };
91 | + };
92 | +};
93 | +
94 | +&pcie {
95 | + status = "okay";
96 | + reset-gpios = <&gpio 19 GPIO_ACTIVE_LOW>,
97 | + <&gpio 4 GPIO_ACTIVE_LOW>;
98 | +};
99 | +
100 | +&pcie0 {
101 | + wifi@0,0 {
102 | + compatible = "mediatek,mt76";
103 | + reg = <0x0000 0 0 0 0>;
104 | + mediatek,mtd-eeprom = <&factory 0x0000>;
105 | + nvmem-cells = <&macaddr_factory_e000>;
106 | + nvmem-cell-names = "mac-address";
107 | +
108 | + led {
109 | + led-active-low;
110 | + };
111 | + };
112 | +};
113 | +
114 | +&pcie1 {
115 | + wifi@0,0 {
116 | + compatible = "mediatek,mt76";
117 | + reg = <0x0000 0 0 0 0>;
118 | + mediatek,mtd-eeprom = <&factory 0x8000>;
119 | + nvmem-cells = <&macaddr_factory_e006>;
120 | + nvmem-cell-names = "mac-address";
121 | + ieee80211-freq-limit = <5000000 6000000>;
122 | +
123 | + led {
124 | + led-sources = <2>;
125 | + led-active-low;
126 | + };
127 | + };
128 | +};
129 | +
130 | +&gmac0 {
131 | + nvmem-cells = <&macaddr_factory_e000>;
132 | + nvmem-cell-names = "mac-address";
133 | +};
134 | +
135 | +&gmac1 {
136 | + status = "okay";
137 | + label = "wan";
138 | + phy-handle = <ðphy4>;
139 | +
140 | + nvmem-cells = <&macaddr_factory_e000>;
141 | + nvmem-cell-names = "mac-address";
142 | + mac-address-increment = <1>;
143 | +};
144 | +
145 | +&mdio {
146 | + ethphy4: ethernet-phy@4 {
147 | + reg = <4>;
148 | + };
149 | +};
150 | +
151 | +&switch0 {
152 | + ports {
153 | + port@0 {
154 | + status = "okay";
155 | + label = "lan1";
156 | + };
157 | +
158 | + port@1 {
159 | + status = "okay";
160 | + label = "lan2";
161 | + };
162 | +
163 | + port@2 {
164 | + status = "okay";
165 | + label = "lan3";
166 | + };
167 | +
168 | + port@3 {
169 | + status = "okay";
170 | + label = "lan4";
171 | + };
172 | + };
173 | +};
174 | +
175 | +&state_default {
176 | + gpio {
177 | + groups = "i2c", "jtag", "uart2", "uart3", "wdt";
178 | + function = "gpio";
179 | + };
180 | +};
181 | +
182 | +&factory {
183 | + compatible = "nvmem-cells";
184 | + #address-cells = <1>;
185 | + #size-cells = <1>;
186 | +
187 | + macaddr_factory_e000: macaddr@e000 {
188 | + reg = <0xe000 0x6>;
189 | + };
190 | +
191 | + macaddr_factory_e006: macaddr@e006 {
192 | + reg = <0xe006 0x6>;
193 | + };
194 | +};
195 | diff --git a/target/linux/ramips/dts/mt7621_zte_e8820v2.dts b/target/linux/ramips/dts/mt7621_zte_e8820v2.dts
196 | new file mode 100644
197 | index 000000000000..5a0012441509
198 | --- /dev/null
199 | +++ b/target/linux/ramips/dts/mt7621_zte_e8820v2.dts
200 | @@ -0,0 +1,181 @@
201 | +#include "mt7621.dtsi"
202 | +
203 | +#include
204 | +#include
205 | +
206 | +/ {
207 | + compatible = "zte,e8820v2", "mediatek,mt7621-soc";
208 | + model = "ZTE E8820V2";
209 | +
210 | + aliases {
211 | + led-boot = &led_sys;
212 | + led-failsafe = &led_sys;
213 | + led-running = &led_sys;
214 | + led-upgrade = &led_sys;
215 | + };
216 | +
217 | + leds {
218 | + compatible = "gpio-leds";
219 | +
220 | + led_sys: sys {
221 | + label = "white:sys";
222 | + gpios = <&gpio 29 GPIO_ACTIVE_LOW>;
223 | + };
224 | +
225 | + led_power: power {
226 | + label = "white:power";
227 | + gpios = <&gpio 31 GPIO_ACTIVE_LOW>;
228 | + };
229 | + };
230 | +
231 | + keys {
232 | + compatible = "gpio-keys";
233 | +
234 | + reset {
235 | + label = "reset";
236 | + gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
237 | + linux,code = ;
238 | + };
239 | +
240 | + wps {
241 | + label = "wps";
242 | + gpios = <&gpio 24 GPIO_ACTIVE_LOW>;
243 | + linux,code = ;
244 | + };
245 | + };
246 | +};
247 | +
248 | +&spi0 {
249 | + status = "okay";
250 | +
251 | + flash@0 {
252 | + compatible = "jedec,spi-nor";
253 | + reg = <0>;
254 | + spi-max-frequency = <10000000>;
255 | + broken-flash-reset;
256 | +
257 | + partitions {
258 | + compatible = "fixed-partitions";
259 | + #address-cells = <1>;
260 | + #size-cells = <1>;
261 | +
262 | + partition@0 {
263 | + label = "u-boot";
264 | + reg = <0x0 0x30000>;
265 | + read-only;
266 | + };
267 | +
268 | + partition@30000 {
269 | + label = "u-boot-env";
270 | + reg = <0x30000 0x10000>;
271 | + read-only;
272 | + };
273 | +
274 | + factory: partition@40000 {
275 | + label = "factory";
276 | + reg = <0x40000 0x10000>;
277 | + read-only;
278 | + };
279 | +
280 | + partition@50000 {
281 | + compatible = "denx,uimage";
282 | + label = "firmware";
283 | + reg = <0x50000 0xfb0000>;
284 | + };
285 | + };
286 | + };
287 | +};
288 | +
289 | +&pcie {
290 | + status = "okay";
291 | + reset-gpios = <&gpio 19 GPIO_ACTIVE_LOW>,
292 | + <&gpio 4 GPIO_ACTIVE_LOW>;
293 | +};
294 | +
295 | +&pcie0 {
296 | + wifi@0,0 {
297 | + compatible = "mediatek,mt76";
298 | + reg = <0x0000 0 0 0 0>;
299 | + mediatek,mtd-eeprom = <&factory 0x0000>;
300 | + nvmem-cells = <&macaddr_factory_e000>;
301 | + nvmem-cell-names = "mac-address";
302 | +
303 | + led {
304 | + led-active-low;
305 | + };
306 | + };
307 | +};
308 | +
309 | +&pcie1 {
310 | + wifi@0,0 {
311 | + compatible = "mediatek,mt76";
312 | + reg = <0x0000 0 0 0 0>;
313 | + mediatek,mtd-eeprom = <&factory 0x8000>;
314 | + nvmem-cells = <&macaddr_factory_e006>;
315 | + nvmem-cell-names = "mac-address";
316 | +
317 | + ieee80211-freq-limit = <5000000 6000000>;
318 | + led {
319 | + led-sources = <2>;
320 | + led-active-low;
321 | + };
322 | + };
323 | +};
324 | +
325 | +
326 | +&gmac0 {
327 | + nvmem-cells = <&macaddr_factory_e000>;
328 | + nvmem-cell-names = "mac-address";
329 | +};
330 | +
331 | +&switch0 {
332 | + ports {
333 | + port@0 {
334 | + status = "okay";
335 | + label = "lan1";
336 | + };
337 | +
338 | + port@1 {
339 | + status = "okay";
340 | + label = "lan2";
341 | + };
342 | +
343 | + port@2 {
344 | + status = "okay";
345 | + label = "lan3";
346 | + };
347 | +
348 | + port@3 {
349 | + status = "okay";
350 | + label = "lan4";
351 | + };
352 | +
353 | + port@4 {
354 | + status = "okay";
355 | + label = "wan";
356 | + nvmem-cells = <&macaddr_factory_e006>;
357 | + nvmem-cell-names = "mac-address";
358 | + };
359 | + };
360 | +};
361 | +
362 | +&state_default {
363 | + gpio {
364 | + groups = "i2c", "uart2", "uart3", "wdt";
365 | + function = "gpio";
366 | + };
367 | +};
368 | +
369 | +&factory {
370 | + compatible = "nvmem-cells";
371 | + #address-cells = <1>;
372 | + #size-cells = <1>;
373 | +
374 | + macaddr_factory_e000: macaddr@e000 {
375 | + reg = <0xe000 0x6>;
376 | + };
377 | +
378 | + macaddr_factory_e006: macaddr@e006 {
379 | + reg = <0xe006 0x6>;
380 | + };
381 | +};
382 |
383 | diff --git a/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds b/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds
384 | index aad2e32b36210..a6a4707fc295d 100644
385 | --- a/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds
386 | +++ b/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds
387 | @@ -157,6 +157,16 @@ zbtlink,zbt-wg1608-16m)
388 | ucidef_set_led_netdev "lan4" "LAN4" "green:lan-4" "lan4"
389 | ucidef_set_led_netdev "wan" "WAN" "green:wan" "wan"
390 | ;;
391 | +zte,e8820s)
392 | + ucidef_set_led_netdev "sys" "SYS_LED" "white:sys" "eth0" "tx rx"
393 | + ucidef_set_led_timer "power" "POWER_LED" "white:sys" "100" "8000"
394 | + ucidef_set_led_netdev "wlan2g" "WiFi 2.4GHz" "white:wlan2g" "ra0"
395 | + ucidef_set_led_netdev "wlan5g" "WiFi 5GHz" "white:wlan5g" "rai0"
396 | + ;;
397 | +zte,e8820v2)
398 | + ucidef_set_led_netdev "sys" "SYS_LED" "white:sys" "eth0" "tx rx"
399 | + ucidef_set_led_timer "power" "POWER_LED" "white:power" "100" "8000"
400 | + ;;
401 | esac
402 |
403 | board_config_flush
404 |
--------------------------------------------------------------------------------
/devices/rockchip_armv8/.config:
--------------------------------------------------------------------------------
1 |
2 | CONFIG_TARGET_rockchip=y
3 | CONFIG_TARGET_rockchip_armv8=y
4 | CONFIG_TARGET_MULTI_PROFILE=y
5 | CONFIG_TARGET_ALL_PROFILES=y
6 |
7 | CONFIG_TARGET_DEVICE_rockchip_armv8_DEVICE_radxa_rock-pi-4=n
8 | CONFIG_TARGET_DEVICE_rockchip_armv8_DEVICE_pine64_rockpro64=n
9 |
10 | CONFIG_PACKAGE_kmod-rtl88x2bu=m
11 | CONFIG_PACKAGE_kmod-pcie_mhi=m
12 |
13 | CONFIG_PACKAGE_luci-ssl=n # uhttpd服务
14 | CONFIG_PACKAGE_luci-ssl-nginx=y # nginx
15 |
16 |
--------------------------------------------------------------------------------
/devices/rockchip_armv8/README.md:
--------------------------------------------------------------------------------
1 | Kernel等部分源码来源 https://github.com/coolsnowwolf/lede 感谢
--------------------------------------------------------------------------------
/devices/rockchip_armv8/diy.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | shopt -s extglob
4 | SHELL_FOLDER=$(dirname $(readlink -f "$0"))
5 |
6 | rm -rf package/boot/uboot-rockchip
7 | svn export --force https://github.com/coolsnowwolf/lede/trunk/package/boot/uboot-rockchip package/boot/uboot-rockchip
8 | svn export --force https://github.com/coolsnowwolf/lede/trunk/package/boot/arm-trusted-firmware-rockchip-vendor package/boot/arm-trusted-firmware-rockchip-vendor
9 |
10 | rm -rf target/linux/generic target/linux/rockchip/!(Makefile)
11 |
12 | svn co https://github.com/coolsnowwolf/lede/trunk/target/linux/generic target/linux/generic
13 | svn co https://github.com/coolsnowwolf/lede/trunk/target/linux/rockchip target/linux/rockchip
14 |
15 | curl -sfL https://raw.githubusercontent.com/coolsnowwolf/lede/master/include/kernel-5.15 -o include/kernel-5.15
16 |
17 | curl -sfL https://raw.githubusercontent.com/coolsnowwolf/lede/master/package/kernel/linux/modules/video.mk -o package/kernel/linux/modules/video.mk
18 |
19 | sed -i "/KernelPackage,ptp/d" package/kernel/linux/modules/other.mk
20 |
21 | mv -f tmp/r8125 feeds/kiddin9/
22 |
23 | rm -rf target/linux/rockchip/armv8/base-files/etc/uci-defaults/13_opkg_update
24 |
25 | sed -i -e 's,kmod-r8168,kmod-r8169,g' target/linux/rockchip/image/armv8.mk
26 |
27 | sed -i 's/DEFAULT_PACKAGES +=/DEFAULT_PACKAGES += fdisk lsblk kmod-drm-rockchip/' target/linux/rockchip/Makefile
28 |
29 | sed -i 's/Ariaboard/光影猫/' target/linux/rockchip/image/armv8.mk
30 |
31 | echo '
32 | CONFIG_SENSORS_PWM_FAN=y
33 | ' >> ./target/linux/rockchip/armv8/config-5.15
34 |
--------------------------------------------------------------------------------
/devices/rockchip_armv8/patches/add_extra_CPU_FLAGS.patch:
--------------------------------------------------------------------------------
1 | --- a/include/target.mk
2 | +++ b/include/target.mk
3 | @@ -259,9 +259,18 @@ ifeq ($(DUMP),1)
4 | CPU_CFLAGS_arc700 = -mcpu=arc700
5 | CPU_CFLAGS_archs = -mcpu=archs
6 | endif
7 | + ifeq ($(BOARD),rockchip)
8 | + CPU_CFLAGS = -O3 -pipe
9 | + CPU_CFLAGS_cortex-a53 = -mcpu=cortex-a53
10 | + CPU_CFLAGS_cortex-a55 = -march=armv8-a+crypto+crc -mcpu=cortex-a55+crypto+crc -mtune=cortex-a55
11 | + CPU_CFLAGS_cortex-a73 = -march=armv8-a+crypto+crc -mcpu=cortex-a73.cortex-a53+crypto+crc -mtune=cortex-a73.cortex-a53
12 | + ifneq ($(SOC_CFLAGS),)
13 | + CPU_CFLAGS_generic = $(SOC_CFLAGS)
14 | + endif
15 | + endif
16 | ifneq ($(CPU_TYPE),)
17 | ifndef CPU_CFLAGS_$(CPU_TYPE)
18 | - $(warning CPU_TYPE "$(CPU_TYPE)" doesn't correspond to a known type)
19 | + $(warning CPU_TYPE "$(CPU_TYPE)" "doesn't correspond to a known type")
20 | endif
21 | endif
22 | DEFAULT_CFLAGS=$(strip $(CPU_CFLAGS) $(CPU_CFLAGS_$(CPU_TYPE)) $(CPU_CFLAGS_$(CPU_SUBTYPE)))
--------------------------------------------------------------------------------
/devices/rockchip_armv8/patches/fan.patch:
--------------------------------------------------------------------------------
1 | From 6bd64bbc79b7a86224dea328dee07fa27f2cc06b Mon Sep 17 00:00:00 2001
2 | From: Lawrence-Tang
3 | Date: Wed, 20 Oct 2021 15:00:23 +0800
4 | Subject: [PATCH] rockchip: add fan control for r2s/r4s
5 |
6 | ---
7 | .../armv8/base-files/etc/init.d/fa-fancontrol | 16 ++++
8 | .../armv8/base-files/usr/bin/cputemp.sh | 14 ++++
9 | .../usr/bin/fa-fancontrol-direct.sh | 69 +++++++++++++++++++
10 | .../armv8/base-files/usr/bin/fa-fancontrol.sh | 36 ++++++++++
11 | 4 files changed, 127 insertions(+)
12 | create mode 100755 target/linux/rockchip/armv8/base-files/etc/init.d/fa-fancontrol
13 | create mode 100755 target/linux/rockchip/armv8/base-files/usr/bin/cputemp.sh
14 | create mode 100755 target/linux/rockchip/armv8/base-files/usr/bin/fa-fancontrol-direct.sh
15 | create mode 100755 target/linux/rockchip/armv8/base-files/usr/bin/fa-fancontrol.sh
16 |
17 | diff --git a/target/linux/rockchip/armv8/base-files/etc/init.d/fa-fancontrol b/target/linux/rockchip/armv8/base-files/etc/init.d/fa-fancontrol
18 | new file mode 100755
19 | index 0000000000000..dd848927101b0
20 | --- /dev/null
21 | +++ b/target/linux/rockchip/armv8/base-files/etc/init.d/fa-fancontrol
22 | @@ -0,0 +1,16 @@
23 | +#!/bin/sh /etc/rc.common
24 | +
25 | +START=21
26 | +start() {
27 | + /usr/bin/fa-fancontrol.sh &
28 | +}
29 | +
30 | +stop() {
31 | +kill -9 $(ps -w | grep fa-fancontrol | grep -v grep | awk '{print$1}') 2>/dev/null
32 | +}
33 | +
34 | +restart() {
35 | +stop
36 | +start
37 | +}
38 | +
39 | diff --git a/target/linux/rockchip/armv8/base-files/usr/bin/cputemp.sh b/target/linux/rockchip/armv8/base-files/usr/bin/cputemp.sh
40 | new file mode 100755
41 | index 0000000000000..e497269bccdcd
42 | --- /dev/null
43 | +++ b/target/linux/rockchip/armv8/base-files/usr/bin/cputemp.sh
44 | @@ -0,0 +1,14 @@
45 | +#!/bin/bash
46 | +
47 | +while true
48 | +do
49 | +echo "-----------------"
50 | +echo "Curr freq: `cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq`,`cat /sys/devices/system/cpu/cpu4/cpufreq/cpuinfo_cur_freq`"
51 | +echo "Temp: `cat /sys/class/thermal/thermal_zone0/temp`"
52 | +if [ -d /sys/devices/platform/pwm-fan ]; then
53 | + CUR=`cat /sys/devices/virtual/thermal/cooling_device0/cur_state`
54 | + MAX=`cat /sys/devices/virtual/thermal/cooling_device0/max_state`
55 | + echo "Fan Level: ${CUR}/${MAX}"
56 | +fi
57 | +sleep 5
58 | +done
59 | diff --git a/target/linux/rockchip/armv8/base-files/usr/bin/fa-fancontrol-direct.sh b/target/linux/rockchip/armv8/base-files/usr/bin/fa-fancontrol-direct.sh
60 | new file mode 100755
61 | index 0000000000000..b16c994d66955
62 | --- /dev/null
63 | +++ b/target/linux/rockchip/armv8/base-files/usr/bin/fa-fancontrol-direct.sh
64 | @@ -0,0 +1,69 @@
65 | +#!/bin/bash
66 | +
67 | +# determine fan controller
68 | +if [ -d /sys/devices/platform/pwm-fan ]; then
69 | + echo "pls use /usr/bin/fa-fancontrol.sh."
70 | + exit 1
71 | +fi
72 | +
73 | +if [ ! -d /sys/class/pwm/pwmchip1 ]; then
74 | + echo "this model does not support pwm."
75 | + exit 1
76 | +fi
77 | +if [ ! -d /sys/class/pwm/pwmchip1/pwm0 ]; then
78 | + echo 0 > /sys/class/pwm/pwmchip1/export
79 | +fi
80 | +sleep 1
81 | +while [ ! -d /sys/class/pwm/pwmchip1/pwm0 ];
82 | +do
83 | + sleep 1
84 | +done
85 | +ISENABLE=`cat /sys/class/pwm/pwmchip1/pwm0/enable`
86 | +if [ $ISENABLE -eq 1 ]; then
87 | + echo 0 > /sys/class/pwm/pwmchip1/pwm0/enable
88 | +fi
89 | +echo 50000 > /sys/class/pwm/pwmchip1/pwm0/period
90 | +echo 1 > /sys/class/pwm/pwmchip1/pwm0/enable
91 | +
92 | +# max speed run 5s
93 | +echo 46990 > /sys/class/pwm/pwmchip1/pwm0/duty_cycle
94 | +sleep 5
95 | +echo 25000 > /sys/class/pwm/pwmchip1/pwm0/duty_cycle
96 | +
97 | +# declare -a CpuTemps=(55000 43000 38000 32000)
98 | +# declare -a PwmDutyCycles=(1000 20000 30000 45000)
99 | +
100 | +declare -a CpuTemps=(75000 63000 58000 52000)
101 | +declare -a PwmDutyCycles=(25000 35000 45000 46990)
102 | +
103 | +declare -a Percents=(100 75 50 25)
104 | +DefaultDuty=49990
105 | +DefaultPercents=0
106 | +
107 | +while true
108 | +do
109 | + temp=$(cat /sys/class/thermal/thermal_zone0/temp)
110 | + INDEX=0
111 | + FOUNDTEMP=0
112 | + DUTY=$DefaultDuty
113 | + PERCENT=$DefaultPercents
114 | +
115 | + for i in 0 1 2 3; do
116 | + if [ $temp -gt ${CpuTemps[$i]} ]; then
117 | + INDEX=$i
118 | + FOUNDTEMP=1
119 | + break
120 | + fi
121 | + done
122 | + if [ ${FOUNDTEMP} == 1 ]; then
123 | + DUTY=${PwmDutyCycles[$i]}
124 | + PERCENT=${Percents[$i]}
125 | + fi
126 | +
127 | + echo $DUTY > /sys/class/pwm/pwmchip1/pwm0/duty_cycle;
128 | +
129 | + # echo "temp: $temp, duty: $DUTY, ${PERCENT}%"
130 | + # cat /sys/devices/system/cpu/cpu*/cpufreq/cpuinfo_cur_freq
131 | +
132 | + sleep 2s;
133 | +done
134 | diff --git a/target/linux/rockchip/armv8/base-files/usr/bin/fa-fancontrol.sh b/target/linux/rockchip/armv8/base-files/usr/bin/fa-fancontrol.sh
135 | new file mode 100755
136 | index 0000000000000..e7c14054c80e9
137 | --- /dev/null
138 | +++ b/target/linux/rockchip/armv8/base-files/usr/bin/fa-fancontrol.sh
139 | @@ -0,0 +1,36 @@
140 | +#!/bin/bash
141 | +
142 | +# determine fan controller
143 | +if [ -d /sys/devices/platform/pwm-fan ]; then
144 | + (cd /sys/devices/virtual/thermal/thermal_zone0 && {
145 | + logger -p user.info -t "pwmfan" "set the conditions for fan"
146 | + [ -f trip_point_3_temp ] && {
147 | + # select fan level 1
148 | + echo 50000 > trip_point_3_temp
149 | + }
150 | + [ -f trip_point_4_temp ] && {
151 | + # select fan level 2-4
152 | + echo 55000 > trip_point_4_temp
153 | + }
154 | + })
155 | +
156 | + (cd /sys/devices/virtual/thermal/cooling_device0 && {
157 | + TYPE=`cat type`
158 | + if [ $TYPE = 'pwm-fan' ]; then
159 | + # run 5s
160 | + for i in `seq 1 5`; do
161 | + logger -p user.info -t "pwmfan" "start to spin ${i}/5"
162 | + echo 3 > cur_state
163 | + sleep 1
164 | + done
165 | + logger -p user.info -t "pwmfan" "set to auto"
166 | + echo 0 > cur_state
167 | + fi
168 | + })
169 | +else
170 | + logger -p user.info -t "pwmfan" "not found cooling device"
171 | + if [ -d /sys/class/pwm ]; then
172 | + nohup /usr/bin/fa-fancontrol-direct.sh&
173 | + fi
174 | +fi
175 | +
176 |
--------------------------------------------------------------------------------
/devices/rockchip_armv8/patches/fix.patch:
--------------------------------------------------------------------------------
1 | From 990db13ff694ffd40cb6389795a0269511aad0ea Mon Sep 17 00:00:00 2001
2 | From: kiddin9 <48883331+kiddin9@users.noreply.github.com>
3 | Date: Tue, 18 Apr 2023 07:32:22 +0800
4 | Subject: [PATCH] Update 301-arm64-dts-rockchip-Add-GuangMiao-G4C-support.patch
5 |
6 | ---
7 | ...64-dts-rockchip-Add-GuangMiao-G4C-support.patch | 14 ++++++++++++--
8 | 1 file changed, 12 insertions(+), 2 deletions(-)
9 |
10 | diff --git a/package/boot/uboot-rockchip/patches/301-arm64-dts-rockchip-Add-GuangMiao-G4C-support.patch b/package/boot/uboot-rockchip/patches/301-arm64-dts-rockchip-Add-GuangMiao-G4C-support.patch
11 | index 57d5b0f8d9be..73d9f52caf99 100644
12 | --- a/package/boot/uboot-rockchip/patches/301-arm64-dts-rockchip-Add-GuangMiao-G4C-support.patch
13 | +++ b/package/boot/uboot-rockchip/patches/301-arm64-dts-rockchip-Add-GuangMiao-G4C-support.patch
14 | @@ -17,13 +17,23 @@
15 | +CONFIG_ENV_OFFSET=0x3F8000
16 | +CONFIG_ROCKCHIP_RK3399=y
17 | +CONFIG_TARGET_EVB_RK3399=y
18 | ++CONFIG_SPL_STACK=0x400000
19 | +CONFIG_NR_DRAM_BANKS=1
20 | ++CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
21 | ++CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x300000
22 | +CONFIG_SYS_LOAD_ADDR=0x800800
23 | +CONFIG_DEBUG_UART_BASE=0xFF1A0000
24 | +CONFIG_DEBUG_UART_CLOCK=24000000
25 | +CONFIG_DEBUG_UART=y
26 | +CONFIG_DEFAULT_FDT_FILE="rockchip/rk3399-guangmiao-g4c.dtb"
27 | +CONFIG_DISPLAY_BOARDINFO_LATE=y
28 | ++CONFIG_SPL_MAX_SIZE=0x2e000
29 | ++CONFIG_SPL_PAD_TO=0x7f8000
30 | ++CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
31 | ++CONFIG_SPL_BSS_START_ADDR=0x400000
32 | ++CONFIG_SPL_BSS_MAX_SIZE=0x2000
33 | ++# CONFIG_SPL_RAW_IMAGE_SUPPORT is not set
34 | ++# CONFIG_SPL_SHARES_INIT_SP_ADDR is not set
35 | +CONFIG_SPL_STACK_R=y
36 | +CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN=0x10000
37 | +CONFIG_TPL=y
38 | @@ -44,16 +54,16 @@
39 | +CONFIG_MMC_DW_ROCKCHIP=y
40 | +CONFIG_MMC_SDHCI=y
41 | +CONFIG_MMC_SDHCI_ROCKCHIP=y
42 | -+CONFIG_DM_ETH=y
43 | +CONFIG_ETH_DESIGNWARE=y
44 | +CONFIG_GMAC_ROCKCHIP=y
45 | +CONFIG_PMIC_RK8XX=y
46 | +CONFIG_REGULATOR_PWM=y
47 | +CONFIG_REGULATOR_RK8XX=y
48 | +CONFIG_PWM_ROCKCHIP=y
49 | -+CONFIG_RAM_RK3399_LPDDR4=y
50 | ++CONFIG_RAM_ROCKCHIP_LPDDR4=y
51 | +CONFIG_BAUDRATE=1500000
52 | +CONFIG_DEBUG_UART_SHIFT=2
53 | ++CONFIG_SYS_NS16550_MEM32=y
54 | +CONFIG_SYSRESET=y
55 | +CONFIG_USB=y
56 | +CONFIG_USB_XHCI_HCD=y
57 |
58 | --- a/target/linux/rockchip/armv8/base-files/etc/board.d/01_leds
59 | +++ b/target/linux/rockchip/armv8/base-files/etc/board.d/01_leds
60 | @@ -9,13 +9,13 @@ boardname="${board##*,}"
61 | board_config_update
62 |
63 | case $board in
64 | -friendlyarm,nanopi-r2c|\
65 | -friendlyarm,nanopi-r2s|\
66 | xunlong,orangepi-r1-plus|\
67 | xunlong,orangepi-r1-plus-lts)
68 | ucidef_set_led_netdev "wan" "WAN" "$boardname:green:wan" "eth0"
69 | ucidef_set_led_netdev "lan" "LAN" "$boardname:green:lan" "eth1"
70 | ;;
71 | +friendlyarm,nanopi-r2c|\
72 | +friendlyarm,nanopi-r2s|\
73 | friendlyarm,nanopi-r4s|\
74 | friendlyarm,nanopi-r4se|\
75 | sharevdi,guangmiao-g4c)
76 |
--------------------------------------------------------------------------------
/devices/rockchip_armv8/patches/pico3399.patch.b:
--------------------------------------------------------------------------------
1 | From f847e36bfe9d24f6bd86dc52ebf17f0025118cd6 Mon Sep 17 00:00:00 2001
2 | From: icevel
3 | Date: Wed, 1 Feb 2023 17:20:59 +0800
4 | Subject: [PATCH] add support
5 |
6 | ---
7 | package/boot/uboot-rockchip/Makefile | 12 +
8 | ...99-Add-support-for-rockchip-pico3399.patch | 749 ++++++++++++++++++
9 | .../armv8/base-files/etc/board.d/02_network | 1 +
10 | .../boot/dts/rockchip/rk3399-pico3399.dts | 668 ++++++++++++++++
11 | target/linux/rockchip/image/armv8.mk | 10 +
12 | ...99-add-support-for-rockchip-pico3399.patch | 11 +
13 | 7 files changed, 1462 insertions(+)
14 | create mode 100644 package/boot/uboot-rockchip/patches/308-rockchip-rk3399-Add-support-for-rockchip-pico3399.patch
15 | create mode 100644 target/linux/rockchip/files/arch/arm64/boot/dts/rockchip/rk3399-pico3399.dts
16 | create mode 100644 target/linux/rockchip/patches-5.15/213-rockchip-rk3399-add-support-for-rockchip-pico3399.patch
17 |
18 | diff --git a/package/boot/uboot-rockchip/Makefile b/package/boot/uboot-rockchip/Makefile
19 | index 69ce25dae..283f4821b 100644
20 | --- a/package/boot/uboot-rockchip/Makefile
21 | +++ b/package/boot/uboot-rockchip/Makefile
22 | @@ -72,6 +72,17 @@ endef
23 |
24 | # RK3399 boards
25 |
26 | +define U-Boot/rockchip-pico3399-rk3399
27 | + BUILD_SUBTARGET:=armv8
28 | + NAME:=rockchip pico3399
29 | + BUILD_DEVICES:= \
30 | + rockchip_pico3399
31 | + DEPENDS:=+PACKAGE_u-boot-rockchip-pico3399-rk3399:arm-trusted-firmware-rk3399
32 | + PKG_BUILD_DEPENDS:=arm-trusted-firmware-rockchip-vendor
33 | + ATF:=rk3399_bl31_v1.35.elf
34 | + USE_RKBIN:=1
35 | +endef
36 | +
37 | define U-Boot/guangmiao-g4c-rk3399
38 | BUILD_SUBTARGET:=armv8
39 | NAME:=GuangMiao G4C
40 | @@ -308,6 +319,7 @@ UBOOT_TARGETS := \
41 | r66s-rk3568 \
42 | station-p2-rk3568 \
43 | panther-x2-rk3566 \
44 | + rockchip-pico3399-rk3399 \
45 | sharevdi-h3399pc-rk3399 \
46 | guangmiao-g4c-rk3399 \
47 | nanopi-r4s-rk3399 \
48 | diff --git a/target/linux/rockchip/armv8/base-files/etc/board.d/02_network b/target/linux/rockchip/armv8/base-files/etc/board.d/02_network
49 | index 8bdefcbb6..5c0aa413a 100755
50 | --- a/target/linux/rockchip/armv8/base-files/etc/board.d/02_network
51 | +++ b/target/linux/rockchip/armv8/base-files/etc/board.d/02_network
52 | @@ -39,6 +39,11 @@ rockchip_setup_interfaces()
53 | friendlyarm,nanopi-r5s)
54 | ucidef_set_interfaces_lan_wan "eth1 eth2" "eth0"
55 | ;;
56 | + ockchip,pico3399)
57 | + ucidef_set_interfaces_lan_wan 'eth0' 'eth1'
58 | + ucidef_add_switch "switch0" \
59 | + "0@eth0" "1:lan:1" "2:lan:2" "3:lan:3" "4:lan:4"
60 | + ;;
61 | *)
62 | ucidef_set_interface_lan 'eth0'
63 | ;;
64 | @@ -88,6 +93,7 @@ rockchip_setup_macs()
65 | hinlink,opc-h68k|\
66 | hinlink,opc-h69k|\
67 | rocktech,mpc1903|\
68 | + rockchip,pico3399|\
69 | sharevdi,h3399pc)
70 | wan_mac=$(macaddr_generate_from_mmc_cid mmcblk0)
71 | lan_mac=$(macaddr_add "$wan_mac" +1)
72 | diff --git a/target/linux/rockchip/image/armv8.mk b/target/linux/rockchip/image/armv8.mk
73 | index f15f8f26b..19d1eba72 100644
74 | --- a/target/linux/rockchip/image/armv8.mk
75 | +++ b/target/linux/rockchip/image/armv8.mk
76 | @@ -192,6 +192,16 @@ define Device/rocktech_mpc1903
77 | endef
78 | TARGET_DEVICES += rocktech_mpc1903
79 |
80 | +define Device/rockchip_pico3399
81 | + DEVICE_VENDOR := rockchip
82 | + DEVICE_MODEL := pico3399
83 | + SOC := rk3399
84 | + UBOOT_DEVICE_NAME := rockchip-pico3399-rk3399
85 | + IMAGE/sysupgrade.img.gz := boot-common | boot-script | pine64-bin | gzip | append-metadata
86 | + DEVICE_PACKAGES := kmod-r8169 kmod-r8125 kmod-nvme -urngd
87 | +endef
88 | +TARGET_DEVICES += rockchip_pico3399
89 | +
90 | define Device/sharevdi_guangmiao-g4c
91 | DEVICE_VENDOR := SHAREVDI
92 | DEVICE_MODEL := GuangMiao G4C
93 | diff --git a/target/linux/rockchip/patches-5.15/213-rockchip-rk3399-add-support-for-rockchip-pico3399.patch b/target/linux/rockchip/patches-5.15/213-rockchip-rk3399-add-support-for-rockchip-pico3399.patch
94 | new file mode 100644
95 | index 000000000..ddfa7f575
96 | --- /dev/null
97 | +++ b/target/linux/rockchip/patches-5.15/213-rockchip-rk3399-add-support-for-rockchip-pico3399.patch
98 | @@ -0,0 +1,8 @@
99 | +--- a/arch/arm64/boot/dts/rockchip/Makefile
100 | ++++ b/arch/arm64/boot/dts/rockchip/Makefile
101 | +@@ -58,6 +58,7 @@
102 | + dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-sapphire.dtb
103 | + dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-sapphire-excavator.dtb
104 | + dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399pro-rock-pi-n10.dtb
105 | ++dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-pico3399.dtb
106 | + dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-king3399.dtb
107 | + dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-mpc1903.dtb
108 | + dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-h3399pc.dtb
109 |
--------------------------------------------------------------------------------
/devices/rockchip_armv8/patches/r6s.patch.b:
--------------------------------------------------------------------------------
1 | --- a/target/linux/rockchip/image/armv8.mk
2 | +++ b/target/linux/rockchip/image/armv8.mk
3 | @@ -52,4 +52,31 @@
4 | TARGET_DEVICES += friendlyarm_nanopi-r2s
5 |
6 | +define Device/friendlyarm_nanopi-r6c
7 | + DEVICE_VENDOR := FriendlyARM
8 | + DEVICE_MODEL := NanoPi R6C
9 | + SOC := rk3328
10 | + DEVICE_PACKAGES := -luci-app-gpsysupgrade
11 | + DEVICE_DTS = rockchip/rk3328-nanopi-r2s
12 | +endef
13 | +TARGET_DEVICES += friendlyarm_nanopi-r6c
14 | +
15 | +define Device/friendlyarm_nanopi-r6s
16 | + DEVICE_VENDOR := FriendlyARM
17 | + DEVICE_MODEL := NanoPi R6S
18 | + SOC := rk3328
19 | + DEVICE_PACKAGES := -luci-app-gpsysupgrade
20 | + DEVICE_DTS = rockchip/rk3328-nanopi-r2s
21 | +endef
22 | +TARGET_DEVICES += friendlyarm_nanopi-r6s
23 | +
24 | +define Device/friendlyarm_nanopc-t6
25 | + DEVICE_VENDOR := FriendlyARM
26 | + DEVICE_MODEL := NanoPC T6
27 | + SOC := rk3328
28 | + DEVICE_PACKAGES := -luci-app-gpsysupgrade
29 | + DEVICE_DTS = rockchip/rk3328-nanopi-r2s
30 | +endef
31 | +TARGET_DEVICES += friendlyarm_nanopc-t6
32 | +
33 | define Device/friendlyarm_nanopi-r4s
34 | DEVICE_VENDOR := FriendlyARM
35 |
36 | --- a/target/linux/rockchip/armv8/base-files/etc/board.d/02_network
37 | +++ b/target/linux/rockchip/armv8/base-files/etc/board.d/02_network
38 | @@ -21,9 +21,14 @@ rockchip_setup_interfaces()
39 | sharevdi,h3399pc|\
40 | sharevdi,guangmiao-g4c|\
41 | xunlong,orangepi-r1-plus|\
42 | - xunlong,orangepi-r1-plus-lts)
43 | + xunlong,orangepi-r1-plus-lts|\
44 | + friendlyarm,nanopc-t6|\
45 | + friendlyarm,nanopi-r6c)
46 | ucidef_set_interfaces_lan_wan 'eth1' 'eth0'
47 | ;;
48 | + friendlyarm,nanopi-r6s)
49 | + ucidef_set_interfaces_lan_wan "eth1 eth0" "eth2"
50 | + ;;
51 | fastrhino,r66s|\
52 | firefly,rk3568-roc-pc|\
53 | friendlyarm,nanopi-r5c|\
54 | @@ -45,10 +50,10 @@ rockchip_setup_interfaces()
55 | esac
56 | }
57 |
58 | -nanopi_r4s_get_mac()
59 | +nanopi_get_mac()
60 | {
61 | local interface=$1
62 | - local eeprom_path="/sys/bus/i2c/devices/2-0051/eeprom"
63 | + local eeprom_path="/sys/bus/i2c/devices/$2/eeprom"
64 | local address
65 |
66 | if [ -f "$eeprom_path" ]; then
67 | @@ -94,8 +99,12 @@ rockchip_setup_macs()
68 | ;;
69 | friendlyarm,nanopi-r4s|\
70 | friendlyarm,nanopi-r4se)
71 | - wan_mac=$(nanopi_r4s_get_mac wan)
72 | - lan_mac=$(nanopi_r4s_get_mac lan)
73 | + wan_mac=$(nanopi_get_mac wan 2-0051)
74 | + lan_mac=$(nanopi_get_mac lan 2-0051)
75 | + ;;
76 | + friendlyarm,nanopi-r6s|friendlyarm,nanopi-r6c|friendlyarm,nanopc-t6)
77 | + wan_mac=$(nanopi_get_mac wan 6-0053)
78 | + lan_mac=$(nanopi_get_mac lan 6-0053)
79 | ;;
80 | friendlyarm,nanopi-r5c|\
81 | friendlyarm,nanopi-r5s|\
82 |
83 | --- a/target/linux/rockchip/armv8/base-files/etc/board.d/01_leds
84 | +++ a/target/linux/rockchip/armv8/base-files/etc/board.d/01_leds
85 | @@ -36,6 +36,15 @@ hinlink,opc-h68k|\
86 | hinlink,opc-h69k)
87 | ucidef_set_led_netdev "wan" "WAN" "blue:net" "eth0"
88 | ;;
89 | +friendlyarm,nanopi-r6s)
90 | + ucidef_set_led_netdev "wan" "WAN" "green:wan" "eth2"
91 | + ucidef_set_led_netdev "lan1" "LAN1" "green:lan1" "eth1"
92 | + ucidef_set_led_netdev "lan2" "LAN2" "green:lan2" "eth0"
93 | + ;;
94 | +friendlyarm,nanopi-r6c)
95 | + ucidef_set_led_netdev "wan" "WAN" "green:wan" "eth0"
96 | + ucidef_set_led_netdev "lan1" "LAN1" "green:lan" "eth1"
97 | + ;;
98 | esac
99 |
100 | board_config_flush
101 |
102 | --- a/target/linux/rockchip/armv8/base-files/etc/hotplug.d/net/40-net-smp-affinity
103 | +++ a/target/linux/rockchip/armv8/base-files/etc/hotplug.d/net/40-net-smp-affinity
104 | @@ -52,5 +52,25 @@ friendlyarm,nanopi-r5s)
105 | set_interface_core 2 "eth1"
106 | set_interface_core 4 "eth2"
107 | ;;
108 | +friendlyarm,nanopi-r6s)
109 | + set_interface_core 2 "eth0"
110 | + echo 3e > /sys/class/net/eth0/queues/rx-0/rps_cpus
111 | + set_interface_core 10 "eth1-0"
112 | + set_interface_core 20 "eth1-16"
113 | + set_interface_core 20 "eth1-18"
114 | + echo fe > /sys/class/net/eth1/queues/rx-0/rps_cpus
115 | + set_interface_core 40 "eth2-0"
116 | + set_interface_core 80 "eth2-16"
117 | + set_interface_core 80 "eth2-18"
118 | + echo fe > /sys/class/net/eth2/queues/rx-0/rps_cpus
119 | + ;;
120 | +friendlyarm,nanopi-r6c)
121 | + set_interface_core 40 "eth0"
122 | + echo fe > /sys/class/net/eth0/queues/rx-0/rps_cpus
123 | + set_interface_core 10 "eth1-0"
124 | + set_interface_core 20 "eth1-16"
125 | + set_interface_core 20 "eth1-18"
126 | + echo fe > /sys/class/net/eth1/queues/rx-0/rps_cpus
127 | + ;;
128 | esac
129 |
130 | --- a/target/linux/rockchip/image/Makefile
131 | +++ b/target/linux/rockchip/image/Makefile
132 | @@ -79,4 +79,15 @@ endif
133 |
134 | include $(SUBTARGET).mk
135 |
136 | +define Image/Build
137 | + if [[ "$(PROFILE_SANITIZED)" == "friendlyarm_nanopc-t6" ]]; then \
138 | + export IMG_PREFIX="$(IMG_PREFIX)$(if $(PROFILE_SANITIZED),-$(PROFILE_SANITIZED))"; \
139 | + export BIN_DIR=$(BIN_DIR); \
140 | + export TOPDIR=$(TOPDIR); \
141 | + export MORE=$(MORE); \
142 | + cd /data/packit/friendlywrt22-rk3588; \
143 | + . ~/packit/packit_nanopi.sh; \
144 | + fi
145 | +endef
146 | +
147 | $(eval $(call BuildImage))
148 |
--------------------------------------------------------------------------------
/devices/rockchip_rk3588_bsp/.config:
--------------------------------------------------------------------------------
1 |
2 | CONFIG_TARGET_rockchip=y
3 | CONFIG_TARGET_rockchip_rk3588_bsp=y
4 | CONFIG_TARGET_MULTI_PROFILE=y
5 |
6 | CONFIG_TARGET_DEVICE_rockchip_rk3588_bsp_DEVICE_friendlyelec_nanopi-r6c=y
7 | CONFIG_TARGET_DEVICE_rockchip_rk3588_bsp_DEVICE_friendlyelec_nanopi-r6c-plus=y
8 | CONFIG_TARGET_DEVICE_rockchip_rk3588_bsp_DEVICE_friendlyelec_nanopi-r6s=y
9 | CONFIG_TARGET_DEVICE_rockchip_rk3588_bsp_DEVICE_friendlyelec_nanopc-t6=y
10 | CONFIG_TARGET_DEVICE_rockchip_rk3588_bsp_DEVICE_xunlong_orangepi-5=y
11 | CONFIG_TARGET_DEVICE_rockchip_rk3588_bsp_DEVICE_xunlong_orangepi-5-plus=y
12 |
13 | CONFIG_PACKAGE_kmod-rtl8821cu=m
14 | CONFIG_PACKAGE_kmod-rtl88x2bu=m
15 | CONFIG_PACKAGE_kmod-pcie_mhi=m
16 |
17 | CONFIG_PACKAGE_luci-ssl=n # uhttpd服务
18 | CONFIG_PACKAGE_luci-ssl-nginx=y # nginx
19 |
20 |
--------------------------------------------------------------------------------
/devices/rockchip_rk3588_bsp/README.md:
--------------------------------------------------------------------------------
1 | 源码来源 https://github.com/mj22226/openwrt 感谢
--------------------------------------------------------------------------------
/devices/rockchip_rk3588_bsp/diy.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | shopt -s extglob
4 |
5 | sed -i "s/SUBTARGETS:=armv8$/SUBTARGETS:=rk3588_bsp/" target/linux/rockchip/Makefile
6 | sed -i "s/SUBTARGET:=armv8$/SUBTARGET:=rk3588_bsp/" target/linux/rockchip/armv8/target.mk
7 |
8 | sed -i -e 's,kmod-r8168,kmod-r8169,g' target/linux/rockchip/image/armv8.mk
9 |
10 | sed -i 's/DEFAULT_PACKAGES +=/DEFAULT_PACKAGES += fdisk lsblk kmod-drm-rockchip/' target/linux/rockchip/Makefile
11 |
12 | echo '
13 | CONFIG_SENSORS_PWM_FAN=y
14 | ' >> ./target/linux/rockchip/armv8/config-6.1
15 |
16 | sed -i "/KernelPackage,ptp/d" package/kernel/linux/modules/other.mk
17 |
18 | rm -rf feeds/kiddin9/{quectel_MHI,shortcut-fe,quectel_Gobinet,rtl88*}
19 |
20 | sed -i "/friendlyelec/d" package/feeds/kiddin9/base-files/files/lib/preinit/02_sysinfo
21 |
22 | mv -f target/linux/rockchip/image/armv8.mk target/linux/rockchip/image/rk3588_bsp.mk
23 |
24 | mv -f target/linux/rockchip/armv8 target/linux/rockchip/rk3588_bsp
25 |
26 | sed -i "s/BUILD_SUBTARGET:=armv8/BUILD_SUBTARGET:=rk3588_bsp/" package/boot/uboot-rockchip/Makefile
27 |
28 | #curl -sfL https://raw.githubusercontent.com/coolsnowwolf/lede/master/package/kernel/linux/modules/video.mk -o package/kernel/linux/modules/video.mk
29 |
30 |
--------------------------------------------------------------------------------
/devices/rockchip_rk3588_bsp/patches/add_extra_CPU_FLAGS.patch:
--------------------------------------------------------------------------------
1 | --- a/include/target.mk
2 | +++ b/include/target.mk
3 | @@ -259,9 +259,18 @@ ifeq ($(DUMP),1)
4 | CPU_CFLAGS_arc700 = -mcpu=arc700
5 | CPU_CFLAGS_archs = -mcpu=archs
6 | endif
7 | + ifeq ($(BOARD),rockchip)
8 | + CPU_CFLAGS = -O3 -pipe
9 | + CPU_CFLAGS_cortex-a53 = -mcpu=cortex-a53
10 | + CPU_CFLAGS_cortex-a55 = -march=armv8-a+crypto+crc -mcpu=cortex-a55+crypto+crc -mtune=cortex-a55
11 | + CPU_CFLAGS_cortex-a73 = -march=armv8-a+crypto+crc -mcpu=cortex-a73.cortex-a53+crypto+crc -mtune=cortex-a73.cortex-a53
12 | + ifneq ($(SOC_CFLAGS),)
13 | + CPU_CFLAGS_generic = $(SOC_CFLAGS)
14 | + endif
15 | + endif
16 | ifneq ($(CPU_TYPE),)
17 | ifndef CPU_CFLAGS_$(CPU_TYPE)
18 | - $(warning CPU_TYPE "$(CPU_TYPE)" doesn't correspond to a known type)
19 | + $(warning CPU_TYPE "$(CPU_TYPE)" "doesn't correspond to a known type")
20 | endif
21 | endif
22 | DEFAULT_CFLAGS=$(strip $(CPU_CFLAGS) $(CPU_CFLAGS_$(CPU_TYPE)) $(CPU_CFLAGS_$(CPU_SUBTYPE)))
--------------------------------------------------------------------------------
/devices/rockchip_rk3588_bsp/patches/fix.patch:
--------------------------------------------------------------------------------
1 | --- a/package/boot/arm-trusted-firmware-rockchip/Makefile
2 | +++ b/package/boot/arm-trusted-firmware-rockchip/Makefile
3 | @@ -28,7 +28,7 @@ define Package/arm-trusted-firmware-rockchip
4 | SECTION:=boot
5 | CATEGORY:=Boot Loaders
6 | TITLE:=ARM Trusted Firmware for Rockchip
7 | - DEPENDS:=@TARGET_rockchip_armv8
8 | + DEPENDS:=@TARGET_rockchip_rk3588_bsp
9 | endef
10 |
11 | define Build/Prepare
12 |
13 | new file mode 100644
14 | index 000000000..ddfa7f575
15 | --- /dev/null
16 | +++ b/target/linux/rockchip/patches-5.10/199-fix_pthread_once_error.patch
17 | @@ -0,0 +1,11 @@
18 | +--- a/scripts/Makefile
19 | ++++ b/scripts/Makefile
20 | +@@ -22,7 +22,7 @@
21 | + HOSTCFLAGS_sign-file.o = $(CRYPTO_CFLAGS)
22 | + HOSTLDLIBS_sign-file = $(CRYPTO_LIBS)
23 | + HOSTCFLAGS_extract-cert.o = $(CRYPTO_CFLAGS)
24 | +-HOSTLDLIBS_extract-cert = $(CRYPTO_LIBS)
25 | ++HOSTLDLIBS_extract-cert = $(CRYPTO_LIBS) -lpthread
26 | +
27 | + ifdef CONFIG_UNWINDER_ORC
28 | + ifeq ($(ARCH),x86_64)
29 |
--------------------------------------------------------------------------------
/devices/rockchip_rk3588_bsp/settings.ini:
--------------------------------------------------------------------------------
1 | REPO_URL="https://github.com/mj22226/openwrt"
2 | REPO_BRANCH="linux-6.1"
3 |
--------------------------------------------------------------------------------
/devices/x86_64/.config:
--------------------------------------------------------------------------------
1 |
2 | CONFIG_TARGET_x86=y
3 | CONFIG_TARGET_x86_64=y
4 | CONFIG_TARGET_ROOTFS_TARGZ=y
5 |
6 | # EFI支持:
7 | CONFIG_GRUB_IMAGES=y
8 | CONFIG_GRUB_EFI_IMAGES=y
9 | CONFIG_VMDK_IMAGES=n
10 |
11 | # 其他需要安装的软件包:
12 | CONFIG_PACKAGE_luci-ssl=n # uhttpd服务
13 | CONFIG_PACKAGE_luci-ssl-nginx=y # nginx
14 |
15 | CONFIG_PACKAGE_kmod-rtl8821cu=m
16 | CONFIG_PACKAGE_kmod-rtl88x2bu=m
17 |
18 | CONFIG_PACKAGE_kmod-pcie_mhi=m
19 |
20 | CONFIG_OPENSSL_PREFER_CHACHA_OVER_GCM=n
21 |
22 |
--------------------------------------------------------------------------------
/devices/x86_64/diy.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | SHELL_FOLDER=$(dirname $(readlink -f "$0"))
4 |
5 | svn co https://github.com/coolsnowwolf/lede/trunk/target/linux/x86/files target/linux/x86/files
6 | rm -rf target/linux/x86/files/.svn
7 |
8 | svn co https://github.com/coolsnowwolf/lede/trunk/target/linux/x86/patches-5.15 target/linux/x86/patches-5.15
9 | rm -rf target/linux/x86/patches-5.15/.svn
10 |
11 | curl -sfL https://raw.githubusercontent.com/coolsnowwolf/lede/master/package/kernel/linux/modules/video.mk -o package/kernel/linux/modules/video.mk
12 | curl -sfL https://raw.githubusercontent.com/coolsnowwolf/lede/master/target/linux/x86/base-files/etc/board.d/02_network -o target/linux/x86/base-files/etc/board.d/02_network
13 |
14 | sed -i 's/DEFAULT_PACKAGES +=/DEFAULT_PACKAGES += kmod-usb-hid kmod-mmc kmod-sdhci usbutils pciutils lm-sensors-detect kmod-alx kmod-vmxnet3 kmod-igbvf kmod-iavf kmod-bnx2x kmod-pcnet32 kmod-tulip kmod-r8125 kmod-8139cp kmod-8139too kmod-i40e kmod-drm-i915 kmod-drm-amdgpu kmod-mlx4-core kmod-mlx5-core fdisk lsblk kmod-phy-broadcom/' target/linux/x86/Makefile
15 |
16 |
17 | mv -f tmp/r81* feeds/kiddin9/
18 | sed -i 's,kmod-r8169,kmod-r8168,g' target/linux/x86/image/64.mk
19 | sed -i 's/256/1024/g' target/linux/x86/image/Makefile
20 |
21 | echo '
22 | CONFIG_ACPI=y
23 | CONFIG_X86_ACPI_CPUFREQ=y
24 | CONFIG_NR_CPUS=512
25 | CONFIG_MMC=y
26 | CONFIG_MMC_BLOCK=y
27 | CONFIG_SDIO_UART=y
28 | CONFIG_MMC_TEST=y
29 | CONFIG_MMC_DEBUG=y
30 | CONFIG_MMC_SDHCI=y
31 | CONFIG_MMC_SDHCI_ACPI=y
32 | CONFIG_MMC_SDHCI_PCI=y
33 | ' >> ./target/linux/x86/config-5.15
34 |
35 | sed -i "s/enabled '0'/enabled '1'/g" feeds/packages/utils/irqbalance/files/irqbalance.config
36 |
37 |
--------------------------------------------------------------------------------
/devices/x86_64/patches/Intel_gpu.patch:
--------------------------------------------------------------------------------
1 | diff --git a/package/firmware/linux-firmware/intel.mk b/package/firmware/linux-firmware/intel.mk
2 | index 923701c703d..7f60014ea6c 100644
3 | --- a/package/firmware/linux-firmware/intel.mk
4 | +++ b/package/firmware/linux-firmware/intel.mk
5 | @@ -176,3 +176,95 @@ define Package/e100-firmware/install
6 | $(INSTALL_DATA) $(PKG_BUILD_DIR)/e100/d102e_ucode.bin $(1)/lib/firmware/e100/
7 | endef
8 | $(eval $(call BuildPackage,e100-firmware))
9 | +
10 | +Package/i915-firmware = $(call Package/firmware-default,Intel GPU firmware)
11 | +define Package/i915-firmware/install
12 | + $(INSTALL_DIR) $(1)/lib/firmware/i915
13 | + $(INSTALL_DATA) $(PKG_BUILD_DIR)/i915/icl_dmc_ver1_09.bin $(1)/lib/firmware/i915/
14 | + $(INSTALL_DATA) $(PKG_BUILD_DIR)/i915/adlp_dmc_ver2_09.bin $(1)/lib/firmware/i915/
15 | + $(INSTALL_DATA) $(PKG_BUILD_DIR)/i915/adlp_dmc_ver2_10.bin $(1)/lib/firmware/i915/
16 | + $(INSTALL_DATA) $(PKG_BUILD_DIR)/i915/adlp_dmc_ver2_12.bin $(1)/lib/firmware/i915/
17 | + $(INSTALL_DATA) $(PKG_BUILD_DIR)/i915/adlp_guc_62.0.3.bin $(1)/lib/firmware/i915/
18 | + $(INSTALL_DATA) $(PKG_BUILD_DIR)/i915/adls_dmc_ver2_01.bin $(1)/lib/firmware/i915/
19 | + $(INSTALL_DATA) $(PKG_BUILD_DIR)/i915/bxt_dmc_ver1_07.bin $(1)/lib/firmware/i915/
20 | + ln -s /lib/firmware/i915/bxt_dmc_ver1_07.bin $(1)/lib/firmware/i915/bxt_dmc_ver1.bin
21 | + $(INSTALL_DATA) $(PKG_BUILD_DIR)/i915/bxt_guc_32.0.3.bin $(1)/lib/firmware/i915/
22 | + $(INSTALL_DATA) $(PKG_BUILD_DIR)/i915/bxt_guc_33.0.0.bin $(1)/lib/firmware/i915/
23 | + $(INSTALL_DATA) $(PKG_BUILD_DIR)/i915/bxt_guc_49.0.1.bin $(1)/lib/firmware/i915/
24 | + $(INSTALL_DATA) $(PKG_BUILD_DIR)/i915/bxt_guc_62.0.0.bin $(1)/lib/firmware/i915/
25 | + $(INSTALL_DATA) $(PKG_BUILD_DIR)/i915/bxt_guc_ver8_7.bin $(1)/lib/firmware/i915/
26 | + $(INSTALL_DATA) $(PKG_BUILD_DIR)/i915/bxt_guc_ver9_29.bin $(1)/lib/firmware/i915/
27 | + $(INSTALL_DATA) $(PKG_BUILD_DIR)/i915/bxt_huc_2.0.0.bin $(1)/lib/firmware/i915/
28 | + $(INSTALL_DATA) $(PKG_BUILD_DIR)/i915/bxt_huc_ver01_07_1398.bin $(1)/lib/firmware/i915/
29 | + $(INSTALL_DATA) $(PKG_BUILD_DIR)/i915/bxt_huc_ver01_8_2893.bin $(1)/lib/firmware/i915/
30 | + $(INSTALL_DATA) $(PKG_BUILD_DIR)/i915/cml_guc_33.0.0.bin $(1)/lib/firmware/i915/
31 | + $(INSTALL_DATA) $(PKG_BUILD_DIR)/i915/cml_guc_49.0.1.bin $(1)/lib/firmware/i915/
32 | + $(INSTALL_DATA) $(PKG_BUILD_DIR)/i915/cml_guc_62.0.0.bin $(1)/lib/firmware/i915/
33 | + $(INSTALL_DATA) $(PKG_BUILD_DIR)/i915/cml_huc_4.0.0.bin $(1)/lib/firmware/i915/
34 | + $(INSTALL_DATA) $(PKG_BUILD_DIR)/i915/cnl_dmc_ver1_06.bin $(1)/lib/firmware/i915/
35 | + $(INSTALL_DATA) $(PKG_BUILD_DIR)/i915/cnl_dmc_ver1_07.bin $(1)/lib/firmware/i915/
36 | + $(INSTALL_DATA) $(PKG_BUILD_DIR)/i915/dg1_dmc_ver2_02.bin $(1)/lib/firmware/i915/
37 | + $(INSTALL_DATA) $(PKG_BUILD_DIR)/i915/dg1_guc_49.0.1.bin $(1)/lib/firmware/i915/
38 | + $(INSTALL_DATA) $(PKG_BUILD_DIR)/i915/dg1_guc_62.0.0.bin $(1)/lib/firmware/i915/
39 | + $(INSTALL_DATA) $(PKG_BUILD_DIR)/i915/dg1_huc_7.7.1.bin $(1)/lib/firmware/i915/
40 | + $(INSTALL_DATA) $(PKG_BUILD_DIR)/i915/dg1_huc_7.9.3.bin $(1)/lib/firmware/i915/
41 | + $(INSTALL_DATA) $(PKG_BUILD_DIR)/i915/ehl_guc_33.0.4.bin $(1)/lib/firmware/i915/
42 | + $(INSTALL_DATA) $(PKG_BUILD_DIR)/i915/ehl_guc_49.0.1.bin $(1)/lib/firmware/i915/
43 | + $(INSTALL_DATA) $(PKG_BUILD_DIR)/i915/ehl_guc_62.0.0.bin $(1)/lib/firmware/i915/
44 | + $(INSTALL_DATA) $(PKG_BUILD_DIR)/i915/ehl_huc_9.0.0.bin $(1)/lib/firmware/i915/
45 | + $(INSTALL_DATA) $(PKG_BUILD_DIR)/i915/glk_dmc_ver1_04.bin $(1)/lib/firmware/i915/
46 | + $(INSTALL_DATA) $(PKG_BUILD_DIR)/i915/glk_guc_32.0.3.bin $(1)/lib/firmware/i915/
47 | + $(INSTALL_DATA) $(PKG_BUILD_DIR)/i915/glk_guc_33.0.0.bin $(1)/lib/firmware/i915/
48 | + $(INSTALL_DATA) $(PKG_BUILD_DIR)/i915/glk_guc_49.0.1.bin $(1)/lib/firmware/i915/
49 | + $(INSTALL_DATA) $(PKG_BUILD_DIR)/i915/glk_guc_62.0.0.bin $(1)/lib/firmware/i915/
50 | + $(INSTALL_DATA) $(PKG_BUILD_DIR)/i915/glk_huc_4.0.0.bin $(1)/lib/firmware/i915/
51 | + $(INSTALL_DATA) $(PKG_BUILD_DIR)/i915/glk_huc_ver03_01_2893.bin $(1)/lib/firmware/i915/
52 | + $(INSTALL_DATA) $(PKG_BUILD_DIR)/i915/icl_dmc_ver1_07.bin $(1)/lib/firmware/i915/
53 | + $(INSTALL_DATA) $(PKG_BUILD_DIR)/i915/icl_dmc_ver1_09.bin $(1)/lib/firmware/i915/
54 | + $(INSTALL_DATA) $(PKG_BUILD_DIR)/i915/icl_guc_32.0.3.bin $(1)/lib/firmware/i915/
55 | + $(INSTALL_DATA) $(PKG_BUILD_DIR)/i915/icl_guc_33.0.0.bin $(1)/lib/firmware/i915/
56 | + $(INSTALL_DATA) $(PKG_BUILD_DIR)/i915/icl_guc_49.0.1.bin $(1)/lib/firmware/i915/
57 | + $(INSTALL_DATA) $(PKG_BUILD_DIR)/i915/icl_guc_62.0.0.bin $(1)/lib/firmware/i915/
58 | + $(INSTALL_DATA) $(PKG_BUILD_DIR)/i915/icl_huc_9.0.0.bin $(1)/lib/firmware/i915/
59 | + $(INSTALL_DATA) $(PKG_BUILD_DIR)/i915/icl_huc_ver8_4_3238.bin $(1)/lib/firmware/i915/
60 | + $(INSTALL_DATA) $(PKG_BUILD_DIR)/i915/kbl_dmc_ver1_01.bin $(1)/lib/firmware/i915/
61 | + $(INSTALL_DATA) $(PKG_BUILD_DIR)/i915/kbl_dmc_ver1_04.bin $(1)/lib/firmware/i915/
62 | + ln -s /lib/firmware/i915/kbl_dmc_ver1_04.bin $(1)/lib/firmware/i915/kbl_dmc_ver1.bin
63 | + $(INSTALL_DATA) $(PKG_BUILD_DIR)/i915/kbl_guc_32.0.3.bin $(1)/lib/firmware/i915/
64 | + $(INSTALL_DATA) $(PKG_BUILD_DIR)/i915/kbl_guc_33.0.0.bin $(1)/lib/firmware/i915/
65 | + $(INSTALL_DATA) $(PKG_BUILD_DIR)/i915/kbl_guc_49.0.1.bin $(1)/lib/firmware/i915/
66 | + $(INSTALL_DATA) $(PKG_BUILD_DIR)/i915/kbl_guc_62.0.0.bin $(1)/lib/firmware/i915/
67 | + $(INSTALL_DATA) $(PKG_BUILD_DIR)/i915/kbl_guc_ver9_14.bin $(1)/lib/firmware/i915/
68 | + $(INSTALL_DATA) $(PKG_BUILD_DIR)/i915/kbl_guc_ver9_39.bin $(1)/lib/firmware/i915/
69 | + $(INSTALL_DATA) $(PKG_BUILD_DIR)/i915/kbl_huc_4.0.0.bin $(1)/lib/firmware/i915/
70 | + $(INSTALL_DATA) $(PKG_BUILD_DIR)/i915/kbl_huc_ver02_00_1810.bin $(1)/lib/firmware/i915/
71 | + $(INSTALL_DATA) $(PKG_BUILD_DIR)/i915/rkl_dmc_ver2_02.bin $(1)/lib/firmware/i915/
72 | + $(INSTALL_DATA) $(PKG_BUILD_DIR)/i915/rkl_dmc_ver2_03.bin $(1)/lib/firmware/i915/
73 | + $(INSTALL_DATA) $(PKG_BUILD_DIR)/i915/skl_dmc_ver1_23.bin $(1)/lib/firmware/i915/
74 | + $(INSTALL_DATA) $(PKG_BUILD_DIR)/i915/skl_dmc_ver1_26.bin $(1)/lib/firmware/i915/
75 | + ln -s /lib/firmware/i915/skl_dmc_ver1_26.bin $(1)/lib/firmware/i915/skl_dmc_ver1.bin
76 | + $(INSTALL_DATA) $(PKG_BUILD_DIR)/i915/skl_dmc_ver1_27.bin $(1)/lib/firmware/i915/
77 | + $(INSTALL_DATA) $(PKG_BUILD_DIR)/i915/skl_guc_32.0.3.bin $(1)/lib/firmware/i915/
78 | + $(INSTALL_DATA) $(PKG_BUILD_DIR)/i915/skl_guc_33.0.0.bin $(1)/lib/firmware/i915/
79 | + $(INSTALL_DATA) $(PKG_BUILD_DIR)/i915/skl_guc_49.0.1.bin $(1)/lib/firmware/i915/
80 | + $(INSTALL_DATA) $(PKG_BUILD_DIR)/i915/skl_guc_62.0.0.bin $(1)/lib/firmware/i915/
81 | + $(INSTALL_DATA) $(PKG_BUILD_DIR)/i915/skl_guc_ver1.bin $(1)/lib/firmware/i915/
82 | + $(INSTALL_DATA) $(PKG_BUILD_DIR)/i915/skl_guc_ver4.bin $(1)/lib/firmware/i915/
83 | + $(INSTALL_DATA) $(PKG_BUILD_DIR)/i915/skl_guc_ver6_1.bin $(1)/lib/firmware/i915/
84 | + ln -s /lib/firmware/i915/skl_guc_ver6_1.bin $(1)/lib/firmware/i915/skl_guc_ver6.bin
85 | + $(INSTALL_DATA) $(PKG_BUILD_DIR)/i915/skl_guc_ver9_33.bin $(1)/lib/firmware/i915/
86 | + $(INSTALL_DATA) $(PKG_BUILD_DIR)/i915/skl_huc_2.0.0.bin $(1)/lib/firmware/i915/
87 | + $(INSTALL_DATA) $(PKG_BUILD_DIR)/i915/skl_huc_ver01_07_1398.bin $(1)/lib/firmware/i915/
88 | + $(INSTALL_DATA) $(PKG_BUILD_DIR)/i915/tgl_dmc_ver2_04.bin $(1)/lib/firmware/i915/
89 | + $(INSTALL_DATA) $(PKG_BUILD_DIR)/i915/tgl_dmc_ver2_06.bin $(1)/lib/firmware/i915/
90 | + $(INSTALL_DATA) $(PKG_BUILD_DIR)/i915/tgl_dmc_ver2_08.bin $(1)/lib/firmware/i915/
91 | + $(INSTALL_DATA) $(PKG_BUILD_DIR)/i915/tgl_dmc_ver2_12.bin $(1)/lib/firmware/i915/
92 | + $(INSTALL_DATA) $(PKG_BUILD_DIR)/i915/tgl_guc_35.2.0.bin $(1)/lib/firmware/i915/
93 | + $(INSTALL_DATA) $(PKG_BUILD_DIR)/i915/tgl_guc_49.0.1.bin $(1)/lib/firmware/i915/
94 | + $(INSTALL_DATA) $(PKG_BUILD_DIR)/i915/tgl_guc_62.0.0.bin $(1)/lib/firmware/i915/
95 | + $(INSTALL_DATA) $(PKG_BUILD_DIR)/i915/tgl_huc_7.0.12.bin $(1)/lib/firmware/i915/
96 | + $(INSTALL_DATA) $(PKG_BUILD_DIR)/i915/tgl_huc_7.0.3.bin $(1)/lib/firmware/i915/
97 | + $(INSTALL_DATA) $(PKG_BUILD_DIR)/i915/tgl_huc_7.5.0.bin $(1)/lib/firmware/i915/
98 | + $(INSTALL_DATA) $(PKG_BUILD_DIR)/i915/tgl_huc_7.9.3.bin $(1)/lib/firmware/i915/
99 | +endef
100 | +$(eval $(call BuildPackage,i915-firmware))
101 |
102 | diff --git a/package/kernel/linux/modules/virt.mk b/package/kernel/linux/modules/virt.mk
103 | index 5ed0d5dbbf2..a853a8c7980 100644
104 | --- a/package/kernel/linux/modules/virt.mk
105 | +++ b/package/kernel/linux/modules/virt.mk
106 | @@ -4,6 +4,50 @@
107 | # This is free software, licensed under the GNU General Public License v2.
108 | # See /LICENSE for more information.
109 | #
110 | +define KernelPackage/vfio-mdev
111 | + SUBMENU:=Virtualization
112 | + TITLE:=VFIO driver support to to virtualize devices
113 | + DEPENDS:=@TARGET_x86_64
114 | + KCONFIG:= \
115 | + CONFIG_IOMMU_API=y \
116 | + CONFIG_MMU=y \
117 | + CONFIG_VFIO=y \
118 | + CONFIG_VFIO_MDEV \
119 | + CONFIG_VFIO_MDEV_DEVICE \
120 | + CONFIG_VFIO_NOIOMMU=y \
121 | + CONFIG_VFIO_PCI=y \
122 | + CONFIG_VFIO_PCI_IGD=y
123 | + FILES:= \
124 | + $(LINUX_DIR)/drivers/vfio/mdev/mdev.ko \
125 | + $(LINUX_DIR)/drivers/vfio/mdev/vfio_mdev.ko@lt5.10
126 | + AUTOLOAD:=$(call AutoProbe,mdev vfio_mdev)
127 | +endef
128 | +
129 | +define KernelPackage/vfio-mdev/description
130 | + Provides a framework to virtualize devices.
131 | +endef
132 | +
133 | +$(eval $(call KernelPackage,vfio-mdev))
134 | +
135 | +define KernelPackage/i915-gvt
136 | + SUBMENU:=Virtualization
137 | + TITLE:=Enable KVM/VFIO support for Intel GVT-g
138 | + DEPENDS:=@TARGET_x86_64 +kmod-kvm-intel +kmod-drm-i915 +kmod-vfio-mdev
139 | + KCONFIG:= CONFIG_DRM_I915_GVT_KVMGT
140 | + FILES:= \
141 | + $(LINUX_DIR)/drivers/gpu/drm/i915/gvt/kvmgt.ko@lt5.18 \
142 | + $(LINUX_DIR)/drivers/gpu/drm/i915/kvmgt.ko@ge5.18
143 | + AUTOLOAD:=$(call AutoProbe,kvmgt)
144 | +endef
145 | +
146 | +define KernelPackage/i915-gvt/description
147 | + Enable Intel GVT-g graphics virtualization technology host support with
148 | + integrated graphics. With GVT-g, it's possible to have one integrated
149 | + graphics device shared by multiple VMs under KVM.
150 | +endef
151 | +
152 | +$(eval $(call KernelPackage,i915-gvt))
153 | +
154 | define KernelPackage/irqbypass
155 | SUBMENU:=Virtualization
156 | TITLE:=IRQ offload/bypass manager
157 |
158 | --- a/target/linux/x86/64/config-5.15
159 | +++ b/target/linux/x86/64/config-5.15
160 | @@ -117,30 +117,12 @@ CONFIG_DRM_FBDEV_EMULATION=y
161 | CONFIG_DRM_FBDEV_OVERALLOC=100
162 | CONFIG_DRM_GEM_SHMEM_HELPER=y
163 | # CONFIG_DRM_HYPERV is not set
164 | -CONFIG_DRM_I915=y
165 | -CONFIG_DRM_I915_CAPTURE_ERROR=y
166 | -CONFIG_DRM_I915_COMPRESS_ERROR=y
167 | -# CONFIG_DRM_I915_DEBUG is not set
168 | -# CONFIG_DRM_I915_DEBUG_GUC is not set
169 | -# CONFIG_DRM_I915_DEBUG_MMIO is not set
170 | -# CONFIG_DRM_I915_DEBUG_RUNTIME_PM is not set
171 | -# CONFIG_DRM_I915_DEBUG_VBLANK_EVADE is not set
172 | -CONFIG_DRM_I915_FENCE_TIMEOUT=10000
173 | CONFIG_DRM_I915_FORCE_PROBE=""
174 | -CONFIG_DRM_I915_GVT=y
175 | CONFIG_DRM_I915_HEARTBEAT_INTERVAL=2500
176 | -# CONFIG_DRM_I915_LOW_LEVEL_TRACEPOINTS is not set
177 | -CONFIG_DRM_I915_MAX_REQUEST_BUSYWAIT=8000
178 | CONFIG_DRM_I915_PREEMPT_TIMEOUT=640
179 | CONFIG_DRM_I915_REQUEST_TIMEOUT=20000
180 | -# CONFIG_DRM_I915_SELFTEST is not set
181 | CONFIG_DRM_I915_STOP_TIMEOUT=100
182 | -# CONFIG_DRM_I915_SW_FENCE_CHECK_DAG is not set
183 | -# CONFIG_DRM_I915_SW_FENCE_DEBUG_OBJECTS is not set
184 | CONFIG_DRM_I915_TIMESLICE_DURATION=1
185 | -CONFIG_DRM_I915_USERFAULT_AUTOSUSPEND=250
186 | -CONFIG_DRM_I915_USERPTR=y
187 | -# CONFIG_DRM_I915_WERROR is not set
188 | CONFIG_DRM_KMS_HELPER=y
189 | CONFIG_DRM_MIPI_DSI=y
190 | CONFIG_DRM_PANEL=y
191 | @@ -178,6 +160,7 @@ CONFIG_FB_CMDLINE=y
192 | CONFIG_FB_DEFERRED_IO=y
193 | CONFIG_FB_EFI=y
194 | CONFIG_FB_HYPERV=y
195 | +# CONFIG_FB_INTEL is not set
196 | CONFIG_FB_MODE_HELPERS=y
197 | CONFIG_FB_SIMPLE=y
198 | CONFIG_FB_SYS_COPYAREA=y
--------------------------------------------------------------------------------
/devices/x86_64/patches/def_set_interfaces_lan_wan.patch:
--------------------------------------------------------------------------------
1 | --- a/target/linux/x86/base-files/etc/board.d/02_network
2 | +++ b/target/linux/x86/base-files/etc/board.d/02_network
3 | @@ -22,6 +22,9 @@ traverse-technologies-geos)
4 | macaddr="$(cat /sys/class/net/eth0/address)" 2>/dev/null
5 | [ -n "$macaddr" ] && ucidef_set_interface_macaddr "wan" "$macaddr"
6 | ;;
7 | +*)
8 | + [ "$(ip address | grep ^[0-9] | awk -F: '{print $2}' | sed "s/ //g" | grep '^[e]' | grep -cvE "(@|\.)")" -gt 2 ] && ucidef_set_interfaces_lan_wan "$(ip address | grep ^[0-9] | awk -F: '{print $2}' | sed "s/ //g" | grep '^[e]' | grep -vE "(@|\.|eth1)" | tr "\n" " " | sed "s/ $//")" "eth1"
9 | + ;;
10 | esac
11 | board_config_flush
12 |
13 |
--------------------------------------------------------------------------------
/devices/x86_64/patches/image-commands.patch:
--------------------------------------------------------------------------------
1 | --- a/include/image-commands.mk
2 | +++ b/include/image-commands.mk
3 | @@ -419,6 +419,17 @@ endef
4 |
5 | # Convert a raw image into a $1 type image.
6 | # E.g. | qemu-image vdi
7 | +define Build/qemu-exsi
8 | + if command -v qemu-img; then \
9 | + name="$(subst .vmdk.zip,,$@)"; \
10 | + qemu-img convert -f raw -O $1 $@ $$name.vmdk; \
11 | + rm -f $@; \
12 | + zip -jm $@ $$name*.vmdk; \
13 | + else \
14 | + echo "WARNING: Install qemu-img to create VDI/VMDK images" >&2; exit 1; \
15 | + fi
16 | +endef
17 | +
18 | define Build/qemu-image
19 | if command -v qemu-img; then \
20 | qemu-img convert -f raw -O $1 $@ $@.new; \
--------------------------------------------------------------------------------
/devices/x86_64/patches/image.patch:
--------------------------------------------------------------------------------
1 | From c7bc056650227ba6003414356f57b33cdb2603b7 Mon Sep 17 00:00:00 2001
2 | From: kiddin9 <48883331+kiddin9@users.noreply.github.com>
3 | Date: Sat, 23 Apr 2022 18:38:12 +0800
4 | Subject: [PATCH] Update Makefile
5 |
6 | ---
7 | target/linux/x86/image/Makefile | 12 ++++--------
8 | 1 file changed, 4 insertions(+), 8 deletions(-)
9 |
10 | diff --git a/target/linux/x86/image/Makefile b/target/linux/x86/image/Makefile
11 | index 322131c2a488..0b4ed1d272eb 100644
12 | --- a/target/linux/x86/image/Makefile
13 | +++ b/target/linux/x86/image/Makefile
14 | @@ -108,22 +108,18 @@ define Device/Default
15 | IMAGE/combined.img := grub-config pc | combined | grub-install | append-metadata
16 | IMAGE/combined.img.gz := grub-config pc | combined | grub-install | gzip | append-metadata
17 | IMAGE/combined.vdi := grub-config pc | combined | grub-install | qemu-image vdi
18 | - IMAGE/combined.vmdk := grub-config pc | combined | grub-install | qemu-image vmdk
19 | + IMAGE/combined.vmdk.zip := grub-config pc | combined | grub-install | qemu-exsi vmdk -o adapter_type=lsilogic -o subformat=monolithicFlat
20 | IMAGE/combined.vhdx := grub-config pc | combined | grub-install | qemu-image vhdx -o subformat=dynamic
21 | - IMAGE/rootfs.img := append-rootfs | pad-to $(ROOTFS_PARTSIZE)
22 | - IMAGE/rootfs.img.gz := append-rootfs | pad-to $(ROOTFS_PARTSIZE) | gzip
23 | ARTIFACT/image-efi.iso := grub-config iso | iso efi
24 | IMAGE/combined-efi.img := grub-config efi | combined efi | grub-install efi | append-metadata
25 | IMAGE/combined-efi.img.gz := grub-config efi | combined efi | grub-install efi | gzip | append-metadata
26 | IMAGE/combined-efi.vdi := grub-config efi | combined efi | grub-install efi | qemu-image vdi
27 | - IMAGE/combined-efi.vmdk := grub-config efi | combined efi | grub-install efi | qemu-image vmdk
28 | + IMAGE/combined-efi.vmdk.zip := grub-config efi | combined efi | grub-install efi | qemu-exsi vmdk -o adapter_type=lsilogic -o subformat=monolithicFlat
29 | IMAGE/combined-efi.vhdx := grub-config efi | combined efi | grub-install efi | qemu-image vhdx -o subformat=dynamic
30 | ifeq ($(CONFIG_TARGET_IMAGES_GZIP),y)
31 | - IMAGES-y := rootfs.img.gz
32 | IMAGES-$$(CONFIG_GRUB_IMAGES) += combined.img.gz
33 | IMAGES-$$(CONFIG_GRUB_EFI_IMAGES) += combined-efi.img.gz
34 | else
35 | - IMAGES-y := rootfs.img
36 | IMAGES-$$(CONFIG_GRUB_IMAGES) += combined.img
37 | IMAGES-$$(CONFIG_GRUB_EFI_IMAGES) += combined-efi.img
38 | endif
39 | @@ -139,8 +135,8 @@ define Device/Default
40 | IMAGES-$$(CONFIG_GRUB_EFI_IMAGES) += combined-efi.vdi
41 | endif
42 | ifeq ($(CONFIG_VMDK_IMAGES),y)
43 | - IMAGES-$$(CONFIG_GRUB_IMAGES) += combined.vmdk
44 | - IMAGES-$$(CONFIG_GRUB_EFI_IMAGES) += combined-efi.vmdk
45 | + IMAGES-$$(CONFIG_GRUB_IMAGES) += combined.vmdk.zip
46 | + IMAGES-$$(CONFIG_GRUB_EFI_IMAGES) += combined-efi.vmdk.zip
47 | endif
48 | ifeq ($(CONFIG_VHDX_IMAGES),y)
49 | IMAGES-$$(CONFIG_GRUB_IMAGES) += combined.vhdx
50 |
--------------------------------------------------------------------------------
/onekey/build.sh:
--------------------------------------------------------------------------------
1 | #/bin/bash
2 | echo
3 | sleep 2s
4 | sudo apt-get update
5 | sudo apt-get upgrade
6 |
7 | sudo apt-get -y install build-essential asciidoc binutils bzip2 gawk gettext git libncurses5-dev patch python3 python2.7 unzip zlib1g-dev lib32gcc-s1 libc6-dev-i386 subversion flex uglifyjs gcc-multilib g++-multilib p7zip p7zip-full msmtp libssl-dev texinfo libglib2.0-dev xmlto qemu-utils libelf-dev autoconf automake libtool autopoint device-tree-compiler ccache xsltproc rename antlr3 gperf curl screen upx-ucl jq
8 |
9 |
10 |
11 | clear
12 | echo
13 | echo
14 | echo
15 | echo 基本环境部署完成.....
16 | echo
17 | echo
18 |
19 |
20 | if [ "$USER" == "root" ]; then
21 | echo
22 | echo
23 | echo "请勿使用root用户编译,换一个普通用户吧~~"
24 | sleep 3s
25 | exit 0
26 | fi
27 |
28 |
29 |
30 |
31 |
32 | rm -Rf openwrt
33 |
34 | echo "
35 |
36 | 1. X86_64
37 |
38 | 2. r2s
39 |
40 | 3. r4s
41 |
42 | 4. Rpi-4B
43 |
44 | 5. Exit
45 |
46 | "
47 |
48 | while :; do
49 |
50 | read -p "你想要编译哪个固件? " CHOOSE
51 |
52 | case $CHOOSE in
53 | 1)
54 | firmware="x86_64"
55 | break
56 | ;;
57 | 2)
58 | firmware="nanopi-r2s"
59 | break
60 | ;;
61 | 3)
62 | firmware="nanopi-r4s"
63 | break
64 | ;;
65 | 4)
66 | firmware="Rpi-4B"
67 | break
68 | ;;
69 | 5) exit 0
70 | ;;
71 |
72 | esac
73 | done
74 |
75 | REPO_BRANCH="$(curl -s https://api.github.com/repos/openwrt/openwrt/tags | jq -r '.[].name' | grep v21 | head -n 1 | sed -e 's/v//')"
76 | git clone -b v$REPO_BRANCH https://github.com/openwrt/openwrt
77 | svn export https://github.com/kenzok78/Bulid_Wrt/trunk/devices openwrt/devices
78 |
79 | cd openwrt
80 | if [[ $firmware == "x86_64" ]]; then
81 | curl -fL -o sdk.tar.xz https://mirrors.cloud.tencent.com/openwrt/releases/$REPO_BRANCH/targets/x86/64/openwrt-sdk-$REPO_BRANCH-x86-64_gcc-8.4.0_musl.Linux-x86_64.tar.xz || curl -fL -o sdk.tar.xz https://downloads.openwrt.org/releases/21.02-SNAPSHOT/targets/x86/64/openwrt-sdk-21.02-SNAPSHOT-x86-64_gcc-8.4.0_musl.Linux-x86_64.tar.xz
82 | elif [[ $firmware == nanopi-* ]]; then
83 | curl -fL -o sdk.tar.xz https://mirrors.cloud.tencent.com/openwrt/releases/$REPO_BRANCH/targets/rockchip/armv8/openwrt-sdk-$REPO_BRANCH-rockchip-armv8_gcc-8.4.0_musl.Linux-x86_64.tar.xz || curl -fL -o sdk.tar.xz https://downloads.openwrt.org/releases/21.02-SNAPSHOT/targets/rockchip/armv8/openwrt-sdk-21.02-SNAPSHOT-rockchip-armv8_gcc-8.4.0_musl.Linux-x86_64.tar.xz
84 | elif [[ $firmware == "Rpi-4B" ]]; then
85 | curl -fL -o sdk.tar.xz https://mirrors.cloud.tencent.com/openwrt/releases/$REPO_BRANCH/targets/bcm27xx/bcm2711/openwrt-sdk-$REPO_BRANCH-bcm27xx-bcm2711_gcc-8.4.0_musl.Linux-x86_64.tar.xz || curl -fL -o sdk.tar.xz https://downloads.openwrt.org/releases/21.02-SNAPSHOT/targets/bcm27xx/bcm2711/openwrt-sdk-21.02-SNAPSHOT-bcm27xx-bcm2711_gcc-8.4.0_musl.Linux-x86_64.tar.xz
86 | fi
87 |
88 |
89 | read -p "请输入后台地址 [回车默认10.0.0.1]: " ip
90 | ip=${ip:-"10.0.0.1"}
91 | echo "您的后台地址为: $ip"
92 | cp -rf devices/common/* ./
93 | cp -rf devices/$firmware/* ./
94 | if [ -f "devices/common/diy.sh" ]; then
95 | chmod +x devices/common/diy.sh
96 | /bin/bash "devices/common/diy.sh"
97 | fi
98 | if [ -f "devices/$firmware/diy.sh" ]; then
99 | chmod +x devices/$firmware/diy.sh
100 | /bin/bash "devices/$firmware/diy.sh"
101 | fi
102 | cp -Rf ./diy/* ./
103 | if [ -f "devices/common/default-settings" ]; then
104 | sed -i 's/10.0.0.1/$ip/' package/*/*/my-default-settings/files/etc/uci-defaults/99-default-settings
105 | fi
106 | if [ -f "devices/$firmware/default-settings" ]; then
107 | sed -i "s/10.0.0.1/$ip/" devices/$firmware/default-settings
108 | cat devices/$firmware/default-settings >> package/*/*/my-default-settings/files/etc/uci-defaults/99-default-settings
109 | fi
110 | if [ -n "$(ls -A "devices/common/patches" 2>/dev/null)" ]; then
111 | find "devices/common/patches" -type f -name '*.patch' ! -name '*.revert.patch' -print0 | sort -z | xargs -I % -t -0 -n 1 sh -c "cat '%' | patch -d './' -p1 --forward"
112 | fi
113 | if [ -n "$(ls -A "devices/$firmware/patches" 2>/dev/null)" ]; then
114 | find "devices/$firmware/patches" -type f -name '*.patch' ! -name '*.revert.patch' -print0 | sort -z | xargs -I % -t -0 -n 1 sh -c "cat '%' | patch -d './' -p1 --forward"
115 | fi
116 | cp devices/common/.config .config
117 | echo >> .config
118 | cat devices/$firmware/.config >> .config
119 | make defconfig
120 | for i in $(make --file=preset_pkg.mk presetpkg); do
121 | sed -i "\$a CONFIG_PACKAGE_$i=y" .config
122 | done
123 | make menuconfig
124 | echo
125 | echo
126 | echo
127 | echo " *****5秒后开始编译*****
128 |
129 | 1.你可以随时按Ctrl+C停止编译
130 |
131 | 3.使用大陆白名单或全局模式"
132 | echo
133 | echo
134 | echo
135 | sleep 3s
136 |
137 | make -j$(($(nproc)+1)) download -j$(($(nproc)+1)) &
138 | make -j$(($(nproc)+1)) || make -j1 V=s
139 |
140 | if [ "$?" == "0" ]; then
141 | echo "
142 |
143 | 编译完成~~~
144 |
145 | 初始后台地址: $ip
146 | 初始用户名密码: root root
147 |
148 | "
149 | fi
150 |
--------------------------------------------------------------------------------
/onekey/rebuild.sh:
--------------------------------------------------------------------------------
1 | #/bin/bash
2 | echo
3 |
4 | if [ "$USER" == "root" ]; then
5 | echo
6 | echo
7 | echo "请勿使用root用户编译,换一个普通用户吧~~"
8 | sleep 3s
9 | exit 0
10 | fi
11 |
12 | echo
13 | echo
14 |
15 | clear
16 |
17 | rm -Rf openwrt/common openwrt/files openwrt/devices
18 | svn export https://github.com/kenzok78/Bulid_Wrt/trunk/devices openwrt/devices
19 | cd openwrt
20 |
21 | git checkout .
22 | git pull
23 |
24 | [ $(grep '^CONFIG_TARGET.*DEVICE.*=y' .config | sed -r 's/.*DEVICE_(.*)=y/\1/') == generic ] && {
25 | firmware=$(grep '^CONFIG_TARGET.*DEVICE.*=y' .config | sed -r 's/CONFIG_TARGET_(.*)_DEVICE_.*=y/\1/')
26 | } || { firmware=$(grep '^CONFIG_TARGET.*DEVICE.*=y' .config | sed -r 's/.*DEVICE_(.*)=y/\1/')
27 | }
28 |
29 | if [ $firmware == "x86_64" ]; then
30 | firmware="x86_64"
31 | elif [ $firmware == "friendlyarm_nanopi-r2s" ]; then
32 | firmware="nanopi-r2s"
33 | elif [ $firmware == "friendlyarm_nanopi-r4s" ]; then
34 | firmware="nanopi-r4s"
35 | elif [ $firmware == "rpi-4" ]; then
36 | firmware="Rpi-4B"
37 | elif [ $firmware == "d-team_newifi-d2" ]; then
38 | firmware="newifi-d2"
39 | else
40 | echo "无法识别固件类型,请退出"
41 | fi
42 |
43 | echo
44 |
45 | read -p "请输入后台地址 [回车默认10.0.0.1]: " ip
46 | ip=${ip:-"10.0.0.1"}
47 | echo "您的后台地址为: $ip"
48 |
49 | rm -Rf feeds package/feeds common files diy tmp
50 | make clean
51 | [ -f ".config" ] && mv .config .config.bak
52 | cp -rf devices/common/* ./
53 | cp -rf devices/$firmware/* ./
54 | if [ -f "devices/common/diy.sh" ]; then
55 | chmod +x devices/common/diy.sh
56 | /bin/bash "devices/common/diy.sh"
57 | fi
58 | if [ -f "devices/$firmware/diy.sh" ]; then
59 | chmod +x devices/$firmware/diy.sh
60 | /bin/bash "devices/$firmware/diy.sh"
61 | fi
62 | cp -Rf ./diy/* ./
63 | if [ -f "devices/common/default-settings" ]; then
64 | sed -i 's/10.0.0.1/$ip/' package/*/*/my-default-settings/files/uci.defaults
65 | fi
66 | if [ -f "devices/$firmware/default-settings" ]; then
67 | sed -i 's/10.0.0.1/$ip/' devices/$firmware/default-settings
68 | cat devices/$firmware/default-settings >> package/*/*/my-default-settings/files/uci.defaults
69 | fi
70 | if [ -n "$(ls -A "devices/common/patches" 2>/dev/null)" ]; then
71 | find "devices/common/patches" -type f -name '*.patch' ! -name '*.revert.patch' -print0 | sort -z | xargs -I % -t -0 -n 1 sh -c "cat '%' | patch -d './' -p1 --forward"
72 | fi
73 | if [ -n "$(ls -A "devices/$firmware/patches" 2>/dev/null)" ]; then
74 | find "devices/$firmware/patches" -type f -name '*.patch' ! -name '*.revert.patch' -print0 | sort -z | xargs -I % -t -0 -n 1 sh -c "cat '%' | patch -d './' -p1 --forward"
75 | fi
76 | [ -f ".config.bak" ] && cp -f .config.bak .config || {
77 | cp -f devices/common/.config .config
78 | echo >> .config
79 | cat devices/$firmware/.config >> .config
80 | }
81 |
82 | [ firmware == "other" ] || {
83 | while true; do
84 | read -p "是否增删插件? [y/N]: " YN
85 | case ${YN:-N} in
86 | [Yy])
87 | make menuconfig
88 | echo ""
89 | ;;
90 | [Nn])
91 | make defconfig
92 | break
93 | ;;
94 | esac
95 | done
96 | }
97 | echo
98 | echo
99 | echo " *****5秒后开始编译*****
100 |
101 | 1.你可以随时按Ctrl+C停止编译
102 |
103 | 3.使用大陆白名单或全局模式"
104 | echo
105 | echo
106 | sleep 3s
107 |
108 | sed -i 's,$(STAGING_DIR_HOST)/bin/upx,upx,' package/feeds/jell/*/Makefile
109 |
110 | make -j$(($(nproc)+1)) download v=s ; make -j$(($(nproc)+1)) || make -j1 V=s
111 |
112 | if [ "$?" == "0" ]; then
113 | echo "
114 |
115 | 编译完成~~~
116 |
117 | 初始后台地址: $ip
118 | 初始用户名密码: root root
119 |
120 | "
121 | fi
122 |
123 |
--------------------------------------------------------------------------------