From: Michael Tremer Date: Sat, 19 May 2012 09:15:56 +0000 (+0200) Subject: Fixes for the Raspberry Pi Computer. X-Git-Tag: v2.1.5~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cf062e0b3840179c1c25d40eccc3e193029843c0;p=oddments%2Ffireinfo.git Fixes for the Raspberry Pi Computer. Memory cards are now detected approprietly. --- diff --git a/fireinfo/system.py b/fireinfo/system.py index 5193f32..28701d6 100644 --- a/fireinfo/system.py +++ b/fireinfo/system.py @@ -294,7 +294,15 @@ class System(object): if s.startswith("ARM-Versatile"): return ("ARM", s) - v, m = s.split(" ", 1) + try: + v, m = s.split(" ", 1) + except ValueError: + if s.startswith("BCM"): + v = "Broadcom" + m = s + else: + v = None + m = s return v, m @@ -358,7 +366,12 @@ class System(object): if mountpoint == "/": # Cut off /dev dev = dev[5:] - # Cut off all digits at end of string + + # Handle raids and MMC cards like (mmcblk0p3). + if dev[-2] == "p": + return dev[:-2] + + # Otherwise cut off all digits at end of string while dev[-1] in string.digits: dev = dev[:-1]