default-settings: move anon_mout setting to automount

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
This commit is contained in:
Tianling Shen 2023-11-30 17:31:32 +08:00
parent 5bb2da249f
commit 0b13de9116
No known key found for this signature in database
GPG Key ID: 6850B6345C862176
3 changed files with 16 additions and 10 deletions

View File

@ -47,6 +47,9 @@ define Build/Compile
endef endef
define Package/automount/install 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_DIR) $(1)/etc/hotplug.d/block
$(INSTALL_BIN) ./files/15-automount $(1)/etc/hotplug.d/block/ $(INSTALL_BIN) ./files/15-automount $(1)/etc/hotplug.d/block/
endef 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

@ -12,16 +12,6 @@ if ! uci -q get system.@imm_init[0].lang > "/dev/null"; then
EOF EOF
fi fi
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
ln -sf "/sbin/ip" "/usr/bin/ip" ln -sf "/sbin/ip" "/usr/bin/ip"
sed -i "/log-facility/d" "/etc/dnsmasq.conf" sed -i "/log-facility/d" "/etc/dnsmasq.conf"