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 | |
parent | 625cfd87d9282c9698a02cd6acd870ee0baee407 (diff) | |
download | busybox-w32-55ae0e9238e1979f0200700ec5dbd0df8d32f7a2.tar.gz busybox-w32-55ae0e9238e1979f0200700ec5dbd0df8d32f7a2.tar.bz2 busybox-w32-55ae0e9238e1979f0200700ec5dbd0df8d32f7a2.zip |
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>
-rw-r--r-- | coreutils/df.c | 2 | ||||
-rw-r--r-- | libbb/Config.src | 19 | ||||
-rw-r--r-- | libbb/find_mount_point.c | 2 |
3 files changed, 21 insertions, 2 deletions
diff --git a/coreutils/df.c b/coreutils/df.c index af9b77b23..70fd1f4fd 100644 --- a/coreutils/df.c +++ b/coreutils/df.c | |||
@@ -160,7 +160,7 @@ int df_main(int argc UNUSED_PARAM, char **argv) | |||
160 | } | 160 | } |
161 | 161 | ||
162 | /* GNU coreutils 6.10 skips certain mounts, try to be compatible. */ | 162 | /* GNU coreutils 6.10 skips certain mounts, try to be compatible. */ |
163 | if (strcmp(device, "rootfs") == 0) | 163 | if (ENABLE_FEATURE_SKIP_ROOTFS && strcmp(device, "rootfs") == 0) |
164 | continue; | 164 | continue; |
165 | 165 | ||
166 | #ifdef WHY_WE_DO_IT_FOR_DEV_ROOT_ONLY | 166 | #ifdef WHY_WE_DO_IT_FOR_DEV_ROOT_ONLY |
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 | |||
161 | Bigger buffers will be allocated with mmap, with fallback to 4 kb | 161 | Bigger buffers will be allocated with mmap, with fallback to 4 kb |
162 | stack buffer if mmap fails. | 162 | stack buffer if mmap fails. |
163 | 163 | ||
164 | config FEATURE_SKIP_ROOTFS | ||
165 | bool "Skip rootfs in mount table" | ||
166 | default y | ||
167 | help | ||
168 | Ignore rootfs entry in mount table. | ||
169 | |||
170 | In Linux, kernel has a special filesystem, rootfs, which is initially | ||
171 | mounted on /. It contains initramfs data, if kernel is configured | ||
172 | to have one. Usually, another file system is mounted over / early | ||
173 | in boot process, and therefore most tools which manipulate | ||
174 | mount table, such as df, will skip rootfs entry. | ||
175 | |||
176 | However, some systems do not mount anything on /. | ||
177 | If you need to configure busybox for one of these systems, | ||
178 | you may find useful to turn this option off to make df show | ||
179 | initramfs statistic. | ||
180 | |||
181 | Otherwise, choose Y. | ||
182 | |||
164 | config MONOTONIC_SYSCALL | 183 | config MONOTONIC_SYSCALL |
165 | bool "Use clock_gettime(CLOCK_MONOTONIC) syscall" | 184 | bool "Use clock_gettime(CLOCK_MONOTONIC) syscall" |
166 | default n | 185 | 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) | |||
43 | /* rootfs mount in Linux 2.6 exists always, | 43 | /* rootfs mount in Linux 2.6 exists always, |
44 | * and it makes sense to always ignore it. | 44 | * and it makes sense to always ignore it. |
45 | * Otherwise people can't reference their "real" root! */ | 45 | * Otherwise people can't reference their "real" root! */ |
46 | if (strcmp(mountEntry->mnt_fsname, "rootfs") == 0) | 46 | if (ENABLE_FEATURE_SKIP_ROOTFS && strcmp(mountEntry->mnt_fsname, "rootfs") == 0) |
47 | continue; | 47 | continue; |
48 | 48 | ||
49 | if (strcmp(name, mountEntry->mnt_dir) == 0 | 49 | if (strcmp(name, mountEntry->mnt_dir) == 0 |