diff options
author | Josh Blum <josh@joshknows.com> | 2010-05-20 17:08:53 -0700 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2010-05-20 17:08:53 -0700 |
commit | 221909b36b2a08a5817e75a3d13ebfe56716c7da (patch) | |
tree | f80bbe1860e26a98ba449f4ea8b53c246d1e6605 /host/utils | |
parent | af1231fddbb8bb24ef7cdd2612e4933f73f83a9f (diff) | |
download | uhd-221909b36b2a08a5817e75a3d13ebfe56716c7da.tar.gz uhd-221909b36b2a08a5817e75a3d13ebfe56716c7da.tar.bz2 uhd-221909b36b2a08a5817e75a3d13ebfe56716c7da.zip |
use only procfs /proc/partitions for discovering raw devices on linux
Diffstat (limited to 'host/utils')
-rwxr-xr-x | host/utils/usrp2_card_burner.py | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/host/utils/usrp2_card_burner.py b/host/utils/usrp2_card_burner.py index 59d0b3231..c39fb9d19 100755 --- a/host/utils/usrp2_card_burner.py +++ b/host/utils/usrp2_card_burner.py @@ -92,7 +92,7 @@ def get_raw_device_hints(): return sorted(set(volumes)) #################################################################### - # Platform Linux: call blockdev on all the dev0 devices + # Platform Linux: parse procfs /proc/partitions #################################################################### if platform.system() == 'Linux': devs = list() @@ -101,12 +101,10 @@ def get_raw_device_hints(): for line in output.splitlines(): try: major, minor, blocks, name = line.split() - if name[-1].isdigit(): assert int(minor) == 0 - dev = os.path.join('/dev/', name) - size = int(command('blockdev', '--getsz', dev))*512 - assert size <= MAX_SD_CARD_SIZE + assert not name[-1].isdigit() or int(minor) == 0 + assert int(blocks)*1024 <= MAX_SD_CARD_SIZE except: continue - devs.append(dev) + devs.append(os.path.join('/dev', name)) return sorted(set(devs)) |