@@ -11,6 +11,7 @@
#include <handler.h>
#include <blkid/blkid.h>
#include <fs_interface.h>
+#include "progress.h"
void diskformat_handler(void);
@@ -51,6 +52,12 @@ static int diskformat(struct img_type *img,
/* File system does not exist, create new file system */
ret = diskformat_mkfs(img->device, fstype);
+
+ /*
+ * Declare that handler has finished
+ */
+ swupdate_progress_update(100);
+
return ret;
}
@@ -25,6 +25,7 @@
#include "swupdate.h"
#include "handler.h"
#include "util.h"
+#include "progress.h"
void diskpart_handler(void);
void diskpart_toggle_boot(void);
@@ -1140,6 +1141,11 @@ handler_release:
if (createtable)
free(createtable);
+ /*
+ * Declare that handler has finished
+ */
+ swupdate_progress_update(100);
+
return ret;
}
@@ -1444,6 +1450,11 @@ handler_release:
if (createtable)
free(createtable);
+ /*
+ * Declare that handler has finished
+ */
+ swupdate_progress_update(100);
+
return ret;
}
@@ -1542,6 +1553,11 @@ toggle_boot_exit:
if (cxt)
diskpart_unref_context(cxt);
+ /*
+ * Declare that handler has finished
+ */
+ swupdate_progress_update(100);
+
return ret;
}
@@ -1668,6 +1684,11 @@ static int gpt_swap_partition(struct img_type *img, void *data)
goto handler_exit;
}
+ /*
+ * Declare that handler has finished
+ */
+ swupdate_progress_update(100);
+
handler_exit:
if (tb)
diskpart_unref_table(tb);
@@ -1688,6 +1709,11 @@ handler_release:
*/
diskpart_reread_partition(img->device);
+ /*
+ * Declare that handler has finished
+ */
+ swupdate_progress_update(100);
+
return ret;
}
Handlers must signal the core when they have finished or which percent was already completed. This allows to maintain the progress interface in sync and to show the correct step during the update. Signed-off-by: Stefano Babic <sbabic@denx.de> --- handlers/diskformat_handler.c | 7 +++++++ handlers/diskpart_handler.c | 26 ++++++++++++++++++++++++++ 2 files changed, 33 insertions(+)