summaryrefslogtreecommitdiff
path: root/cmd/ufetch.c
AgeCommit message (Collapse)Author
2025-07-14cmd: ufetch: Initialise size before first useAndrew Goodbody
The local variable size is not assigned to before it is used for the first time. Correct this. This issue was found by Smatch. Fixes: 86d462c05d57 (cmd: add a fetch utility) Signed-off-by: Andrew Goodbody <[email protected]> Reviewed-by: Casey Connolly <[email protected]> Reviewed-by: Ilias Apalodimas <[email protected]> Reviewed-by: Heinrich Schuchardt <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Casey Connolly <[email protected]>
2025-02-26cmd: ufetch: use 3-bit colour ANSI codesSam Day
Currently, the 8-bit escapes are being used, which aren't supported by vidconsole_escape_char. Since the current usage maps directly to the 3-bit equivalents anyway, let's use those instead. With this change, the fetch output looks as fetching in the vidconsole as it does over serial! Signed-off-by: Sam Day <[email protected]> Tested-by: Alexey Minnekhanov <[email protected]> Tested-by: Ferass El Hafidi <[email protected]>
2025-01-22cmd: ufetch: Show CPU architecture under "CPU"J. Neuschäfer
When looking at ufetch output it isn't immediately obvious which CPU architecture the presented board has. This patch therefore adds the CPU architecture string (for example "powerpc") to the "CPU:" line. The new format is: CPU: powerpc (1 cores, 1 in use) Signed-off-by: J. Neuschäfer <[email protected]> Reviewed-by: Caleb Connolly <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Caleb Connolly <[email protected]>
2025-01-22cmd: Allow building ufetch without CONFIG_BLKJ. Neuschäfer
The ufetch command is still quite useful on systems without block device support; remove the CONFIG_BLK dependency and make sure the code compiles/works with and without CONFIG_BLK. Reviewed-by: Caleb Connolly <[email protected]> Signed-off-by: J. Neuschäfer <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Caleb Connolly <[email protected]>
2025-01-22cmd: ufetch: Fix type mismatch on 32-bitJ. Neuschäfer
On 32-bit architectures, LAST_LINE (_LAST_LINE - 1UL) is 64 bits long, but size_t (from ARRAY_SIZE(...)) is 32 bits. This results in a warning because the max() macro expects the same type on both sides: cmd/ufetch.c: In function ‘do_ufetch’: include/linux/kernel.h:179:24: warning: comparison of distinct pointer types lacks a cast [-Wcompare-distinct-pointer-types] 179 | (void) (&_max1 == &_max2); \ | ^~ cmd/ufetch.c:92:25: note: in expansion of macro ‘max’ 92 | int num_lines = max(LAST_LINE + 1, ARRAY_SIZE(logo_lines)); | ^~~ Fix this by casting LAST_LINE to size_t. Reviewed-by: Caleb Connolly <[email protected]> Signed-off-by: J. Neuschäfer <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Caleb Connolly <[email protected]>
2024-11-29cmd: add a fetch utilityCaleb Connolly
Add a small utility for displaying some information about U-Boot and the hardware it's running on in a similar fashion to the popular neofetch tool for Linux [1]. While the output is meant to be useful, it should also be pleasing to look at and perhaps entertaining. The ufetch command aims to bring this to U-Boot, featuring a colorful ASCII art version of the U-Boot logo. [1]: https://en.wikipedia.org/wiki/Neofetch Reviewed-by: Simon Glass <[email protected]> Acked-by: Ilias Apalodimas <[email protected]> Tested-by: Mattijs Korpershoek <[email protected]> # vim3 Tested-by: Neil Armstrong <[email protected]> # on SM8560-QRD Acked-by: Heinrich Schuchardt <[email protected]> Tested-by: Tony Dinh <[email protected]> Signed-off-by: Caleb Connolly <[email protected]>