-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathreinstallMods
executable file
·46 lines (37 loc) · 1.58 KB
/
reinstallMods
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/sh
# this script is called from /data/rcS.local during system boot
# it checks to see the PackageManager service is installed and if not,
# will install the PackageManager service
#
# the REINSTALL_PACKAGES flag file is then set so that
# when PackageManger runs, it will do boot-time reinstall checks for all packages
scriptDir="$( cd "$(dirname $0)" >/dev/null 2>&1 ; /bin/pwd -P )"
helperResourcesDir="$scriptDir/HelperResources"
source "$helperResourcesDir/EssentialResources"
source "$helperResourcesDir/ServiceResources"
# disable outputting log messages to console
logToConsole=false
logMessage "reinstallMods starting"
if [ -f "$setupOptionsDir/DO_NOT_AUTO_INSTALL" ]; then
logMessage "CRITICAL: SetupHelper was manually uninstalled therefore it was not reinstalled"
logMessage " other packages will NOT BE REINSTALLED either !"
# install PackageManager service
else
# installing the PackageManager service requires remounting root R/W
updateRootToReadWrite
if ! $installFailed ; then
# install PackageManager service if not yet installed
if ! [ -e "$serviceDir/PackageManager" ]; then
logMessage "installing PackageManager service - PackageManager will reinstall all packages"
installService PackageManager
fi
fi
if ! $installFailed ; then
# notify PackageManager that it needs to check all packages for possible reinstall
# flag file is cleared in PackageManager when all install checks have been made
touch "/etc/venus/REINSTALL_PACKAGES"
logMessage "reinstallMods finished"
else
logMessage "reinstallMods not completed - packages will not be reinstalled"
fi
fi