FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Ubuntu > Ubuntu User

 
 
LinkBack Thread Tools
 
Old 12-05-2007, 10:24 PM
Bill Nottingham
 
Default Updated for udev; do not try and make devices. Format devices if we're trying vfat and the device has no filesystem at all.

---
exception.py | 37 ++++++++++++++++++-------------------
1 files changed, 18 insertions(+), 19 deletions(-)

diff --git a/exception.py b/exception.py
index cb6a603..08d2622 100644
--- a/exception.py
+++ b/exception.py
@@ -25,6 +25,7 @@ import traceback
import iutil
import types
import bdb
+import partedUtils
import rhpl
from string import joinfields
from cPickle import Pickler
@@ -255,10 +256,8 @@ def copyExceptionToRemote(intf, scpInfo):
return False

# Save the traceback to a removable storage device, such as a floppy disk
-# or a usb/firewire drive. In the event of a floppy disk, it is assumed to
-# be unformatted and safe for us to destroy. For all other devices, it is
-# assumed that they are already formatted and we will only attempt to write
-# the traceback file to the device. Returns success or not.
+# or a usb/firewire drive. If there's no filesystem, write a vfat one.
+# Returns success or not.
def copyExceptionToDisk(anaconda, device):
# in test mode have save to disk option just copy to new name
if not flags.setupFilesystems:
@@ -271,33 +270,33 @@ def copyExceptionToDisk(anaconda, device):
anaconda.intf.__del__ ()
return True

- file = "/tmp/exndev"
try:
- isys.makeDevInode(device, file)
- except SystemError:
- pass
-
- try:
- fd = os.open(file, os.O_RDONLY)
+ fd = os.open(device, os.O_RDONLY)
except:
return False

os.close(fd)

- # Only format floppy devices, not usb storage devices.
- if device in isys.floppyDriveDict().keys() and rhpl.getArch() != "ia64":
+ fstype = partedUtils.sniffFilesystemType(device)
+ if fstype == None:
+ fstype = 'vfat'
+ try:
+ isys.mount(device, "/tmp/crash", fstype)
+ except SystemError:
+ if fstype != 'vfat':
+ return False
+
cmd = "/usr/sbin/mkdosfs"

if os.access("/sbin/mkdosfs", os.X_OK):
cmd = "/sbin/mkdosfs"

- iutil.execWithRedirect (cmd, [file], stdout = '/dev/tty5',
+ iutil.execWithRedirect (cmd, [device], stdout = '/dev/tty5',
stderr = '/dev/tty5')
-
- try:
- isys.mount(file, "/tmp/crash", fstype = "vfat")
- except SystemError:
- return False
+ try:
+ isys.mount(device, "/tmp/crash", fstype)
+ except SystemError:
+ return False

# copy trace dump we wrote to local storage to disk
try:
--
1.5.3.4

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 

Thread Tools




All times are GMT. The time now is 02:45 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org