From d59ce37629da2c3327e578e1b12c0957d63bc916 Mon Sep 17 00:00:00 2001
From: Topsy Chen <62056970+thomaswcy@users.noreply.github.com>
Date: Thu, 19 Aug 2021 14:50:40 +0800
Subject: [PATCH 1/8] Update patches.sh
---
patches.sh | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/patches.sh b/patches.sh
index 2664de5..0fc60cd 100644
--- a/patches.sh
+++ b/patches.sh
@@ -24,6 +24,15 @@ if [ $DEVICE = 'r2s' ]; then
echo -e "\toption maxfreq0 '1512000'\n" >> package/feeds/luci/luci-app-cpufreq/root/etc/config/cpufreq
fi
+if [ $DEVICE = 'r2c' ]; then
+ sed -i "s/enable '0'/enable '1'/" `find feeds/ -type f -name oled | grep config`
+ sed -i 's/1400000/1450000/' target/linux/rockchip/patches-5.4/991-arm64-dts-rockchip-add-more-cpu-operating-points-for.patch
+ truncate -s-1 package/feeds/luci/luci-app-cpufreq/root/etc/config/cpufreq
+ echo -e "\toption governor0 'schedutil'" >> package/feeds/luci/luci-app-cpufreq/root/etc/config/cpufreq
+ echo -e "\toption minfreq0 '816000'" >> package/feeds/luci/luci-app-cpufreq/root/etc/config/cpufreq
+ echo -e "\toption maxfreq0 '1512000'\n" >> package/feeds/luci/luci-app-cpufreq/root/etc/config/cpufreq
+fi
+
if [ $DEVICE = 'r4s' ]; then
wget https://github.com/immortalwrt/immortalwrt/commit/6c3f6d2686679173b95495c47d861db1f41729dd.patch
sed -i 's/package\/ctcgfw\/r8168\///g' 6c3f6d2686679173b95495c47d861db1f41729dd.patch
From b325117744840262223810810cd52f6f13512d84 Mon Sep 17 00:00:00 2001
From: Topsy Chen <62056970+thomaswcy@users.noreply.github.com>
Date: Thu, 19 Aug 2021 14:51:42 +0800
Subject: [PATCH 2/8] Update README.md
---
README.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/README.md b/README.md
index 74269a7..64d9ea8 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
-# Nanopi R1S R2S R4S Openwrt 固件
+# Nanopi R1S R2S R2C R4S Openwrt 固件
[刷机工具](https://www.balena.io/etcher/)
[下载地址](#下载地址)
@@ -37,7 +37,7 @@ wget -qO- https://github.com/klever1988/nanopi-openwrt/raw/master/scripts/autoup
因为本项目预编译了Image builder,生成固件仅需1-3分钟,如果有兴趣自定义固件可以Fork本项目,编辑设备对应的config.seed文件,例如r2s.config.seed, 去掉(整行删除)不需要的luci app软件包配置行,添加自己所需的软件,可用软件的列表可以在github actions构件输出处获取,例如
-完成之后进入Actions,点击左侧Build,点击右侧Run workflow输入设备名(r2s/r4s/r1s/r1s-h3/r1p)
+完成之后进入Actions,点击左侧Build,点击右侧Run workflow输入设备名(r2s/r2c/r4s/r1s/r1s-h3/r1p)
再点击Run即可获取自己所需的固件
From eebd25915601caae04e66ffb862acba429a74b77 Mon Sep 17 00:00:00 2001
From: Topsy Chen <62056970+thomaswcy@users.noreply.github.com>
Date: Thu, 19 Aug 2021 14:53:36 +0800
Subject: [PATCH 3/8] Update merge_files.sh
---
merge_files.sh | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/merge_files.sh b/merge_files.sh
index 21289d9..948d94d 100644
--- a/merge_files.sh
+++ b/merge_files.sh
@@ -6,7 +6,15 @@ if [ $DEVICE = 'r2s' ]; then
wget https://github.com/friendlyarm/friendlywrt/raw/master-v19.07.1/target/linux/rockchip-rk3328/base-files/etc/init.d/fa-rk3328-pwmfan -qNP files/etc/init.d
chmod +x files/etc/init.d/fa-rk3328-pwmfan
ln -sf ../init.d/fa-rk3328-pwmfan files/etc/rc.d/S96fa-rk3328-pwmfan
-fi
+ fi
+if [ $DEVICE = 'r2c' ]; then
+ mkdir -p files/usr/bin files/etc/init.d files/etc/rc.d
+ wget https://github.com/friendlyarm/friendlywrt/raw/master-v19.07.1/target/linux/rockchip-rk3328/base-files/usr/bin/start-rk3328-pwm-fan.sh -qNP files/usr/bin
+ chmod +x files/usr/bin/start-rk3328-pwm-fan.sh
+ wget https://github.com/friendlyarm/friendlywrt/raw/master-v19.07.1/target/linux/rockchip-rk3328/base-files/etc/init.d/fa-rk3328-pwmfan -qNP files/etc/init.d
+ chmod +x files/etc/init.d/fa-rk3328-pwmfan
+ ln -sf ../init.d/fa-rk3328-pwmfan files/etc/rc.d/S96fa-rk3328-pwmfan
+
if [ $DEVICE = 'r4s' ]; then
mkdir -p files/usr/bin files/etc/init.d files/etc/rc.d
wget https://raw.githubusercontent.com/btyh17mxy/friendlywrt/fix/rk3399-fan-ctl/target/linux/rockchip-rk3399/base-files/usr/bin/start-rk3399-pwm-fan.sh -qNP files/usr/bin
@@ -20,4 +28,4 @@ eval `cat .config | grep \" | head -n 10`
. files/etc/opkg/distfeeds.conf | tee files/etc/opkg/distfeeds.conf
echo "iptables -t nat -A PREROUTING -p udp --dport 53 -j REDIRECT --to-ports 53" >> files/etc/firewall.user
-echo "iptables -t nat -A PREROUTING -p tcp --dport 53 -j REDIRECT --to-ports 53" >> files/etc/firewall.user
\ No newline at end of file
+echo "iptables -t nat -A PREROUTING -p tcp --dport 53 -j REDIRECT --to-ports 53" >> files/etc/firewall.user
From f184b6025bec9e5ea4b1e69730d2634a2442e297 Mon Sep 17 00:00:00 2001
From: Topsy Chen <62056970+thomaswcy@users.noreply.github.com>
Date: Thu, 19 Aug 2021 14:53:51 +0800
Subject: [PATCH 4/8] Update merge_files.sh
---
merge_files.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/merge_files.sh b/merge_files.sh
index 948d94d..e2cb3b8 100644
--- a/merge_files.sh
+++ b/merge_files.sh
@@ -14,7 +14,7 @@ if [ $DEVICE = 'r2c' ]; then
wget https://github.com/friendlyarm/friendlywrt/raw/master-v19.07.1/target/linux/rockchip-rk3328/base-files/etc/init.d/fa-rk3328-pwmfan -qNP files/etc/init.d
chmod +x files/etc/init.d/fa-rk3328-pwmfan
ln -sf ../init.d/fa-rk3328-pwmfan files/etc/rc.d/S96fa-rk3328-pwmfan
-
+ fi
if [ $DEVICE = 'r4s' ]; then
mkdir -p files/usr/bin files/etc/init.d files/etc/rc.d
wget https://raw.githubusercontent.com/btyh17mxy/friendlywrt/fix/rk3399-fan-ctl/target/linux/rockchip-rk3399/base-files/usr/bin/start-rk3399-pwm-fan.sh -qNP files/usr/bin
From acd30812632a41405e3284764078fc73afbc6c63 Mon Sep 17 00:00:00 2001
From: Topsy Chen <62056970+thomaswcy@users.noreply.github.com>
Date: Thu, 19 Aug 2021 14:56:41 +0800
Subject: [PATCH 5/8] Update CHANGELOG.md
---
CHANGELOG.md | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index f5e0d5f..79c707d 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,6 +2,10 @@
# 更新日志
###### (如果没有特别说明,更新内容就是上游Lean和Lienol两位大佬的代码更新)
+## 2021-08-19
+
+- 增加机型:NanoPi R2C 的支持(由@thomaswcy提供支持)
+
## 2021-03-13
- autoupdate.sh脚本实验性功能:升级固件时自动扩容分区至sd卡最大值
From 4fe7e90012f34cf86184f1c9ca2af3c5bfd1300b Mon Sep 17 00:00:00 2001
From: klever1988 <56048681+klever1988@users.noreply.github.com>
Date: Thu, 19 Aug 2021 21:47:17 +0800
Subject: [PATCH 6/8] Update merge_files.sh
---
merge_files.sh | 12 ++----------
1 file changed, 2 insertions(+), 10 deletions(-)
diff --git a/merge_files.sh b/merge_files.sh
index e2cb3b8..27bf52d 100644
--- a/merge_files.sh
+++ b/merge_files.sh
@@ -1,20 +1,12 @@
mv $GITHUB_WORKSPACE/files ./
-if [ $DEVICE = 'r2s' ]; then
+if [ $DEVICE = 'r2s' -o $DEVICE = 'r2c' ]; then
mkdir -p files/usr/bin files/etc/init.d files/etc/rc.d
wget https://github.com/friendlyarm/friendlywrt/raw/master-v19.07.1/target/linux/rockchip-rk3328/base-files/usr/bin/start-rk3328-pwm-fan.sh -qNP files/usr/bin
chmod +x files/usr/bin/start-rk3328-pwm-fan.sh
wget https://github.com/friendlyarm/friendlywrt/raw/master-v19.07.1/target/linux/rockchip-rk3328/base-files/etc/init.d/fa-rk3328-pwmfan -qNP files/etc/init.d
chmod +x files/etc/init.d/fa-rk3328-pwmfan
ln -sf ../init.d/fa-rk3328-pwmfan files/etc/rc.d/S96fa-rk3328-pwmfan
- fi
-if [ $DEVICE = 'r2c' ]; then
- mkdir -p files/usr/bin files/etc/init.d files/etc/rc.d
- wget https://github.com/friendlyarm/friendlywrt/raw/master-v19.07.1/target/linux/rockchip-rk3328/base-files/usr/bin/start-rk3328-pwm-fan.sh -qNP files/usr/bin
- chmod +x files/usr/bin/start-rk3328-pwm-fan.sh
- wget https://github.com/friendlyarm/friendlywrt/raw/master-v19.07.1/target/linux/rockchip-rk3328/base-files/etc/init.d/fa-rk3328-pwmfan -qNP files/etc/init.d
- chmod +x files/etc/init.d/fa-rk3328-pwmfan
- ln -sf ../init.d/fa-rk3328-pwmfan files/etc/rc.d/S96fa-rk3328-pwmfan
- fi
+fi
if [ $DEVICE = 'r4s' ]; then
mkdir -p files/usr/bin files/etc/init.d files/etc/rc.d
wget https://raw.githubusercontent.com/btyh17mxy/friendlywrt/fix/rk3399-fan-ctl/target/linux/rockchip-rk3399/base-files/usr/bin/start-rk3399-pwm-fan.sh -qNP files/usr/bin
From cc4fb7ee9b0f6f6560ef27ad17d9b807f022d929 Mon Sep 17 00:00:00 2001
From: klever1988 <56048681+klever1988@users.noreply.github.com>
Date: Thu, 19 Aug 2021 21:49:32 +0800
Subject: [PATCH 7/8] Update patches.sh
---
patches.sh | 13 ++-----------
1 file changed, 2 insertions(+), 11 deletions(-)
diff --git a/patches.sh b/patches.sh
index 0fc60cd..65e031e 100644
--- a/patches.sh
+++ b/patches.sh
@@ -15,16 +15,7 @@ sed -i '/DEPENDS+/ s/$/ +wsdd2/' `find package/ -follow -type f -path '*/ksmbd-t
sed -i 's/ +ntfs-3g/ +ntfs3-mount/' `find package/ -follow -type f -path '*/automount/Makefile'`
sed -i '/skip\=/ a skip=`mount | grep -q /dev/$device; echo $?`' `find package/ -follow -type f -path */automount/files/15-automount`
-if [ $DEVICE = 'r2s' ]; then
- sed -i "s/enable '0'/enable '1'/" `find feeds/ -type f -name oled | grep config`
- sed -i 's/1400000/1450000/' target/linux/rockchip/patches-5.4/991-arm64-dts-rockchip-add-more-cpu-operating-points-for.patch
- truncate -s-1 package/feeds/luci/luci-app-cpufreq/root/etc/config/cpufreq
- echo -e "\toption governor0 'schedutil'" >> package/feeds/luci/luci-app-cpufreq/root/etc/config/cpufreq
- echo -e "\toption minfreq0 '816000'" >> package/feeds/luci/luci-app-cpufreq/root/etc/config/cpufreq
- echo -e "\toption maxfreq0 '1512000'\n" >> package/feeds/luci/luci-app-cpufreq/root/etc/config/cpufreq
-fi
-
-if [ $DEVICE = 'r2c' ]; then
+if [ $DEVICE = 'r2s' -o $DEVICE = 'r2c' ]; then
sed -i "s/enable '0'/enable '1'/" `find feeds/ -type f -name oled | grep config`
sed -i 's/1400000/1450000/' target/linux/rockchip/patches-5.4/991-arm64-dts-rockchip-add-more-cpu-operating-points-for.patch
truncate -s-1 package/feeds/luci/luci-app-cpufreq/root/etc/config/cpufreq
@@ -40,7 +31,7 @@ if [ $DEVICE = 'r4s' ]; then
sed -i 's/r8169/r8168/' target/linux/rockchip/image/armv8.mk
fi
-if [[ $DEVICE =~ ('r2s'|'r4s'|'r1p') ]]; then
+if [[ $DEVICE =~ ('r2s'|'r2c'|'r4s'|'r1p') ]]; then
wget https://github.com/coolsnowwolf/lede/raw/757e42d70727fe6b937bb31794a9ad4f5ce98081/target/linux/rockchip/config-default -NP target/linux/rockchip/
wget https://github.com/coolsnowwolf/lede/commit/f341ef96fe4b509a728ba1281281da96bac23673.patch
git apply f341ef96fe4b509a728ba1281281da96bac23673.patch
From 6c6a5126504071328ab90a495f0540070ab81099 Mon Sep 17 00:00:00 2001
From: klever1988 <56048681+klever1988@users.noreply.github.com>
Date: Thu, 19 Aug 2021 21:52:48 +0800
Subject: [PATCH 8/8] Update patches.sh
---
patches.sh | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/patches.sh b/patches.sh
index 65e031e..25faaf6 100644
--- a/patches.sh
+++ b/patches.sh
@@ -16,12 +16,13 @@ sed -i 's/ +ntfs-3g/ +ntfs3-mount/' `find package/ -follow -type f -path '*/auto
sed -i '/skip\=/ a skip=`mount | grep -q /dev/$device; echo $?`' `find package/ -follow -type f -path */automount/files/15-automount`
if [ $DEVICE = 'r2s' -o $DEVICE = 'r2c' ]; then
- sed -i "s/enable '0'/enable '1'/" `find feeds/ -type f -name oled | grep config`
sed -i 's/1400000/1450000/' target/linux/rockchip/patches-5.4/991-arm64-dts-rockchip-add-more-cpu-operating-points-for.patch
- truncate -s-1 package/feeds/luci/luci-app-cpufreq/root/etc/config/cpufreq
- echo -e "\toption governor0 'schedutil'" >> package/feeds/luci/luci-app-cpufreq/root/etc/config/cpufreq
- echo -e "\toption minfreq0 '816000'" >> package/feeds/luci/luci-app-cpufreq/root/etc/config/cpufreq
- echo -e "\toption maxfreq0 '1512000'\n" >> package/feeds/luci/luci-app-cpufreq/root/etc/config/cpufreq
+ sed -i "s/enable '0'/enable '1'/" `find package/ -follow -type f -path '*/luci-app-oled/root/etc/config/oled'`
+ config_file_cpufreq=`find package/ -follow -type f -path '*/luci-app-cpufreq/root/etc/config/cpufreq'`
+ truncate -s-1 $config_file_cpufreq
+ echo -e "\toption governor0 'schedutil'" >> $config_file_cpufreq
+ echo -e "\toption minfreq0 '816000'" >> $config_file_cpufreq
+ echo -e "\toption maxfreq0 '1512000'\n" >> $config_file_cpufreq
fi
if [ $DEVICE = 'r4s' ]; then