]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
misc: fs_loader: allow using long script name in request_firmware_into_buf_via_script()
authorWeijie Gao <weijie.gao@mediatek.com>
Mon, 8 Sep 2025 08:34:07 +0000 (16:34 +0800)
committerTom Rini <trini@konsulko.com>
Thu, 18 Sep 2025 21:43:05 +0000 (15:43 -0600)
Use cmd_process() to remove the length limit of script name used for
run_command().

Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
drivers/misc/fs_loader.c

index 87acd385e231b1a6a74797e3b5130a9f381b33bf..6a6796c193194e2934a7d5c26d3574250de42901 100644 (file)
@@ -232,18 +232,15 @@ int request_firmware_into_buf_via_script(void **buf, size_t max_size,
                                         const char *script_name,
                                         size_t *retsize)
 {
+       char *args[2] = { (char *)"run", (char *)script_name };
+       int ret, repeatable;
        ulong addr, size;
-       int ret;
-       char cmd[32];
 
        if (!buf || !script_name || !max_size)
                return -EINVAL;
 
-       /* Create command to run the firmware loading script */
-       snprintf(cmd, sizeof(cmd), "run %s", script_name);
-
        /* Run the firmware loading script */
-       ret = run_command_list(cmd, -1, 0);
+       ret = cmd_process(0, 2, args, &repeatable, NULL);
        if (ret) {
                log_err("Firmware loading script '%s' not defined or failed.\n",
                        script_name);