diff options
author | Peter Jones <pjones@redhat.com> | 2007-07-26 14:15:42 +0000 |
---|---|---|
committer | Peter Jones <pjones@redhat.com> | 2007-07-26 14:15:42 +0000 |
commit | 2b53dbb0a2e284f54f616f48e439cc060e7a3f46 (patch) | |
tree | d33891311055a7ff4b0d08661f037e49bbff3463 /partedUtils.py | |
parent | b5b0e34ce8a389eb3c897dd9b0cdeacc044b63b8 (diff) | |
download | anaconda-2b53dbb0a2e284f54f616f48e439cc060e7a3f46.tar.gz anaconda-2b53dbb0a2e284f54f616f48e439cc060e7a3f46.tar.xz anaconda-2b53dbb0a2e284f54f616f48e439cc060e7a3f46.zip |
- Enable booting from GPT on non-EFI systems.
Diffstat (limited to 'partedUtils.py')
-rw-r--r-- | partedUtils.py | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/partedUtils.py b/partedUtils.py index 59ab4228f..5685cef96 100644 --- a/partedUtils.py +++ b/partedUtils.py @@ -272,6 +272,10 @@ def getDefaultDiskType(): else: return parted.disk_type_get("msdos") +def hasGptLabel(diskset, device): + disk = diskset.disks[device] + return disk.type.name == "gpt" + archLabels = {'i386': ['msdos', 'gpt'], 's390': ['dasd', 'msdos'], 'alpha': ['bsd', 'msdos'], @@ -913,10 +917,13 @@ class DiskSet: continue # FIXME: this belongs in parted itself, but let's do a hack... - if iutil.isMactel() and disk.type.name == "gpt" and \ - os.path.exists("/usr/sbin/gptsync"): - iutil.execWithRedirect("/usr/sbin/gptsync", [disk.dev.path], - stdout="/dev/tty5", stderr="/dev/tty5") + if rhpl.getArch() in ("i386", "x86_64") \ + and disk.type.name == "gpt": + log.debug("syncing gpt to mbr for disk %s" % (disk.dev.path,)) + iutil.execWithRedirect("gptsync", [disk.dev.path,], + stdout="/tmp/gptsync.log", + stderr="/tmp/gptsync.err", + searchPath = 1) del disk self.refreshDevices() @@ -1092,7 +1099,7 @@ class DiskSet: else: disk = labelDisk(deviceFile) except parted.error, msg: - log.debug("parted error: %s" % (msg,)) + log.error("parted error: %s" % (msg,)) raise except: exc = sys.exc_info() @@ -1229,6 +1236,10 @@ class DiskSet: if rc == 0: sys.exit(0) else: + exc = sys.exc_info() + exc = traceback.format_exception(*exc) + for line in exc.splitlines(): + log.error(line) log.error(str) sys.exit(0) |