diff -Naur busybox.orig/coreutils/stat.c busybox/coreutils/stat.c --- busybox.orig/coreutils/stat.c 2010-05-25 20:48:33.000000000 +0400 +++ busybox/coreutils/stat.c 2010-05-27 22:19:12.549963727 +0400 @@ -13,6 +13,7 @@ * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. */ #include "libbb.h" +#include "volume_id.h" #define OPT_FILESYS (1 << 0) #define OPT_TERSE (1 << 1) @@ -663,8 +664,10 @@ #endif ok = 1; argv += optind; - for (i = 0; argv[i]; ++i) + for (i = 0; argv[i]; ++i) { + resolve_mount_spec(&argv[i]); ok &= statfunc(argv[i] IF_FEATURE_STAT_FORMAT(, format)); + } return (ok ? EXIT_SUCCESS : EXIT_FAILURE); } diff -Naur busybox.orig/miscutils/mountpoint.c busybox/miscutils/mountpoint.c --- busybox.orig/miscutils/mountpoint.c 2010-05-25 20:48:33.000000000 +0400 +++ busybox/miscutils/mountpoint.c 2010-05-27 22:17:40.757984150 +0400 @@ -10,6 +10,7 @@ */ #include "libbb.h" +#include "volume_id.h" int mountpoint_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; int mountpoint_main(int argc UNUSED_PARAM, char **argv) @@ -28,13 +29,15 @@ arg = argv[optind]; msg = "%s"; + resolve_mount_spec(&arg); + rc = (opt & OPT_x) ? stat(arg, &st) : lstat(arg, &st); if (rc != 0) goto err; if (opt & OPT_x) { if (S_ISBLK(st.st_mode)) { - printf("%u:%u\n", major(st.st_rdev), + bb_info_msg("%u:%u", major(st.st_rdev), minor(st.st_rdev)); return EXIT_SUCCESS; } @@ -54,7 +57,7 @@ int is_not_mnt = (st_dev == st.st_dev) && (st_ino != st.st_ino); if (opt & OPT_d) - printf("%u:%u\n", major(st_dev), minor(st_dev)); + bb_info_msg("%u:%u", major(st_dev), minor(st_dev)); if (opt & OPT_n) { const char *d = find_block_device(arg); /* name is undefined, but device is mounted -> anonymous superblock! */ @@ -64,10 +67,10 @@ /* TODO: iterate /proc/mounts, or /proc/self/mountinfo * to find out the device name */ } - printf("%s %s\n", d, arg); + bb_info_msg("%s %s", d, arg); } if (!(opt & (OPT_q | OPT_d | OPT_n))) - printf("%s is %sa mountpoint\n", arg, is_not_mnt ? "not " : ""); + bb_info_msg("%s is %sa mountpoint", arg, is_not_mnt ? "not " : ""); return is_not_mnt; } arg = p; diff -Naur busybox.orig/util-linux/findfs.c busybox/util-linux/findfs.c --- busybox.orig/util-linux/findfs.c 2010-05-25 20:48:33.000000000 +0400 +++ busybox/util-linux/findfs.c 2010-05-27 22:17:40.757984150 +0400 @@ -14,7 +14,12 @@ int findfs_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; int findfs_main(int argc UNUSED_PARAM, char **argv) { - char *dev = *++argv; + char *dev; + + getopt32(argv, "n"); + argv += optind; + + dev = *argv; if (!dev) bb_show_usage(); @@ -32,8 +37,13 @@ } if (*argv != dev) { - puts(*argv); - return 0; + if (option_mask32 & 1/*-n*/) { + struct stat st; + xstat(*argv, &st); + bb_info_msg("%u:%u", major(st.st_rdev), minor(st.st_rdev)); + } else + puts(*argv); + return EXIT_SUCCESS; } - return 1; + return EXIT_FAILURE; }