Gentoo Archives: gentoo-dev

From: Paul Smith <pausmith@××××××××××××××.com>
To: david@×××××××××.com
Cc: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] BUILDROOT concept (was Re: [gentoo-dev] ROOT variable)
Date: Fri, 23 Apr 2004 19:46:00
Message-Id: vpdru0zaqxzj.fsf@lemming.engeast.baynetworks.com
In Reply to: Re: [gentoo-dev] BUILDROOT concept (was Re: [gentoo-dev] ROOT variable) by david@futuretel.com
1 %% david@×××××××××.com writes:
2
3 >> Mm. But of course, this will only work if your embedded system just
4 >> happens to be the same architecture as your build system... which I
5 >> think is not a good restriction to make.
6
7 d> I still don't see how `ROOT=/tmp/foo emerge blah` doesn't solve
8 d> your problem.
9
10 Maybe I'm misreading the code, but from what I can see, when you set
11 ROOT it only changes where RDEPEND packages are searched for.
12
13 It does _NOT_ change where DEPEND packages are searched for: they're
14 still searched for on the native system not in the ROOT system. If the
15 native system and the root system are very different, that doesn't seem
16 like it can work properly.
17
18 >> I don't see how this solves the problem. First, the point is to
19 >> allow multiple "build" images, which this does not do, since it
20 >> still uses the local host for all DEPEND information. I don't want
21 >> to have to update (or downgrade!) my local host's installation of
22 >> packages just to build a ROOT with a different setup! Second, the
23 >> ROOT is not a real Portage system here: all the Portage database
24 >> information, etc. is on the local system. Third, this still won't
25 >> work if the ROOT target is to be run on different hardware than the
26 >> build system. Etc.
27
28 d> I don't understand what you mean by 'portage database information'.
29 d> Maybe you could explain more, becuase I don't see any problems here
30 d> either.
31
32 If you look at the code in emerge (this is from the latest Portage CVS)
33 you'll see things like this:
34
35 if myroot=="/":
36 mydep["/"]=edepend["DEPEND"]+" "+edepend["RDEPEND"]
37 if not self.select_dep("/",mydep["/"],myparent=mp,myuse=myuse):
38 return 0
39 else:
40 mydep["/"]=edepend["DEPEND"]
41 mydep[myroot]=edepend["RDEPEND"]
42 if not self.select_dep("/",mydep["/"],myparent=mp,myuse=myuse):
43 return 0
44 elif not self.select_dep(myroot,mydep[myroot],myparent=mp,myuse=myuse):
45 return 0
46
47 IIUC, this shows that if ROOT is not the default (is not "/") then
48 emerge will check the native system for the DEPEND requirements and
49 check the ROOT image only for the RDEPEND requirements.
50
51 Also, you'll see many instances of code like this:
52
53 mylogfile=open("/var/log/emerge.log", "a")
54
55 which is obviously going to be updating the emerge.log file on the
56 native system, not in the ROOT image. And this:
57
58 profilever=os.path.basename(os.path.normpath(os.readlink("/etc/make.profile")))
59
60 which shows Portage checking the profile on the native system, not the
61 one in the ROOT system. I do see that the ebuild cache is kept in ROOT,
62 so that's good (originally I thought it wasn't there). But there is
63 this suspicious looking bit in portage.py, although it might be a bug:
64
65 worldlist=grabfile("/var/cache/edb/world")
66
67 I would think that this should be using the world file in the ROOT, not
68 the native system.
69
70
71 More generally, what I want to be able to do is build for a target
72 (ROOT) a specific set of packages and versions _without_ having to
73 modify my physical system in any way. I don't want the build of the
74 ROOT to have any relationship to what I have installed on my physical
75 system. If I want ROOT to have a version of a package that doesn't work
76 with a newer version of GTK or whatever, I don't want to have to
77 downgrade the version on my physical system in order to build that
78 ROOT. Maybe I want to create a ROOT system with a KDE desktop but don't
79 want KDE installed on my build system. Etc.
80
81 Right now the construction of the ROOT is accomplished by a combination
82 of stuff on the physical system and stuff in the ROOT image.
83
84 --
85 -------------------------------------------------------------------------------
86 Paul D. Smith <psmith@××××××××××××××.com> HASMAT--HA Software Mthds & Tools
87 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist
88 -------------------------------------------------------------------------------
89 These are my opinions---Nortel Networks takes no responsibility for them.
90
91 --
92 gentoo-dev@g.o mailing list

Replies