from catalyst.support import (CatalystError, msg, file_locate, normpath,
touch, cmd, warn, list_bashify, read_makeconf, read_from_clst, ismount)
-from catalyst.targets.targetbase import TargetBase
-from catalyst.targets.clearbase import ClearBase
-from catalyst.targets.genbase import GenBase
+from catalyst.base.targetbase import TargetBase
+from catalyst.base.clearbase import ClearBase
+from catalyst.base.genbase import GenBase
from catalyst.lock import LockDir
-class generic_stage_target(TargetBase, ClearBase, GenBase):
+class StageBase(TargetBase, ClearBase, GenBase):
"""
This class does all of the chroot setup, copying of files, etc. It is
the driver class for pretty much everything that Catalyst does.
from catalyst.support import normpath
-from generic_stage_target import generic_stage_target
+from catalyst.base.stagebase import StageBase
-class embedded_target(generic_stage_target):
+class embedded_target(StageBase):
"""
Builder class for embedded target
"""
if "embedded/fs-type" in addlargs:
self.valid_values.append("embedded/fs-ops")
- generic_stage_target.__init__(self,spec,addlargs)
+ StageBase.__init__(self,spec,addlargs)
self.set_build_kernel_vars(addlargs)
def set_action_sequence(self):
from catalyst.support import (CatalystError, normpath,
touch, cmd, list_bashify)
-from generic_stage_target import generic_stage_target
+from catalyst.base.stagebase import StageBase
-class grp_target(generic_stage_target):
+class grp_target(StageBase):
"""
The builder class for GRP (Gentoo Reference Platform) builds.
"""
self.required_values.append("grp/"+x+"/packages")
self.required_values.append("grp/"+x+"/type")
- generic_stage_target.__init__(self,spec,addlargs)
+ StageBase.__init__(self,spec,addlargs)
def set_target_path(self):
self.settings["target_path"]=normpath(self.settings["storedir"]+"/builds/"+self.settings["target_subpath"]+"/")
print_traceback=True)
def set_use(self):
- generic_stage_target.set_use(self)
- if "BINDIST" in self.settings:
- if "use" in self.settings:
- self.settings["use"].append("bindist")
- else:
- self.settings["use"]=["bindist"]
+ StageBase.set_use(self)
+ if "use" in self.settings:
+ self.settings["use"].append("bindist")
+ else:
+ self.settings["use"]=["bindist"]
def set_mounts(self):
- self.mounts.append("/tmp/grp")
- self.mountmap["/tmp/grp"]=self.settings["target_path"]
+ self.mounts.append("/tmp/grp")
+ self.mountmap["/tmp/grp"]=self.settings["target_path"]
def generate_digests(self):
for pkgset in self.settings["grp"]:
self.gen_digest_file(normpath(destdir+"/"+i))
def set_action_sequence(self):
- self.settings["action_sequence"]=["unpack","unpack_snapshot",\
+ self.settings["action_sequence"]=["unpack","unpack_snapshot",\
"config_profile_link","setup_confdir","portage_overlay","bind","chroot_setup",\
"setup_environment","run_local","unbind",\
"generate_digests","clear_autoresume"]
from catalyst.support import (normpath,
touch, cmd)
-from generic_stage_target import generic_stage_target
+from catalyst.base.stagebase import StageBase
-class livecd_stage1_target(generic_stage_target):
+class livecd_stage1_target(StageBase):
"""
Builder class for LiveCD stage1.
"""
self.valid_values=self.required_values[:]
self.valid_values.extend(["livecd/use"])
- generic_stage_target.__init__(self,spec,addlargs)
+ StageBase.__init__(self,spec,addlargs)
def set_action_sequence(self):
self.settings["action_sequence"]=["unpack","unpack_snapshot",\
self.settings["spec_prefix"]="livecd"
def set_use(self):
- generic_stage_target.set_use(self)
+ StageBase.set_use(self)
if "use" in self.settings:
self.settings["use"].append("livecd")
if "BINDIST" in self.settings:
self.settings["use"].append("bindist")
def set_packages(self):
- generic_stage_target.set_packages(self)
+ StageBase.set_packages(self)
if self.settings["spec_prefix"]+"/packages" in self.settings:
if type(self.settings[self.settings["spec_prefix"]+"/packages"]) == types.StringType:
self.settings[self.settings["spec_prefix"]+"/packages"] = \
if type(self.settings["pkgcache_path"]) != types.StringType:
self.settings["pkgcache_path"]=normpath(string.join(self.settings["pkgcache_path"]))
else:
- generic_stage_target.set_pkgcache_path(self)
+ StageBase.set_pkgcache_path(self)
def register(foo):
foo.update({"livecd-stage1":livecd_stage1_target})
from catalyst.support import (normpath, file_locate, CatalystError, cmd,
read_from_clst, touch)
-from generic_stage_target import generic_stage_target
+from catalyst.base.stagebase import StageBase
-class livecd_stage2_target(generic_stage_target):
+class livecd_stage2_target(StageBase):
"""
Builder class for a LiveCD stage2 build.
"""
"livecd/fstype","livecd/fsops","livecd/linuxrc","livecd/bootargs",\
"gamecd/conf","livecd/xdm","livecd/xsession","livecd/volid"])
- generic_stage_target.__init__(self,spec,addlargs)
+ StageBase.__init__(self,spec,addlargs)
if "livecd/type" not in self.settings:
self.settings["livecd/type"] = "generic-livecd"
from catalyst.support import (CatalystError, normpath,
touch, cmd, list_bashify)
-from generic_stage_target import generic_stage_target
+from catalyst.base.stagebase import StageBase
-class netboot2_target(generic_stage_target):
+class netboot2_target(StageBase):
"""
Builder class for a netboot build, version 2
"""
except:
raise CatalystError("configuration error in netboot2/packages.")
- generic_stage_target.__init__(self,spec,addlargs)
+ StageBase.__init__(self,spec,addlargs)
self.set_build_kernel_vars()
self.settings["merge_path"]=normpath("/tmp/image/")
from catalyst.support import (CatalystError, normpath,
cmd, list_bashify, file_locate)
-from generic_stage_target import generic_stage_target
+from catalyst.base.stagebase import StageBase
-class netboot_target(generic_stage_target):
+class netboot_target(StageBase):
"""
Builder class for a netboot build.
"""
except:
raise CatalystError("configuration error in netboot/packages.")
- generic_stage_target.__init__(self,spec,addlargs)
+ StageBase.__init__(self,spec,addlargs)
self.set_build_kernel_vars(addlargs)
if "netboot/busybox_config" in addlargs:
file_locate(self.settings, ["netboot/busybox_config"])
from catalyst.support import normpath, cmd
-from catalyst.targets.targetbase import TargetBase
-from catalyst.targets.genbase import GenBase
+from catalyst.base.targetbase import TargetBase
+from catalyst.base.genbase import GenBase
class snapshot_target(TargetBase, GenBase):
"""
from catalyst.support import normpath, list_to_string
-from generic_stage_target import generic_stage_target
+from catalyst.base.stagebase import StageBase
-class stage1_target(generic_stage_target):
+class stage1_target(StageBase):
"""
Builder class for a stage1 installation tarball build.
"""
self.required_values=[]
self.valid_values=["chost"]
self.valid_values.extend(["update_seed","update_seed_command"])
- generic_stage_target.__init__(self,spec,addlargs)
+ StageBase.__init__(self,spec,addlargs)
def set_stage_path(self):
self.settings["stage_path"]=normpath(self.settings["chroot_path"]+self.settings["root_path"])
print "stage1 root path is "+self.settings["root_path"]
def set_cleanables(self):
- generic_stage_target.set_cleanables(self)
+ StageBase.set_cleanables(self)
self.settings["cleanables"].extend([\
"/usr/share/zoneinfo", "/etc/portage/package*"])
- # XXX: How do these override_foo() functions differ from the ones in generic_stage_target and why aren't they in stage3_target?
+ # XXX: How do these override_foo() functions differ from the ones in StageBase and why aren't they in stage3_target?
def override_chost(self):
if "chost" in self.settings:
self.settings["LDFLAGS"]=list_to_string(self.settings["ldflags"])
def set_portage_overlay(self):
- generic_stage_target.set_portage_overlay(self)
+ StageBase.set_portage_overlay(self)
if "portage_overlay" in self.settings:
print "\nWARNING !!!!!"
print "\tUsing an portage overlay for earlier stages could cause build issues."
from catalyst.support import normpath, list_to_string
-from generic_stage_target import generic_stage_target
+from catalyst.base.stagebase import StageBase
-class stage2_target(generic_stage_target):
+class stage2_target(StageBase):
"""
Builder class for a stage2 installation tarball build.
"""
def __init__(self,spec,addlargs):
self.required_values=[]
self.valid_values=["chost"]
- generic_stage_target.__init__(self,spec,addlargs)
+ StageBase.__init__(self,spec,addlargs)
def set_source_path(self):
if "seedcache" in self.settings["options"] and os.path.isdir(normpath(self.settings["storedir"]+"/tmp/"+self.settings["source_subpath"]+"/tmp/stage1root/")):
print "\tthe source path will then be "+normpath(self.settings["storedir"]+"/builds/"+self.settings["source_subpath"]+".tar.bz2\n")
# XXX: How do these override_foo() functions differ from the ones in
- # generic_stage_target and why aren't they in stage3_target?
+ # StageBase and why aren't they in stage3_target?
def override_chost(self):
if "chost" in self.settings:
self.settings["LDFLAGS"]=list_to_string(self.settings["ldflags"])
def set_portage_overlay(self):
- generic_stage_target.set_portage_overlay(self)
+ StageBase.set_portage_overlay(self)
if "portage_overlay" in self.settings:
print "\nWARNING !!!!!"
print "\tUsing an portage overlay for earlier stages could cause build issues."
# NOTE: That^^ docstring has influence catalyst-spec(5) man page generation.
-from generic_stage_target import generic_stage_target
+from catalyst.base.stagebase import StageBase
-class stage3_target(generic_stage_target):
+class stage3_target(StageBase):
"""
Builder class for a stage3 installation tarball build.
"""
def __init__(self,spec,addlargs):
self.required_values=[]
self.valid_values=[]
- generic_stage_target.__init__(self,spec,addlargs)
+ StageBase.__init__(self,spec,addlargs)
def set_portage_overlay(self):
- generic_stage_target.set_portage_overlay(self)
+ StageBase.set_portage_overlay(self)
if "portage_overlay" in self.settings:
print "\nWARNING !!!!!"
print "\tUsing an overlay for earlier stages could cause build issues."
print "\tDont say we did not warn you\n"
def set_cleanables(self):
- generic_stage_target.set_cleanables(self)
+ StageBase.set_cleanables(self)
def register(foo):
foo.update({"stage3":stage3_target})
# NOTE: That^^ docstring has influence catalyst-spec(5) man page generation.
-from generic_stage_target import generic_stage_target
+from catalyst.base.stagebase import StageBase
-class stage4_target(generic_stage_target):
+class stage4_target(StageBase):
"""
Builder class for stage4.
"""
"stage4/gk_mainargs","splash_theme",\
"portage_overlay","stage4/rcadd","stage4/rcdel",\
"stage4/linuxrc","stage4/unmerge","stage4/rm","stage4/empty"])
- generic_stage_target.__init__(self,spec,addlargs)
+ StageBase.__init__(self,spec,addlargs)
def set_cleanables(self):
self.settings["cleanables"]=["/var/tmp/*","/tmp/*"]
from catalyst.support import cmd, list_bashify, CatalystError
-from generic_stage_target import generic_stage_target
+from catalyst.base.stagebase import StageBase
-class tinderbox_target(generic_stage_target):
+class tinderbox_target(StageBase):
"""
Builder class for the tinderbox target
"""
self.required_values=["tinderbox/packages"]
self.valid_values=self.required_values[:]
self.valid_values.extend(["tinderbox/use"])
- generic_stage_target.__init__(self,spec,addlargs)
+ StageBase.__init__(self,spec,addlargs)
def run_local(self):
# tinderbox