kdave / btrfs-progs

Development of userspace BTRFS tools
GNU General Public License v2.0
550 stars 241 forks source link

Box version not working for btrfs-find-root #648

Closed space88man closed 1 year ago

space88man commented 1 year ago

The release btrfs.box.static (6.3.2) is not working for btrfs-find-root:

ln btrfs.box.static btrfs-find-root
./btrfs-find-root

# ./btrfs-find-root 
usage: btrfs [global] <group> [<group>...] <command> [<args>]

Global options:
  --format <format> if supported, print subcommand output in that format (text, json)
  -v|--verbose      increase verbosity of the subcommand
  -q|--quiet        print only errors
  --log <level>     set log level (default, info, verbose, debug, quiet)

Options for the main command only:
  --help            print condensed help for all subcommands
  --version         print version string

Expected result:

# ./btrfs-find-root
btrfs-find-root: not enough arguments: 0 but at least 1 expected

Whereas other links are working

ln btrfs.box.static mkfs.btrfs
./mkfs.btrfs 

# ./mkfs.btrfs
btrfs-progs v6.3.2
See https://btrfs.readthedocs.io for more information.

usage: mkfs.btrfs [options] <dev> [<dev...>]

    Create a BTRFS filesystem on a device or multiple devices

    Allocation profiles:
    -d|--data PROFILE         data profile, raid0, raid1, raid1c3, raid1c4, raid5, raid6, raid10, dup or single
    -m|--metadata PROFILE     metadata profile, values like for data profile 
    -M|--mixed                mix metadata and data together 
    Features:
    --csum TYPE               
...
kdave commented 1 year ago

You're right, however this looks like a documentation typo, the find-root tool is listed in the btrfs help --box commands but has never had the support in the code, i.e. no BOX_MAIN like the other builtins. I can add it but I'm not sure it's a good idea, the tool is from the old times when there were several standalone tools that got replaced by the one btrfs command.

kdave commented 1 year ago

Fix pushed to devel. Even if we'd want to have the command under btrfs, for now it's OK to add the support to btrfs.box.