aboutsummaryrefslogtreecommitdiffstats
path: root/package/base-files
diff options
context:
space:
mode:
Diffstat (limited to 'package/base-files')
-rwxr-xr-xpackage/base-files/files/bin/config_generate7
-rwxr-xr-xpackage/base-files/files/lib/functions/uci-defaults.sh6
2 files changed, 13 insertions, 0 deletions
diff --git a/package/base-files/files/bin/config_generate b/package/base-files/files/bin/config_generate
index abb1388ba1..eb6816e519 100755
--- a/package/base-files/files/bin/config_generate
+++ b/package/base-files/files/bin/config_generate
@@ -264,6 +264,13 @@ generate_static_system() {
uci -q set "system.@system[-1].hostname=$hostname"
fi
+ local compat_version
+ if json_get_var compat_version compat_version; then
+ uci -q set "system.@system[-1].compat_version=$compat_version"
+ else
+ uci -q set "system.@system[-1].compat_version=1.0"
+ fi
+
if json_is_a ntpserver array; then
local keys key
json_get_keys keys ntpserver
diff --git a/package/base-files/files/lib/functions/uci-defaults.sh b/package/base-files/files/lib/functions/uci-defaults.sh
index 12b900031d..27a409fe3b 100755
--- a/package/base-files/files/lib/functions/uci-defaults.sh
+++ b/package/base-files/files/lib/functions/uci-defaults.sh
@@ -68,6 +68,12 @@ ucidef_set_model_name() {
json_select ..
}
+ucidef_set_compat_version() {
+ json_select_object system
+ json_add_string compat_version "${1:-1.0}"
+ json_select ..
+}
+
ucidef_set_interface_lan() {
ucidef_set_interface "lan" ifname "$1" protocol "${2:-static}"
}