diff options
author | Jeremy Katz <katzj@redhat.com> | 2003-08-13 23:30:32 +0000 |
---|---|---|
committer | Jeremy Katz <katzj@redhat.com> | 2003-08-13 23:30:32 +0000 |
commit | 8fb83ba30befb70761a777d203c2c4e363ed9081 (patch) | |
tree | 1bc1ec256cd5e6dd064c29dcdebe9d94edba825a | |
parent | 180fce53541cb6021ef54b127427312633bc5809 (diff) | |
download | anaconda-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.
-rw-r--r-- | iutil.py | 18 |
1 files changed, 15 insertions, 3 deletions
@@ -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") |