Merge "Issue dmsetup command for the old verity and new verity" into newkernel_dev
diff --git a/fs/simpleramfs/mounts-root b/fs/simpleramfs/mounts-root
index 42b3248..cb76ea4 100755
--- a/fs/simpleramfs/mounts-root
+++ b/fs/simpleramfs/mounts-root
@@ -79,6 +79,19 @@
   [ "${1#"$2"}" != "$1" ]
 }
 
+oldargstonewargs() {
+  local root_dev=$(replacefirst "$4" "payload=" "")
+  local hash_dev=$(replacefirst "$5" "hashtree=" "")
+  local hashstart=$(replacefirst "$6" "hashstart=" "")
+  local alg=$(replacefirst "$7" "alg=" "")
+  local root_digest=$(replacefirst "$8" "root_hexdigest=" "")
+  local salt=$(replacefirst "$9" "salt=" "")
+
+  local data_blockcount=$(($2 / 8))
+  local hash_blockstart=$(($hashstart / 8))
+
+  echo "$1 $2 $3 0 $root_dev $hash_dev 4096 4096 $data_blockcount $hash_blockstart $alg $root_digest $salt"
+}
 
 # host:path format in root= means we should do an NFS root
 if [ "${ROOTDEV#*:/}" != "$ROOTDEV" ]; then
@@ -162,7 +175,10 @@
     args=$(readverity $KERNELDEV)
     args=$(replacefirst "$args" ROOT_DEV "$ROOTDEV")
     args=$(replacefirst "$args" HASH_DEV "$KERNELDEV")
-    if ! dmsetup create -r vroot --table "$args"; then
+    altargs=$(oldargstonewargs $args)
+    echo "dmsetup: $args"
+    echo "dmsetup: $altargs"
+    if ! dmsetup create vroot -r --table "$args" && ! dmsetup create vroot -r --table "$altargs"; then
       veritynote=
       read x y armplatform platform junk </proc/cpuinfo
       # TODO(jnewlin): Renable verity for 725B2 when we get the user space