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 | |
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')
-rw-r--r-- | host/include/uhd/types/dict.hpp | 2 | ||||
-rwxr-xr-x | host/utils/usrp2_card_burner.py | 10 |
2 files changed, 5 insertions, 7 deletions
diff --git a/host/include/uhd/types/dict.hpp b/host/include/uhd/types/dict.hpp index b5fb11120..50a2b5c3b 100644 --- a/host/include/uhd/types/dict.hpp +++ b/host/include/uhd/types/dict.hpp @@ -46,7 +46,7 @@ namespace uhd{ * \param first the begin iterator * \param last the end iterator */ - template <class InputIterator> + template <typename InputIterator> dict(InputIterator first, InputIterator last){ for(InputIterator it = first; it != last; it++){ _map.push_back(*it); 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)) |