更新编译说明及修正hash的脚本
This commit is contained in:
parent
a87b94f9bd
commit
9dd846f553
80
README.md
Normal file
80
README.md
Normal file
@ -0,0 +1,80 @@
|
||||
# iFish 木鱼的LEDE编译脚本
|
||||
|
||||
> 推荐编译环境为 **Ubuntu 20.04**,但其实木鱼本鱼用 **Ubuntu 21.04** 也能编译成功。差别在于安装的组件会有些差别,在21中部分组件使用了别的名字。具体哪些忘记了,安装的时候会有提示的。
|
||||
|
||||
## 编译案例脚本
|
||||
|
||||
### 首次编译
|
||||
|
||||
```shell
|
||||
# 安装依赖库
|
||||
sudo apt-get update
|
||||
sudo apt-get -y install build-essential asciidoc binutils bzip2 gawk gettext git libncurses5-dev libz-dev patch python3 python2.7 unzip zlib1g-dev lib32gcc1 libc6-dev-i386 subversion flex uglifyjs git-core gcc-multilib p7zip p7zip-full msmtp libssl-dev texinfo libglib2.0-dev xmlto qemu-utils upx libelf-dev autoconf automake libtool autopoint device-tree-compiler g++-multilib antlr3 gperf wget curl swig rsync
|
||||
|
||||
# 准备LEDE仓库
|
||||
git clone https://github.com/coolsnowwolf/lede
|
||||
cd lede
|
||||
# 后续编译:更新LEDE
|
||||
git pull
|
||||
|
||||
# 配置好源
|
||||
cp feeds.conf.default feeds.conf
|
||||
echo 'src-git lede_ifish https://github.com/iccfish/lede-ifish-package.git' >>feeds.conf.default
|
||||
# 更新源
|
||||
./scripts/feeds update -a
|
||||
./scripts/feeds install -a -f
|
||||
|
||||
# 选择编译脚本,本仓库自带了AX6和AX3600的
|
||||
cp ./feeds/lede_ifish/ax6.config ./.config
|
||||
|
||||
# 更新配置
|
||||
make defconfig
|
||||
# 下载,建议挂梯子,否则可能有失败的情况
|
||||
make download -j$(($(nproc) + 1))
|
||||
|
||||
# 编译。首次编译时间较长,需要联网下载源码,建议挂梯子;偶有失败可重试
|
||||
make -j1 V=s
|
||||
# 如出现错误类似“po2lmo: command not found”的错误可能是编译顺序的问题,可在出现错误后手动运行以下编译命令:
|
||||
make package/feeds/luci/luci-base/compile V=99
|
||||
# 后再重试上面的编译。不要用root账号
|
||||
```
|
||||
|
||||
编译完成后,输出的内容在 `bin/targets/` 下面。
|
||||
|
||||
### 更新编译
|
||||
|
||||
```shell
|
||||
cd lede
|
||||
|
||||
# 更新LEDE
|
||||
git pull
|
||||
|
||||
# 更新源
|
||||
./scripts/feeds update -a
|
||||
./scripts/feeds install -a -f
|
||||
|
||||
# 更新缓存hash。lede源中的部分缓存hash不正确,导致每次都要联网下载,更新后可避免联网更新的出现
|
||||
bash ./feeds/lede_ifish/fixhash.sh
|
||||
|
||||
# 编译
|
||||
make -j$(($(nproc) + 1)) V=s
|
||||
```
|
||||
|
||||
### 更新配置
|
||||
|
||||
```shell
|
||||
# 重新更新配置
|
||||
make defconfig
|
||||
|
||||
# 下载,建议挂梯子,否则可能有失败的情况
|
||||
make download -j$(($(nproc) + 1))
|
||||
|
||||
# 尝试并行编译,如果失败则回滚为单线程编译
|
||||
make download -j$(($(nproc) + 1)) | make -j1 | make -j1 V=s
|
||||
```
|
||||
|
||||
## 相关链接
|
||||
|
||||
相关引用的模块请参考本仓库子模块。
|
||||
|
||||
1. 编译配置及命令可参考 [OpenWrt-AX6-duochajian](https://github.com/jingleijack/OpenWrt-AX6-duochajian)
|
38
fixhash.sh
Normal file
38
fixhash.sh
Normal file
@ -0,0 +1,38 @@
|
||||
#!/bin/bash
|
||||
|
||||
correct_hash() {
|
||||
echo 正在处理 $1
|
||||
|
||||
pkgdate=$(grep -Po '(?<=PKG_SOURCE_DATE:=)([\d-]+)' $1)
|
||||
pkghash=$(grep -Po '(?<=PKG_SOURCE_VERSION:=)([a-f\d]+)' $1)
|
||||
pkgname=$(grep -Po '(?<=PKG_NAME:=)([-\w]+)' $1)
|
||||
pkgmirror=$(grep -Po '(?<=PKG_MIRROR_HASH:=)([a-f\d]+)' $1)
|
||||
|
||||
local="dl/$pkgname-$pkgdate-${pkghash:0:8}.tar.xz"
|
||||
|
||||
if [ -e "$local" ]; then
|
||||
echo 文件 $local 存在,正在计算SHA256...
|
||||
sha256=$(sha256sum $local | awk '{print $1}')
|
||||
|
||||
echo SHA256:$sha256
|
||||
|
||||
if [ "$sha256" != "$pkgmirror" ]; then
|
||||
echo HASH不匹配,期望:$pkgmirror,正在更新...
|
||||
sed -i "s#$pkgmirror#$sha256#" $1
|
||||
else
|
||||
echo HASH匹配
|
||||
fi
|
||||
else
|
||||
echo cache文件 $local 不存在
|
||||
fi
|
||||
}
|
||||
|
||||
correct_hash package/firmware/ath11k-firmware/Makefile
|
||||
correct_hash package/qca/nss/qca-nss-drv/Makefile
|
||||
correct_hash package/qca/nss/qca-nss-drv-64/Makefile
|
||||
correct_hash package/qca/nss/qca-nss-ecm/Makefile
|
||||
correct_hash package/qca/nss/qca-nss-ecm-64/Makefile
|
||||
correct_hash package/qca/nss/qca-ssdk/Makefile
|
||||
correct_hash package/qca/nss/qca-nss-dp/Makefile
|
||||
correct_hash package/qca/nss/qca-nss-clients/Makefile
|
||||
correct_hash package/qca/nss/qca-nss-clients-64/Makefile
|
Loading…
Reference in New Issue
Block a user