sycn
This commit is contained in:
parent
a6b1cca5ad
commit
5a562900a4
@ -192,6 +192,14 @@ generate_network() {
|
||||
EOF
|
||||
}
|
||||
;;
|
||||
|
||||
qmi|\
|
||||
mbim)
|
||||
uci -q batch <<-EOF
|
||||
set network.$1.proto='${protocol}'
|
||||
set network.$1.pdptype='ipv4'
|
||||
EOF
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
@ -296,7 +304,7 @@ generate_static_system() {
|
||||
delete system.ntp
|
||||
set system.ntp='timeserver'
|
||||
set system.ntp.enabled='1'
|
||||
set system.ntp.enable_server='0'
|
||||
set system.ntp.enable_server='1'
|
||||
add_list system.ntp.server='ntp.aliyun.com'
|
||||
add_list system.ntp.server='time1.cloud.tencent.com'
|
||||
add_list system.ntp.server='time.ustc.edu.cn'
|
||||
|
@ -11,4 +11,3 @@
|
||||
-------------------------------------------------------------
|
||||
%D %V, %C
|
||||
-------------------------------------------------------------
|
||||
|
||||
|
@ -48,6 +48,7 @@ boot() {
|
||||
|
||||
/bin/config_generate
|
||||
uci_apply_defaults
|
||||
sync
|
||||
|
||||
# temporary hack until configd exists
|
||||
/sbin/reload_config
|
||||
|
@ -4,8 +4,7 @@
|
||||
START=10
|
||||
USE_PROCD=1
|
||||
|
||||
validate_system_section()
|
||||
{
|
||||
validate_system_section() {
|
||||
uci_load_validate system system "$1" "$2" \
|
||||
'hostname:string:OpenWrt' \
|
||||
'conloglevel:uinteger' \
|
||||
@ -23,8 +22,9 @@ system_config() {
|
||||
echo "$hostname" > /proc/sys/kernel/hostname
|
||||
[ -z "$conloglevel" -a -z "$buffersize" ] || dmesg ${conloglevel:+-n $conloglevel} ${buffersize:+-s $buffersize}
|
||||
echo "$timezone" > /tmp/TZ
|
||||
[ -n "$zonename" ] && [ -f "/usr/share/zoneinfo/$zonename" ] && \
|
||||
ln -sf "/usr/share/zoneinfo/$zonename" /tmp/localtime && rm -f /tmp/TZ
|
||||
[ -n "$zonename" ] && [ -f "/usr/share/zoneinfo/${zonename// /_}" ] \
|
||||
&& ln -sf "/usr/share/zoneinfo/${zonename// /_}" /tmp/localtime \
|
||||
&& rm -f /tmp/TZ
|
||||
|
||||
# apply timezone to kernel
|
||||
hwclock -u --systz
|
||||
@ -35,8 +35,7 @@ reload_service() {
|
||||
config_foreach validate_system_section system system_config
|
||||
}
|
||||
|
||||
service_triggers()
|
||||
{
|
||||
service_triggers() {
|
||||
procd_add_reload_trigger "system"
|
||||
procd_add_validation validate_system_section
|
||||
}
|
||||
|
@ -3,7 +3,7 @@
|
||||
[ -f /etc/banner ] && cat /etc/banner
|
||||
[ -n "$FAILSAFE" ] && cat /etc/banner.failsafe
|
||||
|
||||
fgrep -sq '/ overlay ro,' /proc/mounts && {
|
||||
grep -Fsq '/ overlay ro,' /proc/mounts && {
|
||||
echo 'Your JFFS2-partition seems full and overlayfs is mounted read-only.'
|
||||
echo 'Please try to remove files from /overlay/upper/... and reboot!'
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
root::0:0:99999:7:::
|
||||
root:::0:99999:7:::
|
||||
daemon:*:0:0:99999:7:::
|
||||
ftp:*:0:0:99999:7:::
|
||||
network:*:0:0:99999:7:::
|
||||
|
@ -250,4 +250,8 @@ macaddr_canonicalize() {
|
||||
[ ${#canon} -ne 17 ] && return
|
||||
|
||||
printf "%02x:%02x:%02x:%02x:%02x:%02x" 0x${canon// / 0x} 2>/dev/null
|
||||
}
|
||||
}
|
||||
|
||||
dt_is_enabled() {
|
||||
grep -q okay "/proc/device-tree/$1/status"
|
||||
}
|
||||
|
@ -96,7 +96,7 @@ ucidef_set_interfaces_lan_wan() {
|
||||
|
||||
ucidef_set_bridge_device() {
|
||||
json_select_object bridge
|
||||
json_add_string name "${1:switch0}"
|
||||
json_add_string name "${1:-switch0}"
|
||||
json_select ..
|
||||
}
|
||||
|
||||
@ -629,6 +629,21 @@ ucidef_set_ntpserver() {
|
||||
json_select ..
|
||||
}
|
||||
|
||||
ucidef_add_wlan() {
|
||||
local path="$1"; shift
|
||||
|
||||
ucidef_wlan_idx=${ucidef_wlan_idx:-0}
|
||||
|
||||
json_select_object wlan
|
||||
json_select_object "wl$ucidef_wlan_idx"
|
||||
json_add_string path "$path"
|
||||
json_add_fields "$@"
|
||||
json_select ..
|
||||
json_select ..
|
||||
|
||||
ucidef_wlan_idx="$((ucidef_wlan_idx + 1))"
|
||||
}
|
||||
|
||||
board_config_update() {
|
||||
json_init
|
||||
[ -f ${CFG} ] && json_load "$(cat ${CFG})"
|
||||
|
@ -128,14 +128,14 @@ wifi_updown() {
|
||||
[ enable = "$1" ] && {
|
||||
_wifi_updown disable "$2"
|
||||
ubus_wifi_cmd "$cmd" "$2"
|
||||
ubus call network reload
|
||||
scan_wifi
|
||||
cmd=up
|
||||
ubus call network reload
|
||||
}
|
||||
[ reconf = "$1" ] && {
|
||||
ubus call network reload
|
||||
scan_wifi
|
||||
cmd=reconf
|
||||
ubus call network reload
|
||||
}
|
||||
ubus_wifi_cmd "$cmd" "$2"
|
||||
_wifi_updown "$@"
|
||||
|
Loading…
x
Reference in New Issue
Block a user