"Das U-Boot" Source Tree
0
fork

Configure Feed

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

fs/erofs: add filesystem commands

Add 'ls' and 'load' commands.

Signed-off-by: Huang Jianan <jnhuang95@gmail.com>

authored by

Huang Jianan and committed by
Tom Rini
739941e1 65cb7305

+50
+1
MAINTAINERS
··· 813 813 M: Huang Jianan <jnhuang95@gmail.com> 814 814 L: linux-erofs@lists.ozlabs.org 815 815 S: Maintained 816 + F: cmd/erofs.c 816 817 F: fs/erofs/ 817 818 F: include/erofs.h 818 819
+6
cmd/Kconfig
··· 2201 2201 cramfsls - lists files in a cramfs image 2202 2202 cramfsload - loads a file from a cramfs image 2203 2203 2204 + config CMD_EROFS 2205 + bool "EROFS command support" 2206 + select FS_EROFS 2207 + help 2208 + Support for the EROFS fs 2209 + 2204 2210 config CMD_EXT2 2205 2211 bool "ext2 command support" 2206 2212 select FS_EXT4
+1
cmd/Makefile
··· 61 61 obj-$(CONFIG_EFI) += efi.o 62 62 obj-$(CONFIG_CMD_EFIDEBUG) += efidebug.o 63 63 obj-$(CONFIG_CMD_ELF) += elf.o 64 + obj-$(CONFIG_CMD_EROFS) += erofs.o 64 65 obj-$(CONFIG_HUSH_PARSER) += exit.o 65 66 obj-$(CONFIG_CMD_EXT4) += ext4.o 66 67 obj-$(CONFIG_CMD_EXT2) += ext2.o
+42
cmd/erofs.c
··· 1 + // SPDX-License-Identifier: GPL-2.0+ 2 + /* 3 + * Copyright (C) 2022 Huang Jianan <jnhuang95@gmail.com> 4 + * 5 + * Author: Huang Jianan <jnhuang95@gmail.com> 6 + * 7 + * erofs.c: implements EROFS related commands 8 + */ 9 + 10 + #include <command.h> 11 + #include <fs.h> 12 + #include <erofs.h> 13 + 14 + static int do_erofs_ls(struct cmd_tbl *cmdtp, int flag, int argc, char * const argv[]) 15 + { 16 + return do_ls(cmdtp, flag, argc, argv, FS_TYPE_EROFS); 17 + } 18 + 19 + U_BOOT_CMD(erofsls, 4, 1, do_erofs_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_erofs_load(struct cmd_tbl *cmdtp, int flag, int argc, char * const argv[]) 26 + { 27 + return do_load(cmdtp, flag, argc, argv, FS_TYPE_EROFS); 28 + } 29 + 30 + U_BOOT_CMD(erofsload, 7, 0, do_erofs_load, 31 + "load binary file from a EROFS 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 EROFS 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 + );