Signed-off-by: John Crispin <blogic@openwrt.org>
void ubus_init_system(struct ubus_context *ctx);
void procd_state_next(void);
+void procd_state_ubus_connect(void);
void procd_shutdown(int event);
void procd_early(void);
void procd_preinit(void);
enum {
STATE_NONE = 0,
STATE_EARLY,
+ STATE_UBUS,
STATE_INIT,
STATE_RUNNING,
STATE_SHUTDOWN,
procd_coldplug();
break;
- case STATE_INIT:
+ case STATE_UBUS:
// try to reopen incase the wdt was not available before coldplug
watchdog_init(0);
LOG("- ubus -\n");
procd_connect_ubus();
-
- LOG("- init -\n");
service_init();
service_start_early("ubus", ubus_cmd);
+ break;
+ case STATE_INIT:
+ LOG("- init -\n");
procd_inittab();
procd_inittab_run("respawn");
procd_inittab_run("askconsole");
state_enter();
}
+void procd_state_ubus_connect(void)
+{
+ if (state == STATE_UBUS)
+ procd_state_next();
+}
+
void procd_shutdown(int event)
{
if (state >= STATE_SHUTDOWN)
DEBUG(2, "Connected to ubus, id=%08x\n", ctx->local_id);
ubus_add_uloop(ctx);
+ procd_state_ubus_connect();
}
void