From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 9A545138247 for ; Wed, 22 Jan 2014 05:04:32 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id E3BDFE1178; Wed, 22 Jan 2014 05:04:16 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id DFD5FE1178 for ; Wed, 22 Jan 2014 05:04:15 +0000 (UTC) Received: from spoonbill.gentoo.org (spoonbill.gentoo.org [81.93.255.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 1A9A133FAEE for ; Wed, 22 Jan 2014 05:04:15 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by spoonbill.gentoo.org (Postfix) with ESMTP id DED37187CC for ; Wed, 22 Jan 2014 05:04:12 +0000 (UTC) From: "Brian Dolbec" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Brian Dolbec" Message-ID: <1390365016.32dd2617139e93159abb42eb4e3028a8b3f2f48a.dol-sen@gentoo> Subject: [gentoo-commits] proj/catalyst:3.0 commit in: catalyst/, catalyst/base/ X-VCS-Repository: proj/catalyst X-VCS-Files: catalyst/base/stagebase.py catalyst/defaults.py X-VCS-Directories: catalyst/ catalyst/base/ X-VCS-Committer: dol-sen X-VCS-Committer-Name: Brian Dolbec X-VCS-Revision: 32dd2617139e93159abb42eb4e3028a8b3f2f48a X-VCS-Branch: 3.0 Date: Wed, 22 Jan 2014 05:04:12 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 156ba7a2-3bdf-4d66-9277-76b43bae0ffb X-Archives-Hash: 5d867f7bd12b502df32a9fb7d79b68b0 commit: 32dd2617139e93159abb42eb4e3028a8b3f2f48a Author: Anthony G. Basile gentoo org> AuthorDate: Mon Dec 30 23:57:28 2013 +0000 Commit: Brian Dolbec gmail com> CommitDate: Wed Jan 22 04:30:16 2014 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/catalyst.git;a=commit;h=32dd2617 catalyst/targets/generic_stage_target.py: mount /dev/shm on linux Add shm targets defaults. Anthony G. Basile gentoo.org> Some build systems require /dev/shm to be mounted, like python's build system. We make sure that on Linux systems, /dev/shm is mounted in the stage chroots. See bug #496328. Douglas Freed mtu.edu> : Mount /dev/shm in the chroot with the right options Bind mounting /dev/shm into the chroot isn't a good idea, as there may be collisions and result in weird side effects. Instead, we can just mount a new tmpfs there, with the right options to ensure security. (Forward ported to 3.0 branch from 2.X Brian Dolbec) --- catalyst/base/stagebase.py | 6 +++++- catalyst/defaults.py | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py index 7e09ed1..10868ee 100644 --- a/catalyst/base/stagebase.py +++ b/catalyst/base/stagebase.py @@ -209,6 +209,7 @@ class StageBase(TargetBase, ClearBase, GenBase): #self.mountmap["portdir"] = None if os.uname()[0] == "Linux": self.mounts.append("devpts") + self.mounts.append("shm") self.set_mounts() @@ -930,7 +931,7 @@ class StageBase(TargetBase, ClearBase, GenBase): ensure_dirs(target, mode=0755) if not os.path.exists(self.mountmap[x]): - if not self.mountmap[x] == "tmpfs": + if self.mountmap[x] not in ["tmpfs", "shmfs"]: ensure_dirs(self.mountmap[x], mode=0755) src=self.mountmap[x] @@ -951,6 +952,9 @@ class StageBase(TargetBase, ClearBase, GenBase): self.settings["var_tmpfs_portage"] + "G " + \ src + " " + target retval=os.system(cmd) + elif src == "shmfs": + cmd = "mount -t tmpfs -o noexec,nosuid,nodev shm " + target + retval=os.system(cmd) else: cmd = "mount --bind " + src + " " + target #print "bind(); cmd =", cmd diff --git a/catalyst/defaults.py b/catalyst/defaults.py index 27bcff4..1f86c1d 100644 --- a/catalyst/defaults.py +++ b/catalyst/defaults.py @@ -92,6 +92,7 @@ TARGET_MOUNT_DEFAULTS = { "port_tmpdir": "/var/tmp/portage", "port_logdir": "/var/log/portage", "proc": "/proc", + "shm": "/dev/shm", } SOURCE_MOUNT_DEFAULTS = { @@ -101,6 +102,7 @@ SOURCE_MOUNT_DEFAULTS = { "portdir": None, # set from settings options "port_tmpdir": "tmpfs", "proc": "/proc", + "shm": "shmfs", } # legend: key: message