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 32763138247 for ; Wed, 18 Dec 2013 03:29:01 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 990F3E09DB; Wed, 18 Dec 2013 03:29:00 +0000 (UTC) Received: from qmta08.westchester.pa.mail.comcast.net (qmta08.westchester.pa.mail.comcast.net [76.96.62.80]) by pigeon.gentoo.org (Postfix) with ESMTP id 1C383E09DB for ; Wed, 18 Dec 2013 03:28:59 +0000 (UTC) Received: from omta05.westchester.pa.mail.comcast.net ([76.96.62.43]) by qmta08.westchester.pa.mail.comcast.net with comcast id 2qKD1n0030vyq2s58rUzuL; Wed, 18 Dec 2013 03:28:59 +0000 Received: from odin.tremily.us ([24.18.63.50]) by omta05.westchester.pa.mail.comcast.net with comcast id 2rUy1n00Z152l3L3RrUzSA; Wed, 18 Dec 2013 03:28:59 +0000 Received: by odin.tremily.us (Postfix, from userid 1000) id 0A8E9D8BAF7; Tue, 17 Dec 2013 19:28:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tremily.us; s=odin; t=1387337338; bh=qAdXy/ZRStu9xRVg0FxvenlD1blDgKb3uXcPEq0mkok=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=R8CdjOnAcXKAiBpOvRrPRMpZNXuGNfdZgqaK6oOknSSc6yGKNOpQ3C9GHuNHn8p06 hutoj5qE57ov1ymrfJcIf5x2LKORxtYbiJ7gl3rHpvuJDrnISRXsNdAzxxNHYQ/XS2 FJNgQ5Igi68E9Jwm6+teXw6gLgK+S+gnKG3ctJLU= Date: Tue, 17 Dec 2013 19:28:57 -0800 From: "W. Trevor King" To: gentoo-catalyst@lists.gentoo.org Cc: Brian Dolbec Subject: Re: [gentoo-catalyst] [PATCH 2/2] modules/generic_stage_target.py, modules/stage1_target.py: Add a target_mounts dictionary Message-ID: <20131218032857.GD25409@odin.tremily.us> References: <1387328847-25840-1-git-send-email-dolsen@gentoo.org> <1387328847-25840-3-git-send-email-dolsen@gentoo.org> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-catalyst@lists.gentoo.org Reply-to: gentoo-catalyst@lists.gentoo.org MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="TtHApM1pROLbWHag" Content-Disposition: inline In-Reply-To: <1387328847-25840-3-git-send-email-dolsen@gentoo.org> OpenPGP: id=39A2F3FA2AB17E5D8764F388FC29BDCDF15F5BE8; url=http://tremily.us/pubkey.txt User-Agent: Mutt/1.5.22 (2013-10-16) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=q20121106; t=1387337339; bh=0/1pbZUgBgJDC3J3sokWUfGY7u+IR0CJgkOwvkVP1Ek=; h=Received:Received:Received:Date:From:To:Subject:Message-ID: MIME-Version:Content-Type; b=auICQjETO9FfsNYh73ltL5QtP6QR/IYTIto0bzQMcKK0MppS432iXtseALDKJ8jWR s1BBYBNROMbEy0yyV3ZQgCN+ixzRuqW0dbVnIvLa84EIh9J7Mb4c3AdMMx4hHLlDv5 erPccVXN/sW/Mn2ym58250qsK4sMzgcUbbouiOpNHFAzlQM3D3KIzx1BO0+OGkqBWe 9DvTDA7mUJeoGgI/oRwlf7eJtdUFJU59fTiYGzeEu24Lw3AX8fMvFGgyehbfTZnV1u zFtulx/3Duc1pZbTb0utroLzg97YTXT224927jwSpiHWgQYk8fVjOFiNnYv7WH06JD aJ+ZWXbX7KfjA== X-Archives-Salt: 9ab5ea1d-9091-45df-ae34-3a27e7d6cc99 X-Archives-Hash: f1165eaac545d11e63231065fc922793 --TtHApM1pROLbWHag Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Dec 17, 2013 at 05:07:27PM -0800, Brian Dolbec wrote: > +target_mounts =3D { > + "proc": "/proc", > + =E2=80=A6 > + "port_logdir": "/var/log/portage", > + } > =E2=80=A6 > @@ -173,11 +188,12 @@ class generic_stage_target(generic_target): > file_locate(self.settings,["portage_confdir"],expand=3D0) > =20 > """ Setup our mount points """ > + self.target_mounts =3D target_mounts.copy() > if "SNAPCACHE" in self.settings: > self.mounts=3D["proc", "dev", "portdir", "distdir", "port_tmpdir"] > self.mountmap=3D{"proc":"/proc", "dev":"/dev", "devpts":"/dev/pts", > - "portdir":self.settings["snapshot_cache_path"]+"/portage",\ > - "distdir":self.settings["distdir"],"port_tmpdir":"tmpfs"} > + "portdir":normpath(self.settings["snapshot_cache_path"]+"/" + self.s= ettings["repo_name"]), > + "distdir":self.settings["distdir"],"port_tmpdir":"tmpfs"} Can we do this for the mountmap defaults too, and just override the mountmap special cases in the SNAPCACHE branch? I think this would be a good commit for that (or we can do it in a commit after this). I don't think the 'portage' =E2=86=92 self.settings["repo_name"] replacement should go in this commit. It also looks like there is some leading non-tab whitespace at the beginning of your new distdir line, which was otherwise unchanged. > - self.mounts.append("/var/log/portage") > - self.mountmap["/var/log/portage"]=3Dself.settings["port_logdir"] > - self.env["PORT_LOGDIR"]=3D"/var/log/portage" > + self.mounts.append("port_logdir") > + self.mountmap["port_logdir"]=3Dself.settings["port_logdir"] > + self.env["PORT_LOGDIR"]=3Dself.settings["port_logdir"] I don't know where we stand on 'x=3Dy' vs 'x =3D y', but I'd prefer the latter here. I also think that the PORT_LOGDIR environment variable should be: self.env["PORT_LOGDIR"] =3D self.target_mounts["port_logdir"] Nothing in the chroot should care where the source comes from ;). I'd considering renaming mountmap =E2=86=92 source_mounts for clarity, using existing settings to override source_mounts at initialization, and using source_mounts thereafter. > def bind(self): > for x in self.mounts: > - if not os.path.exists(self.settings["chroot_path"] + self.mountmap[x]= ): > - os.makedirs(self.settings["chroot_path"]+x,0755) > + #print "bind(); x =3D", x > + target =3D normpath(self.settings["chroot_path"] + self.target_mounts= [x]) > + if not os.path.exists(target): > + os.makedirs(target, 0755) > =20 > if not os.path.exists(self.mountmap[x]): > if not self.mountmap[x] =3D=3D "tmpfs": > - os.makedirs(self.mountmap[x],0755) > + os.makedirs(self.mountmap[x], 0755) > =20 > src=3Dself.mountmap[x] Might as well shift this src declaration up and use it instead of self.mountmap[x] earlier. Not exactly required for this commit, but you are defining target, so it's not too much of a stretch ;). =20 > - if "SNAPCACHE" in self.settings and x =3D=3D "/usr/portage": > + #print "bind(); src =3D", src > + if "SNAPCACHE" in self.settings and x =3D=3D self.settings["portdir"]: Oops. x is the mountmap key, so I think this should be 'portdir'. > + #print "bind(); cmd =3D", cmd If it's not useful enough to print, I don't think we should commit it ;). I'll be happy once we're using subprocess :p. A few typos, but I think this makes mount handling much more sane :). Cheers, Trevor --=20 This email may be signed or encrypted with GnuPG (http://www.gnupg.org). For more information, see http://en.wikipedia.org/wiki/Pretty_Good_Privacy --TtHApM1pROLbWHag Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iQIcBAEBAgAGBQJSsRZ3AAoJEKKfehoaNkbtVr0P/0vXzSN8FZjno5n0qNpGrDJB s8hdM2+ZBtMSY/7GL2/MsRh8+TrvYY72UBsxUp8ca1Df7NYcrQKRITK45C7wDDuV b4sLbVj4x4ONTgxTErcqO94Xd+/3xZLpdaw+OVMzivBlCJYKfX3HD9RXEvAwnL2W x/iH3ualn1jrbs/JdRKBO9GtHQga+fsfqQ+ki+CO8csJgOhSX5mlekn4ECHk51uJ 5WfnnF18HIKx2H9lgJrhpbUrWw4pi5B48PKq6yQBYVZg1kgFlDNCZoQoclb5ihEQ NxWD8FiAcWzBDUnEFVWm0W5BUmTj5QAx3Vgpv7xgS6VGmqVPZaiadHC2C2m5h2vc Qx5lME1GFHDYsSHg+D8F4MZEckYrLuBggdeVmxAXsRmMC/LrJiGcKfM5Y5jHGk7w A+8dEgKJP+1qqwotdAJpZ54FnUlPPjzznlW4B3taWNesS6J95Bdp6GRBW3r94VqI 2o17Ox385vtoQ2iM/mBAfLdt1FSzA/uTkzmWo5pY+tJUiBVUW3/O3lHeCfLyYgw7 +reVwCTadgtS/0GouSgE1fdw+z+EHh258GSTBptE37p9jI02CjyQHV4FTtwVRQFB sQNBsV5dDz1lP2kl9M7xEzoJVrV5/ld8JohFUAaAiPmOEkuAxVJxU1keq6ra6XfD HKQvQAN5N8KCOXG4hcNq =8kPq -----END PGP SIGNATURE----- --TtHApM1pROLbWHag--