lmi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lmi] `mount --mount-commands` obsolete


From: Greg Chicares
Subject: Re: [lmi] `mount --mount-commands` obsolete
Date: Wed, 2 Nov 2016 15:42:20 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Icedove/45.3.0

On 2016-11-02 00:49, Vadim Zeitlin wrote:
> On Tue, 1 Nov 2016 20:57:01 +0000 Greg Chicares <address@hidden> wrote:
> 
> GC> I'm working on replacing 'echo -e' with 'printf' for portability, and
> GC> I just came across this line:
> GC>   restore_opt_mount=`mount --mount-commands 2>/dev/null | grep '"/opt"'`
> GC> which no longer does what it's supposed to do. Apparently, cygwin's
> GC> 'mount' used to have a '--mount-commands' option, but no longer does:
> 
>  Yes, it looks like it was renamed to --mount-entries in this commit
> 
> https://cygwin.com/git/gitweb.cgi?p=newlib-cygwin.git;a=commit;f=winsup/utils/mount.cc;h=56d81795705a67bef7e1e5fa934a2109e34b316f

And the output was changed, from 'mount' commands to something that looks
like /etc/fstab . Then, on 2010-11-05T02:51:19Z, I noted that the old
'mount' option no longer worked:

+# 'mount --mount-commands' is invalid; errors resulting from this
+#   obsolete option are discarded here.

but didn't realize that it had been replaced with another option that is
actually usable. Fixed now.

BTW, how did you find this? I located the lmi change cited above with
'git log -S', but is there a way to do that without cloning the cygwin
repository? Oh...okay, you presumably used the 'gitweb' search box, so
what I missed is that we can just go to a project's git web interface
and search there, to find information that regular search engines
don't see.

> back in 2008. Unfortunately, the commit message doesn't mention why the
> change was done, but I guess the new name is simply more logical because
> the output is indeed a set of entries, not commands. It's still a pity that
> they couldn't keep the old option for compatibility, of course...
> 
> GC> Now why doesn't *nix mount(8) have an option like that?
> 
>  Again, I can't be sure, but I think it's because any well-behaved Unix
> system is supposed to have either/both /etc/mtab or/and /proc/mounts that
> already contains this information, while things are not always that simple
> under Cygwin.

Thanks. I was looking for such an option in this context:

http://lists.nongnu.org/archive/html/lmi/2016-10/msg00003.html
|
| 
http://git.savannah.gnu.org/cgit/lmi.git/commit/README.schroot?id=28d831a259f5a656f10f9cf14c9467f3b2835af4
| +# This being a "plain" schroot, mount essential directories:
| +mount -t devpts -o rw,nosuid,noexec,relatime,mode=600 devpts /dev/pts
| +mount -t proc -o rw,nosuid,nodev,noexec,relatime proc /proc
| +
| +# If the chroot is to be permanent, consider adding those mounts to 
/etc/fstab .
...
| https://wiki.debian.org/chroot#Default_Configurations
| | Generally the file /etc/fstab might look like this:
| | # grep chroot /etc/fstab
| | /dev /srv/chroot/wheezy/dev auto bind 0 0
| | /dev/pts /srv/chroot/wheezy/dev/pts auto bind 0 0
| | /proc /srv/chroot/wheezy/proc auto bind 0 0

What I actually did is this:

$schroot --chroot=cross-lmi --user=root --directory=/
# cat /etc/mtab >> /etc/fstab
# cat /etc/fstab
# UNCONFIGURED FSTAB FOR BASE SYSTEM
devpts /dev/pts devpts rw,nosuid,noexec,relatime,mode=600 0 0
proc /proc proc rw,nosuid,nodev,noexec,relatime 0 0

...which modified /srv/chroot/cross-lmi/etc/fstab, whereas I think
the debian.org documentation suggests modifying the host's fstab.
Well, next time I reboot, I'll find out whether that works.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]