diff --git a/Makefile b/Makefile index 86c73590..cc6db02b 100644 --- a/Makefile +++ b/Makefile @@ -325,7 +325,7 @@ MAKEOPTS = --no-print-directory Q=$(Q) # built-in sources into "busybox", all files that contain the main function and # are not compiled standalone progs_box_main = btrfs.o mkfs/main.o image/main.o convert/main.o \ - tune/main.o + tune/main.o btrfs-find-root.o progs_box_all_objects = $(mkfs_objects) $(image_objects) $(convert_objects) $(tune_objects) progs_box_all_static_objects = $(static_mkfs_objects) $(static_image_objects) \ diff --git a/btrfs-find-root.c b/btrfs-find-root.c index e5a60c20..6e32859f 100644 --- a/btrfs-find-root.c +++ b/btrfs-find-root.c @@ -25,6 +25,7 @@ #include "kernel-shared/disk-io.h" #include "kernel-shared/volumes.h" #include "kernel-shared/extent_io.h" +#include "common/box.h" #include "common/utils.h" #include "common/extent-cache.h" #include "common/help.h" @@ -329,7 +330,7 @@ static const struct cmd_struct btrfs_find_root_cmd = { "btrfs-find-root", NULL, btrfs_find_root_usage, NULL, 0, }; -int main(int argc, char **argv) +int BOX_MAIN(find_root)(int argc, char **argv) { struct btrfs_fs_info *fs_info; struct btrfs_find_root_filter filter = {0}; diff --git a/btrfs.c b/btrfs.c index cd0ca130..b0a75f6e 100644 --- a/btrfs.c +++ b/btrfs.c @@ -420,6 +420,8 @@ int main(int argc, char **argv) return convert_main(argc, argv); } else if (!strcmp(bname, "btrfstune")) { return btrfstune_main(argc, argv); + } else if (!strcmp(bname, "btrfs-find-root")) { + return find_root_main(argc, argv); #endif } else { int shift; diff --git a/common/box.h b/common/box.h index f3fd312d..27a092be 100644 --- a/common/box.h +++ b/common/box.h @@ -33,6 +33,7 @@ DECLARE_BOX_MAIN(mkfs); DECLARE_BOX_MAIN(image); DECLARE_BOX_MAIN(convert); DECLARE_BOX_MAIN(btrfstune); +DECLARE_BOX_MAIN(find_root); #else #define BOX_MAIN(standalone) main