blockd: send mount.ready when startup has completed
authorDaniel Golle <daniel@makrotopia.org>
Wed, 28 Jul 2021 18:20:56 +0000 (19:20 +0100)
committerDaniel Golle <daniel@makrotopia.org>
Wed, 28 Jul 2021 19:21:49 +0000 (20:21 +0100)
Emmit mount.ready notification when 'block autofs start' has completed.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
blockd.c

index bf15f100b9035a53c973d2760c546c1556154ece..1e11c886797299a9a6474b236ec1f67a1fc59168 100644 (file)
--- a/blockd.c
+++ b/blockd.c
@@ -507,7 +507,9 @@ static int send_block_notification(struct ubus_context *ctx, const char *action,
        strncat(evname, action, sizeof(evname) - 1);
 
        blob_buf_init(&buf, 0);
-       blobmsg_add_string(&buf, "devname", devname);
+
+       if (devname)
+               blobmsg_add_string(&buf, "devname", devname);
 
        err = ubus_notify(ctx, &block_object, evname, buf.head, -1);
 
@@ -626,6 +628,7 @@ static int autofs_mount(void)
 static void blockd_startup(struct uloop_timeout *t)
 {
        block("autofs", "start", NULL);
+       send_block_notification(&conn.ctx, "ready", NULL);
 }
 
 struct uloop_timeout startup = {