Please see attached.
It's a context diff (hope I got it right) for which the modified files
are at http://www.casita.net/tmp/ (because of size).
The patch adds config option "--enable-mtab". Probably better to do that
in "configure.ac" but I'm low on the Autoconf learning curve.
http://www.casita.net/tmp/coreutils-8.24.diff
http://www.casita.net/tmp/configure
http://www.casita.net/tmp/mountlist.c
... and I also now find that it's late.
On 03/03/2016 09:57 PM, Pádraig Brady wrote:
> Note coreutils 8.25 has a change wrt bind mounts to prioritize mounts
> nearer the device root, which might help you:
> http://git.sv.gnu.org/gitweb/?p=coreutils.git;a=commitdiff;h=v8.24-31-g3babaf8
*blush*
8.25 has been out for more than six weeks already. (Coreutils is one of
the packages I try to keep really current.)
I will give 8.25 a whirl and let you know how it looks, both in 'chroot'
and in the bind-laden "system disk" hack.
> Note /proc/self/mountinfo is more informative than /proc/mounts
> in this context as it has more info.
Sounds good.
The nice thing about /proc/mounts is that it can serve as a dynamic
/etc/mtab. (Thus the distributors got seduced into using it full time.)
The nice thing about /etc/mtab is that admins, developers, and tinkers
can manually set it however they feel they need. The flames against it
on the lists are a little surprising, and rather sad.
-- R; <><
diff -r -u coreutils-8.24.0/configure coreutils-8.24/configure
--- coreutils-8.24.0/configure 2015-07-03 17:01:58.000000000 -0400
+++ coreutils-8.24/configure 2016-03-04 10:02:32.281596995 -0500
@@ -2134,6 +2134,9 @@
-dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
dvidir=$ac_optarg ;;
+ -enable-mtab | --enable-mtab)
+ CFLAGS="$CFLAGS -DUSE_MTAB" ;;
+
-enable-* | --enable-*)
ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
# Reject names that are not valid shell variable names.
diff -r -u coreutils-8.24.0/lib/mountlist.c coreutils-8.24/lib/mountlist.c
--- coreutils-8.24.0/lib/mountlist.c 2015-07-01 11:08:30.000000000 -0400
+++ coreutils-8.24/lib/mountlist.c 2016-03-04 09:50:56.621941386 -0500
@@ -463,7 +463,8 @@
{
FILE *fp;
-#ifdef __linux__
+#if defined __linux__ && !defined USE_MTAB
+
/* Try parsing mountinfo first, as that make device IDs available.
Note we could use libmount routines to simplify this parsing a little
(and that code is in previous versions of this function), however