From 82e7ae76e1035ab9752a9a8c10a8132522fb1bcc Mon Sep 17 00:00:00 2001 Message-Id: <82e7ae76e1035ab9752a9a8c10a8132522fb1bcc.1364471577.git.wking@tremily.us> From: "W. Trevor King" Date: Thu, 28 Mar 2013 07:50:53 -0400 Subject: [PATCH] generic_stage_target.py: Mount /run/shm in stage chroots You need this on Ubuntu 12.04.1 (and likely other Debian-based distributions) where /dev/shm is a symlink to /run/shm. It would be nice if additional mount points like this were configurable, but until we get to that point this hard coded solution will keep things running. --- modules/generic_stage_target.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/modules/generic_stage_target.py b/modules/generic_stage_target.py index 31cb025..7710704 100644 --- a/modules/generic_stage_target.py +++ b/modules/generic_stage_target.py @@ -184,6 +184,8 @@ class generic_stage_target(generic_target): "/usr/portage/distfiles":self.settings["distdir"],"/var/tmp/portage":"tmpfs"} if os.uname()[0] == "Linux": self.mounts.append("/dev/pts") + self.mounts.append('/run/shm') + self.mountmap['/run/shm'] = 'tmpfs' self.set_mounts() @@ -895,6 +897,7 @@ class generic_stage_target(generic_target): def bind(self): for x in self.mounts: + print('mounting {}'.format(x)) if not os.path.exists(self.settings["chroot_path"]+x): os.makedirs(self.settings["chroot_path"]+x,0755) @@ -914,7 +917,12 @@ class generic_stage_target(generic_target): self.settings["chroot_path"]+x) else: if src == "tmpfs": - if "var_tmpfs_portage" in self.settings: + if x.endswith('shm'): + retval = os.system( + 'mount -t tmpfs none {}{}'.format( + self.settings['chroot_path'], + x)) + elif "var_tmpfs_portage" in self.settings: retval=os.system("mount -t tmpfs -o size="+\ self.settings["var_tmpfs_portage"]+"G "+src+" "+\ self.settings["chroot_path"]+x) -- 1.8.2