diff options
author | Lauri Kasanen <curaga@operamail.com> | 2011-01-31 06:27:35 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2011-01-31 06:27:35 +0100 |
commit | 55ae0e9238e1979f0200700ec5dbd0df8d32f7a2 (patch) | |
tree | a84f49f35110aff62102c808cb983f6fb7bde10f /libbb | |
parent | 625cfd87d9282c9698a02cd6acd870ee0baee407 (diff) |
df,find_mount_point: optionally don't ignore rootfs
Signed-off-by: Lauri Kasanen <curaga@operamail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'libbb')
-rw-r--r-- | libbb/Config.src | 19 | ||||
-rw-r--r-- | libbb/find_mount_point.c | 2 |
2 files changed, 20 insertions, 1 deletions
diff --git a/libbb/Config.src b/libbb/Config.src index 85892d3fe..dfb897d5f 100644 --- a/libbb/Config.src +++ b/libbb/Config.src @@ -161,6 +161,25 @@ config FEATURE_COPYBUF_KB Bigger buffers will be allocated with mmap, with fallback to 4 kb stack buffer if mmap fails. +config FEATURE_SKIP_ROOTFS + bool "Skip rootfs in mount table" + default y + help + Ignore rootfs entry in mount table. + + In Linux, kernel has a special filesystem, rootfs, which is initially + mounted on /. It contains initramfs data, if kernel is configured + to have one. Usually, another file system is mounted over / early + in boot process, and therefore most tools which manipulate + mount table, such as df, will skip rootfs entry. + + However, some systems do not mount anything on /. + If you need to configure busybox for one of these systems, + you may find useful to turn this option off to make df show + initramfs statistic. + + Otherwise, choose Y. + config MONOTONIC_SYSCALL bool "Use clock_gettime(CLOCK_MONOTONIC) syscall" default n diff --git a/libbb/find_mount_point.c b/libbb/find_mount_point.c index 361698a6b..56637ad92 100644 --- a/libbb/find_mount_point.c +++ b/libbb/find_mount_point.c @@ -43,7 +43,7 @@ struct mntent* FAST_FUNC find_mount_point(const char *name, int subdir_too) /* rootfs mount in Linux 2.6 exists always, * and it makes sense to always ignore it. * Otherwise people can't reference their "real" root! */ - if (strcmp(mountEntry->mnt_fsname, "rootfs") == 0) + if (ENABLE_FEATURE_SKIP_ROOTFS && strcmp(mountEntry->mnt_fsname, "rootfs") == 0) continue; if (strcmp(name, mountEntry->mnt_dir) == 0 |