Gentoo Archives: gentoo-catalyst

From: "W. Trevor King" <wking@×××××××.us>
To: gentoo-catalyst@l.g.o
Subject: Re: [gentoo-catalyst] [PATCH 2/2] modules/generic_stage_target.py, modules/stage1_target.py: Add a target_mounts dictionary
Date: Thu, 19 Dec 2013 17:20:44
Message-Id: 20131219172037.GS25409@odin.tremily.us
In Reply to: Re: [gentoo-catalyst] [PATCH 2/2] modules/generic_stage_target.py, modules/stage1_target.py: Add a target_mounts dictionary by Brian Dolbec
1 On Wed, Dec 18, 2013 at 11:47:25PM -0800, Brian Dolbec wrote:
2 > On Wed, 2013-12-18 at 23:34 -0800, Brian Dolbec wrote:
3 > > On Tue, 2013-12-17 at 21:35 -0800, W. Trevor King wrote:
4 > > > On Tue, Dec 17, 2013 at 09:18:04PM -0800, Brian Dolbec wrote:
5 > > > > On Tue, 2013-12-17 at 19:28 -0800, W. Trevor King wrote:
6 > > > > > On Tue, Dec 17, 2013 at 05:07:27PM -0800, Brian Dolbec wrote:
7 > > > > > > - self.mounts.append("/var/log/portage")
8 > > > > > > - self.mountmap["/var/log/portage"]=self.settings["port_logdir"]
9 > > > > > > - self.env["PORT_LOGDIR"]="/var/log/portage"
10 > > > > > > + self.mounts.append("port_logdir")
11 > > > > > > + self.mountmap["port_logdir"]=self.settings["port_logdir"]
12 > > > > > > + self.env["PORT_LOGDIR"]=self.settings["port_logdir"]
13 > > > > >
14 > > > > > I also think that the PORT_LOGDIR environment variable
15 > > > > > should be:
16 > > > > >
17 > > > > > self.env["PORT_LOGDIR"] = self.target_mounts["port_logdir"]
18 > > >
19 > > > I don't care about caps, I was trying to fix settings → target_mounts,
20 > > > since settings holds the mount source ;).
21 > >
22 > > No, this code block is adding it to the environment if defined in
23 > > settings. This patch was just removing the hard coded paths.
24 > >
25 > > This is the full if block:
26 > >
27 > > if "port_logdir" in self.settings:
28 > > self.mounts.append("port_logdir")
29 > > self.mountmap["port_logdir"]=self.settings["port_logdir"]
30 > > self.env["PORT_LOGDIR"]=self.settings["port_logdir"]
31 > > self.env["PORT_LOGDIR_CLEAN"]='find "${PORT_LOGDIR}" -type f ! -name "summary.log*" -mtime +30 -delete'
32 > >
33 > > So far it is not used from the new TARGET_MOUNTS_DEFAULTS.
34 > > It is so far only enabled if uncommented and defined in catalyst.conf or
35 > > from the cli.
36 > >
37 > > Should I remove it from the TARGET_MOUNTS_DEFAULTS for the time being?
38 >
39 > What we could do is add a "PortageLog" to the options setting which
40 > would turn on and use the defaults unless otherwise overridden by
41 > setting the port_logdir config option. But that would be something to
42 > add later.
43 >
44 > This patch is to fix/complete the mounts, mountmap changes from the
45 > hard-coded paths and paths as keys.
46
47 Who is consuming the env dict? I thought it was for scripts running
48 in the chroot, in which case it can't possibly care about the mount
49 source, but might conceivably care about the mount target. In any
50 case, current usage in your pending branch is inconsistent:
51
52 $ git grep 'self\.env\[.*\] *=' origin/pending --
53 origin/pending:modules/generic_stage_target.py: self.env["CCACHE_DIR"] = self.target_mounts["ccache"]
54 origin/pending:modules/generic_stage_target.py: self.env["PATH"]="/usr/lib/icecc/bin:"+self.env["PATH"]
55 origin/pending:modules/generic_stage_target.py: self.env["PORT_LOGDIR"]=self.settings["port_logdir"]
56 origin/pending:modules/generic_stage_target.py: self.env["PORT_LOGDIR_CLEAN"]='find "${PORT_LOGDIR}" -type f ! -name "summary.log*" -mtime +30 -delete'
57 origin/pending:modules/generic_stage_target.py: self.env[varname]=self.settings[x]
58 origin/pending:modules/generic_stage_target.py: self.env[varname]=string.join(self.settings[x])
59 origin/pending:modules/generic_stage_target.py: self.env[varname]="true"
60 origin/pending:modules/generic_stage_target.py: self.env[varname]="false"
61 origin/pending:modules/generic_stage_target.py: self.env["MAKEOPTS"]=self.settings["makeopts"]
62 origin/pending:modules/generic_stage_target.py: self.env[kname+"_kernelopts"]=myopts
63 origin/pending:modules/generic_stage_target.py: self.env[kname+"_kernelopts"]=""
64 origin/pending:modules/generic_stage_target.py: self.env["clst_kextraversion"]=\
65 origin/pending:modules/generic_target.py: self.env["PATH"]="/bin:/sbin:/usr/bin:/usr/sbin"
66
67 CCACHE_DIR is set using target_mounts (which makes sense to me), but
68 PORT_LOGDIR is set using settings (which does not make sense to me).
69 For example, if I decide to configure port_logdir (via my Catalyst
70 settings) to /some/wonky/path/on/the/host/system, I want Catalyst to
71 bind-mount that to /var/tmp/portage
72 (TARGET_MOUNTS_DEFAULTS['port_logdir']) and then have emerges in the
73 chroot use /var/tmp/portage. If emerges in the chroot try to use
74 /some/wonky/path/on/the/host/system thinks are not going to work.
75
76 Cheers,
77 TRevor
78
79 --
80 This email may be signed or encrypted with GnuPG (http://www.gnupg.org).
81 For more information, see http://en.wikipedia.org/wiki/Pretty_Good_Privacy

Attachments

File name MIME type
signature.asc application/pgp-signature