On 12/04/18 11:41, Rosy Song wrote:
   Add hotplug handle script for storage devices,
   this will add corresponding option in the
   /etc/config/samba file automatically.

   If user do not want this feature, it can be cancel
   via samba relevant menu option.

Hi,
patch as such looks ok. however i am not sure if we want to always add any and every device we see into uci unconditionally. also having this as a compile option for the main package is bad as it will result in release builds never seeing this feature. please move it to a separate package inside the same Makefile and a small nitpick at the end of the patch ...

    John

Signed-off-by: Rosy Song <rosys...@rosinson.com>
---
  package/network/services/samba36/Makefile          | 11 +++
  .../network/services/samba36/files/lib/samba.sh    | 83 ++++++++++++++++++++++
  .../network/services/samba36/files/samba.hotplug   | 11 +++
  3 files changed, 105 insertions(+)
  create mode 100644 package/network/services/samba36/files/lib/samba.sh
  create mode 100644 package/network/services/samba36/files/samba.hotplug

[...]
diff --git a/package/network/services/samba36/files/samba.hotplug 
b/package/network/services/samba36/files/samba.hotplug
new file mode 100644
index 0000000000..d4c8e7c5f5
--- /dev/null
+++ b/package/network/services/samba36/files/samba.hotplug
@@ -0,0 +1,11 @@
+. /lib/samba/samba.sh
+
+samba_dev_filter $DEVNAME
+[ "$FLAG_DEV_TYPE" = "not-mtd" ]  || exit
+
+config_load samba
+case $ACTION in
+       add) samba_add_section $DEVNAME;;
+       remove) samba_delete_section $DEVNAME;;
+esac
+uci commit

uci commit samba should be enough here.



_______________________________________________
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev

Reply via email to