summaryrefslogtreecommitdiffstats
path: root/iutil.py
diff options
context:
space:
mode:
authorJeremy Katz <katzj@redhat.com>2003-08-13 23:30:32 +0000
committerJeremy Katz <katzj@redhat.com>2003-08-13 23:30:32 +0000
commit8fb83ba30befb70761a777d203c2c4e363ed9081 (patch)
tree1bc1ec256cd5e6dd064c29dcdebe9d94edba825a /iutil.py
parent180fce53541cb6021ef54b127427312633bc5809 (diff)
downloadanaconda-8fb83ba30befb70761a777d203c2c4e363ed9081.tar.gz
anaconda-8fb83ba30befb70761a777d203c2c4e363ed9081.tar.xz
anaconda-8fb83ba30befb70761a777d203c2c4e363ed9081.zip
if you boot with rpmarch=i586 (or similar), use that as the
architecture (#101971) yes, you can shoot yourself in the foot with this.
Diffstat (limited to 'iutil.py')
-rw-r--r--iutil.py18
1 files changed, 15 insertions, 3 deletions
diff --git a/iutil.py b/iutil.py
index 33e7d547a..76fb330d0 100644
--- a/iutil.py
+++ b/iutil.py
@@ -611,16 +611,28 @@ def writeRpmPlatform(root="/"):
return
if not os.access("%s/etc/rpm" %(root,), os.X_OK):
os.mkdir("%s/etc/rpm" %(root,))
+
+ myarch = rhpl.arch.canonArch
+
+ # now allow an override with rpmarch=i586 on the command line (#101971)
+ f = open("/proc/cmdline", "r")
+ buf = f.read()
+ f.close()
+ args = buf.split(" ")
+ for arg in args:
+ if arg.startswith("rpmarch="):
+ myarch = arg[8:]
+
f = open("%s/etc/rpm/platform" %(root,), 'w+')
- f.write("%s-redhat-linux\n" %(rhpl.arch.canonArch,))
+ f.write("%s-redhat-linux\n" %(myarch,))
f.close()
# FIXME: writing /etc/rpm/macros feels wrong somehow
# temporary workaround for #92285
if os.access("%s/etc/rpm/macros" %(root,), os.R_OK):
return
- if not (rhpl.arch.canonArch.startswith("ppc64") or
- rhpl.arch.canonArch in ("s390x", "sparc64", "x86_64", "ia64")):
+ if not (myarch.startswith("ppc64") or
+ myarch in ("s390x", "sparc64", "x86_64", "ia64")):
return
f = open("%s/etc/rpm/macros" %(root,), 'w+')
f.write("%_transaction_color 3\n")