Lines 126-140
Link Here
|
126 |
# this next line checks to make sure that the specified variables exist on disk. |
126 |
# this next line checks to make sure that the specified variables exist on disk. |
127 |
file_locate(self.settings,["source_path","snapshot_path","distdir"],expand=0) |
127 |
file_locate(self.settings,["source_path","snapshot_path","distdir"],expand=0) |
128 |
|
128 |
|
129 |
# if we are using portage_confdir, check that as well |
|
|
130 |
if self.settings.has_key("portage_confdir"): |
131 |
file_locate(self.settings,["portage_confdir"],expand=0) |
132 |
|
133 |
# setup our mount points |
129 |
# setup our mount points |
134 |
self.mounts=[ "/proc","/dev","/dev/pts","/usr/portage/distfiles" ] |
130 |
self.mounts=[ "/proc","/dev","/dev/pts","/usr/portage/distfiles" ] |
135 |
self.mountmap={"/proc":"/proc", "/dev":"/dev", "/dev/pts":"/dev/pts",\ |
131 |
self.mountmap={"/proc":"/proc", "/dev":"/dev", "/dev/pts":"/dev/pts",\ |
136 |
"/usr/portage/distfiles":self.settings["distdir"]} |
132 |
"/usr/portage/distfiles":self.settings["distdir"]} |
137 |
|
133 |
|
|
|
134 |
# handle portage_confdir |
135 |
if self.settings.has_key("portage_confdir"): |
136 |
file_locate(self.settings,["portage_confdir"],expand=0) |
137 |
self.mounts.append(self.settings["portage_confdir"]) |
138 |
self.mountmap[self.settings["portage_confdir"]]="/etc/portage" |
139 |
|
138 |
if self.settings["target"]=="grp": |
140 |
if self.settings["target"]=="grp": |
139 |
self.mounts.append("/tmp/grp") |
141 |
self.mounts.append("/tmp/grp") |
140 |
self.mountmap["/tmp/grp"]=self.settings["target_path"] |
142 |
self.mountmap["/tmp/grp"]=self.settings["target_path"] |
Lines 228-239
Link Here
|
228 |
cmd("ln -sf ../usr/portage/profiles/"+self.settings["target_profile"]+\ |
230 |
cmd("ln -sf ../usr/portage/profiles/"+self.settings["target_profile"]+\ |
229 |
" "+self.settings["chroot_path"]+"/etc/make.profile","Error creating profile link") |
231 |
" "+self.settings["chroot_path"]+"/etc/make.profile","Error creating profile link") |
230 |
|
232 |
|
231 |
if self.settings.has_key("portage_confdir"): |
|
|
232 |
print "Configuring /etc/portage..." |
233 |
cmd("rm -rf "+self.settings["chroot_path"]+"/etc/portage","Error zapping /etc/portage") |
234 |
cmd("cp -R "+self.settings["portage_confdir"]+" "+self.settings["chroot_path"]+\ |
235 |
"/etc/portage","Error copying /etc/portage") |
236 |
|
237 |
for x in self.mounts: |
233 |
for x in self.mounts: |
238 |
if not os.path.exists(self.settings["chroot_path"]+x): |
234 |
if not os.path.exists(self.settings["chroot_path"]+x): |
239 |
os.makedirs(self.settings["chroot_path"]+x) |
235 |
os.makedirs(self.settings["chroot_path"]+x) |
Lines 246-252
Link Here
|
246 |
if retval!=0: |
242 |
if retval!=0: |
247 |
self.unbind() |
243 |
self.unbind() |
248 |
raise CatalystError,"Couldn't bind mount "+src |
244 |
raise CatalystError,"Couldn't bind mount "+src |
249 |
|
245 |
|
250 |
def unbind(self): |
246 |
def unbind(self): |
251 |
ouch=0 |
247 |
ouch=0 |
252 |
mypath=self.settings["chroot_path"] |
248 |
mypath=self.settings["chroot_path"] |