Skip to content

Commit 607de52

Browse files
committed
theme: set default theme to openwrt2020
1 parent 0c0d111 commit 607de52

File tree

5 files changed

+64
-49
lines changed

5 files changed

+64
-49
lines changed

.github/workflows/lo-test.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ jobs:
6767
fi
6868
./scripts/feeds update -a
6969
./scripts/feeds install -a
70-
. $GITHUB_WORKSPACE/merge_packages.sh
71-
. $GITHUB_WORKSPACE/patches.sh
70+
. $GITHUB_WORKSPACE/scripts/merge_packages.sh
71+
. $GITHUB_WORKSPACE/scripts/patches.sh
7272
cd
7373
[ $BRANCH != 'master' ] && BRANCH='openwrt-18.06'
7474
svn export https://github.com/openwrt/luci/branches/$BRANCH luci
@@ -199,7 +199,7 @@ jobs:
199199
sudo sysctl vm.swappiness=0
200200
curl -L https://github.com/klever1988/sshactions/releases/download/cache/ib-$DEVICE.tar.xz | tar -Jxvf -
201201
mv *imagebuilder* ib && cd ib
202-
. $GITHUB_WORKSPACE/merge_files.sh
202+
. $GITHUB_WORKSPACE/scripts/merge_files.sh
203203
mkdir -p files/local_feed && sudo mount --bind packages files/local_feed
204204
sed -i '/luci-lib-base/d;/luci-lib-ipkg/d' include/target.mk
205205
sed -i 's/luci-app-[^ ]*//g' include/target.mk $(find target/ -name Makefile)
@@ -246,7 +246,7 @@ jobs:
246246
sudo sysctl vm.swappiness=0
247247
curl -L https://github.com/klever1988/sshactions/releases/download/cache/ib-$DEVICE.tar.xz | tar -Jxvf -
248248
mv *imagebuilder* ib && cd ib
249-
. $GITHUB_WORKSPACE/merge_files.sh
249+
. $GITHUB_WORKSPACE/scripts/merge_files.sh
250250
sed -i '/local/d;s/#//' files/etc/opkg/distfeeds.conf
251251
sed -i '/luci-lib-base/d;/luci-lib-ipkg/d' include/target.mk
252252
sed -i 's/luci-app-[^ ]*//g' include/target.mk $(find target/ -name Makefile)

patches/99-disallow-aaaa.patch

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
diff --git a/src/dns_query.c b/src/dns_query.c
2+
index 0b6c9c0..81f2f7a 100644
3+
--- a/src/dns_query.c
4+
+++ b/src/dns_query.c
5+
@@ -413,6 +413,7 @@ static int rrs2cent(unsigned char *msg, size_t msgsz, unsigned char **ptr, size_
6+
break;
7+
#if IS_CACHED_AAAA
8+
case T_AAAA:
9+
+ break;
10+
/* Validate types we use internally */
11+
if(rdlength!=16) goto invalid_length;
12+
goto default_case;
File renamed without changes.
File renamed without changes.

patches.sh scripts/patches.sh

+48-45
Original file line numberDiff line numberDiff line change
@@ -15,71 +15,74 @@ sed -i '/DEPENDS+/ s/$/ +wsdd2/' `find package/ -follow -type f -path '*/ksmbd-t
1515
sed -i 's/ +ntfs-3g/ +ntfs3-mount/' `find package/ -follow -type f -path '*/automount/Makefile'`
1616
sed -i '/skip\=/ a skip=`mount | grep -q /dev/$device; echo $?`' `find package/ -follow -type f -path */automount/files/15-automount`
1717

18-
if [ $DEVICE = 'x86' ]; then
18+
mkdir `find package/ -follow -type d -path '*/pdnsd-alt'`/patches
19+
mv patches/99-disallow-aaaa.patch `find package/ -follow -type d -path '*/pdnsd-alt'`/patches
20+
21+
if [ $DEVICE != 'r1s' ]; then
22+
23+
# remove non-exist package from x86 profile
1924
sed -i 's/kmod-i40evf//' target/linux/x86/Makefile
20-
fi
2125

22-
if [ $DEVICE = 'r2s' -o $DEVICE = 'r2c' ]; then
23-
sed -i 's/1400000/1450000/' target/linux/rockchip/patches-5.4/991-arm64-dts-rockchip-add-more-cpu-operating-points-for.patch
26+
# enable r2s oled plugin by default
2427
sed -i "s/enable '0'/enable '1'/" `find package/ -follow -type f -path '*/luci-app-oled/root/etc/config/oled'`
28+
29+
# swap the network adapter driver to r8168 to gain better performance for r4s
30+
sed -i 's/r8169/r8168/' target/linux/rockchip/image/armv8.mk
31+
32+
# change the voltage value for over-clock stablization
33+
sed -i 's/1400000/1450000/' target/linux/rockchip/patches-5.4/991-arm64-dts-rockchip-add-more-cpu-operating-points-for.patch
2534
config_file_cpufreq=`find package/ -follow -type f -path '*/luci-app-cpufreq/root/etc/config/cpufreq'`
2635
truncate -s-1 $config_file_cpufreq
2736
echo -e "\toption governor0 'schedutil'" >> $config_file_cpufreq
2837
echo -e "\toption minfreq0 '816000'" >> $config_file_cpufreq
2938
echo -e "\toption maxfreq0 '1512000'\n" >> $config_file_cpufreq
30-
fi
3139

32-
if [ $DEVICE = 'r4s' ]; then
33-
sed -i 's/r8169/r8168/' target/linux/rockchip/image/armv8.mk
34-
fi
35-
36-
if [[ $DEVICE =~ ('r2s'|'r2c'|'r4s'|'r1p') ]]; then
40+
# enable the gpu for device 'r2s'|'r2c'|'r4s'|'r1p'
3741
wget https://github.com/coolsnowwolf/lede/raw/757e42d70727fe6b937bb31794a9ad4f5ce98081/target/linux/rockchip/config-default -NP target/linux/rockchip/
3842
wget https://github.com/coolsnowwolf/lede/commit/f341ef96fe4b509a728ba1281281da96bac23673.patch
3943
git apply f341ef96fe4b509a728ba1281281da96bac23673.patch
4044
rm f341ef96fe4b509a728ba1281281da96bac23673.patch
45+
46+
# bring the ethinfo back
47+
cd package/emortal/autocore/files/x86
48+
cp rpcd_luci rpcd_10_system.js rpcd_luci-mod-status.json ../arm
49+
cd -
50+
mf_autcore=`find package/ -path '*/autocore/Makefile'`
51+
sed -i '/arm\/cpuinfo/a\\t$(INSTALL_DATA) ./files/x86/rpcd_21_ethinfo.js $(1)/www/luci-static/resources/view/status/include/21_ethinfo.js' $mf_autcore
52+
sed -i '/arm\/cpuinfo/a\\t$(INSTALL_DIR) $(1)/www/luci-static/resources/view/status/include' $mf_autcore
53+
sed -i '/arm\/cpuinfo/a\\t$(INSTALL_BIN) ./files/x86/ethinfo $(1)/sbin/ethinfo' $mf_autcore
54+
55+
# inject the firmware version
56+
strDate=`TZ=UTC-8 date +%Y-%m-%d`
57+
status_pages=`find package/ -follow -type f \( -path '*/autocore/files/arm/index.htm' -o -path '*/autocore/files/x86/index.htm' -o -path '*/autocore/files/arm/rpcd_10_system.js' -o -path '*/autocore/files/x86/rpcd_10_system.js' \)`
58+
for status_page in $status_pages; do
59+
case $status_page in
60+
*htm)
61+
line_number_FV=`grep -n 'Firmware Version' $status_page | cut -d: -f 1`
62+
sed -i '/ver\./d' $status_page
63+
sed -i $line_number_FV' a <a href="https://github.com/klever1988/nanopi-openwrt" target="_blank">klever1988/nanopi-openwrt</a> '$strDate $status_page
64+
;;
65+
*js)
66+
line_number_FV=`grep -m1 -n 'corelink' $status_page | cut -d: -f1`
67+
sed -i $line_number_FV' i var pfv = document.createElement('\''placeholder'\'');pfv.innerHTML = '\''<a href="https://github.com/klever1988/nanopi-openwrt" target="_blank">klever1988/nanopi-openwrt</a> '$strDate"';" $status_page
68+
line_number_FV=`grep -n 'Firmware Version' $status_page | cut -d : -f 1`
69+
sed -i '/Firmware Version/d' $status_page
70+
sed -i $line_number_FV' a _('\''Firmware Version'\''), pfv,' $status_page
71+
;;
72+
esac
73+
done
74+
4175
fi
4276

43-
#inject the firmware version
44-
strDate=`TZ=UTC-8 date +%Y-%m-%d`
45-
status_pages=`find package/ -follow -type f \( -path '*/autocore/files/arm/index.htm' -o -path '*/autocore/files/x86/index.htm' -o -path '*/autocore/files/arm/rpcd_10_system.js' -o -path '*/autocore/files/x86/rpcd_10_system.js' \)`
46-
for status_page in $status_pages; do
47-
case $status_page in
48-
*htm)
49-
line_number_FV=`grep -n 'Firmware Version' $status_page | cut -d: -f 1`
50-
sed -i '/ver\./d' $status_page
51-
sed -i $line_number_FV' a <a href="https://github.com/klever1988/nanopi-openwrt" target="_blank">klever1988/nanopi-openwrt</a> '$strDate $status_page
52-
;;
53-
*js)
54-
line_number_FV=`grep -m1 -n 'corelink' $status_page | cut -d: -f1`
55-
sed -i $line_number_FV' i var pfv = document.createElement('\''placeholder'\'');pfv.innerHTML = '\''<a href="https://github.com/klever1988/nanopi-openwrt" target="_blank">klever1988/nanopi-openwrt</a> '$strDate"';" $status_page
56-
line_number_FV=`grep -n 'Firmware Version' $status_page | cut -d : -f 1`
57-
sed -i '/Firmware Version/d' $status_page
58-
sed -i $line_number_FV' a _('\''Firmware Version'\''), pfv,' $status_page
59-
;;
60-
esac
61-
done
62-
63-
#fix argon css
77+
# little optimization argon css
6478
css_file=`find package/ -follow -type f -path '*/argon/css/cascade.css'`
6579
line_number_h6=`grep -m1 -n 'h6 {' $css_file | cut -d: -f1`
6680
if [[ ! -z "$line_number_h6" ]]; then
6781
sed -i $line_number_h6',+10 s/font-weight: normal/font-weight: bold/' $css_file
6882
fi
6983

70-
#set default theme to argon
71-
sed -i '/uci commit luci/i\uci set luci.main.mediaurlbase="/luci-static/argon"' `find package -type f -path '*/default-settings/files/zzz-default-settings'`
72-
73-
#bring the ethinfo back
74-
if [ $DEVICE != 'r1s' ]; then
75-
cd package/emortal/autocore/files/x86
76-
cp rpcd_luci rpcd_10_system.js rpcd_luci-mod-status.json ../arm
77-
cd -
78-
mf_autcore=`find package/ -path '*/autocore/Makefile'`
79-
sed -i '/arm\/cpuinfo/a\\t$(INSTALL_DATA) ./files/x86/rpcd_21_ethinfo.js $(1)/www/luci-static/resources/view/status/include/21_ethinfo.js' $mf_autcore
80-
sed -i '/arm\/cpuinfo/a\\t$(INSTALL_DIR) $(1)/www/luci-static/resources/view/status/include' $mf_autcore
81-
sed -i '/arm\/cpuinfo/a\\t$(INSTALL_BIN) ./files/x86/ethinfo $(1)/sbin/ethinfo' $mf_autcore
82-
fi
84+
# set default theme to openwrt2020
85+
sed -i '/uci commit luci/i\uci set luci.main.mediaurlbase="/luci-static/openwrt2020"' `find package -type f -path '*/default-settings/files/zzz-default-settings'`
8386

84-
#remove the mirros from cn
87+
# remove the mirros from cn
8588
sed -i '/182.140.223.146/d;/\.cn\//d;/tencent/d' scripts/download.pl

0 commit comments

Comments
 (0)