Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 498968 - Modify handbook instructions to mount a separate tmpfs instance at /mnt/gentoo/dev/shm
Summary: Modify handbook instructions to mount a separate tmpfs instance at /mnt/gento...
Status: RESOLVED FIXED
Alias: None
Product: [OLD] Docs on www.gentoo.org
Classification: Unclassified
Component: Installation Handbook (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Sven Vermeulen (RETIRED)
URL:
Whiteboard:
Keywords:
: 509808 (view as bug list)
Depends on:
Blocks:
 
Reported: 2014-01-22 22:15 UTC by Kyle Sanderson
Modified: 2014-06-01 13:37 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kyle Sanderson 2014-01-22 22:15:30 UTC
From Bug 496328, floppym seems to indicate the handbook is completely broken as /dev/shm isn't mounted as part of the chroot instructions. I hit the trap, apparently others are as well. It would be nice to have a line for mounting /dev/shm, and have it working in the chroot as there are (now) malicious ebuilds that check for it.
Comment 1 Mike Gilbert gentoo-dev 2014-01-22 22:18:57 UTC
For the record, I never said the handbook is completely broken, nor anything to that effect.
Comment 2 Mike Gilbert gentoo-dev 2014-01-22 22:25:08 UTC
Just to make this bug a little more useful:

It was proposed that perhaps we should change the following command in the handbook:

mount --rbind /dev /mnt/gentoo/dev

Into 3 commands:

mount --bind /dev /mnt/gentoo/dev
mount --bind /dev/pts /mnt/gentoo/dev/pts
mount -t tmpfs shm /mnt/gentoo/dev/shm

The last of these 3 commands would create a new tmpfs for shared memory within the chroot environment, which could prevent conflicts between processes inside and outside the chroot.

Personally, I have never witnessed such a conflict, but it could happen in theory.
Comment 3 Kyle Sanderson 2014-01-22 22:27:57 UTC
(In reply to Mike Gilbert from comment #1)
> For the record, I never said the handbook is completely broken, nor anything
> to that effect.

(In reply to Mike Gilbert from Bug 496328 comment #1)
> Honestly, I don't feel it is our responsibility to tell you how to properly
> configure a chroot build environment. Our installation handbook already
> properly documents that. So my initial reaction is to reject this request.
> 
> However, I can see the value in preventing broken systems.

(In reply to Mike Gilbert from Bug 496328 comment #18)
> This bug is finding quite a few configurations that were simply broken, and
> nobody noticed. I would prefer to leave it as-is.

I could be looking too deep into this, which is usually the case. Thanks for fixing the documentation in the bug though; I'm really horrible with phrasing (as you've likely already noted ;-) ).
Comment 4 Mike Gilbert gentoo-dev 2014-01-22 22:34:44 UTC
(In reply to Kyle Sanderson from comment #3)

I think we are talking past one another. I have been saying that the handbook is fine all along.

There are a couple of things we have found to be broken:

1. catalyst was broken, and is now fixed.
2. SELinux policy was broken, and a fix is in progress.

There is some unknown problem with YOUR system/install environment that causes the instructions in the handbook to not work for YOU. We have not figured out exactly what that is.
Comment 5 Sven Vermeulen (RETIRED) gentoo-dev 2014-01-23 19:13:05 UTC
I also have /dev/mqueue as a separate mount. Should it be mounted explicitly as well?
Comment 6 Mike Gilbert gentoo-dev 2014-01-23 20:08:46 UTC
I am not familiar enough with that to answer that.
Comment 7 Chris Slycord 2014-04-18 13:35:19 UTC
(In reply to Mike Gilbert from comment #4)
> (In reply to Kyle Sanderson from comment #3)
> 
> I think we are talking past one another. I have been saying that the
> handbook is fine all along.
> 
> There are a couple of things we have found to be broken:
> 
> 1. catalyst was broken, and is now fixed.
> 2. SELinux policy was broken, and a fix is in progress.
> 
> There is some unknown problem with YOUR system/install environment that
> causes the instructions in the handbook to not work for YOU. We have not
> figured out exactly what that is.

For what it's worth, I (In reply to Mike Gilbert from comment #4)
> (In reply to Kyle Sanderson from comment #3)
> 
> I think we are talking past one another. I have been saying that the
> handbook is fine all along.
> 
> There are a couple of things we have found to be broken:
> 
> 1. catalyst was broken, and is now fixed.
> 2. SELinux policy was broken, and a fix is in progress.
> 
> There is some unknown problem with YOUR system/install environment that
> causes the instructions in the handbook to not work for YOU. We have not
> figured out exactly what that is.

For what it's worth, I hit the same bug when doing the mount --rbind stuff as well. I believe it's related to the fact that outside the chroot, at least on this ubuntu live DVD I'm using, /dev/shm is a symlink to /run/shm and when we --rbind it, inside the chroot it's a symlink to nothing.

And just doing "mount --bind /dev/ /mnt/gentoo/dev" and later doing "mount -t tmpfs shm /dev/shm" didn't do any good, as it simply made a second symlinked mountpoint. The only way I was able to do it was to --bind /dev and /dev/pts then go into the chroot, remove /dev/shm, create it as a directory with 1777, then do "mount -t tmpfs shm /dev/shm"

Only after that was I able to get python to install properly.
Comment 8 Mike Gilbert gentoo-dev 2014-04-18 13:51:21 UTC
(In reply to Chris Slycord from comment #7)

Ah, thanks for that insight. I think the handbook still assumes you are using a Gentoo installcd though.
Comment 9 Sven Vermeulen (RETIRED) gentoo-dev 2014-04-18 19:39:09 UTC
Yes; we have to assume that anyone using a different installation CD can deal with the changes in the environment. It is quite hard to follow through on the differences between other media.

What are they thinking, making /dev/shm -> /run/shm... that only to save a tmpfs mount?
Comment 10 nm (RETIRED) gentoo-dev 2014-05-08 08:40:14 UTC
*** Bug 509808 has been marked as a duplicate of this bug. ***
Comment 11 Sven Vermeulen (RETIRED) gentoo-dev 2014-06-01 13:37:40 UTC
Applied the following:

diff -u -B -r1.145 hb-install-system.xml
--- hb-install-system.xml       13 Apr 2014 11:58:00 -0000      1.145
+++ hb-install-system.xml       1 Jun 2014 13:36:05 -0000
@@ -109,6 +109,21 @@
 # <i>mount --rbind /dev /mnt/gentoo/dev</i>
 </pre>
 
+<!--
+Only warning for non-Gentoo installation media. The more other installation
+media diverge from ours, the more difficult it will be to create proper
+documentation. If this becomes a larger issue, we will need to include a
+single warning up front, and perhaps have a wiki page where users can put the
+differences, so that the installation instructions can focus on Gentoo-only
+media.
+-->
+<warn>
+When using non-Gentoo installation media, this might not be sufficient.
+Some distributions make <path>/dev/shm</path> a symbolic link to
+<path>/run/shm</path> which, after the chroot, becomes invalid. Making
+<path>/dev/shm</path> a proper tmpfs-mount up front can fix this.
+</warn>
+
 </body>
 </subsection>
 <subsection>