diff options
author | Chris Lumens <clumens@redhat.com> | 2011-11-10 11:32:11 -0500 |
---|---|---|
committer | Chris Lumens <clumens@redhat.com> | 2011-11-10 15:50:41 -0500 |
commit | 732558a85699676d8c2975e8ed891eb07bcd77bc (patch) | |
tree | 7f240ccadcf77958e90708e14be86993c666df05 | |
parent | 6cbc5d09cdc844a56b408fc8ba10da9946f80b1a (diff) | |
download | anaconda-732558a85699676d8c2975e8ed891eb07bcd77bc.tar.gz anaconda-732558a85699676d8c2975e8ed891eb07bcd77bc.tar.xz anaconda-732558a85699676d8c2975e8ed891eb07bcd77bc.zip |
Don't use the rpmdb to figure out upgrade target arch (#748119).
This will fail if /var is on a separate partition, since we do not have
the logic to mount additional partitions at this point. Instead, just
run a chrooted /bin/arch which should always succeed.
-rw-r--r-- | pyanaconda/storage/__init__.py | 25 |
1 files changed, 5 insertions, 20 deletions
diff --git a/pyanaconda/storage/__init__.py b/pyanaconda/storage/__init__.py index 470107437..079a3b876 100644 --- a/pyanaconda/storage/__init__.py +++ b/pyanaconda/storage/__init__.py @@ -1460,28 +1460,13 @@ class Storage(object): return 0 def getReleaseString(): - relArch = None relName = None relVer = None - import rpm - iutil.resetRpmDb() - ts = rpm.TransactionSet(ROOT_PATH) - - # We get the arch from the initscripts package, but the version and name - # must come from reading the release file. try: - # pylint: disable-msg=E1101 - mi = ts.dbMatch('provides', 'initscripts') - except Exception: - # This could happen in a variety of cases, but the biggest one is we're - # examining an installed system that doesn't use RPM. Raise an - # exception for the caller to handle. - raise ValueError - - for h in mi: - relArch = h['arch'] - break + relArch = iutil.execWithCapture("arch", [], root=ROOT_PATH).strip() + except: + relArch = None filename = "%s/etc/redhat-release" % ROOT_PATH if os.access(filename, os.R_OK): @@ -1548,8 +1533,8 @@ def findExistingRootDevices(anaconda, upgradeany=False): device.teardown(recursive=True) if arch is None: - # we failed to determine the arch (for instance when there is a - # corrupted rpm database on the target system) + # we failed to determine the arch (for instance when we cant' + # run a binary on the target system) log.info("findExistingRootDevices: no arch.") continue |