Cleaned up directory after copy of tools from perforce directory

Got rid of stale copies of some tools like "crosperf" and moved all
files under v14 directory (that came from perforce) into the top
directory.

BUG=None
TEST=None

Change-Id: I408d17a36ceb00e74db71403d2351fd466a14f8e
Reviewed-on: https://gerrit-int.chromium.org/33887
Tested-by: Luis Lozano <llozano@chromium.org>
Reviewed-by: Yunlian Jiang <yunlian@google.com>
Commit-Queue: Luis Lozano <llozano@chromium.org>
diff --git a/image_chromeos.py b/image_chromeos.py
index 30b29a4..d5d5f7f 100755
--- a/image_chromeos.py
+++ b/image_chromeos.py
@@ -171,6 +171,7 @@
                                                options.remote)
     logger.GetLogger().LogFatalIf(not successfully_imaged,
                                   "Image verification failed!")
+    TryRemountPartitionAsRW(options.chromeos_root, options.remote)
   else:
     l.LogOutput("Checksums match. Skipping reimage")
   return retval
@@ -268,6 +269,23 @@
   else:
     return False
 
+# Remount partition as writable.
+# TODO: auto-detect if an image is built using --noenable_rootfs_verification.
+def TryRemountPartitionAsRW(chromeos_root, remote):
+  l = logger.GetLogger()
+  cmd_executer = command_executer.GetCommandExecuter()
+  command = "sudo mount -o remount,rw /"
+  retval = cmd_executer.CrosRunCommand(\
+    command, chromeos_root=chromeos_root, machine=remote, terminated_timeout=10)
+  if retval:
+    ## Safely ignore.
+    l.LogWarning("Failed to remount partition as rw, "
+                 "probably the image was not built with "
+                 "\"--noenable_rootfs_verification\", "
+                 "you can safely ignore this.")
+  else:
+    l.LogOutput("Re-mounted partition as writable.")
+
 
 def EnsureMachineUp(chromeos_root, remote):
   l = logger.GetLogger()