sqfs.c 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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. #include <command.h>
  10. #include <fs.h>
  11. #include <squashfs.h>
  12. static int do_sqfs_ls(struct cmd_tbl *cmdtp, int flag, int argc, char * const argv[])
  13. {
  14. return do_ls(cmdtp, flag, argc, argv, FS_TYPE_SQUASHFS);
  15. }
  16. U_BOOT_CMD(sqfsls, 4, 1, do_sqfs_ls,
  17. "List files in directory. Default: root (/).",
  18. "<interface> [<dev[:part]>] [directory]\n"
  19. " - list files from 'dev' on 'interface' in 'directory'\n"
  20. );
  21. static int do_sqfs_load(struct cmd_tbl *cmdtp, int flag, int argc, char * const argv[])
  22. {
  23. return do_load(cmdtp, flag, argc, argv, FS_TYPE_SQUASHFS);
  24. }
  25. U_BOOT_CMD(sqfsload, 7, 0, do_sqfs_load,
  26. "load binary file from a SquashFS filesystem",
  27. "<interface> [<dev[:part]> [<addr> [<filename> [bytes [pos]]]]]\n"
  28. " - Load binary file 'filename' from 'dev' on 'interface'\n"
  29. " to address 'addr' from SquashFS filesystem.\n"
  30. " 'pos' gives the file position to start loading from.\n"
  31. " If 'pos' is omitted, 0 is used. 'pos' requires 'bytes'.\n"
  32. " 'bytes' gives the size to load. If 'bytes' is 0 or omitted,\n"
  33. " the load stops on end of file.\n"
  34. " If either 'pos' or 'bytes' are not aligned to\n"
  35. " ARCH_DMA_MINALIGN then a misaligned buffer warning will\n"
  36. " be printed and performance will suffer for the load."
  37. );