Merge pull request #10564 from 1582130940/pull

This commit is contained in:
aiamadeus 2022-12-11 08:25:52 +08:00 committed by GitHub
commit d86fda2741
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 11 additions and 11 deletions

View File

@ -48,6 +48,7 @@ boot() {
/bin/config_generate /bin/config_generate
uci_apply_defaults uci_apply_defaults
sync
# temporary hack until configd exists # temporary hack until configd exists
/sbin/reload_config /sbin/reload_config

View File

@ -4,8 +4,7 @@
START=10 START=10
USE_PROCD=1 USE_PROCD=1
validate_system_section() validate_system_section() {
{
uci_load_validate system system "$1" "$2" \ uci_load_validate system system "$1" "$2" \
'hostname:string:OpenWrt' \ 'hostname:string:OpenWrt' \
'conloglevel:uinteger' \ 'conloglevel:uinteger' \
@ -23,8 +22,9 @@ system_config() {
echo "$hostname" > /proc/sys/kernel/hostname echo "$hostname" > /proc/sys/kernel/hostname
[ -z "$conloglevel" -a -z "$buffersize" ] || dmesg ${conloglevel:+-n $conloglevel} ${buffersize:+-s $buffersize} [ -z "$conloglevel" -a -z "$buffersize" ] || dmesg ${conloglevel:+-n $conloglevel} ${buffersize:+-s $buffersize}
echo "$timezone" > /tmp/TZ echo "$timezone" > /tmp/TZ
[ -n "$zonename" ] && [ -f "/usr/share/zoneinfo/$zonename" ] && \ [ -n "$zonename" ] && [ -f "/usr/share/zoneinfo/${zonename// /_}" ] \
ln -sf "/usr/share/zoneinfo/$zonename" /tmp/localtime && rm -f /tmp/TZ && ln -sf "/usr/share/zoneinfo/${zonename// /_}" /tmp/localtime \
&& rm -f /tmp/TZ
# apply timezone to kernel # apply timezone to kernel
hwclock -u --systz hwclock -u --systz
@ -35,8 +35,7 @@ reload_service() {
config_foreach validate_system_section system system_config config_foreach validate_system_section system system_config
} }
service_triggers() service_triggers() {
{
procd_add_reload_trigger "system" procd_add_reload_trigger "system"
procd_add_validation validate_system_section procd_add_validation validate_system_section
} }

View File

@ -3,7 +3,7 @@
[ -f /etc/banner ] && cat /etc/banner [ -f /etc/banner ] && cat /etc/banner
[ -n "$FAILSAFE" ] && cat /etc/banner.failsafe [ -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 'Your JFFS2-partition seems full and overlayfs is mounted read-only.'
echo 'Please try to remove files from /overlay/upper/... and reboot!' echo 'Please try to remove files from /overlay/upper/... and reboot!'
} }

View File

@ -1,4 +1,4 @@
root::0:0:99999:7::: root:::0:99999:7:::
daemon:*:0:0:99999:7::: daemon:*:0:0:99999:7:::
ftp:*:0:0:99999:7::: ftp:*:0:0:99999:7:::
network:*:0:0:99999:7::: network:*:0:0:99999:7:::

View File

@ -96,7 +96,7 @@ ucidef_set_interfaces_lan_wan() {
ucidef_set_bridge_device() { ucidef_set_bridge_device() {
json_select_object bridge json_select_object bridge
json_add_string name "${1:switch0}" json_add_string name "${1:-switch0}"
json_select .. json_select ..
} }

View File

@ -128,14 +128,14 @@ wifi_updown() {
[ enable = "$1" ] && { [ enable = "$1" ] && {
_wifi_updown disable "$2" _wifi_updown disable "$2"
ubus_wifi_cmd "$cmd" "$2" ubus_wifi_cmd "$cmd" "$2"
ubus call network reload
scan_wifi scan_wifi
cmd=up cmd=up
ubus call network reload
} }
[ reconf = "$1" ] && { [ reconf = "$1" ] && {
ubus call network reload
scan_wifi scan_wifi
cmd=reconf cmd=reconf
ubus call network reload
} }
ubus_wifi_cmd "$cmd" "$2" ubus_wifi_cmd "$cmd" "$2"
_wifi_updown "$@" _wifi_updown "$@"