Gentoo Archives: gentoo-dev

From: Paul Smith <pausmith@××××××××××××××.com>
To: Paul de Vrieze <pauldv@g.o>
Cc: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] Creating multiple "installations" on the same host
Date: Wed, 24 Mar 2004 14:44:40
Message-Id: vpdrisgu1f00.fsf@lemming.engeast.baynetworks.com
In Reply to: Re: [gentoo-dev] Creating multiple "installations" on the same host by Paul de Vrieze
1 %% Paul de Vrieze <pauldv@g.o> writes:
2
3 >> Are these supersets of each other or can they be disjoint? In
4 >> other words, if I have a library package contains header files,
5 >> which are build time dependencies, and shared libraries, which are
6 >> both build and runtime dependencies, should I declare both DEPEND
7 >> and RDEPEND?
8
9 pdv> Yes.
10
11 Good to know; thanks.
12
13 >> In the above example that package is a DEPEND... but it will be
14 >> installed under ROOT, not under /.
15
16 pdv> If it is not in RDEPEND (which most compiletime dependencies are
17 pdv> with the exception of things like autoconf/automake etc.) that is
18 pdv> a bug and should be filed.
19
20 OK, I think I begin to see the intent behind ROOT, and I don't think it
21 is flexible enough for what I am looking for. Admittedly, what I'm
22 looking for is probably fairly unique :).
23
24
25 ROOT appears to allow someone to create a different installed area, but
26 it still requires that all the software required to build that installed
27 area reside on the base system (everything that is in a DEPEND
28 line--which is virtually everything!)
29
30 This isn't what I'm looking for, actually. I want to be able to build
31 an install area with complete freedom from my "real" desktop. I want to
32 build with completely different versions of all sorts of tools than the
33 ones on my "real" system, without having to install them on my real
34 system.
35
36 In fact, I want to be able to do it without even being root!
37
38
39 What I would be interested in seeing is a new variable, like BUILDROOT,
40 that could be set to something other than "/". This value would be
41 prefixed to any path that looked at the build system rather than the
42 install system. This is basically how we do it except our code is not
43 clean either--instead it forces ROOT into the role of my suggested
44 BUILDROOT above, so it serves both roles.
45
46 Then, if people wanted a 100% divorced install they could set
47 BUILDROOT==ROOT==something besides "/". As a result, nothing on the
48 "real" system (well, except for things like sh and python to run the
49 Portage tools themselves--which is OK) would be used.
50
51 This is how we use Portage actually: we first create a "host" image
52 which contains all the build tools (cross compilers, build system,
53 Portage itself, etc.) Then we use that "host" image to generate the
54 other images. In this way the entire environment can be created with no
55 special privileges or access, and without impacting the contents of the
56 "real" system at all.
57
58
59 The other change I would like to see is a way to avoid the requirement
60 for root access. These extra "images" I'm creating don't need to be
61 installed as root, because I'm creating them in my own area. Not only
62 that, but if there's a personal BUILDROOT then even _THAT_ doesn't
63 require root access; it could also be an image I've built myself.
64
65 In that past when dealing with permissions I've had good results using
66 an idea taken from UNIX's sticky bit: instead of requiring the user to
67 configure some account you just use the owner of the upper directory and
68 apply that to the contents. In this situation, we would find the owner
69 of the ROOT and/or BUILDROOT directories and use that as the required
70 owner instead of hardcoding "root" in Portage. Obviously a little bit
71 of logic has to enter in here: if the owner of either ROOT or BUILDROOT
72 is root then you must be root; if the owner of neither of them is root
73 then they must be the same. Another safety measure might be that if
74 either was "/", then you have to be root (just in case someone
75 accidentally chowns their "/" directory). For example.
76
77
78 I'm willing to supply patches for these things if it seems like
79 something people are interested in.
80
81 --
82 -------------------------------------------------------------------------------
83 Paul D. Smith <psmith@××××××××××××××.com> HASMAT--HA Software Mthds & Tools
84 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist
85 -------------------------------------------------------------------------------
86 These are my opinions---Nortel Networks takes no responsibility for them.
87
88 --
89 gentoo-dev@g.o mailing list

Replies

Subject Author
Re: [gentoo-dev] Creating multiple "installations" on the same host Paul de Vrieze <pauldv@g.o>