Added a patch from Mike Frysinger <vapier@gentoo.org> to support cbuild.
authorChris Gianelloni <wolf31o2@gentoo.org>
Tue, 9 Jan 2007 14:53:52 +0000 (14:53 +0000)
committerChris Gianelloni <wolf31o2@gentoo.org>
Tue, 9 Jan 2007 14:53:52 +0000 (14:53 +0000)
git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/catalyst/trunk@1206 d1e1f19c-881f-0410-ab34-b69fee027534

21 files changed:
ChangeLog
arch/alpha.py
arch/amd64.py
arch/arm.py
arch/hppa.py
arch/ia64.py
arch/mips.py
arch/ppc.py
arch/ppc64.py
arch/s390.py
arch/sh.py
arch/sparc.py
arch/sparc64.py
arch/x86.py
modules/generic_stage_target.py
targets/netboot/netboot-combine.sh
targets/support/bootloader-setup.sh
targets/support/create-iso.sh
targets/support/functions.sh
targets/support/netboot2-final.sh
targets/support/pre-kmerge.sh

index edc03fa9d53d06f11563051e0438288fe6af5511..beaa59ad59ef9c9da87e3a9949ce89bc1c98564a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,15 @@
 # Copyright 2002-2007 Gentoo Foundation; Distributed under the GPL v2
 # $Id: $
 
+  09 Jan 2007; Chris Gianelloni <wolf31o2@gentoo.org> arch/alpha.py,
+  arch/amd64.py, arch/arm.py, arch/hppa.py, arch/ia64.py, arch/mips.py,
+  arch/ppc.py, arch/ppc64.py, arch/s390.py, arch/sh.py, arch/sparc.py,
+  arch/sparc64.py, arch/x86.py, modules/generic_stage_target.py,
+  targets/netboot/netboot-combine.sh, targets/support/bootloader-setup.sh,
+  targets/support/create-iso.sh, targets/support/functions.sh,
+  targets/support/netboot2-final.sh, targets/support/pre-kmerge.sh:
+  Added a patch from Mike Frysinger <vapier@gentoo.org> to support cbuild.
+
   02 Jan 2007; Chris Gianelloni <wolf31o2@gentoo.org> README, arch/alpha.py,
   arch/amd64.py, arch/arm.py, arch/hppa.py, arch/ia64.py, arch/mips.py,
   arch/ppc.py, arch/ppc64.py, arch/s390.py, arch/sh.py, arch/sparc.py,
index acc382704f7c5184e85205d7bce63ca8e447f034..49a265d24c56460207fac8d545a474ef0d6f082a 100644 (file)
@@ -6,7 +6,6 @@ class generic_alpha(builder.generic):
        "abstract base class for all alpha builders"
        def __init__(self,myspec):
                builder.generic.__init__(self,myspec)
-               self.settings["mainarch"]="alpha"
                self.settings["CHROOT"]="chroot"
                self.settings["CFLAGS"]="-mieee -pipe"
 
index 1b1d08b3cf69923b43ae03589e9d639bd9c2d557..b652df13a36b4782b2e1711f37105d779aad9bf9 100644 (file)
@@ -5,7 +5,6 @@ class generic_amd64(builder.generic):
        "abstract base class for all amd64 builders"
        def __init__(self,myspec):
                builder.generic.__init__(self,myspec)
-               self.settings["mainarch"]="amd64"
                self.settings["CHROOT"]="chroot"
 
 class arch_amd64(generic_amd64):
index eb96dd6ee79d28c793ae9ec69736a291da6269d2..961256814ebe54e4cdc33b9f4f5b5058de92cef4 100644 (file)
@@ -6,7 +6,6 @@ class generic_arm(builder.generic):
        "Abstract base class for all arm (little endian) builders"
        def __init__(self,myspec):
                builder.generic.__init__(self,myspec)
-               self.settings["mainarch"]="arm"
                self.settings["CHROOT"]="chroot"
                self.settings["CFLAGS"]="-O2 -pipe"
                self.settings["CXXFLAGS"]="-O1 -pipe"
@@ -15,7 +14,6 @@ class generic_armeb(builder.generic):
        "Abstract base class for all arm (big endian) builders"
        def __init__(self,myspec):
                builder.generic.__init__(self,myspec)
-               self.settings["mainarch"]="arm"
                self.settings["CHROOT"]="chroot"
                self.settings["CFLAGS"]="-O2 -pipe"
                self.settings["CXXFLAGS"]="-O1 -pipe"
index 0eb2ab6d123a2cc3605fa9ca947f19423a03a028..32b694bd4035e63ca61b531bc0449d920752a80e 100644 (file)
@@ -6,7 +6,6 @@ class generic_hppa(builder.generic):
        "Abstract base class for all hppa builders"
        def __init__(self,myspec):
                builder.generic.__init__(self,myspec)
-               self.settings["mainarch"]="hppa"
                self.settings["CHROOT"]="chroot"
                self.settings["CFLAGS"]="-O2 -pipe"
                self.settings["CXXFLAGS"]="-O2 -pipe"
index 70a028ae4172e48bf0e5eb67b3c76904ec8ca6c6..64433209a1d9dc8ac2dd30b6d7da1a3e0dee3ccd 100644 (file)
@@ -6,7 +6,6 @@ class arch_ia64(builder.generic):
        "builder class for ia64"
        def __init__(self,myspec):
                builder.generic.__init__(self,myspec)
-               self.settings["mainarch"]="ia64"
                self.settings["CHROOT"]="chroot"
                self.settings["CFLAGS"]="-O2 -pipe"
                self.settings["CFLAGS"]="-O2 -pipe"
index aa72e026a9af2011330dc74b1ca43f28d00b67c0..f52d4db06d6257d379e2c5b5edeb6ad7df831020 100644 (file)
@@ -6,7 +6,6 @@ class generic_mips(builder.generic):
        "Abstract base class for all mips builders [Big-endian]"
        def __init__(self,myspec):
                builder.generic.__init__(self,myspec)
-               self.settings["mainarch"]="mips"
                self.settings["CHROOT"]="chroot"
                self.settings["CHOST"]="mips-unknown-linux-gnu"
 
@@ -14,7 +13,6 @@ class generic_mipsel(builder.generic):
        "Abstract base class for all mipsel builders [Little-endian]"
        def __init__(self,myspec):
                builder.generic.__init__(self,myspec)
-               self.settings["mainarch"]="mips"
                self.settings["CHROOT"]="chroot"
                self.settings["CHOST"]="mipsel-unknown-linux-gnu"
 
index c774434f0996f4234f2065ee5996fb6a4f770ac5..3968dd107882dca6e08616014c92058d78cb83c7 100644 (file)
@@ -11,12 +11,12 @@ class generic_ppc(builder.generic):
        "abstract base class for all ppc builders"
        def __init__(self,myspec):
                builder.generic.__init__(self,myspec)
-               self.settings["mainarch"]="ppc"
                self.settings["CHOST"]="powerpc-unknown-linux-gnu"
-               if self.settings["hostarch"]=="ppc64":
+               if self.settings["buildarch"]=="ppc64":
                        if not os.path.exists("/bin/linux32"):
                                raise CatalystError,"required /bin/linux32 executable not found (\"emerge setarch\" to fix."
                        self.settings["CHROOT"]="linux32 chroot"
+                       self.settings["crosscompile"] = False;
                else:
                        self.settings["CHROOT"]="chroot"
 
index e2cabe38b30f28346393020c6e46047292de54aa..709ebaa38d9db3bfec0cc07e5853f6568c88c0f6 100644 (file)
@@ -5,7 +5,6 @@ class generic_ppc64(builder.generic):
        "abstract base class for all ppc64 builders"
        def __init__(self,myspec):
                builder.generic.__init__(self,myspec)
-               self.settings["mainarch"]="ppc64"
                self.settings["CHROOT"]="chroot"
 
 class arch_ppc64(generic_ppc64):
index ee58e3fdae11862a63466fe28d7eff3bb2802463..1c218048c7c270fe9eccf4606ffdffc0551bd81b 100644 (file)
@@ -6,7 +6,6 @@ class generic_s390(builder.generic):
        "abstract base class for all s390 builders"
        def __init__(self,myspec):
                builder.generic.__init__(self,myspec)
-               self.settings["mainarch"]="s390"
                self.settings["CHROOT"]="chroot"
 
 class arch_s390(generic_s390):
index 473568b544cf844d8879ca829e516858dfc162c2..dc5fbc1818bbbaa7c4ae9518c87aa3f13a02fcec 100644 (file)
@@ -6,14 +6,12 @@ class generic_sh(builder.generic):
        "Abstract base class for all sh builders [Little-endian]"
        def __init__(self,myspec):
                builder.generic.__init__(self,myspec)
-               self.settings["mainarch"]="sh"
                self.settings["CHROOT"]="chroot"
 
 class generic_sheb(builder.generic):
        "Abstract base class for all sheb builders [Big-endian]"
        def __init__(self,myspec):
                builder.generic.__init__(self,myspec)
-               self.settings["mainarch"]="sh"
                self.settings["CHROOT"]="chroot"
 
 class arch_sh(generic_sh):
index d0449049d1bdd0483eb2aba5171c912842aed552..d3f311f90c65e461561e1a198f8e19b024b69a46 100644 (file)
@@ -6,11 +6,11 @@ class generic_sparc(builder.generic):
        "abstract base class for all sparc builders"
        def __init__(self,myspec):
                builder.generic.__init__(self,myspec)
-               self.settings["mainarch"]="sparc"
-               if self.settings["hostarch"]=="sparc64":
+               if self.settings["buildarch"]=="sparc64":
                        if not os.path.exists("/bin/linux32"):
                                raise CatalystError,"required /bin/linux32 executable not found (\"emerge setarch\" to fix.)"
                        self.settings["CHROOT"]="linux32 chroot"
+                       self.settings["crosscompile"] = False;
                else:
                        self.settings["CHROOT"]="chroot"
 
index c94b43eeec802dc4fdb9d016260f4376c47347a7..d72da92a932e400bd51ccb42f31189869bf5bb0a 100644 (file)
@@ -6,7 +6,6 @@ class generic_sparc64(builder.generic):
        "abstract base class for all sparc64 builders"
        def __init__(self,myspec):
                builder.generic.__init__(self,myspec)
-               self.settings["mainarch"]="sparc64"
                self.settings["CHROOT"]="chroot"
 
 class arch_sparc64(generic_sparc64):
index bab9dbe276dfa9c93067e260400090d7c160110f..4b675e22c28f5252fee3a5f3caf35d3d78beb473 100644 (file)
@@ -6,11 +6,11 @@ class generic_x86(builder.generic):
        "abstract base class for all x86 builders"
        def __init__(self,myspec):
                builder.generic.__init__(self,myspec)
-               self.settings["mainarch"]="x86"
-               if self.settings["hostarch"]=="amd64":
+               if self.settings["buildarch"]=="amd64":
                        if not os.path.exists("/bin/linux32"):
                                raise CatalystError,"required /bin/linux32 executable not found (\"emerge setarch\" to fix.)"
                        self.settings["CHROOT"]="linux32 chroot"
+                       self.settings["crosscompile"] = False;
                else:
                        self.settings["CHROOT"]="chroot"
 
index 01775834148dda8d553843e7b56db843aa1166b8..1bd15997bf843798d74b999208e72698170d44d4 100644 (file)
@@ -17,40 +17,21 @@ class generic_stage_target(generic_target):
                
                self.valid_values.extend(["version_stamp","target","subarch",\
                        "rel_type","profile","snapshot","source_subpath","portage_confdir",\
-                       "cflags","cxxflags","ldflags","chost","hostuse","portage_overlay",\
+                       "cflags","cxxflags","ldflags","cbuild","chost","hostuse","portage_overlay",\
                        "distcc_hosts","makeopts","pkgcache_path","kerncache_path"])
                
                self.set_valid_build_kernel_vars(addlargs)
                generic_target.__init__(self,myspec,addlargs)
-               # map the mainarch we are running under to the mainarches we support for
-               # building stages and LiveCDs. (for example, on amd64, we can build
-               # stages for x86 or amd64.
-               targetmap={     
-                               "x86" : ["x86"],
-                               "amd64" : ["x86","amd64"],
-                               "sparc64" : ["sparc","sparc64"],
-                               "ia64" : ["ia64"],
-                               "alpha" : ["alpha"],
-                               "sparc" : ["sparc"],
-                               "sh" : ["sh"],
-                               "s390" : ["s390"],
-                               "ppc" : ["ppc"],
-                               "ppc64" : ["ppc","ppc64"],
-                               "hppa" : ["hppa"],
-                               "mips" : ["mips"],
-                               "arm" : ["arm"]
-               }
-               
-               machinemap={    
+               machinemap={
                                "i386" : "x86",
                                "i486" : "x86",
                                "i586" : "x86",
                                "i686" : "x86",
                                "x86_64" : "amd64",
+                               "sparc" : "sparc",
                                "sparc64" : "sparc64",
                                "ia64" : "ia64",
                                "alpha" : "alpha",
-                               "sparc" : "sparc",
                                "sh2" : "sh",
                                "sh3" : "sh",
                                "sh4" : "sh",
@@ -60,8 +41,12 @@ class generic_stage_target(generic_target):
                                "s390" : "s390",
                                "ppc" : "ppc",
                                "ppc64" : "ppc64",
-                               "parisc" : "hppa",
-                               "parisc64" : "hppa",
+                               "powerpc" : "powerpc",
+                               "powerpc64" : "powerpc64",
+                               "parisc" : "parisc",
+                               "parisc64" : "parisc",
+                               "hppa" : "hppa",
+                               "hppa64" : "hppa",
                                "mips" : "mips",
                                "mips64" : "mips",
                                "arm" : "arm",
@@ -70,31 +55,38 @@ class generic_stage_target(generic_target):
                                "armv5b" : "arm"
                }
                
-               mymachine=os.uname()[4]
-               if not machinemap.has_key(mymachine):
-                       raise CatalystError, "Unknown machine type "+mymachine
-                       
-               self.settings["hostarch"]=machinemap[mymachine]
-               self.archmap={}
-               self.subarchmap={}
+               if self.settings.has_key("chost"):
+                       hostmachine = self.settings["chost"].split("-")[0]
+               else:
+                       hostmachine = os.uname()[4]
+               if not machinemap.has_key(hostmachine):
+                       raise CatalystError, "Unknown host machine type "+hostmachine
+               self.settings["hostarch"] = machinemap[hostmachine]
+               if self.settings.has_key("cbuild"):
+                       buildmachine = self.settings["cbuild"].split("-")[0]
+               else:
+                       buildmachine = os.uname()[4]
+               if not machinemap.has_key(buildmachine):
+                       raise CatalystError, "Unknown build machine type "+buildmachine
+               self.settings["buildarch"] = machinemap[buildmachine]
+               self.settings["crosscompile"] = (self.settings["hostarch"] != self.settings["buildarch"])
+               self.archmap = {}
+               self.subarchmap = {}
                
-               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]
-                               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
-                               self.archmap[x].register(self.subarchmap)
-                               fh.close()      
-                       
-                       except IOError:
-                               msg("Can't find "+x+".py plugin in "+self.settings["sharedir"]+"/arch/")
+               x = 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]
+                       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
+                       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
                try:
                        self.arch=self.subarchmap[self.settings["subarch"]](self.settings)
-                except:
+               except:
                        print "Invalid subarch: "+self.settings["subarch"]
                        print "Choose one of the following:",
                        for x in self.subarchmap:
@@ -103,14 +95,16 @@ class generic_stage_target(generic_target):
                        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:
-               if self.settings["mainarch"]==self.settings["hostarch"]:
+               # print a nice informational message:
+               if self.settings["buildarch"]==self.settings["hostarch"]:
                        print "Building natively for",self.settings["hostarch"]
-               
+               elif self.settings["crosscompile"]:
+                       print "Cross-compiling on",self.settings["buildarch"],"for different machine type",\
+                               self.settings["hostarch"]
                else:
-                       print "Building on",self.settings["hostarch"],"for alternate machine type",\
-                               self.settings["mainarch"]
+                       print "Building on",self.settings["buildarch"],"for alternate personality type",\
+                               self.settings["hostarch"]
+
                # This should be first to be set as other set_ options depend on this
                self.set_spec_prefix()
                
@@ -204,6 +198,10 @@ class generic_stage_target(generic_target):
                        # for the chroot:
                        self.env["CCACHE_DIR"]="/var/tmp/ccache"        
 
+       def override_cbuild(self):
+               if self.makeconf.has_key("CBUILD"):
+                       self.settings["CBUILD"]=self.makeconf["CBUILD"]
+
        def override_chost(self):
                if self.makeconf.has_key("CHOST"):
                        self.settings["CHOST"]=self.makeconf["CHOST"]
@@ -831,7 +829,8 @@ class generic_stage_target(generic_target):
 
        def chroot_setup(self):
                self.makeconf=read_makeconf(self.settings["chroot_path"]+"/etc/make.conf")
-               self.override_chost()   
+               self.override_cbuild()
+               self.override_chost()
                self.override_cflags()
                self.override_cxxflags()        
                self.override_ldflags() 
@@ -868,7 +867,8 @@ class generic_stage_target(generic_target):
                                cmd("mv "+self.settings["chroot_path"]+"/etc/hosts "+self.settings["chroot_path"]+\
                                        "/etc/hosts.bck", "Could not backup /etc/hosts",env=self.env)
                                cmd("cp /etc/hosts "+self.settings["chroot_path"]+"/etc/hosts", "Could not copy /etc/hosts",env=self.env)
-                       #self.override_chost()  
+                       #self.override_cbuild()
+                       #self.override_chost()
                        #self.override_cflags()
                        #self.override_cxxflags()       
                        #self.override_ldflags()        
@@ -887,6 +887,8 @@ class generic_stage_target(generic_target):
                        if self.settings.has_key("LDFLAGS"):
                                myf.write('LDFLAGS="'+self.settings["LDFLAGS"]+'"\n')
                        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")
+                       if self.settings.has_key("CBUILD"):
+                               myf.write('CBUILD="'+self.settings["CBUILD"]+'"\n')
                        myf.write('CHOST="'+self.settings["CHOST"]+'"\n')
                    
                    # Figure out what our USE vars are for building
@@ -1077,7 +1079,7 @@ class generic_stage_target(generic_target):
                         self.purge()
 
                for x in self.settings["action_sequence"]:
-                       print "Running action sequence: "+x
+                       print "--- Running action sequence: "+x
                        sys.stdout.flush()
                        try:
                                apply(getattr(self,x))
index 7663f5b8991fe3dc7e60d760cb45c417174c1fd0..df5d49b2cf706a97f80d918359507374ddc3209e 100644 (file)
@@ -14,7 +14,7 @@ export FEATURES="${clst_myfeatures}"
 
 # First install the boot package that we need
 booter=""
-case ${clst_mainarch} in
+case ${clst_hostarch} in
        alpha)
                booter=""
        ;;
@@ -50,7 +50,7 @@ do
        create_normal_loop ${clst_chroot_path}/tmp/staging/initrd-${kname} ${clst_target_path} initrd-${kname}.igz
        rm -r ${clst_chroot_path}/tmp/staging/initrd-${kname}
 
-       case ${clst_mainarch} in
+       case ${clst_hostarch} in
                alpha)
                        # Until aboot is patched this is broken currently.
                        # please use catalyst 1.1.5 or older
@@ -92,10 +92,10 @@ do
                        ;;
                sparc*)
                        #TEST TEST TEST TEST
-                       #elftoaout -o /netboot-${kname}.${clst_mainarch} /usr/src/linux/vmlinux
-                       #elftoaout -o /netboot-${kname}.${clst_mainarch} /${kname}
-                       #piggy=${clst_mainarch/sparc/piggyback}
-                       #${piggy} /netboot-${kname}.${clst_mainarch} /usr/src/linux/System.map /initrd-${kname}.igz
+                       #elftoaout -o /netboot-${kname}.${clst_hostarch} /usr/src/linux/vmlinux
+                       #elftoaout -o /netboot-${kname}.${clst_hostarch} /${kname}
+                       #piggy=${clst_hostarch/sparc/piggyback}
+                       #${piggy} /netboot-${kname}.${clst_hostarch} /usr/src/linux/System.map /initrd-${kname}.igz
                        ;;
                x86)
                        mknbi-linux \
index 028565fadbc833a1d8179e1426f5129e66746aac..5377c8c1ebc538d389295ac711b59976bdf96c60 100755 (executable)
@@ -12,7 +12,7 @@ check_filesystem_type
 
 default_append_line="root=/dev/ram0 init=/linuxrc ${cmdline_opts} ${custom_kopts} cdroot"
 
-case ${clst_mainarch} in
+case ${clst_hostarch} in
        alpha)
                # NO SOFTLEVEL SUPPORT YET
                acfg=$1/etc/aboot.conf
index 9d2062e3f46b9181a4f9de541241ab2724982ef8..1999668f287383b4d88cc8e7eba7389874a4b168 100755 (executable)
@@ -6,7 +6,7 @@
 ## START RUNSCRIPT
 
 # Check for our CD ISO creation tools
-case ${clst_mainarch} in
+case ${clst_hostarch} in
        mips)
                cdmaker="sgibootcd"
                cdmakerpkg="sys-boot/sgibootcd"
@@ -27,7 +27,7 @@ if [ -z "${clst_iso_volume_id}" ]
 then
        case ${clst_livecd_type} in
                gentoo-*)
-                       case ${clst_mainarch} in
+                       case ${clst_hostarch} in
                                alpha)
                                        clst_iso_volume_id="Gentoo Linux - Alpha"
                                ;;
@@ -75,7 +75,7 @@ then
 fi
 
 # Here we actually create the ISO images for each architecture
-case ${clst_mainarch} in
+case ${clst_hostarch} in
        alpha)
                case ${clst_fstype} in
                        zisofs)
index 18984d280e6dd2a41de319c053f3d5c70c76576f..34bd98b4bdb6cc3a647f6d7e0975449949123524 100755 (executable)
@@ -211,3 +211,7 @@ check_filesystem_type(){
                ;;
        esac
 }                                                                                                                                                                                                                              
+
+run_crossdev() {
+       crossdev ${clst_CHOST}
+}
index dbe56f487e025a71a934c4d270cfb070d594243e..48a6747224a19ac30f28cc7cdecd773b8192d734 100755 (executable)
@@ -20,7 +20,7 @@ rmdir ${clst_target_path}boot
 
 # Any post-processing necessary for each architecture can be done here.  This
 # may include things like sparc's elftoaout, x86's PXE boot, etc.
-case ${clst_mainarch} in
+case ${clst_hostarch} in
        alpha)
                sleep 0
                ;;
index 3503ab49af1e87624c4ac158c5a637a037b1b2b0..2b7544ffa1e634b2d29fbfc964537f3ec31136d3 100755 (executable)
@@ -13,7 +13,7 @@ case ${clst_target} in
                # Setup case structure for livecd_type
                case ${clst_livecd_type} in
                        gentoo-release-minimal | gentoo-release-universal)
-                               case ${clst_mainarch} in
+                               case ${clst_hostarch} in
                                        amd64|x86)
                                                sed -i 's/initramfs_data.cpio.gz /initramfs_data.cpio.gz -r 1024x768 /' /usr/share/genkernel/genkernel
                                        ;;
@@ -32,14 +32,14 @@ case ${clst_target} in
                sed -e "s/@@MYDATE@@/${clst_netboot2_builddate}/g" \
                    -e "s/@@RELVER@@/${clst_version_stamp}/g" \
                        ${clst_root_path}usr/share/genkernel/netboot/linuxrc.x \
-                               > ${clst_root_path}usr/share/genkernel/${clst_mainarch}/linuxrc
+                               > ${clst_root_path}usr/share/genkernel/${clst_hostarch}/linuxrc
 
                echo ">>> Copying support files to ${clst_root_path} ..."
                cp -pPRf ${clst_root_path}usr/share/genkernel/netboot/misc/* \
                        ${clst_merge_path}
 
                echo ">>> Copying busybox config ..."
-               cp -f ${clst_root_path}usr/share/genkernel/${clst_mainarch}/nb-busybox.cf \
-                       ${clst_root_path}usr/share/genkernel/${clst_mainarch}/busy-config
+               cp -f ${clst_root_path}usr/share/genkernel/${clst_hostarch}/nb-busybox.cf \
+                       ${clst_root_path}usr/share/genkernel/${clst_hostarch}/busy-config
        ;;
 esac