JianyuWang0623 commented on code in PR #3003:
URL: https://github.com/apache/nuttx-apps/pull/3003#discussion_r1963049764


##########
system/fastboot/fastboot.c:
##########
@@ -770,6 +780,38 @@ static void fastboot_filedump(FAR struct fastboot_ctx_s 
*context,
   fastboot_okay(context, "");
 }
 
+#ifdef CONFIG_SYSTEM_FASTBOOTD_MKRD
+static void fastboot_mkrd(FAR struct fastboot_ctx_s *context,
+                          FAR const char *arg)
+{
+  struct boardioc_mkrd_s desc;
+  int ret = -1;
+
+  if (arg)
+    {
+      ret = sscanf(arg, "%" PRIu8 " %" PRIu32 " %" PRIu16,
+                   &desc.minor, &desc.nsectors, &desc.sectsize);
+    }
+
+  if (ret != 3)
+    {
+      fastboot_fail(context, "Usage: mkrd <minor> <nsectors> <sectsize>");
+      return;
+    }
+
+  desc.rdflags  = RDFLAG_WRENABLED | RDFLAG_FUNLINK;
+
+  ret = boardctl(BOARDIOC_MKRD, (uintptr_t)&desc);
+  if (ret < 0)
+    {
+      fastboot_fail(context, "Create RAM disk failed");

Review Comment:
   Done, Format string support for fastboot_fail() was added.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to