read partition length from recovery.fstab

Don't hardcode magical partition behavior in the script generator.

Change-Id: I4aeea022f8a32a7c9f316be2c2514510344ca0e0
diff --git a/tools/releasetools/common.py b/tools/releasetools/common.py
index a7413a0..b182088 100644
--- a/tools/releasetools/common.py
+++ b/tools/releasetools/common.py
@@ -173,11 +173,27 @@
     p.mount_point = pieces[0]
     p.fs_type = pieces[1]
     p.device = pieces[2]
-    if len(pieces) == 4:
-      p.device2 = pieces[3]
+    p.length = 0
+    options = None
+    if len(pieces) >= 4:
+      if pieces[3].startswith("/"):
+        p.device2 = pieces[3]
+        if len(pieces) >= 5:
+          options = pieces[4]
+      else:
+        p.device2 = None
+        options = pieces[3]
     else:
       p.device2 = None
 
+    if options:
+      options = options.split(",")
+      for i in options:
+        if i.startswith("length="):
+          p.length = int(i[7:])
+        else:
+          print "%s: unknown option \"%s\"" % (p.mount_point, i)
+
     d[p.mount_point] = p
   return d