summaryrefslogtreecommitdiffstats
path: root/system.c
diff options
context:
space:
mode:
Diffstat (limited to 'system.c')
-rw-r--r--system.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/system.c b/system.c
index 658dd5e..8dbc7d0 100644
--- a/system.c
+++ b/system.c
@@ -24,6 +24,7 @@
#include "procd.h"
#include "watchdog.h"
+#include "hotplug.h"
#define HOSTNAME_PATH "/proc/sys/kernel/hostname"
@@ -55,6 +56,17 @@ static int system_info(struct ubus_context *ctx, struct ubus_object *obj,
return 0;
}
+static int system_upgrade(struct ubus_context *ctx, struct ubus_object *obj,
+ struct ubus_request_data *req, const char *method,
+ struct blob_attr *msg)
+{
+ procd_reconnect_ubus(0);
+ log_shutdown();
+ hotplug_shutdown();
+
+ return 0;
+}
+
enum {
WDT_FREQUENCY,
WDT_TIMEOUT,
@@ -120,6 +132,7 @@ static int watchdog_set(struct ubus_context *ctx, struct ubus_object *obj,
static const struct ubus_method system_methods[] = {
UBUS_METHOD_NOARG("info", system_info),
+ UBUS_METHOD_NOARG("upgrade", system_upgrade),
UBUS_METHOD("watchdog", watchdog_set, watchdog_policy),
};