Lines 138-143
class generic_stage_target(generic_target):
Link Here
|
138 |
self.set_dest_path() |
138 |
self.set_dest_path() |
139 |
self.set_stage_path() |
139 |
self.set_stage_path() |
140 |
self.set_target_path() |
140 |
self.set_target_path() |
|
|
141 |
self.set_crossroot_path() |
141 |
|
142 |
|
142 |
self.set_controller_file() |
143 |
self.set_controller_file() |
143 |
self.set_action_sequence() |
144 |
self.set_action_sequence() |
Lines 439-444
class generic_stage_target(generic_target):
Link Here
|
439 |
if not os.path.exists(self.settings["autoresume_path"]): |
440 |
if not os.path.exists(self.settings["autoresume_path"]): |
440 |
os.makedirs(self.settings["autoresume_path"],0755) |
441 |
os.makedirs(self.settings["autoresume_path"],0755) |
441 |
|
442 |
|
|
|
443 |
def set_crossroot_path(self): |
444 |
self.settings["crossroot_path"]=normpath(self.settings["storedir"]+\ |
445 |
"/crossroot/") |
446 |
|
442 |
def set_controller_file(self): |
447 |
def set_controller_file(self): |
443 |
self.settings["controller_file"]=normpath(self.settings["sharedir"]+\ |
448 |
self.settings["controller_file"]=normpath(self.settings["sharedir"]+\ |
444 |
"/targets/"+self.settings["target"]+"/"+self.settings["target"]+\ |
449 |
"/targets/"+self.settings["target"]+"/"+self.settings["target"]+\ |
Lines 458-464
class generic_stage_target(generic_target):
Link Here
|
458 |
""" Default action sequence for run method """ |
463 |
""" Default action sequence for run method """ |
459 |
self.settings["action_sequence"]=["unpack","unpack_snapshot",\ |
464 |
self.settings["action_sequence"]=["unpack","unpack_snapshot",\ |
460 |
"config_profile_link","setup_confdir","portage_overlay",\ |
465 |
"config_profile_link","setup_confdir","portage_overlay",\ |
461 |
"base_dirs","bind","chroot_setup","setup_environment",\ |
466 |
"base_dirs","qemu_setup","bind","chroot_setup","setup_environment",\ |
462 |
"run_local","preclean","unbind","clean"] |
467 |
"run_local","preclean","unbind","clean"] |
463 |
# if self.settings.has_key("TARBALL") or \ |
468 |
# if self.settings.has_key("TARBALL") or \ |
464 |
# not self.settings.has_key("FETCH"): |
469 |
# not self.settings.has_key("FETCH"): |
Lines 1034-1039
class generic_stage_target(generic_target):
Link Here
|
1034 |
"Could not backup /etc/portage/make.conf",env=self.env) |
1039 |
"Could not backup /etc/portage/make.conf",env=self.env) |
1035 |
touch(self.settings["autoresume_path"]+"chroot_setup") |
1040 |
touch(self.settings["autoresume_path"]+"chroot_setup") |
1036 |
|
1041 |
|
|
|
1042 |
def qemu_setup(self): |
1043 |
if not self.settings.has_key("QEMU"): |
1044 |
return |
1045 |
|
1046 |
if self.settings.has_key("AUTORESUME") \ |
1047 |
and os.path.exists(self.settings["autoresume_path"]+"qemu_setup"): |
1048 |
print "Resume point detected, skipping qemu_setup operation..." |
1049 |
else: |
1050 |
print "Setting up qemu..." |
1051 |
|
1052 |
if self.settings["crosscompile"]: |
1053 |
cmd("mkdir -p "+self.settings["crossroot_path"]) |
1054 |
cmd('USE="static static-libs -acl -nls -idn -ssl" emerge --oneshot --noreplace --quiet --root='+self.settings["crossroot_path"]+" app-arch/tar app-arch/bzip2 app-arch/gzip sys-apps/findutils sys-apps/sed sys-devel/make",\ |
1055 |
"Could not build static binaries",env=self.env) |
1056 |
|
1057 |
cmd("cp /usr/bin/qemu-static-"+self.settings["hostarch"]+" "+self.settings["chroot_path"]+\ |
1058 |
"usr/bin",\ |
1059 |
"Could not copy qemu-static-"+self.settings["hostarch"],env=self.env) |
1060 |
cmd("cp "+self.settings["sharedir"]+"/targets/support/qemu-binfmt "+self.settings["chroot_path"]+\ |
1061 |
"usr/bin/qemu-static-"+self.settings["hostarch"]+"-binfmt",\ |
1062 |
"Could not copy qemu-binfmt",env=self.env) |
1063 |
|
1064 |
touch(self.settings["autoresume_path"]+"qemu_setup") |
1065 |
|
1066 |
self.mounts.append("/crossroot") |
1067 |
self.mountmap["/crossroot"]=\ |
1068 |
self.settings["crossroot_path"] |
1069 |
|
1037 |
def fsscript(self): |
1070 |
def fsscript(self): |
1038 |
if self.settings.has_key("AUTORESUME") \ |
1071 |
if self.settings.has_key("AUTORESUME") \ |
1039 |
and os.path.exists(self.settings["autoresume_path"]+"fsscript"): |
1072 |
and os.path.exists(self.settings["autoresume_path"]+"fsscript"): |
Lines 1090-1095
class generic_stage_target(generic_target):
Link Here
|
1090 |
"clean script failed.",env=self.env) |
1123 |
"clean script failed.",env=self.env) |
1091 |
touch(self.settings["autoresume_path"]+"clean") |
1124 |
touch(self.settings["autoresume_path"]+"clean") |
1092 |
|
1125 |
|
|
|
1126 |
""" Clean up qemu """ |
1127 |
if self.settings.has_key("QEMU") and self.settings["crosscompile"]: |
1128 |
cmd("rm -f "+self.settings["stage_path"]+"/usr/bin/qemu-static-"+self.settings["hostarch"],\ |
1129 |
"Could not remove qemu-static-"+self.settings["hostarch"],env=self.env) |
1130 |
cmd("rm -f "+self.settings["stage_path"]+"/usr/bin/qemu-static-"+self.settings["hostarch"]+"-binfmt",\ |
1131 |
"Could not remove qemu-static-"+self.settings["hostarch"]+"-binfmt",env=self.env) |
1132 |
cmd("rmdir "+self.settings["stage_path"]+"/crossroot",\ |
1133 |
"Could not remove crossroot directory",env=self.env) |
1134 |
|
1093 |
def empty(self): |
1135 |
def empty(self): |
1094 |
if self.settings.has_key("AUTORESUME") \ |
1136 |
if self.settings.has_key("AUTORESUME") \ |
1095 |
and os.path.exists(self.settings["autoresume_path"]+"empty"): |
1137 |
and os.path.exists(self.settings["autoresume_path"]+"empty"): |