"Das U-Boot" Source Tree
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

fs/squashfs: add filesystem commands

Add 'ls' and 'load' commands.

Signed-off-by: Joao Marcos Costa <joaomarcos.costa@bootlin.com>

authored by

Joao Marcos Costa and committed by
Tom Rini
bba604b6 c5100613

+50
+1
MAINTAINERS
··· 974 974 S: Maintained 975 975 F: fs/squashfs/ 976 976 F: include/sqfs.h 977 + F: cmd/sqfs.c 977 978 978 979 TARGET_BCMNS3 979 980 M: Bharat Gooty <bharat.gooty@broadcom.com>
+6
cmd/Kconfig
··· 2090 2090 help 2091 2091 Support for the FAT fs 2092 2092 2093 + config CMD_SQUASHFS 2094 + bool "SquashFS command support" 2095 + select FS_SQUASHFS 2096 + help 2097 + Enables SquashFS filesystem commands (e.g. load, ls). 2098 + 2093 2099 config CMD_FS_GENERIC 2094 2100 bool "filesystem commands" 2095 2101 help
+1
cmd/Makefile
··· 63 63 obj-$(CONFIG_CMD_EXT2) += ext2.o 64 64 obj-$(CONFIG_CMD_FAT) += fat.o 65 65 obj-$(CONFIG_CMD_FDT) += fdt.o 66 + obj-$(CONFIG_CMD_SQUASHFS) += sqfs.o 66 67 obj-$(CONFIG_CMD_FLASH) += flash.o 67 68 obj-$(CONFIG_CMD_FPGA) += fpga.o 68 69 obj-$(CONFIG_CMD_FPGAD) += fpgad.o
+42
cmd/sqfs.c
··· 1 + // SPDX-License-Identifier: GPL-2.0 2 + /* 3 + * Copyright (C) 2020 Bootlin 4 + * 5 + * Author: Joao Marcos Costa <joaomarcos.costa@bootlin.com> 6 + * 7 + * squashfs.c: implements SquashFS related commands 8 + */ 9 + 10 + #include <command.h> 11 + #include <fs.h> 12 + #include <squashfs.h> 13 + 14 + static int do_sqfs_ls(struct cmd_tbl *cmdtp, int flag, int argc, char * const argv[]) 15 + { 16 + return do_ls(cmdtp, flag, argc, argv, FS_TYPE_SQUASHFS); 17 + } 18 + 19 + U_BOOT_CMD(sqfsls, 4, 1, do_sqfs_ls, 20 + "List files in directory. Default: root (/).", 21 + "<interface> [<dev[:part]>] [directory]\n" 22 + " - list files from 'dev' on 'interface' in 'directory'\n" 23 + ); 24 + 25 + static int do_sqfs_load(struct cmd_tbl *cmdtp, int flag, int argc, char * const argv[]) 26 + { 27 + return do_load(cmdtp, flag, argc, argv, FS_TYPE_SQUASHFS); 28 + } 29 + 30 + U_BOOT_CMD(sqfsload, 7, 0, do_sqfs_load, 31 + "load binary file from a SquashFS filesystem", 32 + "<interface> [<dev[:part]> [<addr> [<filename> [bytes [pos]]]]]\n" 33 + " - Load binary file 'filename' from 'dev' on 'interface'\n" 34 + " to address 'addr' from SquashFS filesystem.\n" 35 + " 'pos' gives the file position to start loading from.\n" 36 + " If 'pos' is omitted, 0 is used. 'pos' requires 'bytes'.\n" 37 + " 'bytes' gives the size to load. If 'bytes' is 0 or omitted,\n" 38 + " the load stops on end of file.\n" 39 + " If either 'pos' or 'bytes' are not aligned to\n" 40 + " ARCH_DMA_MINALIGN then a misaligned buffer warning will\n" 41 + " be printed and performance will suffer for the load." 42 + );