class generic_stage_target(generic_target):
def __init__(self,myspec,addlargs):
- self.required_values.extend(["version_stamp","target","subarch","rel_type",\
- "profile","snapshot","source_subpath"])
+ self.required_values.extend(["version_stamp","target","subarch",\
+ "rel_type","profile","snapshot","source_subpath"])
- self.valid_values.extend(["version_stamp","target","subarch","rel_type","profile",\
- "snapshot","source_subpath","portage_confdir","cflags","cxxflags",\
- "ldflags","chost","hostuse","portage_overlay","distcc_hosts","makeopts",\
- "pkgcache_path","kerncache_path"])
+ self.valid_values.extend(["version_stamp","target","subarch",\
+ "rel_type","profile","snapshot","source_subpath","portage_confdir",\
+ "cflags","cxxflags","ldflags","chost","hostuse","portage_overlay",\
+ "distcc_hosts","makeopts","pkgcache_path","kerncache_path"])
self.set_valid_build_kernel_vars(addlargs)
generic_target.__init__(self,myspec,addlargs)
for x in targetmap[self.settings["hostarch"]]:
try:
fh=open(self.settings["sharedir"]+"/arch/"+x+".py")
- # this next line loads the plugin as a module and assigns it to archmap[x]
+ # This next line loads the plugin as a module and assigns it to
+ # archmap[x]
self.archmap[x]=imp.load_module(x,fh,"arch/"+x+".py",(".py","r",imp.PY_SOURCE))
- # this next line registers all the subarches supported in the plugin
+ # This next line registers all the subarches supported in the
+ # plugin
self.archmap[x].register(self.subarchmap)
fh.close()
except IOError:
msg("Can't find "+x+".py plugin in "+self.settings["sharedir"]+"/arch/")
- # call arch constructor, pass our settings
+ # Call arch constructor, pass our settings
try:
- self.arch=self.subarchmap[self.settings["subarch"]](self.settings)
+ self.arch=self.subarchmap[self.settings["subarch"]](self.settings)
except:
- print "Invalid subarch: "+self.settings["subarch"]
- print "Choose one of the following:",
- for x in self.subarchmap:
- print x,
+ print "Invalid subarch: "+self.settings["subarch"]
+ print "Choose one of the following:",
+ for x in self.subarchmap:
+ print x,
print
- sys.exit(2)
-
+ sys.exit(2)
+
print "Using target:",self.settings["target"]
# self.settings["mainarch"] should now be set by our arch constructor,
# so we print a nice informational message:
def set_action_sequence(self):
#Default action sequence for run method
self.settings["action_sequence"]=["unpack","unpack_snapshot",\
- "config_profile_link","setup_confdir","portage_overlay","bind","chroot_setup",\
- "setup_environment","run_local","preclean","unbind","clean"]
+ "config_profile_link","setup_confdir","portage_overlay",\
+ "base_dirs","bind","chroot_setup","setup_environment",\
+ "run_local","preclean","unbind","clean"]
if not self.settings.has_key("TARBALL"):
self.settings["action_sequence"].append("capture")
self.settings["action_sequence"].append("clear_autoresume")
cmd("rsync -a "+x+"/ "+\
self.settings["chroot_path"], self.settings["spec_prefix"]+"/root_overlay: "+x+" copy failed.",env=self.env)
+ def base_dirs(self):
+ pass
+
def bind(self):
for x in self.mounts:
if not os.path.exists(self.settings["chroot_path"]+x):
print "\tIf you break it, you buy it. Don't complain to us about it."
print "\tDont say we did not warn you\n"
+ def base_dirs(self):
+ if os.uname()[0] == "FreeBSD":
+ # baselayout no longer creates the .keep files in proc and dev for FreeBSD as it
+ # would create them too late...we need them earlier before bind mounting filesystems
+ # since proc and dev are not writeable, so...create them here
+ if not os.path.exists(self.settings["stage_path"]+"/proc"):
+ os.makedirs(self.settings["stage_path"]+"/proc")
+ if not os.path.exists(self.settings["stage_path"]+"/dev"):
+ os.makedirs(self.settings["stage_path"]+"/dev")
+ if not os.path.isfile(self.settings["stage_path"]+"/proc/.keep"):
+ try:
+ proc_keepfile = open(self.settings["stage_path"]+"/proc/.keep","w")
+ proc_keepfile.write('')
+ proc_keepfile.close()
+ except IOError:
+ print "!!! Failed to create %s" % (self.settings["stage_path"]+"/dev/.keep")
+ if not os.path.isfile(self.settings["stage_path"]+"/dev/.keep"):
+ try:
+ dev_keepfile = open(self.settings["stage_path"]+"/dev/.keep","w")
+ dev_keepfile.write('')
+ dev_keepfile.close()
+ except IOError:
+ print "!!! Failed to create %s" % (self.settings["stage_path"]+"/dev/.keep")
+ else:
+ pass
+
def set_mounts(self):
# stage_path/proc probably doesn't exist yet, so create it
if not os.path.exists(self.settings["stage_path"]+"/proc"):