1 // SPDX-License-Identifier: GPL-2.0+
4 * Roger Knecht <rknecht@pm.de>
12 static int do_cat(struct cmd_tbl
*cmdtp
, int flag
, int argc
,
29 ret
= fs_load_alloc(ifname
, dev
, file
, 0, 0, (void **)&buffer
,
37 return CMD_RET_FAILURE
;
39 log_err("File does not exist: ifname=%s dev=%s file=%s\n", ifname
, dev
, file
);
40 return CMD_RET_FAILURE
;
42 log_err("File is too large: ifname=%s dev=%s file=%s\n", ifname
, dev
, file
);
43 return CMD_RET_FAILURE
;
45 log_err("Not enough memory: ifname=%s dev=%s file=%s\n", ifname
, dev
, file
);
46 return CMD_RET_FAILURE
;
49 log_err("File-read failed: ifname=%s dev=%s file=%s\n", ifname
, dev
, file
);
50 return CMD_RET_FAILURE
;
54 buffer
[file_size
] = '\0';
63 "<interface> <dev[:part]> <file>\n"
64 " - Print file from 'dev' on 'interface' to standard output\n");
66 U_BOOT_CMD(cat
, 4, 1, do_cat
,
67 "Print file to standard output",