Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 76146 - bind mount for portage_confdir
Summary: bind mount for portage_confdir
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: Catalyst (show other bugs)
Hardware: All All
: High normal (vote)
Assignee: Gentoo Catalyst Developers
URL:
Whiteboard: InCVS
Keywords:
Depends on:
Blocks:
 
Reported: 2004-12-30 08:29 UTC by John Davis (zhen) (RETIRED)
Modified: 2005-01-14 11:50 UTC (History)
1 user (show)

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


Attachments
patch for /usr/lib/catalyst/modules/generic_stage_target.py (generic_stage_target.py.diff,1.72 KB, patch)
2004-12-30 09:06 UTC, John Davis (zhen) (RETIRED)
Details | Diff
portage_confdir bind mount patch (portage_confdir-bindmount.patch,3.28 KB, patch)
2005-01-01 20:25 UTC, John Davis (zhen) (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description John Davis (zhen) (RETIRED) gentoo-dev 2004-12-30 08:29:43 UTC
setup the portage_confdir key to use a bind mount
Comment 1 John Davis (zhen) (RETIRED) gentoo-dev 2004-12-30 09:06:22 UTC
Created attachment 47223 [details, diff]
patch for /usr/lib/catalyst/modules/generic_stage_target.py

patch for a bind mount to portage_confdir (/etc/portage). test and let me know
what happens. If successful, I will add the patch to CVS.
Comment 2 William Kilian 2004-12-31 12:54:28 UTC
output from trial:

# catalyst -dVf /etc/catalyst/stage1/x86/x86/x86-stage1.kn-srvr.2004-12-31.12-25-42.-0600.spec
Gentoo Catalyst, version 1.1.0
Copyright 2003-2004 The Gentoo Foundation
Distributed under the GNU General Public License version 2

Using default Catalyst configuration file, /etc/catalyst/catalyst.conf
Setting storedir to default value "/var/tmp/catalyst"
Setting portdir to default value "/usr/portage"
Setting distdir to config file value "/usr/portage/distfiles"
Setting options to config file value "ccache pkgcache kerncache"
Setting sharedir to config file value "/usr/lib/catalyst"
Compiler cache support enabled.
Package cache support enabled.
Kernel cache support enabled.
Envscript support enabled.
Building natively for x86
Setting up directories...
Running command "rm -rf /var/tmp/catalyst/tmp/default/stage1-x86-kn-srvr.2004-12-31.12-25-42.-0600"
Unpacking stage tarball...
Running command "tar xjpf /var/tmp/catalyst/builds/default/stage3-x86-try2-2004.3.tar.bz2 -C /var/tmp/catalyst/tmp/default/stage1-x86-kn-srvr.2004-12-31.12-25-42.-0600"
Cleaning up existing portage tree snapshot...
Running command "rm -rf /var/tmp/catalyst/tmp/default/stage1-x86-kn-srvr.2004-12-31.12-25-42.-0600/usr/portage"
Unpacking portage tree snapshot...
Running command "tar xjpf /var/tmp/catalyst/snapshots/portage-kn-srvr.2004-12-31.12-25-42.-0600.tar.bz2 -C /var/tmp/catalyst/tmp/default/stage1-x86-kn-srvr.2004-12-31.12-25-42.-0600/usr"
Configuring profile link...
Running command "rm -f /var/tmp/catalyst/tmp/default/stage1-x86-kn-srvr.2004-12-31.12-25-42.-0600/etc/make.profile"
Running command "ln -sf ../usr/portage/profiles/default-linux/x86/2004.3 /var/tmp/catalyst/tmp/default/stage1-x86-kn-srvr.2004-12-31.12-25-42.-0600/etc/make.profile"
!!! catalyst: could not complete build
Comment 3 William Kilian 2004-12-31 12:59:06 UTC
it didn't matter if my portage_confdir was a symlink or a normal directory, got the same output either way
Comment 4 John Davis (zhen) (RETIRED) gentoo-dev 2005-01-01 20:25:13 UTC
Created attachment 47347 [details, diff]
portage_confdir bind mount patch

give this patch a whirl, it worked on my machine. apply the patch to the
modules directory. let me know what happens!
Comment 5 William Kilian 2005-01-06 19:14:13 UTC
I haven't tested the patch yet. It might be best not to implement a bind mount for portage_confdir. Using a bind mount would allow the user to change the files while catalyst is running. That's probably bad and I can't think of a valid use case. Using a separate copy is probably better than using a bind mount. Since this was originally inspired by a desire for portage_confdir to work even if it was a symbolic link, I tested cp's behaviour with symlinks.

If /path/symlink is a symbolic link to /path/dir:

# cp -R /path/symlink /path/cp-target

makes /path/cp-target a symlink to /path/dir

# cp -R /path/symlink/ /path/cp-target

(note the trailing slash on /path/symlink/) copies the contents of /path/dir to a new directory /path/cp-target if cp-target does not already exist or to /path/cp-target/symlink if cp-target already exists.

So I suggest, instead of using a bind mount, doing this:

# rm -rf $targetTempRoot/etc/portage
# cp -R ${portage_confdir}/ $targetTempRoot/etc/portage

I will go ahead and test your portage_confdir bind mount patch unless I hear from you that you don't want me to.
Comment 6 William Kilian 2005-01-06 20:18:50 UTC
looks like the bind is backwards, see this mount excerpt while a build is running:

/usr/portage/distfiles on /var/tmp/catalyst/tmp/default/stage1-x86-kn-srvr.2005-01-06.21-16-26.-0600/usr/portage/distfiles type none (rw,bind)
/etc/portage on /var/tmp/catalyst/tmp/default/stage1-x86-kn-srvr.2005-01-06.21-16-26.-0600/etc/catalyst/etc-portage/kn-srvr type none (rw,bind)
/var/tmp/catalyst/packages/default/stage1-x86-kn-srvr.2005-01-06.21-16-26.-0600 on /var/tmp/catalyst/tmp/default/stage1-x86-kn-srvr.2005-01-06.21-16-26.-0600/usr/portage/packages type none (rw,bind)
/root/.ccache on /var/tmp/catalyst/tmp/default/stage1-x86-kn-srvr.2005-01-06.21-16-26.-0600/var/tmp/ccache type none (rw,bind)
Comment 7 John Davis (zhen) (RETIRED) gentoo-dev 2005-01-09 17:05:23 UTC
hm, ok, having catalyst copy the drive would probably be advantageous for the reasons that you stated. I will add your fix to CVS, thanks for all of the testing!
Comment 8 Chris Gianelloni (RETIRED) gentoo-dev 2005-01-14 11:50:39 UTC
Catalyst 1.1.2 is now out!