[PATCH 1/2] activate.py: add diagnostic output for USB probing
Bernie Innocenti
bernie at codewiz.org
Fri Feb 12 06:32:15 EST 2010
This debug output helps finding out why activate.py refuses to
activate a laptop. Without it, one is left wondering whether mount
failed, leases.dat wasn't found or its content was incorrect.
---
30olpc-boot/activate.py | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/30olpc-boot/activate.py b/30olpc-boot/activate.py
index 72094ea..0d14269 100755
--- a/30olpc-boot/activate.py
+++ b/30olpc-boot/activate.py
@@ -31,8 +31,11 @@ def blk_mounted(device, mnt, fstype=None):
def try_blk(device, mnt, fstype=None):
"""Try to mount a block device and read keylist from it."""
try:
+ print >> sys.stderr, "Trying " + device + "...",
with blk_mounted(device, mnt, fstype):
+ print >> sys.stderr, "mounted...",
with open(os.path.join(mnt,'lease.sig')) as f:
+ print >> sys.stderr, "lease.sig found."
return f.read()
except:
return None
@@ -214,6 +217,7 @@ def usb_init():
global _usb_first
# ignore modprobe failures, since older kernels don't have
# modular usb (trac #7113).
+ print >> sys.stderr, "Loading USB modules..."
call(['/sbin/modprobe','ohci-hcd'])
call(['/sbin/modprobe','usb-storage'])
if _usb_first:
@@ -318,6 +322,7 @@ def activate (serial_num, uuid):
send('USB success')
try:
# return minimized lease
+ print >> sys.stderr, "Checking lease..."
return find_lease(serial_num, uuid, keylist)
except:
send('USB fail')
--
1.6.2.5
More information about the Devel
mailing list