string const m = _nanomsg.blocking_get ();
string const n = _nanomsg.blocking_get ();
throw CopyError (m, raw_convert<int>(n));
+ } else if (s == DIST_WRITER_FORMATTING) {
+ sub ("Formatting drive");
+ set_progress_unknown ();
} else if (s == DIST_WRITER_PROGRESS) {
- string p = _nanomsg.blocking_get();
- set_progress (raw_convert<float>(p));
+ sub ("Copying DCP");
+ set_progress (raw_convert<float>(_nanomsg.blocking_get()));
}
}
}
*/
#define DIST_WRITER_ERROR "E"
-/** Some progress has been made. Following this will come
+/** The disk writer is formatting the drive. It is not possible
+ * to give progress reports on this so the writer just tells us
+ * it's happening. This is finished when DIST_WRITER_PROGRESS
+ * messages start arriving
+ */
+#define DIST_WRITER_FORMATTING "F"
+
+/** Some progress has been made in the main "copy" part of the task.
+ * Following this will come
progress as a float from 0 to 1\n
}
LOG_DIST_NC ("Opened partition");
+ nanomsg->blocking_send(DIST_WRITER_FORMATTING "\n");
+
r = ext4_mkfs(&fs, bd, &info, F_SET_EXT4);
if (r != EOK) {
throw CopyError ("Failed to make filesystem", r);