summaryrefslogtreecommitdiff
path: root/rootdir/system
diff options
context:
space:
mode:
authornailyk-fr <nailyk_git@nailyk.fr>2017-03-12 19:42:22 +0100
committerMax Weffers <rcstar6696@gmail.com>2017-03-27 14:09:20 +0200
commit98fb5e441250ff0ec52e2dd7355fbfbb026695ad (patch)
tree4246d8e3991107bacece35aef8f3aa6e64ad1cfd /rootdir/system
parent48856dd0c794ab0bba2133226d33e94c8c6465c3 (diff)
shinano-common: vendor: Camera init
Change-Id: I0b85560bb56beee0d21751fe55587c2de4b8ff00
Diffstat (limited to 'rootdir/system')
-rwxr-xr-xrootdir/system/bin/credmgrfirstboot.sh27
1 files changed, 27 insertions, 0 deletions
diff --git a/rootdir/system/bin/credmgrfirstboot.sh b/rootdir/system/bin/credmgrfirstboot.sh
new file mode 100755
index 0000000..9d9c837
--- /dev/null
+++ b/rootdir/system/bin/credmgrfirstboot.sh
@@ -0,0 +1,27 @@
+#!/system/bin/sh
+CREDFOLDER=/data/credmgr
+
+# If credmgrd data doesn't match our
+
+if [ $(find $CREDFOLDER -group credmgr_client -type f -name "credmgr.db" | wc -l ) -eq 0 ]; then
+ # If /data/credmgr exist remove it
+ /system/bin/logwrapper /system/bin/toybox echo "CREDINIT: Dont match"
+ if [ -d "$CREDFOLDER" ]; then
+ /system/bin/logwrapper /system/bin/toybox echo "CREDINIT: Drop old credmgrdata"
+ /system/bin/mv -vf $CREDFOLDER $CREDFOLDER.old
+ fi
+ # Put binary into /cache
+ /system/bin/logwrapper mkdir $CREDFOLDER
+ /system/bin/logwrapper chown system:credmgr_client $CREDFOLDER
+ /system/bin/logwrapper chcon u:object_r:credmgrd_data_file:s0 $CREDFOLDER
+ /system/bin/logwrapper /system/bin/toybox echo "CREDINIT: cp initial file"
+ /system/bin/logwrapper cp -v /system/vendor/CredentialManagerData /cache/CredentialManagerData
+fi
+
+if [ $? -eq 0 ]; then
+ # Tell init we are ready
+ /system/bin/setprop sys.credmgrdready true
+else
+ /system/bin/toybox echo "CREDINIT: Something goes wrong at credmgrd init!"
+fi
+