Donny9 commented on code in PR #3003: URL: https://github.com/apache/nuttx-apps/pull/3003#discussion_r1962992077
########## system/fastboot/Kconfig: ########## @@ -31,4 +31,12 @@ config FASTBOOTD_USB_BOARDCTL ---help--- Connect usbdev before running fastboot daemon. +config SYSTEM_FASTBOOTD_MKRD + bool "Create RAM disk" + default n + depends on BOARDCTL Review Comment: remove BOARDCTL, BOARDCTL_MKRD depends on BOARDCTL ########## 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: add ret output ########## 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) Review Comment: arg != NULL -- 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