@@ -27,6 +27,7 @@
#include "network_ipc.h"
#include "network_interface.h"
#include "installer.h"
+#include "installer_priv.h"
#include "swupdate.h"
#include "pctl.h"
#include "generated/autoconf.h"
@@ -40,6 +40,7 @@
#include "network_interface.h"
#include "mongoose_interface.h"
#include "installer.h"
+#include "installer_priv.h"
#include "progress.h"
#include "pctl.h"
#include "state.h"
new file mode 100644
@@ -0,0 +1,25 @@
+/*
+ * (C) Copyright 2020
+ * Stefano Babic, DENX Software Engineering, sbabic@denx.de.
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+
+#ifndef _INSTALLER_PRIV_H
+#define _INSTALLER_PRIV_H
+
+#include "swupdate_status.h"
+
+struct installer {
+ int fd; /* install image file handle */
+ RECOVERY_STATUS status; /* "idle" or "request source" info */
+ RECOVERY_STATUS last_install; /* result from last installation */
+ int last_error; /* error code if installation failed */
+ char errormsg[64]; /* error message if installation failed */
+ sourcetype source; /* Who triggered the update */
+ int dry_run; /* set it if no changes in hardware must be done */
+ unsigned int len; /* Len of data valid in info, data is optional */
+ char info[2048]; /* info */
+};
+
+#endif
@@ -76,18 +76,6 @@ enum {
RECOVERY_DWL,
};
-struct installer {
- int fd; /* install image file handle */
- RECOVERY_STATUS status; /* "idle" or "request source" info */
- RECOVERY_STATUS last_install; /* result from last installation */
- int last_error; /* error code if installation failed */
- char errormsg[64]; /* error message if installation failed */
- sourcetype source; /* Who triggered the update */
- int dry_run; /* set it if no changes in hardware must be done */
- unsigned int len; /* Len of data valid in info */
- char info[2048]; /* info */
-};
-
typedef void (*notifier) (RECOVERY_STATUS status, int error, int level, const char *msg);
void notify(RECOVERY_STATUS status, int error, int level, const char *msg);
The "struct installer" is a shared global data structure used to store setup for the current installation and to lock if an update is running by storing the current status. It is loaded just by the initiator of an update (the installers as streaming or file). It should be better moved to a private file instead of beeing in util.h that is included by all due to get logging facilities. Signed-off-by: Stefano Babic <sbabic@denx.de> --- core/network_thread.c | 1 + core/stream_interface.c | 1 + include/installer_priv.h | 25 +++++++++++++++++++++++++ include/util.h | 12 ------------ 4 files changed, 27 insertions(+), 12 deletions(-) create mode 100644 include/installer_priv.h