All of lore.kernel.org
 help / color / mirror / Atom feed
From: Huang Jianan <jnhuang95@gmail.com>
To: u-boot@lists.denx.de, trini@konsulko.com
Cc: linux-erofs@lists.ozlabs.org
Subject: [PATCH v3 4/5] fs/erofs: add filesystem commands
Date: Tue,  8 Feb 2022 22:05:12 +0800	[thread overview]
Message-ID: <20220208140513.30570-5-jnhuang95@gmail.com> (raw)
In-Reply-To: <20220208140513.30570-1-jnhuang95@gmail.com>

Add 'ls' and 'load' commands.

Signed-off-by: Huang Jianan <jnhuang95@gmail.com>
---
 MAINTAINERS  |  1 +
 cmd/Kconfig  |  6 ++++++
 cmd/Makefile |  1 +
 cmd/erofs.c  | 42 ++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 50 insertions(+)
 create mode 100644 cmd/erofs.c

diff --git a/MAINTAINERS b/MAINTAINERS
index 571a64bf7e..aa417bc44f 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -798,6 +798,7 @@ EROFS
 M:	Huang Jianan <jnhuang95@gmail.com>
 L:	linux-erofs@lists.ozlabs.org
 S:	Maintained
+F:	cmd/erofs.c
 F:	fs/erofs/
 F:	include/erofs.h
 
diff --git a/cmd/Kconfig b/cmd/Kconfig
index 5e25e45fd2..50b8f33434 100644
--- a/cmd/Kconfig
+++ b/cmd/Kconfig
@@ -2176,6 +2176,12 @@ config CMD_CRAMFS
 	     cramfsls   - lists files in a cramfs image
 	     cramfsload - loads a file from a cramfs image
 
+config CMD_EROFS
+	bool "EROFS command support"
+	select FS_EROFS
+	help
+	  Support for the EROFS fs
+
 config CMD_EXT2
 	bool "ext2 command support"
 	select FS_EXT4
diff --git a/cmd/Makefile b/cmd/Makefile
index 166c652d98..d668b3c62d 100644
--- a/cmd/Makefile
+++ b/cmd/Makefile
@@ -60,6 +60,7 @@ obj-$(CONFIG_CMD_EEPROM) += eeprom.o
 obj-$(CONFIG_EFI) += efi.o
 obj-$(CONFIG_CMD_EFIDEBUG) += efidebug.o
 obj-$(CONFIG_CMD_ELF) += elf.o
+obj-$(CONFIG_CMD_EROFS) += erofs.o
 obj-$(CONFIG_HUSH_PARSER) += exit.o
 obj-$(CONFIG_CMD_EXT4) += ext4.o
 obj-$(CONFIG_CMD_EXT2) += ext2.o
diff --git a/cmd/erofs.c b/cmd/erofs.c
new file mode 100644
index 0000000000..add80b8b59
--- /dev/null
+++ b/cmd/erofs.c
@@ -0,0 +1,42 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2022 Huang Jianan <jnhuang95@gmail.com>
+ *
+ * Author: Huang Jianan <jnhuang95@gmail.com>
+ *
+ * erofs.c:	implements EROFS related commands
+ */
+
+#include <command.h>
+#include <fs.h>
+#include <erofs.h>
+
+static int do_erofs_ls(struct cmd_tbl *cmdtp, int flag, int argc, char * const argv[])
+{
+	return do_ls(cmdtp, flag, argc, argv, FS_TYPE_EROFS);
+}
+
+U_BOOT_CMD(erofsls, 4, 1, do_erofs_ls,
+	   "List files in directory. Default: root (/).",
+	   "<interface> [<dev[:part]>] [directory]\n"
+	   "    - list files from 'dev' on 'interface' in 'directory'\n"
+);
+
+static int do_erofs_load(struct cmd_tbl *cmdtp, int flag, int argc, char * const argv[])
+{
+	return do_load(cmdtp, flag, argc, argv, FS_TYPE_EROFS);
+}
+
+U_BOOT_CMD(erofsload, 7, 0, do_erofs_load,
+	   "load binary file from a EROFS filesystem",
+	   "<interface> [<dev[:part]> [<addr> [<filename> [bytes [pos]]]]]\n"
+	   "    - Load binary file 'filename' from 'dev' on 'interface'\n"
+	   "      to address 'addr' from EROFS filesystem.\n"
+	   "      'pos' gives the file position to start loading from.\n"
+	   "      If 'pos' is omitted, 0 is used. 'pos' requires 'bytes'.\n"
+	   "      'bytes' gives the size to load. If 'bytes' is 0 or omitted,\n"
+	   "      the load stops on end of file.\n"
+	   "      If either 'pos' or 'bytes' are not aligned to\n"
+	   "      ARCH_DMA_MINALIGN then a misaligned buffer warning will\n"
+	   "      be printed and performance will suffer for the load."
+);
-- 
2.25.1


WARNING: multiple messages have this Message-ID (diff)
From: Huang Jianan <jnhuang95@gmail.com>
To: u-boot@lists.denx.de, trini@konsulko.com
Cc: linux-erofs@lists.ozlabs.org, xiang@kernel.org,
	Huang Jianan <jnhuang95@gmail.com>
Subject: [PATCH v3 4/5] fs/erofs: add filesystem commands
Date: Tue,  8 Feb 2022 22:05:12 +0800	[thread overview]
Message-ID: <20220208140513.30570-5-jnhuang95@gmail.com> (raw)
In-Reply-To: <20220208140513.30570-1-jnhuang95@gmail.com>

Add 'ls' and 'load' commands.

Signed-off-by: Huang Jianan <jnhuang95@gmail.com>
---
 MAINTAINERS  |  1 +
 cmd/Kconfig  |  6 ++++++
 cmd/Makefile |  1 +
 cmd/erofs.c  | 42 ++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 50 insertions(+)
 create mode 100644 cmd/erofs.c

diff --git a/MAINTAINERS b/MAINTAINERS
index 571a64bf7e..aa417bc44f 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -798,6 +798,7 @@ EROFS
 M:	Huang Jianan <jnhuang95@gmail.com>
 L:	linux-erofs@lists.ozlabs.org
 S:	Maintained
+F:	cmd/erofs.c
 F:	fs/erofs/
 F:	include/erofs.h
 
diff --git a/cmd/Kconfig b/cmd/Kconfig
index 5e25e45fd2..50b8f33434 100644
--- a/cmd/Kconfig
+++ b/cmd/Kconfig
@@ -2176,6 +2176,12 @@ config CMD_CRAMFS
 	     cramfsls   - lists files in a cramfs image
 	     cramfsload - loads a file from a cramfs image
 
+config CMD_EROFS
+	bool "EROFS command support"
+	select FS_EROFS
+	help
+	  Support for the EROFS fs
+
 config CMD_EXT2
 	bool "ext2 command support"
 	select FS_EXT4
diff --git a/cmd/Makefile b/cmd/Makefile
index 166c652d98..d668b3c62d 100644
--- a/cmd/Makefile
+++ b/cmd/Makefile
@@ -60,6 +60,7 @@ obj-$(CONFIG_CMD_EEPROM) += eeprom.o
 obj-$(CONFIG_EFI) += efi.o
 obj-$(CONFIG_CMD_EFIDEBUG) += efidebug.o
 obj-$(CONFIG_CMD_ELF) += elf.o
+obj-$(CONFIG_CMD_EROFS) += erofs.o
 obj-$(CONFIG_HUSH_PARSER) += exit.o
 obj-$(CONFIG_CMD_EXT4) += ext4.o
 obj-$(CONFIG_CMD_EXT2) += ext2.o
diff --git a/cmd/erofs.c b/cmd/erofs.c
new file mode 100644
index 0000000000..add80b8b59
--- /dev/null
+++ b/cmd/erofs.c
@@ -0,0 +1,42 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2022 Huang Jianan <jnhuang95@gmail.com>
+ *
+ * Author: Huang Jianan <jnhuang95@gmail.com>
+ *
+ * erofs.c:	implements EROFS related commands
+ */
+
+#include <command.h>
+#include <fs.h>
+#include <erofs.h>
+
+static int do_erofs_ls(struct cmd_tbl *cmdtp, int flag, int argc, char * const argv[])
+{
+	return do_ls(cmdtp, flag, argc, argv, FS_TYPE_EROFS);
+}
+
+U_BOOT_CMD(erofsls, 4, 1, do_erofs_ls,
+	   "List files in directory. Default: root (/).",
+	   "<interface> [<dev[:part]>] [directory]\n"
+	   "    - list files from 'dev' on 'interface' in 'directory'\n"
+);
+
+static int do_erofs_load(struct cmd_tbl *cmdtp, int flag, int argc, char * const argv[])
+{
+	return do_load(cmdtp, flag, argc, argv, FS_TYPE_EROFS);
+}
+
+U_BOOT_CMD(erofsload, 7, 0, do_erofs_load,
+	   "load binary file from a EROFS filesystem",
+	   "<interface> [<dev[:part]> [<addr> [<filename> [bytes [pos]]]]]\n"
+	   "    - Load binary file 'filename' from 'dev' on 'interface'\n"
+	   "      to address 'addr' from EROFS filesystem.\n"
+	   "      'pos' gives the file position to start loading from.\n"
+	   "      If 'pos' is omitted, 0 is used. 'pos' requires 'bytes'.\n"
+	   "      'bytes' gives the size to load. If 'bytes' is 0 or omitted,\n"
+	   "      the load stops on end of file.\n"
+	   "      If either 'pos' or 'bytes' are not aligned to\n"
+	   "      ARCH_DMA_MINALIGN then a misaligned buffer warning will\n"
+	   "      be printed and performance will suffer for the load."
+);
-- 
2.25.1


  parent reply	other threads:[~2022-02-08 14:05 UTC|newest]

Thread overview: 60+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-22 15:48 [PATCH 1/3] fs/erofs: new filesystem Huang Jianan
2021-08-22 15:48 ` Huang Jianan
2021-08-22 15:48 ` [PATCH 2/3] fs/erofs: add lz4 1.8.3 decompressor Huang Jianan
2021-08-22 15:48   ` Huang Jianan
2021-08-22 15:48 ` [PATCH 3/3] fs/erofs: add lz4 decompression support Huang Jianan
2021-08-22 15:48   ` Huang Jianan
2021-08-23  4:24 ` [PATCH 1/3] fs/erofs: new filesystem Bin Meng
2021-08-23  4:24   ` Bin Meng
2021-08-23 11:46   ` Huang Jianan
2021-08-23 11:46     ` Huang Jianan
2021-08-23 12:36 ` [PATCH v2 0/3] " Huang Jianan
2021-08-23 12:36   ` Huang Jianan
2021-08-23 12:36   ` [PATCH v2 1/3] fs/erofs: add erofs filesystem support Huang Jianan
2021-08-23 12:36     ` Huang Jianan
2021-08-25 22:39     ` Tom Rini
2021-08-25 22:39       ` Tom Rini
2021-08-30 13:27       ` Huang Jianan
2021-08-30 13:27         ` Huang Jianan
2021-08-30 15:31         ` Huang Jianan
2021-08-30 15:31           ` Huang Jianan
2021-08-30 16:06           ` Tom Rini
2021-08-30 16:06             ` Tom Rini
2021-08-30 16:23             ` Gao Xiang
2021-08-30 16:23               ` Gao Xiang
2021-08-23 12:36   ` [PATCH v2 2/3] fs/erofs: add lz4 1.8.3 decompressor Huang Jianan
2021-08-23 12:36     ` Huang Jianan
2021-08-25 22:39     ` Tom Rini
2021-08-25 22:39       ` Tom Rini
2021-08-30 13:30       ` Huang Jianan
2021-08-30 13:30         ` Huang Jianan
2021-08-23 12:36   ` [PATCH v2 3/3] fs/erofs: add lz4 decompression support Huang Jianan
2021-08-23 12:36     ` Huang Jianan
2021-08-25  1:23   ` [PATCH v2 0/3] fs/erofs: new filesystem Gao Xiang
2021-08-25  1:23     ` Gao Xiang
2021-08-25 22:40   ` Tom Rini
2021-08-25 22:40     ` Tom Rini
2022-01-05 11:57     ` Gao Xiang
2022-01-05 11:57       ` Gao Xiang
2022-01-14 14:20       ` Huang Jianan
2022-01-14 14:20         ` Huang Jianan
2022-02-08 14:05   ` [PATCH v3 0/5] " Huang Jianan
2022-02-08 14:05     ` Huang Jianan
2022-02-08 14:05     ` [PATCH v3 1/5] fs/erofs: add erofs filesystem support Huang Jianan
2022-02-08 14:05       ` Huang Jianan
2022-02-08 14:05     ` [PATCH v3 2/5] lib/lz4: update LZ4 decompressor module Huang Jianan
2022-02-08 14:05       ` Huang Jianan
2022-02-08 14:05     ` [PATCH v3 3/5] fs/erofs: add lz4 decompression support Huang Jianan
2022-02-08 14:05       ` Huang Jianan
2022-02-08 14:05     ` Huang Jianan [this message]
2022-02-08 14:05       ` [PATCH v3 4/5] fs/erofs: add filesystem commands Huang Jianan
2022-02-08 14:05     ` [PATCH v3 5/5] test/py: Add tests for the erofs Huang Jianan
2022-02-08 14:05       ` Huang Jianan
2022-02-10 13:03       ` Tom Rini
2022-02-10 13:03         ` Tom Rini
2022-02-10 12:43     ` [PATCH v3 0/5] fs/erofs: new filesystem Gao Xiang
2022-02-10 12:43       ` Gao Xiang
2022-02-10 13:34       ` Tom Rini
2022-02-10 13:34         ` Tom Rini
2022-02-10 14:08         ` Gao Xiang
2022-02-10 14:08           ` Gao Xiang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220208140513.30570-5-jnhuang95@gmail.com \
    --to=jnhuang95@gmail.com \
    --cc=linux-erofs@lists.ozlabs.org \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.