1
0
mirror of https://git.openwrt.org/feed/packages.git synced 2024-06-16 12:23:59 +02:00

ksmbd-tools: append config from /var/run/config/ for runtime shares

Dynamically created shares shouldn't be stored in the /etc/config/
because of:
1. Flash wearing
2. Risk of inconsistent state on reboots

With this change all automation/hotplug.d scripts can store runtime in
the /var/run/config/samba. It's useful e.g. for USB drives that user
wants to be automatically shared.

Also: automated scripts should never call "uci [foo] commit" as that
could flush incomplete config. This problem also gets solved.

Identical feature was added to samba36 in the OpenWrt commit
5a59e2c059866 ("samba36: append config from /var/run/config/ for runtime
shares") but wasn't ported to ksmbd until now.

Cc: Jo-Philipp Wich <jo@mein.io>
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
This commit is contained in:
Rafał Miłecki 2022-08-10 14:23:40 +02:00 committed by Rosen Penev
parent 5a2fa10d07
commit c9cba61989

View File

@ -116,6 +116,7 @@ init_config()
mkdir -p /var/etc/ksmbd
config_load ksmbd
CONFIG_APPEND=1 UCI_CONFIG_DIR=/var/run/config config_load ksmbd
config_foreach smb_header globals
config_foreach smb_add_share share
}