1 Index: modules/generic_stage_target.py
2 ===================================================================
3 --- modules/generic_stage_target.py (revision 1203)
4 +++ modules/generic_stage_target.py (working copy)
7 self.valid_values.extend(["version_stamp","target","subarch",\
8 "rel_type","profile","snapshot","source_subpath","portage_confdir",\
9 - "cflags","cxxflags","ldflags","chost","hostuse","portage_overlay",\
10 + "cflags","cxxflags","ldflags","cbuild","chost","hostuse","portage_overlay",\
11 "distcc_hosts","makeopts","pkgcache_path","kerncache_path"])
13 self.set_valid_build_kernel_vars(addlargs)
14 generic_target.__init__(self,myspec,addlargs)
15 - # map the mainarch we are running under to the mainarches we support for
16 - # building stages and LiveCDs. (for example, on amd64, we can build
17 - # stages for x86 or amd64.
20 - "amd64" : ["x86","amd64"],
21 - "sparc64" : ["sparc","sparc64"],
23 - "alpha" : ["alpha"],
24 - "sparc" : ["sparc"],
28 - "ppc64" : ["ppc","ppc64"],
42 "sparc64" : "sparc64",
54 - "parisc64" : "hppa",
55 + "powerpc" : "powerpc",
56 + "powerpc64" : "powerpc64",
57 + "parisc" : "parisc",
58 + "parisc64" : "parisc",
68 - mymachine=os.uname()[4]
69 - if not machinemap.has_key(mymachine):
70 - raise CatalystError, "Unknown machine type "+mymachine
72 - self.settings["hostarch"]=machinemap[mymachine]
75 + if self.settings.has_key("chost"):
76 + hostmachine = self.settings["chost"].split("-")[0]
78 + hostmachine = os.uname()[4]
79 + if not machinemap.has_key(hostmachine):
80 + raise CatalystError, "Unknown host machine type "+hostmachine
81 + self.settings["hostarch"] = machinemap[hostmachine]
82 + if self.settings.has_key("cbuild"):
83 + buildmachine = self.settings["cbuild"].split("-")[0]
85 + buildmachine = os.uname()[4]
86 + if not machinemap.has_key(buildmachine):
87 + raise CatalystError, "Unknown build machine type "+buildmachine
88 + self.settings["buildarch"] = machinemap[buildmachine]
89 + self.settings["crosscompile"] = (self.settings["hostarch"] != self.settings["buildarch"])
91 + self.subarchmap = {}
93 - for x in targetmap[self.settings["hostarch"]]:
95 - fh=open(self.settings["sharedir"]+"/arch/"+x+".py")
96 - # This next line loads the plugin as a module and assigns it to
98 - self.archmap[x]=imp.load_module(x,fh,"arch/"+x+".py",(".py","r",imp.PY_SOURCE))
99 - # This next line registers all the subarches supported in the
101 - self.archmap[x].register(self.subarchmap)
105 - msg("Can't find "+x+".py plugin in "+self.settings["sharedir"]+"/arch/")
106 + x = self.settings["hostarch"]
108 + fh = open(self.settings["sharedir"]+"/arch/"+x+".py")
109 + # this next line loads the plugin as a module and assigns it to archmap[x]
110 + self.archmap[x] = imp.load_module(x,fh,"arch/"+x+".py",(".py","r",imp.PY_SOURCE))
111 + # this next line registers all the subarches supported in the plugin
112 + self.archmap[x].register(self.subarchmap)
115 + msg("Can't find "+x+".py plugin in "+self.settings["sharedir"]+"/arch/")
116 # Call arch constructor, pass our settings
118 self.arch=self.subarchmap[self.settings["subarch"]](self.settings)
121 print "Invalid subarch: "+self.settings["subarch"]
122 print "Choose one of the following:",
123 for x in self.subarchmap:
127 print "Using target:",self.settings["target"]
128 - # self.settings["mainarch"] should now be set by our arch constructor,
129 - # so we print a nice informational message:
130 - if self.settings["mainarch"]==self.settings["hostarch"]:
131 + # print a nice informational message:
132 + if self.settings["buildarch"]==self.settings["hostarch"]:
133 print "Building natively for",self.settings["hostarch"]
135 + elif self.settings["crosscompile"]:
136 + print "Cross-compiling on",self.settings["buildarch"],"for different machine type",\
137 + self.settings["hostarch"]
139 - print "Building on",self.settings["hostarch"],"for alternate machine type",\
140 - self.settings["mainarch"]
141 + print "Building on",self.settings["buildarch"],"for alternate personality type",\
142 + self.settings["hostarch"]
144 # This should be first to be set as other set_ options depend on this
145 self.set_spec_prefix()
149 self.env["CCACHE_DIR"]="/var/tmp/ccache"
151 + def override_cbuild(self):
152 + if self.makeconf.has_key("CBUILD"):
153 + self.settings["CBUILD"]=self.makeconf["CBUILD"]
155 def override_chost(self):
156 if self.makeconf.has_key("CHOST"):
157 self.settings["CHOST"]=self.makeconf["CHOST"]
160 def chroot_setup(self):
161 self.makeconf=read_makeconf(self.settings["chroot_path"]+"/etc/make.conf")
162 - self.override_chost()
163 + self.override_cbuild()
164 + self.override_chost()
165 self.override_cflags()
166 self.override_cxxflags()
167 self.override_ldflags()
169 cmd("mv "+self.settings["chroot_path"]+"/etc/hosts "+self.settings["chroot_path"]+\
170 "/etc/hosts.bck", "Could not backup /etc/hosts",env=self.env)
171 cmd("cp /etc/hosts "+self.settings["chroot_path"]+"/etc/hosts", "Could not copy /etc/hosts",env=self.env)
172 - #self.override_chost()
173 + #self.override_cbuild()
174 + #self.override_chost()
175 #self.override_cflags()
176 #self.override_cxxflags()
177 #self.override_ldflags()
179 if self.settings.has_key("LDFLAGS"):
180 myf.write('LDFLAGS="'+self.settings["LDFLAGS"]+'"\n')
181 myf.write("# This should not be changed unless you know exactly what you are doing. You\n# should probably be using a different stage, instead.\n")
182 + if self.settings.has_key("CBUILD"):
183 + myf.write('CBUILD="'+self.settings["CBUILD"]+'"\n')
184 myf.write('CHOST="'+self.settings["CHOST"]+'"\n')
186 # Figure out what our USE vars are for building
187 @@ -1078,7 +1080,7 @@
190 for x in self.settings["action_sequence"]:
191 - print "Running action sequence: "+x
192 + print "--- Running action sequence: "+x
195 apply(getattr(self,x))
196 Index: targets/netboot/netboot-combine.sh
197 ===================================================================
198 --- targets/netboot/netboot-combine.sh (revision 1203)
199 +++ targets/netboot/netboot-combine.sh (working copy)
202 # First install the boot package that we need
204 -case ${clst_mainarch} in
205 +case ${clst_hostarch} in
210 create_normal_loop ${clst_chroot_path}/tmp/staging/initrd-${kname} ${clst_target_path} initrd-${kname}.igz
211 rm -r ${clst_chroot_path}/tmp/staging/initrd-${kname}
213 - case ${clst_mainarch} in
214 + case ${clst_hostarch} in
216 # Until aboot is patched this is broken currently.
217 # please use catalyst 1.1.5 or older
222 - #elftoaout -o /netboot-${kname}.${clst_mainarch} /usr/src/linux/vmlinux
223 - #elftoaout -o /netboot-${kname}.${clst_mainarch} /${kname}
224 - #piggy=${clst_mainarch/sparc/piggyback}
225 - #${piggy} /netboot-${kname}.${clst_mainarch} /usr/src/linux/System.map /initrd-${kname}.igz
226 + #elftoaout -o /netboot-${kname}.${clst_hostarch} /usr/src/linux/vmlinux
227 + #elftoaout -o /netboot-${kname}.${clst_hostarch} /${kname}
228 + #piggy=${clst_hostarch/sparc/piggyback}
229 + #${piggy} /netboot-${kname}.${clst_hostarch} /usr/src/linux/System.map /initrd-${kname}.igz
233 Index: targets/support/functions.sh
234 ===================================================================
235 --- targets/support/functions.sh (revision 1203)
236 +++ targets/support/functions.sh (working copy)
243 + crossdev ${clst_CHOST}
245 Index: targets/support/netboot2-final.sh
246 ===================================================================
247 --- targets/support/netboot2-final.sh (revision 1203)
248 +++ targets/support/netboot2-final.sh (working copy)
251 # Any post-processing necessary for each architecture can be done here. This
252 # may include things like sparc's elftoaout, x86's PXE boot, etc.
253 -case ${clst_mainarch} in
254 +case ${clst_hostarch} in
258 Index: targets/support/bootloader-setup.sh
259 ===================================================================
260 --- targets/support/bootloader-setup.sh (revision 1203)
261 +++ targets/support/bootloader-setup.sh (working copy)
264 default_append_line="root=/dev/ram0 init=/linuxrc ${cmdline_opts} ${custom_kopts} cdroot"
266 -case ${clst_mainarch} in
267 +case ${clst_hostarch} in
269 # NO SOFTLEVEL SUPPORT YET
270 acfg=$1/etc/aboot.conf
271 Index: targets/support/create-iso.sh
272 ===================================================================
273 --- targets/support/create-iso.sh (revision 1203)
274 +++ targets/support/create-iso.sh (working copy)
278 # Check for our CD ISO creation tools
279 -case ${clst_mainarch} in
280 +case ${clst_hostarch} in
283 cdmakerpkg="sys-boot/sgibootcd"
286 case ${clst_livecd_type} in
288 - case ${clst_mainarch} in
289 + case ${clst_hostarch} in
291 clst_iso_volume_id="Gentoo Linux - Alpha"
296 # Here we actually create the ISO images for each architecture
297 -case ${clst_mainarch} in
298 +case ${clst_hostarch} in
300 case ${clst_fstype} in
302 Index: targets/support/pre-kmerge.sh
303 ===================================================================
304 --- targets/support/pre-kmerge.sh (revision 1203)
305 +++ targets/support/pre-kmerge.sh (working copy)
307 # Setup case structure for livecd_type
308 case ${clst_livecd_type} in
309 gentoo-release-minimal | gentoo-release-universal)
310 - case ${clst_mainarch} in
311 + case ${clst_hostarch} in
313 sed -i 's/initramfs_data.cpio.gz /initramfs_data.cpio.gz -r 1024x768 /' /usr/share/genkernel/genkernel
316 sed -e "s/@@MYDATE@@/${clst_netboot2_builddate}/g" \
317 -e "s/@@RELVER@@/${clst_version_stamp}/g" \
318 ${clst_root_path}usr/share/genkernel/netboot/linuxrc.x \
319 - > ${clst_root_path}usr/share/genkernel/${clst_mainarch}/linuxrc
320 + > ${clst_root_path}usr/share/genkernel/${clst_hostarch}/linuxrc
322 echo ">>> Copying support files to ${clst_root_path} ..."
323 cp -pPRf ${clst_root_path}usr/share/genkernel/netboot/misc/* \
326 echo ">>> Copying busybox config ..."
327 - cp -f ${clst_root_path}usr/share/genkernel/${clst_mainarch}/nb-busybox.cf \
328 - ${clst_root_path}usr/share/genkernel/${clst_mainarch}/busy-config
329 + cp -f ${clst_root_path}usr/share/genkernel/${clst_hostarch}/nb-busybox.cf \
330 + ${clst_root_path}usr/share/genkernel/${clst_hostarch}/busy-config
334 ===================================================================
335 --- arch/hppa.py (revision 1203)
336 +++ arch/hppa.py (working copy)
338 "Abstract base class for all hppa builders"
339 def __init__(self,myspec):
340 builder.generic.__init__(self,myspec)
341 - self.settings["mainarch"]="hppa"
342 self.settings["CHROOT"]="chroot"
343 self.settings["CFLAGS"]="-O2 -pipe"
344 self.settings["CXXFLAGS"]="-O2 -pipe"
346 ===================================================================
347 --- arch/mips.py (revision 1203)
348 +++ arch/mips.py (working copy)
350 "Abstract base class for all mips builders [Big-endian]"
351 def __init__(self,myspec):
352 builder.generic.__init__(self,myspec)
353 - self.settings["mainarch"]="mips"
354 self.settings["CHROOT"]="chroot"
355 self.settings["CHOST"]="mips-unknown-linux-gnu"
358 "Abstract base class for all mipsel builders [Little-endian]"
359 def __init__(self,myspec):
360 builder.generic.__init__(self,myspec)
361 - self.settings["mainarch"]="mips"
362 self.settings["CHROOT"]="chroot"
363 self.settings["CHOST"]="mipsel-unknown-linux-gnu"
366 ===================================================================
367 --- arch/sparc.py (revision 1203)
368 +++ arch/sparc.py (working copy)
370 "abstract base class for all sparc builders"
371 def __init__(self,myspec):
372 builder.generic.__init__(self,myspec)
373 - self.settings["mainarch"]="sparc"
374 - if self.settings["hostarch"]=="sparc64":
375 + if self.settings["buildarch"]=="sparc64":
376 if not os.path.exists("/bin/linux32"):
377 raise CatalystError,"required /bin/linux32 executable not found (\"emerge setarch\" to fix.)"
378 self.settings["CHROOT"]="linux32 chroot"
379 + self.settings["crosscompile"] = False;
381 self.settings["CHROOT"]="chroot"
384 ===================================================================
385 --- arch/sh.py (revision 1203)
386 +++ arch/sh.py (working copy)
388 "Abstract base class for all sh builders [Little-endian]"
389 def __init__(self,myspec):
390 builder.generic.__init__(self,myspec)
391 - self.settings["mainarch"]="sh"
392 self.settings["CHROOT"]="chroot"
394 class generic_sheb(builder.generic):
395 "Abstract base class for all sheb builders [Big-endian]"
396 def __init__(self,myspec):
397 builder.generic.__init__(self,myspec)
398 - self.settings["mainarch"]="sh"
399 self.settings["CHROOT"]="chroot"
401 class arch_sh(generic_sh):
403 ===================================================================
404 --- arch/amd64.py (revision 1203)
405 +++ arch/amd64.py (working copy)
407 "abstract base class for all amd64 builders"
408 def __init__(self,myspec):
409 builder.generic.__init__(self,myspec)
410 - self.settings["mainarch"]="amd64"
411 self.settings["CHROOT"]="chroot"
413 class arch_amd64(generic_amd64):
415 ===================================================================
416 --- arch/ppc64.py (revision 1203)
417 +++ arch/ppc64.py (working copy)
419 "abstract base class for all ppc64 builders"
420 def __init__(self,myspec):
421 builder.generic.__init__(self,myspec)
422 - self.settings["mainarch"]="ppc64"
423 self.settings["CHROOT"]="chroot"
425 class arch_ppc64(generic_ppc64):
427 ===================================================================
428 --- arch/s390.py (revision 1203)
429 +++ arch/s390.py (working copy)
431 "abstract base class for all s390 builders"
432 def __init__(self,myspec):
433 builder.generic.__init__(self,myspec)
434 - self.settings["mainarch"]="s390"
435 self.settings["CHROOT"]="chroot"
437 class arch_s390(generic_s390):
439 ===================================================================
440 --- arch/arm.py (revision 1203)
441 +++ arch/arm.py (working copy)
443 "Abstract base class for all arm (little endian) builders"
444 def __init__(self,myspec):
445 builder.generic.__init__(self,myspec)
446 - self.settings["mainarch"]="arm"
447 self.settings["CHROOT"]="chroot"
448 self.settings["CFLAGS"]="-O2 -pipe"
449 self.settings["CXXFLAGS"]="-O1 -pipe"
451 "Abstract base class for all arm (big endian) builders"
452 def __init__(self,myspec):
453 builder.generic.__init__(self,myspec)
454 - self.settings["mainarch"]="arm"
455 self.settings["CHROOT"]="chroot"
456 self.settings["CFLAGS"]="-O2 -pipe"
457 self.settings["CXXFLAGS"]="-O1 -pipe"
459 ===================================================================
460 --- arch/ppc.py (revision 1203)
461 +++ arch/ppc.py (working copy)
463 "abstract base class for all ppc builders"
464 def __init__(self,myspec):
465 builder.generic.__init__(self,myspec)
466 - self.settings["mainarch"]="ppc"
467 self.settings["CHOST"]="powerpc-unknown-linux-gnu"
468 - if self.settings["hostarch"]=="ppc64":
469 + if self.settings["buildarch"]=="ppc64":
470 if not os.path.exists("/bin/linux32"):
471 raise CatalystError,"required /bin/linux32 executable not found (\"emerge setarch\" to fix."
472 self.settings["CHROOT"]="linux32 chroot"
473 + self.settings["crosscompile"] = False;
475 self.settings["CHROOT"]="chroot"
477 Index: arch/sparc64.py
478 ===================================================================
479 --- arch/sparc64.py (revision 1203)
480 +++ arch/sparc64.py (working copy)
482 "abstract base class for all sparc64 builders"
483 def __init__(self,myspec):
484 builder.generic.__init__(self,myspec)
485 - self.settings["mainarch"]="sparc64"
486 self.settings["CHROOT"]="chroot"
488 class arch_sparc64(generic_sparc64):
490 ===================================================================
491 --- arch/ia64.py (revision 1203)
492 +++ arch/ia64.py (working copy)
494 "builder class for ia64"
495 def __init__(self,myspec):
496 builder.generic.__init__(self,myspec)
497 - self.settings["mainarch"]="ia64"
498 self.settings["CHROOT"]="chroot"
499 self.settings["CFLAGS"]="-O2 -pipe"
500 self.settings["CFLAGS"]="-O2 -pipe"
502 ===================================================================
503 --- arch/alpha.py (revision 1203)
504 +++ arch/alpha.py (working copy)
506 "abstract base class for all alpha builders"
507 def __init__(self,myspec):
508 builder.generic.__init__(self,myspec)
509 - self.settings["mainarch"]="alpha"
510 self.settings["CHROOT"]="chroot"
511 self.settings["CFLAGS"]="-mieee -pipe"
514 ===================================================================
515 --- arch/x86.py (revision 1203)
516 +++ arch/x86.py (working copy)
518 "abstract base class for all x86 builders"
519 def __init__(self,myspec):
520 builder.generic.__init__(self,myspec)
521 - self.settings["mainarch"]="x86"
522 - if self.settings["hostarch"]=="amd64":
523 + if self.settings["buildarch"]=="amd64":
524 if not os.path.exists("/bin/linux32"):
525 raise CatalystError,"required /bin/linux32 executable not found (\"emerge setarch\" to fix.)"
526 self.settings["CHROOT"]="linux32 chroot"
527 + self.settings["crosscompile"] = False;
529 self.settings["CHROOT"]="chroot"