brillo_RecoverFromBadImage: Improve mapping of partitions to devices.

Turns out that different boards have their by-name mapping in different
locations; however, they all seem to have a symlink to that directory at
/dev/block/by-name. We can use it to simplify and robustify partition
name resolution in this test.

BUG=b:25892336
TEST=site_util/brillo_recovery_test_setup.py -q -i /path/to/system.img

Change-Id: Id5f31ef4c997b884a1838de40bd8ea26b973e942
Reviewed-on: https://chromium-review.googlesource.com/316520
Commit-Ready: Gilad Arnold <garnold@chromium.org>
Tested-by: Gilad Arnold <garnold@chromium.org>
Reviewed-by: David Zeuthen <zeuthen@chromium.org>
Reviewed-by: Dan Shi <dshi@google.com>
1 file changed