public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/catalyst:master commit in: catalyst/, catalyst/arch/
@ 2015-10-08 17:19 Mike Frysinger
  0 siblings, 0 replies; 2+ messages in thread
From: Mike Frysinger @ 2015-10-08 17:19 UTC (permalink / raw
  To: gentoo-commits

commit:     c9bba40c088befd40cc14763622049d40a11b1fd
Author:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Tue Oct  6 17:48:19 2015 +0000
Commit:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Tue Oct  6 17:48:19 2015 +0000
URL:        https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=c9bba40c

arch: hoist default CHROOT setting up

Rather than require every arch to set CHROOT=chroot by default, let the
generic core do it.

 catalyst/arch/alpha.py   | 1 -
 catalyst/arch/amd64.py   | 1 -
 catalyst/arch/arm.py     | 2 --
 catalyst/arch/arm64.py   | 1 -
 catalyst/arch/hppa.py    | 1 -
 catalyst/arch/ia64.py    | 1 -
 catalyst/arch/m68k.py    | 1 -
 catalyst/arch/mips.py    | 4 ----
 catalyst/arch/powerpc.py | 3 ---
 catalyst/arch/s390.py    | 2 --
 catalyst/arch/sh.py      | 2 --
 catalyst/arch/sparc.py   | 3 ---
 catalyst/arch/x86.py     | 2 --
 catalyst/builder.py      | 1 +
 14 files changed, 1 insertion(+), 24 deletions(-)

diff --git a/catalyst/arch/alpha.py b/catalyst/arch/alpha.py
index 01b6382..a4e7caf 100644
--- a/catalyst/arch/alpha.py
+++ b/catalyst/arch/alpha.py
@@ -7,7 +7,6 @@ class generic_alpha(builder.generic):
 	"abstract base class for all alpha builders"
 	def __init__(self,myspec):
 		builder.generic.__init__(self,myspec)
-		self.settings["CHROOT"]="chroot"
 		self.settings["CFLAGS"]="-mieee -pipe"
 
 class arch_alpha(generic_alpha):

diff --git a/catalyst/arch/amd64.py b/catalyst/arch/amd64.py
index 463e8f5..1d9db0e 100644
--- a/catalyst/arch/amd64.py
+++ b/catalyst/arch/amd64.py
@@ -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["CHROOT"]="chroot"
 
 class arch_amd64(generic_amd64):
 	"builder class for generic amd64 (Intel and AMD)"

diff --git a/catalyst/arch/arm.py b/catalyst/arch/arm.py
index c0d322c..05146f1 100644
--- a/catalyst/arch/arm.py
+++ b/catalyst/arch/arm.py
@@ -6,14 +6,12 @@ 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["CHROOT"]="chroot"
 		self.settings["CFLAGS"]="-O2 -pipe"
 
 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["CHROOT"]="chroot"
 		self.settings["CFLAGS"]="-O2 -pipe"
 
 class arch_arm(generic_arm):

diff --git a/catalyst/arch/arm64.py b/catalyst/arch/arm64.py
index 00e7527..c12a0a0 100644
--- a/catalyst/arch/arm64.py
+++ b/catalyst/arch/arm64.py
@@ -5,7 +5,6 @@ class arch_arm64(builder.generic):
 	"builder class for arm64"
 	def __init__(self,myspec):
 		builder.generic.__init__(self,myspec)
-		self.settings["CHROOT"]="chroot"
 		self.settings["CFLAGS"]="-O2 -pipe"
 		self.settings["CFLAGS"]="-O2 -pipe"
 		self.settings["CHOST"]="aarch64-unknown-linux-gnu"

diff --git a/catalyst/arch/hppa.py b/catalyst/arch/hppa.py
index c5589c4..6e96909 100644
--- a/catalyst/arch/hppa.py
+++ b/catalyst/arch/hppa.py
@@ -5,7 +5,6 @@ class generic_hppa(builder.generic):
 	"Abstract base class for all hppa builders"
 	def __init__(self,myspec):
 		builder.generic.__init__(self,myspec)
-		self.settings["CHROOT"]="chroot"
 		self.settings["CFLAGS"]="-O2 -pipe"
 		self.settings["CXXFLAGS"]="-O2 -pipe"
 

diff --git a/catalyst/arch/ia64.py b/catalyst/arch/ia64.py
index 3f06040..de0ec9e 100644
--- a/catalyst/arch/ia64.py
+++ b/catalyst/arch/ia64.py
@@ -5,7 +5,6 @@ class arch_ia64(builder.generic):
 	"builder class for ia64"
 	def __init__(self,myspec):
 		builder.generic.__init__(self,myspec)
-		self.settings["CHROOT"]="chroot"
 		self.settings["CFLAGS"]="-O2 -pipe"
 		self.settings["CFLAGS"]="-O2 -pipe"
 		self.settings["CHOST"]="ia64-unknown-linux-gnu"

diff --git a/catalyst/arch/m68k.py b/catalyst/arch/m68k.py
index c9f194b..9fc1083 100644
--- a/catalyst/arch/m68k.py
+++ b/catalyst/arch/m68k.py
@@ -5,7 +5,6 @@ class generic_m68k(builder.generic):
 	"abstract base class for all m68k builders"
 	def __init__(self,myspec):
 		builder.generic.__init__(self,myspec)
-		self.settings["CHROOT"]="chroot"
 		self.settings["CFLAGS"]=" -pipe"
 
 class arch_m68k(generic_m68k):

diff --git a/catalyst/arch/mips.py b/catalyst/arch/mips.py
index 5416d22..9682bf2 100644
--- a/catalyst/arch/mips.py
+++ b/catalyst/arch/mips.py
@@ -5,28 +5,24 @@ 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["CHROOT"]="chroot"
 		self.settings["CHOST"]="mips-unknown-linux-gnu"
 
 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["CHROOT"]="chroot"
 		self.settings["CHOST"]="mipsel-unknown-linux-gnu"
 
 class generic_mips64(builder.generic):
 	"Abstract base class for all mips64 builders [Big-endian]"
 	def __init__(self,myspec):
 		builder.generic.__init__(self,myspec)
-		self.settings["CHROOT"]="chroot"
 		self.settings["CHOST"]="mips64-unknown-linux-gnu"
 
 class generic_mips64el(builder.generic):
 	"Abstract base class for all mips64el builders [Little-endian]"
 	def __init__(self,myspec):
 		builder.generic.__init__(self,myspec)
-		self.settings["CHROOT"]="chroot"
 		self.settings["CHOST"]="mips64el-unknown-linux-gnu"
 
 class arch_mips1(generic_mips):

diff --git a/catalyst/arch/powerpc.py b/catalyst/arch/powerpc.py
index fb98316..0c4861f 100644
--- a/catalyst/arch/powerpc.py
+++ b/catalyst/arch/powerpc.py
@@ -15,14 +15,11 @@ class generic_ppc(builder.generic):
 					"(\"emerge setarch\" to fix.)", print_traceback=True)
 			self.settings["CHROOT"]="linux32 chroot"
 			self.settings["crosscompile"] = False
-		else:
-			self.settings["CHROOT"]="chroot"
 
 class generic_ppc64(builder.generic):
 	"abstract base class for all 64-bit powerpc builders"
 	def __init__(self,myspec):
 		builder.generic.__init__(self,myspec)
-		self.settings["CHROOT"]="chroot"
 
 class arch_ppc(generic_ppc):
 	"builder class for generic powerpc"

diff --git a/catalyst/arch/s390.py b/catalyst/arch/s390.py
index f2cf80d..8ff287b 100644
--- a/catalyst/arch/s390.py
+++ b/catalyst/arch/s390.py
@@ -5,13 +5,11 @@ class generic_s390(builder.generic):
 	"abstract base class for all s390 builders"
 	def __init__(self,myspec):
 		builder.generic.__init__(self,myspec)
-		self.settings["CHROOT"]="chroot"
 
 class generic_s390x(builder.generic):
 	"abstract base class for all s390x builders"
 	def __init__(self,myspec):
 		builder.generic.__init__(self,myspec)
-		self.settings["CHROOT"]="chroot"
 
 class arch_s390(generic_s390):
 	"builder class for generic s390"

diff --git a/catalyst/arch/sh.py b/catalyst/arch/sh.py
index 64d6e0e..fdf3974 100644
--- a/catalyst/arch/sh.py
+++ b/catalyst/arch/sh.py
@@ -5,13 +5,11 @@ 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["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["CHROOT"]="chroot"
 
 class arch_sh(generic_sh):
 	"Builder class for SH [Little-endian]"

diff --git a/catalyst/arch/sparc.py b/catalyst/arch/sparc.py
index ec69386..39f50ca 100644
--- a/catalyst/arch/sparc.py
+++ b/catalyst/arch/sparc.py
@@ -14,14 +14,11 @@ class generic_sparc(builder.generic):
 					"(\"emerge setarch\" to fix.)", print_traceback=True)
 			self.settings["CHROOT"]="linux32 chroot"
 			self.settings["crosscompile"] = False
-		else:
-			self.settings["CHROOT"]="chroot"
 
 class generic_sparc64(builder.generic):
 	"abstract base class for all sparc64 builders"
 	def __init__(self,myspec):
 		builder.generic.__init__(self,myspec)
-		self.settings["CHROOT"]="chroot"
 
 class arch_sparc(generic_sparc):
 	"builder class for generic sparc (sun4cdm)"

diff --git a/catalyst/arch/x86.py b/catalyst/arch/x86.py
index 33b29c0..0d6a9ad 100644
--- a/catalyst/arch/x86.py
+++ b/catalyst/arch/x86.py
@@ -14,8 +14,6 @@ class generic_x86(builder.generic):
 					"(\"emerge setarch\" to fix.)", print_traceback=True)
 			self.settings["CHROOT"]="linux32 chroot"
 			self.settings["crosscompile"] = False
-		else:
-			self.settings["CHROOT"]="chroot"
 
 class arch_x86(generic_x86):
 	"builder class for generic x86 (386+)"

diff --git a/catalyst/builder.py b/catalyst/builder.py
index 3ba86c8..adaea90 100644
--- a/catalyst/builder.py
+++ b/catalyst/builder.py
@@ -2,6 +2,7 @@
 class generic(object):
 	def __init__(self,myspec):
 		self.settings=myspec
+		self.settings.setdefault('CHROOT', 'chroot')
 
 	def mount_safety_check(self):
 		"""


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [gentoo-commits] proj/catalyst:master commit in: catalyst/, catalyst/arch/
@ 2015-10-08 17:19 Mike Frysinger
  0 siblings, 0 replies; 2+ messages in thread
From: Mike Frysinger @ 2015-10-08 17:19 UTC (permalink / raw
  To: gentoo-commits

commit:     710593e8a0f48213ed53057ca025486378d6e862
Author:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Tue Oct  6 17:55:04 2015 +0000
Commit:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Tue Oct  6 17:55:04 2015 +0000
URL:        https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=710593e8

arch: add helper for working w/setarch

The util-linux package has included setarch now for years, so there's
no need to check for the old linux32 program names.

Add a helper for setting up the chroot variable to the right target
that the arch wants.  This can expand in the future for other arch
combos.

 catalyst/arch/powerpc.py | 8 +-------
 catalyst/arch/sparc.py   | 8 +-------
 catalyst/arch/x86.py     | 8 +-------
 catalyst/builder.py      | 7 +++++++
 4 files changed, 10 insertions(+), 21 deletions(-)

diff --git a/catalyst/arch/powerpc.py b/catalyst/arch/powerpc.py
index 0c4861f..7f4194e 100644
--- a/catalyst/arch/powerpc.py
+++ b/catalyst/arch/powerpc.py
@@ -1,8 +1,5 @@
 
-import os
-
 from catalyst import builder
-from catalyst.support import CatalystError
 
 class generic_ppc(builder.generic):
 	"abstract base class for all 32-bit powerpc builders"
@@ -10,10 +7,7 @@ class generic_ppc(builder.generic):
 		builder.generic.__init__(self,myspec)
 		self.settings["CHOST"]="powerpc-unknown-linux-gnu"
 		if self.settings["buildarch"]=="ppc64":
-			if not os.path.exists("/bin/linux32") and not os.path.exists("/usr/bin/linux32"):
-				raise CatalystError("required executable linux32 not found "
-					"(\"emerge setarch\" to fix.)", print_traceback=True)
-			self.settings["CHROOT"]="linux32 chroot"
+			self.setarch('linux32')
 			self.settings["crosscompile"] = False
 
 class generic_ppc64(builder.generic):

diff --git a/catalyst/arch/sparc.py b/catalyst/arch/sparc.py
index 39f50ca..174d0a9 100644
--- a/catalyst/arch/sparc.py
+++ b/catalyst/arch/sparc.py
@@ -1,18 +1,12 @@
 
-import os
-
 from catalyst import builder
-from catalyst.support import CatalystError
 
 class generic_sparc(builder.generic):
 	"abstract base class for all sparc builders"
 	def __init__(self,myspec):
 		builder.generic.__init__(self,myspec)
 		if self.settings["buildarch"]=="sparc64":
-			if not os.path.exists("/bin/linux32") and not os.path.exists("/usr/bin/linux32"):
-				raise CatalystError("required executable linux32 not found "
-					"(\"emerge setarch\" to fix.)", print_traceback=True)
-			self.settings["CHROOT"]="linux32 chroot"
+			self.setarch('linux32')
 			self.settings["crosscompile"] = False
 
 class generic_sparc64(builder.generic):

diff --git a/catalyst/arch/x86.py b/catalyst/arch/x86.py
index 0d6a9ad..118d5ce 100644
--- a/catalyst/arch/x86.py
+++ b/catalyst/arch/x86.py
@@ -1,18 +1,12 @@
 
-import os
-
 from catalyst import builder
-from catalyst.support import CatalystError
 
 class generic_x86(builder.generic):
 	"abstract base class for all x86 builders"
 	def __init__(self,myspec):
 		builder.generic.__init__(self,myspec)
 		if self.settings["buildarch"]=="amd64":
-			if not os.path.exists("/bin/linux32") and not os.path.exists("/usr/bin/linux32"):
-				raise CatalystError("required executable linux32 not found "
-					"(\"emerge setarch\" to fix.)", print_traceback=True)
-			self.settings["CHROOT"]="linux32 chroot"
+			self.setarch('linux32')
 			self.settings["crosscompile"] = False
 
 class arch_x86(generic_x86):

diff --git a/catalyst/builder.py b/catalyst/builder.py
index adaea90..7380cac 100644
--- a/catalyst/builder.py
+++ b/catalyst/builder.py
@@ -4,6 +4,13 @@ class generic(object):
 		self.settings=myspec
 		self.settings.setdefault('CHROOT', 'chroot')
 
+	def setarch(self, arch):
+		"""Set the chroot wrapper to run through `setarch |arch|`
+
+		Useful for building x86-on-amd64 and such.
+		"""
+		self.settings['CHROOT'] = 'setarch %s %s' % (arch, self.settings['CHROOT'])
+
 	def mount_safety_check(self):
 		"""
 		Make sure that no bind mounts exist in chrootdir (to use before


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-10-08 17:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-08 17:19 [gentoo-commits] proj/catalyst:master commit in: catalyst/, catalyst/arch/ Mike Frysinger
  -- strict thread matches above, loose matches on Subject: below --
2015-10-08 17:19 Mike Frysinger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox