Allowing factory reset for eMMC on x86

The existing implementation in factory_reset.sh used CPU architecture to
determine the device on which to reset. Our new platforms
break the assumption of x86 devices always installing to /dev/sd*
devices, so a change is needed -- For all architectures, scan for sd*
and mmcblk* devices with the 'removable' attribute not set. If only one such
device is found, reset that device. Otherwise, return an error.

BUG=chrome-os-partner:25099
TEST=factory install on Rambi.
     factory reset on Rambi.
     factory install on Panther.
     factory reset on Panther.

Change-Id: I225200deefa8164107b41b6ebf10a9705bb01844
Reviewed-on: https://chromium-review.googlesource.com/186867
Tested-by: Bowgo Tsai <bowgotsai@chromium.org>
Reviewed-by: Bowgo Tsai <bowgotsai@chromium.org>
Commit-Queue: Bowgo Tsai <bowgotsai@chromium.org>
2 files changed