rootdir: record last build signature and kernel version

(cherry pick from commit 93394034a24534a6807da25b4dabeda36867cd8f)

Rotate /default.prop and /proc/version into /data/misc/recovery/
as an aid in determining the vintage of the LAST_LOGCAT and
LAST_DMESG in the bugreport collection.

Signed-off-by: Mark Salyzyn <salyzyn@google.com>
Test: manually confirm content rotation through reboots
Bug: 62793047
Change-Id: Ibbe546c76041f20e308e58e5548939afac75db97
diff --git a/rootdir/init.rc b/rootdir/init.rc
index 8f58a95..041e444 100644
--- a/rootdir/init.rc
+++ b/rootdir/init.rc
@@ -379,6 +379,20 @@
 
     # create basic filesystem structure
     mkdir /data/misc 01771 system misc
+    mkdir /data/misc/recovery 0770 system log
+    copy /data/misc/recovery/default.prop /data/misc/recovery/default.prop.1
+    chmod 0440 /data/misc/recovery/default.prop.1
+    chown system log /data/misc/recovery/default.prop.1
+    copy /default.prop /data/misc/recovery/default.prop
+    chmod 0440 /data/misc/recovery/default.prop
+    chown system log /data/misc/recovery/default.prop
+    mkdir /data/misc/recovery/proc 0770 system log
+    copy /data/misc/recovery/proc/version /data/misc/recovery/proc/version.1
+    chmod 0440 /data/misc/recovery/proc/version.1
+    chown system log /data/misc/recovery/proc/version.1
+    copy /proc/version /data/misc/recovery/proc/version
+    chmod 0440 /data/misc/recovery/proc/version
+    chown system log /data/misc/recovery/proc/version
     mkdir /data/misc/bluedroid 02770 bluetooth bluetooth
     # Fix the access permissions and group ownership for 'bt_config.conf'
     chmod 0660 /data/misc/bluedroid/bt_config.conf