Good day. In attach patch for package restorefactory: 1.added blinking for diag led 2.timeout for reset button
diff_ress_diag.patch Signed-off-by: Alexander Khrykin <alexan...@mezon.ru> mac80211 patch. https://dev.openwrt.org/ticket/7698 in attach mac80211.patch Signed-off-by:alexander barakin aka sash-kan <alex.bara...@gmail.com>
Index: feeds/packages/utils/restorefactory/files/etc/hotplug.d/button/50-restorefactory =================================================================== --- feeds/packages/utils/restorefactory/files/etc/hotplug.d/button/50-restorefactory (revision 22987) +++ feeds/packages/utils/restorefactory/files/etc/hotplug.d/button/50-restorefactory (working copy) @@ -1,31 +1,48 @@ #!/bin/sh system_config() { - config_get button "$1" button "reset" - config_get action "$1" action "pressed" - config_get timeout "$1" timeout "5" + config_get button "$1" button "reset" + config_get action "$1" action "pressed" + config_get timeout "$1" timeout "10" } +blinking() { + i=0 + b=0 + while [[ $i -lt $timeout ]] + do + echo $b > /proc/diag/led/diag + sleep 1 + [ "$b" = "0" ] && b=1 || b=0 + $((i++)) + done + echo 0 > /proc/diag/led/diag + return 0 +} + config_load system config_foreach system_config restorefactory [ "$BUTTON" = "$button" ] && { - [ -f /tmp/run/restorefactory.pid ] && read PID < /tmp/run/restorefactory.pid && kill $PID && rm /tmp/run/restorefactory.pid && logger -p user.info -t "restorefactory" "restore to factory defaults aborted" + [ -f /tmp/run/restorefactory.pid ] && read PID < /tmp/run/restorefactory.pid && kill $PID \ + && rm /tmp/run/restorefactory.pid && echo 1 > /proc/diag/led/diag \ + && logger -p user.info -t "restorefactory" "restore to factory defaults aborted" - [ "$ACTION" = "$action" ] && { + [ "$ACTION" = "$action" ] && { - if [ "$timeout" -gt 0 ] - then - sleep "$timeout" && firstboot && reboot & - echo $! > /tmp/run/restorefactory.pid - logger -p user.info -t "restorefactory" "restoring to factory defaults in $timeout seconds" - elif [ "$timeout" -eq 0 ] - then - firstboot && reboot & - else - logger -p user.info -t "restorefactory" "invalid timeout value ($timeout)" - fi - } + if [ "$timeout" -gt 0 ] + then + blinking && firstboot && reboot & + echo $! > /tmp/run/restorefactory.pid + logger -p user.info -t "restorefactory" "restoring to factory defaults in $timeout seconds" + elif [ "$timeout" -eq 0 ] + then + firstboot && reboot & + else + logger -p user.info -t "restorefactory" "invalid timeout value ($timeout)" + fi + } } +
--- a/package/mac80211/files/lib/wifi/mac80211.sh +++ b/package/mac80211/files/lib/wifi/mac80211.sh @@ -330,6 +330,13 @@ enable_mac80211() { echo "Failed to start hostapd for $phy" return } + # bug: https://dev.openwrt.org/ticket/7698 + [ "$(cat /proc/diag/model)" == "ASUS WL-500g Premium V2" ] && \ + { + echo -n $(cat /proc/diag/gpiomask) > /proc/diag/gpiomask + echo 1 > /proc/diag/led/power + } + sleep 2 for vif in $vifs; do
_______________________________________________ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel