update_kernel.sh: Learn partition layout from target

Don't depend on chromeos-common.sh or disk_layout_util.sh
for these constants, since they are going away.
Instead, learn them from the target.

BUG=b:35045101
TEST=`update_kernel`

Change-Id: I8ad6e73ab08a0b7baf5f66f8bed89e0e25742a5c
Reviewed-on: https://chromium-review.googlesource.com/451543
Commit-Ready: Ian Coolidge <icoolidge@google.com>
Tested-by: Ian Coolidge <icoolidge@google.com>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
diff --git a/remote_access.sh b/remote_access.sh
index f6c7fa6..1cf1437 100644
--- a/remote_access.sh
+++ b/remote_access.sh
@@ -110,6 +110,7 @@
 
 # Wrapper for ssh that runs the commmand given by the args on the remote host
 # If an ssh error occurs, re-runs the ssh command.
+# Output is stored in REMOTE_OUT.
 remote_sh() {
   local ssh_status=0
   _remote_sh "$@" || ssh_status=$?
@@ -172,6 +173,12 @@
   info "Target reports arch is ${FLAGS_arch}"
 }
 
+# Discover partition numbers from the target.
+learn_partition_layout() {
+  source <(remote_sh_raw cat /usr/sbin/write_gpt.sh)
+  load_base_vars
+}
+
 # Checks whether a remote device has rebooted successfully.
 #
 # This uses a rapidly-retried SSH connection, which will wait for at most