diff --git a/barrel/cmds.cc b/barrel/cmds.cc index 1a424ec..78a97b7 100644 --- a/barrel/cmds.cc +++ b/barrel/cmds.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) [2021-2022] SUSE LLC + * Copyright (c) [2021-2024] SUSE LLC * * All Rights Reserved. * @@ -20,6 +20,8 @@ */ +#include + #include "cmds.h" #include "commit.h" #include "create-encryption.h" @@ -78,6 +80,9 @@ namespace barrel const vector create_cmds = { +#if LIBSTORAGE_NG_VERSION_AT_LEAST(1, 100) + { "bcachefs", make_shared() }, +#endif { "btrfs", make_shared() }, { "encryption", make_shared() }, { "exfat", make_shared() }, diff --git a/barrel/create-filesystem.cc b/barrel/create-filesystem.cc index fe3b496..7f756c7 100644 --- a/barrel/create-filesystem.cc +++ b/barrel/create-filesystem.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) [2021-2023] SUSE LLC + * Copyright (c) [2021-2024] SUSE LLC * * All Rights Reserved. * @@ -31,6 +31,7 @@ #include #include #include +#include #include "Utils/GetOpts.h" #include "Utils/Text.h" @@ -66,6 +67,9 @@ namespace barrel const map str_to_fs_type = { +#if LIBSTORAGE_NG_VERSION_AT_LEAST(1, 100) + { "bcachefs", FsType::BCACHEFS }, +#endif { "btrfs", FsType::BTRFS }, { "exfat", FsType::EXFAT }, { "ext2", FsType::EXT2 }, @@ -583,6 +587,24 @@ namespace barrel } +#if LIBSTORAGE_NG_VERSION_AT_LEAST(1, 100) + + shared_ptr + CmdCreateBcachefs::parse(GetOpts& get_opts) const + { + return parse_create_filesystem(get_opts, FsType::BCACHEFS); + } + + + const char* + CmdCreateBcachefs::help() const + { + return _("Alias for 'create filesystem --type bcachefs'"); + } + +#endif + + shared_ptr CmdCreateBtrfs::parse(GetOpts& get_opts) const { diff --git a/barrel/create-filesystem.h b/barrel/create-filesystem.h index 7880dee..d2f2259 100644 --- a/barrel/create-filesystem.h +++ b/barrel/create-filesystem.h @@ -1,5 +1,5 @@ /* - * Copyright (c) [2021-2022] SUSE LLC + * Copyright (c) [2021-2024] SUSE LLC * * All Rights Reserved. * @@ -24,6 +24,8 @@ #define BARREL_CREATE_FILESYSTEM_H +#include + #include "handle.h" @@ -38,6 +40,18 @@ namespace barrel }; +#if LIBSTORAGE_NG_VERSION_AT_LEAST(1, 100) + + struct CmdCreateBcachefs : public CmdCreateFilesystem + { + virtual shared_ptr parse(GetOpts& get_opts) const override; + virtual const char* help() const override; + virtual bool is_alias() const override { return true; } + }; + +#endif + + struct CmdCreateBtrfs : public CmdCreateFilesystem { virtual shared_ptr parse(GetOpts& get_opts) const override; diff --git a/doc/barrel.xml.in b/doc/barrel.xml.in index 8f6a239..a718980 100644 --- a/doc/barrel.xml.in +++ b/doc/barrel.xml.in @@ -2,13 +2,13 @@ - 2023-10-06 + 2024-01-29 barrel 8 - 2023-10-06 + 2024-01-29 @VERSION@ Storage Management @@ -342,7 +342,7 @@ type - Set file system type. Possible values are btrfs, exfat, + Set file system type. Possible values are bcachefs, btrfs, exfat, ext2, ext3, ext4, f2fs, jfs, nilfs2, ntfs, reiserfs, swap, udf, vfat, xfs. Not all file systems may be available on the diff --git a/package/barrel.changes b/package/barrel.changes index 112176e..4ab9ee5 100644 --- a/package/barrel.changes +++ b/package/barrel.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Mon Jan 29 11:16:40 CET 2024 - aschnell@suse.com + +- experimental support for bcachefs + ------------------------------------------------------------------- Tue Jan 02 16:34:48 CET 2024 - aschnell@suse.com