mirror of
https://github.com/Dichgrem/Blog.git
synced 2025-07-31 17:09:30 -04:00
update:openwrt
This commit is contained in:
@ -155,10 +155,10 @@ su openwrt
|
|||||||
cd ~
|
cd ~
|
||||||
```
|
```
|
||||||
|
|
||||||
- **拉取源码,这里用的是 OpenWrt 24.10 分支源码:**
|
- **拉取源码,这里用的是 ImmortalWrt 24.10 分支源码:**
|
||||||
```
|
```
|
||||||
git clone https://github.com/openwrt/openwrt.git
|
git clone https://github.com/immortalwrt/immortalwrt.git
|
||||||
cd openwrt
|
cd immortalwrt
|
||||||
git switch openwrt-24.10
|
git switch openwrt-24.10
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -216,24 +216,26 @@ git clone https://github.com/chenmozhijin/turboacc.git
|
|||||||
|
|
||||||
- **自定义配置**
|
- **自定义配置**
|
||||||
|
|
||||||
**修改默认IP为 10.0.0.2**
|
|
||||||
```
|
|
||||||
sed -i 's/192.168.1.1/192.168.2.1/g' package/base-files/files/bin/config_generate
|
|
||||||
```
|
```
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
# diy-part2.sh — 在镜像生成时注入默认设置
|
||||||
|
|
||||||
**修改默认主机名**
|
# 1. 默认 hostname(可选)
|
||||||
```
|
sed -i 's/=ImmortalWrt/=my-device/' package/base-files/files/bin/config_generate
|
||||||
sed -i '/uci commit system/i\uci set system.@system[0].hostname='OpenWrt'' package/lean/default-settings/files/zzz-default-settings
|
|
||||||
```
|
|
||||||
|
|
||||||
**加入编译者信息**
|
# 2. 默认 IP 地址(可选)
|
||||||
```
|
sed -i 's/192.168.1.1/192.168.5.1/' package/base-files/files/bin/config_generate
|
||||||
sed -i "s/OpenWrt /smith build $(TZ=UTC-8 date "+%Y.%m.%d") @ OpenWrt /g" package/lean/default-settings/files/zzz-default-settings
|
|
||||||
```
|
|
||||||
|
|
||||||
**修改默认主题**
|
# 3. 默认 root 密码(请换成安全密码)
|
||||||
```
|
HASH=$(openssl passwd -1 'yourpassword')
|
||||||
sed -i "s/luci-theme-bootstrap/luci-theme-argon/g" feeds/luci/collections/luci/Makefile
|
sed -i "s|root::0:0:99999|root:${HASH}:0:0:99999|" package/base-files/files/etc/shadow
|
||||||
|
|
||||||
|
# 4. 设置默认 LuCI 主题为 argon(内置在 luci feeds)
|
||||||
|
cat >>package/base-files/files/etc/uci-defaults/99_set_theme <<'EOF'
|
||||||
|
uci set luci.main.mediaurlbase=/luci-static/argon
|
||||||
|
uci commit luci
|
||||||
|
EOF
|
||||||
|
chmod +x package/base-files/files/etc/uci-defaults/99_set_theme
|
||||||
```
|
```
|
||||||
|
|
||||||
- 执行 **make menuconfig** 命令进入编译菜单。
|
- 执行 **make menuconfig** 命令进入编译菜单。
|
||||||
@ -316,6 +318,10 @@ find dl -size -1024c -exec rm -f {} \;
|
|||||||
- **最后编译固件(-j 后面是线程数,首次编译推荐用单线程)编译完成后输出路径是bin/targets.**
|
- **最后编译固件(-j 后面是线程数,首次编译推荐用单线程)编译完成后输出路径是bin/targets.**
|
||||||
```
|
```
|
||||||
make V=s -j1
|
make V=s -j1
|
||||||
|
|
||||||
|
或者使用 make world -j1 V=s 2>&1 | tee world_debug.log
|
||||||
|
|
||||||
|
如果报错可查看 grep -E "(error|fatal|Cannot install package)" world_debug.log -n
|
||||||
```
|
```
|
||||||
| make层级 | 目录示例 | 说明 |
|
| make层级 | 目录示例 | 说明 |
|
||||||
| -------- | ---------------------------- | ---------------- |
|
| -------- | ---------------------------- | ---------------- |
|
||||||
@ -402,6 +408,16 @@ opkg list-upgradable | grep luci- | cut -f 1 -d ' ' | xargs opkg upgrade
|
|||||||
# 如果要更新所有软件,包括 OpenWRT 内核、固件等
|
# 如果要更新所有软件,包括 OpenWRT 内核、固件等
|
||||||
opkg list-upgradable | cut -f 1 -d ' ' | xargs opkg upgrade
|
opkg list-upgradable | cut -f 1 -d ' ' | xargs opkg upgrade
|
||||||
```
|
```
|
||||||
|
## 常用仓库
|
||||||
|
|
||||||
|
```
|
||||||
|
src/gz kwrt_core https://dl.openwrt.ai/releases/24.10/targets/x86/64/6.6.83
|
||||||
|
src/gz kwrt_base https://dl.openwrt.ai/releases/24.10/packages/x86_64/base
|
||||||
|
src/gz kwrt_packages https://dl.openwrt.ai/releases/24.10/packages/x86_64/packages
|
||||||
|
src/gz kwrt_luci https://dl.openwrt.ai/releases/24.10/packages/x86_64/luci
|
||||||
|
src/gz kwrt_routing https://dl.openwrt.ai/releases/24.10/packages/x86_64/routing
|
||||||
|
src/gz kwrt_kiddin9 https://dl.openwrt.ai/releases/24.10/packages/x86_64/kiddin9
|
||||||
|
```
|
||||||
|
|
||||||
## 常用科学插件
|
## 常用科学插件
|
||||||
|
|
||||||
|
@ -281,10 +281,10 @@
|
|||||||
</span><span>cd ~
|
</span><span>cd ~
|
||||||
</span></code></pre>
|
</span></code></pre>
|
||||||
<ul>
|
<ul>
|
||||||
<li><strong>拉取源码,这里用的是 OpenWrt 24.10 分支源码:</strong></li>
|
<li><strong>拉取源码,这里用的是 ImmortalWrt 24.10 分支源码:</strong></li>
|
||||||
</ul>
|
</ul>
|
||||||
<pre style="background-color:#151515;color:#e8e8d3;"><code><span>git clone https://github.com/openwrt/openwrt.git
|
<pre style="background-color:#151515;color:#e8e8d3;"><code><span>git clone https://github.com/immortalwrt/immortalwrt.git
|
||||||
</span><span>cd openwrt
|
</span><span>cd immortalwrt
|
||||||
</span><span>git switch openwrt-24.10
|
</span><span>git switch openwrt-24.10
|
||||||
</span></code></pre>
|
</span></code></pre>
|
||||||
<h3 id="mu-lu-shuo-ming">目录说明</h3>
|
<h3 id="mu-lu-shuo-ming">目录说明</h3>
|
||||||
@ -335,17 +335,25 @@
|
|||||||
<ul>
|
<ul>
|
||||||
<li><strong>自定义配置</strong></li>
|
<li><strong>自定义配置</strong></li>
|
||||||
</ul>
|
</ul>
|
||||||
<p><strong>修改默认IP为 10.0.0.2</strong></p>
|
<pre style="background-color:#151515;color:#e8e8d3;"><code><span>#!/usr/bin/env bash
|
||||||
<pre style="background-color:#151515;color:#e8e8d3;"><code><span>sed -i 's/192.168.1.1/192.168.2.1/g' package/base-files/files/bin/config_generate
|
</span><span># diy-part2.sh — 在镜像生成时注入默认设置
|
||||||
</span></code></pre>
|
</span><span>
|
||||||
<p><strong>修改默认主机名</strong></p>
|
</span><span># 1. 默认 hostname(可选)
|
||||||
<pre style="background-color:#151515;color:#e8e8d3;"><code><span>sed -i '/uci commit system/i\uci set system.@system[0].hostname='OpenWrt'' package/lean/default-settings/files/zzz-default-settings
|
</span><span>sed -i 's/=ImmortalWrt/=my-device/' package/base-files/files/bin/config_generate
|
||||||
</span></code></pre>
|
</span><span>
|
||||||
<p><strong>加入编译者信息</strong></p>
|
</span><span># 2. 默认 IP 地址(可选)
|
||||||
<pre style="background-color:#151515;color:#e8e8d3;"><code><span>sed -i "s/OpenWrt /smith build $(TZ=UTC-8 date "+%Y.%m.%d") @ OpenWrt /g" package/lean/default-settings/files/zzz-default-settings
|
</span><span>sed -i 's/192.168.1.1/192.168.5.1/' package/base-files/files/bin/config_generate
|
||||||
</span></code></pre>
|
</span><span>
|
||||||
<p><strong>修改默认主题</strong></p>
|
</span><span># 3. 默认 root 密码(请换成安全密码)
|
||||||
<pre style="background-color:#151515;color:#e8e8d3;"><code><span>sed -i "s/luci-theme-bootstrap/luci-theme-argon/g" feeds/luci/collections/luci/Makefile
|
</span><span>HASH=$(openssl passwd -1 'yourpassword')
|
||||||
|
</span><span>sed -i "s|root::0:0:99999|root:${HASH}:0:0:99999|" package/base-files/files/etc/shadow
|
||||||
|
</span><span>
|
||||||
|
</span><span># 4. 设置默认 LuCI 主题为 argon(内置在 luci feeds)
|
||||||
|
</span><span>cat >>package/base-files/files/etc/uci-defaults/99_set_theme <<'EOF'
|
||||||
|
</span><span>uci set luci.main.mediaurlbase=/luci-static/argon
|
||||||
|
</span><span>uci commit luci
|
||||||
|
</span><span>EOF
|
||||||
|
</span><span>chmod +x package/base-files/files/etc/uci-defaults/99_set_theme
|
||||||
</span></code></pre>
|
</span></code></pre>
|
||||||
<ul>
|
<ul>
|
||||||
<li>执行 <strong>make menuconfig</strong> 命令进入编译菜单。</li>
|
<li>执行 <strong>make menuconfig</strong> 命令进入编译菜单。</li>
|
||||||
@ -420,6 +428,10 @@
|
|||||||
<li><strong>最后编译固件(-j 后面是线程数,首次编译推荐用单线程)编译完成后输出路径是bin/targets.</strong></li>
|
<li><strong>最后编译固件(-j 后面是线程数,首次编译推荐用单线程)编译完成后输出路径是bin/targets.</strong></li>
|
||||||
</ul>
|
</ul>
|
||||||
<pre style="background-color:#151515;color:#e8e8d3;"><code><span>make V=s -j1
|
<pre style="background-color:#151515;color:#e8e8d3;"><code><span>make V=s -j1
|
||||||
|
</span><span>
|
||||||
|
</span><span>或者使用 make world -j1 V=s 2>&1 | tee world_debug.log
|
||||||
|
</span><span>
|
||||||
|
</span><span>如果报错可查看 grep -E "(error|fatal|Cannot install package)" world_debug.log -n
|
||||||
</span></code></pre>
|
</span></code></pre>
|
||||||
<table><thead><tr><th>make层级</th><th>目录示例</th><th>说明</th></tr></thead><tbody>
|
<table><thead><tr><th>make层级</th><th>目录示例</th><th>说明</th></tr></thead><tbody>
|
||||||
<tr><td>make[1]</td><td>顶层 Makefile</td><td>解析依赖,调度模块</td></tr>
|
<tr><td>make[1]</td><td>顶层 Makefile</td><td>解析依赖,调度模块</td></tr>
|
||||||
@ -490,6 +502,14 @@
|
|||||||
</span><span># 如果要更新所有软件,包括 OpenWRT 内核、固件等
|
</span><span># 如果要更新所有软件,包括 OpenWRT 内核、固件等
|
||||||
</span><span>opkg list-upgradable | cut -f 1 -d ' ' | xargs opkg upgrade
|
</span><span>opkg list-upgradable | cut -f 1 -d ' ' | xargs opkg upgrade
|
||||||
</span></code></pre>
|
</span></code></pre>
|
||||||
|
<h2 id="chang-yong-cang-ku">常用仓库</h2>
|
||||||
|
<pre style="background-color:#151515;color:#e8e8d3;"><code><span>src/gz kwrt_core https://dl.openwrt.ai/releases/24.10/targets/x86/64/6.6.83
|
||||||
|
</span><span>src/gz kwrt_base https://dl.openwrt.ai/releases/24.10/packages/x86_64/base
|
||||||
|
</span><span>src/gz kwrt_packages https://dl.openwrt.ai/releases/24.10/packages/x86_64/packages
|
||||||
|
</span><span>src/gz kwrt_luci https://dl.openwrt.ai/releases/24.10/packages/x86_64/luci
|
||||||
|
</span><span>src/gz kwrt_routing https://dl.openwrt.ai/releases/24.10/packages/x86_64/routing
|
||||||
|
</span><span>src/gz kwrt_kiddin9 https://dl.openwrt.ai/releases/24.10/packages/x86_64/kiddin9
|
||||||
|
</span></code></pre>
|
||||||
<h2 id="chang-yong-ke-xue-cha-jian">常用科学插件</h2>
|
<h2 id="chang-yong-ke-xue-cha-jian">常用科学插件</h2>
|
||||||
<table><thead><tr><th>特性</th><th>HomeProxy</th><th>OpenClash</th><th>Passwall</th><th>ShellClash</th></tr></thead><tbody>
|
<table><thead><tr><th>特性</th><th>HomeProxy</th><th>OpenClash</th><th>Passwall</th><th>ShellClash</th></tr></thead><tbody>
|
||||||
<tr><td><strong>核心</strong></td><td>Sing-box、Xray</td><td>Clash</td><td>Xray、Sing-box</td><td>Clash、Xray、Sing-box</td></tr>
|
<tr><td><strong>核心</strong></td><td>Sing-box、Xray</td><td>Clash</td><td>Xray、Sing-box</td><td>Clash、Xray、Sing-box</td></tr>
|
||||||
|
Binary file not shown.
BIN
public/pagefind/fragment/en_e78a56d.pf_fragment
Normal file
BIN
public/pagefind/fragment/en_e78a56d.pf_fragment
Normal file
Binary file not shown.
Binary file not shown.
BIN
public/pagefind/index/en_2b926b0.pf_index
Normal file
BIN
public/pagefind/index/en_2b926b0.pf_index
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
public/pagefind/index/en_4ab17da.pf_index
Normal file
BIN
public/pagefind/index/en_4ab17da.pf_index
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
public/pagefind/index/en_98eed27.pf_index
Normal file
BIN
public/pagefind/index/en_98eed27.pf_index
Normal file
Binary file not shown.
BIN
public/pagefind/index/en_ddbabf6.pf_index
Normal file
BIN
public/pagefind/index/en_ddbabf6.pf_index
Normal file
Binary file not shown.
BIN
public/pagefind/index/en_f5907bc.pf_index
Normal file
BIN
public/pagefind/index/en_f5907bc.pf_index
Normal file
Binary file not shown.
@ -1 +1 @@
|
|||||||
{"version":"1.3.0","languages":{"en":{"hash":"en_36b0d71545","wasm":"en","page_count":98}}}
|
{"version":"1.3.0","languages":{"en":{"hash":"en_153c70164b","wasm":"en","page_count":98}}}
|
BIN
public/pagefind/pagefind.en_153c70164b.pf_meta
Normal file
BIN
public/pagefind/pagefind.en_153c70164b.pf_meta
Normal file
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user