diff --git a/.github/workflows/lo-test.yml b/.github/workflows/lo-test.yml index 854d412..3f0b60d 100644 --- a/.github/workflows/lo-test.yml +++ b/.github/workflows/lo-test.yml @@ -67,8 +67,8 @@ jobs: fi ./scripts/feeds update -a ./scripts/feeds install -a - . $GITHUB_WORKSPACE/merge_packages.sh - . $GITHUB_WORKSPACE/patches.sh + . $GITHUB_WORKSPACE/scripts/merge_packages.sh + . $GITHUB_WORKSPACE/scripts/patches.sh cd [ $BRANCH != 'master' ] && BRANCH='openwrt-18.06' svn export https://github.com/openwrt/luci/branches/$BRANCH luci @@ -199,7 +199,7 @@ jobs: sudo sysctl vm.swappiness=0 curl -L https://github.com/klever1988/sshactions/releases/download/cache/ib-$DEVICE.tar.xz | tar -Jxvf - mv *imagebuilder* ib && cd ib - . $GITHUB_WORKSPACE/merge_files.sh + . $GITHUB_WORKSPACE/scripts/merge_files.sh mkdir -p files/local_feed && sudo mount --bind packages files/local_feed sed -i '/luci-lib-base/d;/luci-lib-ipkg/d' include/target.mk sed -i 's/luci-app-[^ ]*//g' include/target.mk $(find target/ -name Makefile) @@ -246,7 +246,7 @@ jobs: sudo sysctl vm.swappiness=0 curl -L https://github.com/klever1988/sshactions/releases/download/cache/ib-$DEVICE.tar.xz | tar -Jxvf - mv *imagebuilder* ib && cd ib - . $GITHUB_WORKSPACE/merge_files.sh + . $GITHUB_WORKSPACE/scripts/merge_files.sh sed -i '/local/d;s/#//' files/etc/opkg/distfeeds.conf sed -i '/luci-lib-base/d;/luci-lib-ipkg/d' include/target.mk sed -i 's/luci-app-[^ ]*//g' include/target.mk $(find target/ -name Makefile) diff --git a/patches/99-disallow-aaaa.patch b/patches/99-disallow-aaaa.patch new file mode 100644 index 0000000..3f98698 --- /dev/null +++ b/patches/99-disallow-aaaa.patch @@ -0,0 +1,12 @@ +diff --git a/src/dns_query.c b/src/dns_query.c +index 0b6c9c0..81f2f7a 100644 +--- a/src/dns_query.c ++++ b/src/dns_query.c +@@ -413,6 +413,7 @@ static int rrs2cent(unsigned char *msg, size_t msgsz, unsigned char **ptr, size_ + break; + #if IS_CACHED_AAAA + case T_AAAA: ++ break; + /* Validate types we use internally */ + if(rdlength!=16) goto invalid_length; + goto default_case; diff --git a/merge_files.sh b/scripts/merge_files.sh similarity index 100% rename from merge_files.sh rename to scripts/merge_files.sh diff --git a/merge_packages.sh b/scripts/merge_packages.sh similarity index 100% rename from merge_packages.sh rename to scripts/merge_packages.sh diff --git a/patches.sh b/scripts/patches.sh similarity index 52% rename from patches.sh rename to scripts/patches.sh index 1fbab99..efd7d0d 100644 --- a/patches.sh +++ b/scripts/patches.sh @@ -15,71 +15,74 @@ 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 = 'x86' ]; then - sed -i 's/kmod-i40evf//' target/linux/x86/Makefile -fi +mkdir `find package/ -follow -type d -path '*/pdnsd-alt'`/patches +mv patches/99-disallow-aaaa.patch `find package/ -follow -type d -path '*/pdnsd-alt'`/patches -if [ $DEVICE = 'r2s' -o $DEVICE = 'r2c' ]; then - sed -i 's/1400000/1450000/' target/linux/rockchip/patches-5.4/991-arm64-dts-rockchip-add-more-cpu-operating-points-for.patch +if [ $DEVICE != 'r1s' ]; then + + # remove non-exist package from x86 profile + sed -i 's/kmod-i40evf//' target/linux/x86/Makefile + + # enable r2s oled plugin by default sed -i "s/enable '0'/enable '1'/" `find package/ -follow -type f -path '*/luci-app-oled/root/etc/config/oled'` + + # swap the network adapter driver to r8168 to gain better performance for r4s + sed -i 's/r8169/r8168/' target/linux/rockchip/image/armv8.mk + + # change the voltage value for over-clock stablization + sed -i 's/1400000/1450000/' target/linux/rockchip/patches-5.4/991-arm64-dts-rockchip-add-more-cpu-operating-points-for.patch 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 - sed -i 's/r8169/r8168/' target/linux/rockchip/image/armv8.mk -fi - -if [[ $DEVICE =~ ('r2s'|'r2c'|'r4s'|'r1p') ]]; then + # enable the gpu for device 'r2s'|'r2c'|'r4s'|'r1p' 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 rm f341ef96fe4b509a728ba1281281da96bac23673.patch + + # bring the ethinfo back + cd package/emortal/autocore/files/x86 + cp rpcd_luci rpcd_10_system.js rpcd_luci-mod-status.json ../arm + cd - + mf_autcore=`find package/ -path '*/autocore/Makefile'` + 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 + sed -i '/arm\/cpuinfo/a\\t$(INSTALL_DIR) $(1)/www/luci-static/resources/view/status/include' $mf_autcore + sed -i '/arm\/cpuinfo/a\\t$(INSTALL_BIN) ./files/x86/ethinfo $(1)/sbin/ethinfo' $mf_autcore + + # inject the firmware version + strDate=`TZ=UTC-8 date +%Y-%m-%d` + 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' \)` + for status_page in $status_pages; do + case $status_page in + *htm) + line_number_FV=`grep -n 'Firmware Version' $status_page | cut -d: -f 1` + sed -i '/ver\./d' $status_page + sed -i $line_number_FV' a klever1988/nanopi-openwrt '$strDate $status_page + ;; + *js) + line_number_FV=`grep -m1 -n 'corelink' $status_page | cut -d: -f1` + sed -i $line_number_FV' i var pfv = document.createElement('\''placeholder'\'');pfv.innerHTML = '\''klever1988/nanopi-openwrt '$strDate"';" $status_page + line_number_FV=`grep -n 'Firmware Version' $status_page | cut -d : -f 1` + sed -i '/Firmware Version/d' $status_page + sed -i $line_number_FV' a _('\''Firmware Version'\''), pfv,' $status_page + ;; + esac + done + fi -#inject the firmware version -strDate=`TZ=UTC-8 date +%Y-%m-%d` -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' \)` -for status_page in $status_pages; do -case $status_page in - *htm) - line_number_FV=`grep -n 'Firmware Version' $status_page | cut -d: -f 1` - sed -i '/ver\./d' $status_page - sed -i $line_number_FV' a klever1988/nanopi-openwrt '$strDate $status_page - ;; - *js) - line_number_FV=`grep -m1 -n 'corelink' $status_page | cut -d: -f1` - sed -i $line_number_FV' i var pfv = document.createElement('\''placeholder'\'');pfv.innerHTML = '\''klever1988/nanopi-openwrt '$strDate"';" $status_page - line_number_FV=`grep -n 'Firmware Version' $status_page | cut -d : -f 1` - sed -i '/Firmware Version/d' $status_page - sed -i $line_number_FV' a _('\''Firmware Version'\''), pfv,' $status_page - ;; -esac -done - -#fix argon css +# little optimization argon css css_file=`find package/ -follow -type f -path '*/argon/css/cascade.css'` line_number_h6=`grep -m1 -n 'h6 {' $css_file | cut -d: -f1` if [[ ! -z "$line_number_h6" ]]; then sed -i $line_number_h6',+10 s/font-weight: normal/font-weight: bold/' $css_file fi -#set default theme to argon -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'` +# set default theme to openwrt2020 +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'` -#bring the ethinfo back -if [ $DEVICE != 'r1s' ]; then -cd package/emortal/autocore/files/x86 -cp rpcd_luci rpcd_10_system.js rpcd_luci-mod-status.json ../arm -cd - -mf_autcore=`find package/ -path '*/autocore/Makefile'` -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 -sed -i '/arm\/cpuinfo/a\\t$(INSTALL_DIR) $(1)/www/luci-static/resources/view/status/include' $mf_autcore -sed -i '/arm\/cpuinfo/a\\t$(INSTALL_BIN) ./files/x86/ethinfo $(1)/sbin/ethinfo' $mf_autcore -fi - -#remove the mirros from cn +# remove the mirros from cn sed -i '/182.140.223.146/d;/\.cn\//d;/tencent/d' scripts/download.pl \ No newline at end of file