diff --git a/.github/workflows/friendlywrt_with_features.yml b/.github/workflows/friendlywrt_with_features.yml index 36fd25bee035b26983945f7af30b103a5ed3f336..3ff8f38504b82d0203801832bb6b9bc0248cd8c5 100644 --- a/.github/workflows/friendlywrt_with_features.yml +++ b/.github/workflows/friendlywrt_with_features.yml @@ -69,8 +69,6 @@ jobs: cd .. rm -rf friendlywrt/package/libs cp -r openwrt/package/libs friendlywrt/package/ - # rm -rf friendlywrt/package/libs/elfutils - # cp -r lede/package/libs/elfutils friendlywrt/package/libs/ - name: Install Openwrt octeontx patches run: | diff --git a/README.md b/README.md index ae9b9c1eb8aaacc380b9dd1d77f24111e06b1898..5133ebf7501c2113565d7be6bcaff175317b392d 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,10 @@ 编译了两种固件,分别是基于 Lean 的和基于官方固件的。 +点击[这里](https://github.com/songchenwen/nanopi-r2s/releases)下载固件,推荐下载 FriendlyWRT 开头的版本。 + +NanoPi R2S 图形化刷机工具 luci-app-r2sflasher 的 ipk 安装包,也可以从[这里](https://github.com/songchenwen/nanopi-r2s/releases)下载到,选择4月14日及之后的版本把 zip 包解压之后即可得到 ipk。 + | 荐 | 固件名字 | 状态 | 改动记录 | 简介 | | :--- | :------ | :--- | :----- | :--- | | * | FriendlyWRT | [![friendlywrt](https://github.com/songchenwen/nanopi-r2s/workflows/friendlywrt/badge.svg)](https://github.com/songchenwen/nanopi-r2s/actions?query=workflow%3Afriendlywrt) | [改动记录](FriendlyWRT/CHANGELOG.md) | 以 FriendlyWRT 为基础, 添加 Lean 的包 | diff --git a/luci-app-r2sflasher/Makefile b/luci-app-r2sflasher/Makefile index f72d75c795b88d575c861394240312165a67a474..47e7f3c9b88d05e3177a439a846c8bb9603cc8bf 100644 --- a/luci-app-r2sflasher/Makefile +++ b/luci-app-r2sflasher/Makefile @@ -12,7 +12,7 @@ define Package/$(PKG_NAME) SUBMENU:=3. Applications TITLE:=LuCI Application to Flash NanoPi R2S ROM PKGARCH:=all - DEPENDS:=+bash +unzip +pv +losetup +zstd + DEPENDS:=+bash +gzip +tar +unzip +pv +losetup +zstd endef define Build/Prepare diff --git a/luci-app-r2sflasher/root/usr/bin/rom_flash b/luci-app-r2sflasher/root/usr/bin/rom_flash index 9ed771157a8c3f7e16d7c903a06015cdc2827a0a..7e84e01b2a61b0185841427532a4a29508ffb781 100755 --- a/luci-app-r2sflasher/root/usr/bin/rom_flash +++ b/luci-app-r2sflasher/root/usr/bin/rom_flash @@ -31,7 +31,6 @@ cd $workingdir inputfile=$1 nobackup=$2 -imgfile=rom.img lomntpoint=/mnt/img backupfile=/tmp/backup.tar.gz @@ -59,18 +58,28 @@ fi if [ "$inputfileext" == "zip" ]; then gzfile=$(unzip -Z -1 "$inputfile" | grep "sd.img.gz$") + imgfile=$(unzip -Z -1 "$inputfile" | grep ".img$") - if [ "$gzfile" == "" ]; then + if [ "$gzfile" == "" ] && [ "$imgfile" == "" ]; then echo "没发现 sd.img.gz 结尾的固件包" cd /root rm -rf $workingdir exit 1 fi - unzip "$inputfile" "$gzfile" + + if ! [ "$gzfile" == "" ]; then + unzip "$inputfile" "$gzfile" + imgfile="" + else + if ! [ "$imgfile" == "" ]; then + unzip "$inputfile" "$imgfile" + fi + fi + rm $inputfile - if [ -f "$gzfile" ]; then - echo "zip 固件已解压至 $gzfile" + if [ -f "$gzfile" ] || [ -f "$imgfile" ]; then + echo "zip 固件已解压至 ${gzfile}${imgfile}" else echo "zip 固件解压失败" cd /root @@ -79,7 +88,7 @@ if [ "$inputfileext" == "zip" ]; then fi fi -if [ "$gzfile" == "" ]; then +if [ "$gzfile" == "" ] && [ "$imgfile" == "" ]; then echo "不是有效的 ROM 文件" cd /root rm $inputfile @@ -87,17 +96,20 @@ if [ "$gzfile" == "" ]; then exit 1 fi -echo "开始解压 gz 文件......" -pv "$gzfile" | gunzip -dc > "$imgfile" -if [ -f "$imgfile" ]; then - echo "gz 固件已解压至 $imgfile" - rm $gzfile -else - echo "gz 固件解压失败" - rm $gzfile - cd /root - rm -rf $workingdir - exit 1 +if ! [ "$gzfile" == "" ]; then + echo "开始解压 gz 文件......" + imgfile="rom.img" + pv "$gzfile" | gunzip -dc > "$imgfile" + if [ -f "$imgfile" ]; then + echo "gz 固件已解压至 $imgfile" + rm $gzfile + else + echo "gz 固件解压失败" + rm $gzfile + cd /root + rm -rf $workingdir + exit 1 + fi fi lodev=$(losetup -f)