Skip to content
Snippets Groups Projects
Commit 9d845509 authored by Marek Behún's avatar Marek Behún Committed by Tom Rini
Browse files

cmd: Add the 'btrsubvol' command to list BTRFS subvolumes


Signed-off-by: default avatarMarek Behun <marek.behun@nic.cz>

 create mode 100644 cmd/btrfs.c
parent 0c936ee3
No related branches found
No related tags found
No related merge requests found
...@@ -1313,6 +1313,16 @@ config CMD_CROS_EC ...@@ -1313,6 +1313,16 @@ config CMD_CROS_EC
endmenu endmenu
menu "Filesystem commands" menu "Filesystem commands"
config CMD_BTRFS
bool "Enable the 'btrsubvol' command"
select FS_BTRFS
help
This enables the 'btrsubvol' command to list subvolumes
of a BTRFS filesystem. There are no special commands for
listing BTRFS directories or loading BTRFS files - this
can be done by the generic 'fs' commands (see CMD_FS_GENERIC)
when BTRFS is enabled (see FS_BTRFS).
config CMD_CBFS config CMD_CBFS
bool "Enable the 'cbfs' command" bool "Enable the 'cbfs' command"
depends on FS_CBFS depends on FS_CBFS
......
...@@ -27,6 +27,7 @@ obj-$(CONFIG_CMD_BOOTMENU) += bootmenu.o ...@@ -27,6 +27,7 @@ obj-$(CONFIG_CMD_BOOTMENU) += bootmenu.o
obj-$(CONFIG_CMD_BOOTSTAGE) += bootstage.o obj-$(CONFIG_CMD_BOOTSTAGE) += bootstage.o
obj-$(CONFIG_CMD_BOOTZ) += bootz.o obj-$(CONFIG_CMD_BOOTZ) += bootz.o
obj-$(CONFIG_CMD_BOOTI) += booti.o obj-$(CONFIG_CMD_BOOTI) += booti.o
obj-$(CONFIG_CMD_BTRFS) += btrfs.o
obj-$(CONFIG_CMD_CACHE) += cache.o obj-$(CONFIG_CMD_CACHE) += cache.o
obj-$(CONFIG_CMD_CBFS) += cbfs.o obj-$(CONFIG_CMD_CBFS) += cbfs.o
obj-$(CONFIG_CMD_CLK) += clk.o obj-$(CONFIG_CMD_CLK) += clk.o
......
/*
* 2017 by Marek Behun <marek.behun@nic.cz>
*
* SPDX-License-Identifier: GPL-2.0+
*/
#include <common.h>
#include <command.h>
#include <btrfs.h>
#include <fs.h>
int do_btrsubvol(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
{
if (argc != 3)
return CMD_RET_USAGE;
if (fs_set_blk_dev(argv[1], argv[2], FS_TYPE_BTRFS))
return 1;
btrfs_list_subvols();
return 0;
}
U_BOOT_CMD(btrsubvol, 3, 1, do_btrsubvol,
"list subvolumes of a BTRFS filesystem",
"<interface> <dev[:part]>\n"
" - List subvolumes of a BTRFS filesystem."
)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment