提交 c4df26fc 编写于 作者: S songchenwen

luci-app-r2sflasher support img.zip file

上级 929220ad
......@@ -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: |
......
......@@ -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 的包 |
......
......@@ -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
......
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册