CHERRY-PICK: clobber-state: try to get rootfs partition/disk from environement variables

clobber-state invokes 'rootdev' command to get rootfs partition and root disk.
Sometimes we'll invoke 'clobber-state' directly under a tmpfs for factory
wiping. The 'rootdev' cannot report correct output under such
a situation. This CL tries to get rootfs partition/disk from environment
variables first and fallbacks to 'rootdev' command if it's unavailable.

BUG=chromium:427793
TEST=Manual on a Paine device:
     1. exports ROOT_DEV="/dev/sda3"
     2. exports ROOT_DISK="/dev/sda"
     3. clobber-state "factory fast"

Change-Id: Id83dc246c54e9f911e971f2dff60787001a84d14
Reviewed-on: https://chromium-review.googlesource.com/254043
Tested-by: Bowgo Tsai <bowgotsai@chromium.org>
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
Commit-Queue: Bowgo Tsai <bowgotsai@chromium.org>
(cherry picked from commit 3f7db8b36d3814cf31a25726b354819ca990f387)
Reviewed-on: https://chromium-review.googlesource.com/306925
Reviewed-by: Shun-Hsing Ou <shunhsingou@chromium.org>
Tested-by: Shun-Hsing Ou <shunhsingou@chromium.org>
1 file changed