aboutsummaryrefslogtreecommitdiff
path: root/rootdir/system/bin/credmgrfirstboot.sh
diff options
context:
space:
mode:
authornailyk-fr <jenkins@nailyk.fr>2017-10-23 20:58:15 +0200
committerArian <arian.kulmer@web.de>2019-10-07 11:07:18 +0200
commit0fbdefc48c77d3b4a9ba0a1937362933b0343f8c (patch)
treef3b01b8256044b356de34749bdda83b75546a520 /rootdir/system/bin/credmgrfirstboot.sh
parent5b555b410b729908841f6afa928d4d1b164afcaf (diff)
Shinano-common: init: Rework credmgr init script
* Next to the AIDs remove credmgrd init script need some reworks. Root perm at startup is needed for chmod/chown. Change-Id: I9373820c8d0d2fc68e25d671ffbf638fead75316
Diffstat (limited to 'rootdir/system/bin/credmgrfirstboot.sh')
-rwxr-xr-xrootdir/system/bin/credmgrfirstboot.sh7
1 files changed, 6 insertions, 1 deletions
diff --git a/rootdir/system/bin/credmgrfirstboot.sh b/rootdir/system/bin/credmgrfirstboot.sh
index 33062df..36e0c08 100755
--- a/rootdir/system/bin/credmgrfirstboot.sh
+++ b/rootdir/system/bin/credmgrfirstboot.sh
@@ -29,18 +29,23 @@ if [ "x$CREDMGRCNT" == "x0" ]; then
echo "CREDINIT: Dont match"
if [ -d "$CREDFOLDER" ]; then
echo "CREDINIT: Drop old credmgrdata"
- mv -vf $CREDFOLDER ${CREDFOLDER}.old
+ mv -vf $CREDFOLDER ${CREDFOLDER}.$(date +"%Y-%m-%d") >> $LOG 2>&1
fi
# Put binary into /cache
mkdir $CREDFOLDER >> $LOG 2>&1
F_ERR $? "mkdir $CREDFOLDER"
+ # Set perms on folder
chown system:system $CREDFOLDER >> $LOG 2>&1
F_ERR $? "chown $CREDFOLDER"
+ chmod 770 $CREDFOLDER >> $LOG 2>&1
+ F_ERR $? "chmod 770"
chcon u:object_r:credmgrd_data_file:s0 $CREDFOLDER >> $LOG 2>&1
F_ERR $? "chcon $CREDFOLDER"
echo "CREDINIT: cp initial file" >> $LOG 2>&1
cp -v /system/vendor/CredentialManagerData /cache/CredentialManagerData >> $LOG 2>&1
F_ERR $? "copy CredentialManagerData"
+ chown system:system /cache/CredentialManagerData >> $LOG 2>&1
+ F_ERR $? "chown CredentialManagerData"
else
F_ERR 0 "credmgr found already. no preparation required."
fi