add hotplug events
authorolivier.hardouin@gmail.com <olivier.hardouin@gmail.com>
Wed, 15 Jun 2016 14:10:23 +0000 (16:10 +0200)
committerJohn Crispin <john@phrozen.org>
Wed, 15 Jun 2016 15:28:11 +0000 (17:28 +0200)
add hotplug events (add, remove) to inform other subsystems
remove obsolete /etc/mountd/event call

Signed-off-by: Olivier Hardouin <olivier.hardouin@gmail.com>
mount.c

diff --git a/mount.c b/mount.c
index 36b99f58e9bc40cfc0aa4f5e35109e47b7944999..0133f172007f629791c77a578cca6d3048b64cc4 100644 (file)
--- a/mount.c
+++ b/mount.c
@@ -161,6 +161,7 @@ static void mount_add_list(char *name, char *dev, char *serial,
                snprintf(tmp2, 64, "/tmp/run/mountd/%s", dev);
                symlink(tmp2, tmp);
                mount_new("/tmp/run/mountd/", dev);
+               system_printf("ACTION=add DEVICE=%s NAME=%s /sbin/hotplug-call mount", dev, name);
        }
 }
 
@@ -715,7 +716,7 @@ static void mount_enum_drives(void)
                        log_printf("removing %s\n", q->dev);
                        snprintf(tmp, 64, "%s%s", uci_path, q->name);
                        unlink(tmp);
-                       system_printf("/etc/mountd/event remove %s %s", q->dev, q->name);
+                       system_printf("ACTION=remove DEVICE=%s NAME=%s /sbin/hotplug-call mount", q->dev, q->name);
                        free(q);
                        mount_dump_uci_state();
                        system_printf("/etc/fonstated/ReloadSamba");