default-settings: move anon_mout setting to automount

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
(cherry picked from commit 0b13de9116)
This commit is contained in:
Tianling Shen
2023-11-30 17:31:32 +08:00
parent 38cb4f7d30
commit c559471a73
4 changed files with 31 additions and 19 deletions

View File

@@ -47,6 +47,9 @@ define Build/Compile
endef
define Package/automount/install
$(INSTALL_DIR) $(1)/etc/uci-defaults
$(INSTALL_BIN) ./files/11-anonmount $(1)/etc/uci-defaults/
$(INSTALL_DIR) $(1)/etc/hotplug.d/block
$(INSTALL_BIN) ./files/15-automount $(1)/etc/hotplug.d/block/
endef

View File

@@ -0,0 +1,13 @@
#!/bin/sh
if ! uci -q get system.@imm_init[0].anon_mount > "/dev/null"; then
uci -q batch <<-EOF
set fstab.@global[0].anon_mount="1"
commit fstab
set system.@imm_init[0].anon_mount="1"
commit system
EOF
fi
exit 0

View File

@@ -3,19 +3,13 @@
uci -q get system.@imm_init[0] > "/dev/null" || uci -q add system imm_init > "/dev/null"
if ! uci -q get system.@imm_init[0].lang > "/dev/null"; then
uci -q set luci.main.lang="auto"
uci -q commit luci
uci -q batch <<-EOF
set luci.main.lang="auto"
commit luci
uci -q set system.@imm_init[0].lang="1"
uci -q commit system
fi
if ! uci -q get system.@imm_init[0].anon_mount > "/dev/null"; then
uci -q set fstab.@global[0].anon_mount="1"
uci -q commit fstab
uci -q set system.@imm_init[0].anon_mount="1"
uci -q commit system
set system.@imm_init[0].lang="1"
commit system
EOF
fi
ln -sf "/sbin/ip" "/usr/bin/ip"

View File

@@ -3,13 +3,15 @@
uci -q get system.@imm_init[0] > "/dev/null" || uci -q add system imm_init > "/dev/null"
uci -q get system.@imm_init[0].ipv6 > "/dev/null" && exit 0
uci -q set dhcp.lan.ra="hybrid"
uci -q set dhcp.lan.ndp="hybrid"
uci -q set dhcp.lan.dhcpv6="hybrid"
uci -q set dhcp.lan.ra_management="1"
uci -q commit dhcp
uci -q batch <<-EOF
set dhcp.lan.ra="hybrid"
set dhcp.lan.ndp="hybrid"
set dhcp.lan.dhcpv6="hybrid"
set dhcp.lan.ra_management="1"
commit dhcp
uci -q set system.@imm_init[0].ipv6="1"
uci -q commit system
set system.@imm_init[0].ipv6="1"
commit system
EOF
exit 0