-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathrecovery.rc
executable file
·196 lines (151 loc) · 4.95 KB
/
recovery.rc
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
on early-init
start ueventd
on init
sysclktz 0
loglevel 9
# setup the global environment
export PATH /sbin
export ANDROID_ROOT /system
export ANDROID_DATA /data
export EXTERNAL_STORAGE /sdcard
export ASEC_MOUNTPOINT /mnt/asec
export LOOP_MOUNTPOINT /mnt/obb
insmod /lib/modules/fsr.ko
insmod /lib/modules/fsr_stl.ko
insmod /lib/modules/rfs_glue.ko
insmod /lib/modules/rfs_fat.ko
insmod /lib/modules/param.ko
symlink /misc /etc
# Backward compatibility
symlink /sys/kernel/debug /d
# create mountpoints
mkdir /mnt 0775 root root
mkdir /sdcard 0000 system system
# Create cgroup mount point for cpu accounting
mkdir /acct
mount cgroup none /acct cpuacct
mkdir /acct/uid
mkdir /tmp
mount tmpfs nodev /tmp
symlink /sdcard /mnt/sdcard
mkdir /system
mkdir /efs
mkdir /data 0771 system system
mkdir /cache 0777 system cache
mkdir /config 0500 root root
# Directory for putting things only root should see.
mkdir /mnt/secure 0700 root root
# Directory for staging bindmounts
mkdir /mnt/secure/staging 0700 root root
# Directory-target for where the secure container
# imagefile directory will be bind-mounted
mkdir /mnt/secure/asec 0700 root root
# Secure container public mount points.
mkdir /mnt/asec 0700 root system
mount tmpfs tmpfs /mnt/asec mode=0755,gid=1000
# Create cgroup mount points for process groups
mkdir /dev/cpuctl
mount cgroup none /dev/cpuctl cpu
chown system system /dev/cpuctl
chown system system /dev/cpuctl/tasks
chmod 0777 /dev/cpuctl/tasks
write /dev/cpuctl/cpu.shares 1024
mkdir /dev/cpuctl/fg_boost
chown system system /dev/cpuctl/fg_boost/tasks
chmod 0777 /dev/cpuctl/fg_boost/tasks
write /dev/cpuctl/fg_boost/cpu.shares 1024
mkdir /dev/cpuctl/bg_non_interactive
chown system system /dev/cpuctl/bg_non_interactive/tasks
chmod 0777 /dev/cpuctl/bg_non_interactive/tasks
# 5.0 %
write /dev/cpuctl/bg_non_interactive/cpu.shares 52
# Force the PDA mode. ICS handle very badly the usb_switch ...
chown radio system /sys/devices/virtual/sec/switch/UsbMenuSel
chown radio system /sys/devices/virtual/sec/switch//tethering
chown radio system /sys/devices/virtual/sec/switch/uart_sel
chown radio system /sys/devices/virtual/sec/switch/usb_sel
chown radio system /sys/devices/virtual/sec/switch/usb_state
write /sys/devices/virtual/sec/switch/usb_sel "PDA"
on fs
# SYSTEM
mkdir /system
# Mount /system rw first to give the filesystem a chance to save a checkpoint
mount yaffs2 /dev/block/mtdblock1 /system
# DATA
# We chown/chmod /data again so because mount is run as root + defaults
exec apply_disk_policy
mkdir /data 0771 system system
mount yaffs2 /dev/block/mtdblock2 /data nosuid nodev
chown system system /data
chmod 0771 /data
# CACHE
mkdir /cache 0771 system cache
chown system cache /cache
chmod 0771 /cache
# This may have been created by the recovery system with odd permissions
chown system cache /cache/recovery
chmod 0770 /cache/recovery
# EFS
mkdir /efs 0771 system system
# mount rfs /dev/block/stl4 /efs nosuid nodev check=no
mount yaffs2 /dev/block/mtdblock4 /efs nosuid nodev
chown radio radio /efs
chmod 0771 /efs
mkdir /cache/recovery
# SEC_DMCRYPT for MC_CRYPT_ROOT before apply_disk_policy or apply_sec_devenc_init
#chown system system /efs
#chown radio radio /efs
chown radio system /efs
chmod 0771 /efs
exec apply_disk_policy
on post-fs
# DATA
exec apply_disk_policy
chown system system /data
chmod 0771 /data
# CACHE
chown system cache /cache
chmod 0777 /cache
# This may have been created by the recovery system with odd permissions
mkdir /cache/recovery
chown system cache /cache/recovery
chmod 0777 /cache/recovery
# EFS
chown radio radio /efs
chmod 0771 /efs
chown radio system /efs
chmod 0771 /efs
exec apply_disk_policy
write /proc/sys/kernel/panic_on_oops 1
write /proc/sys/kernel/hung_task_timeout_secs 0
write /proc/cpu/alignment 4
write /proc/sys/kernel/sched_latency_ns 10000000
write /proc/sys/kernel/sched_wakeup_granularity_ns 2000000
write /proc/sys/kernel/sched_compat_yield 1
write /proc/sys/kernel/sched_child_runs_first 0
on boot
# basic network init
ifup lo
hostname localhost
domainname localdomain
# set RLIMIT_NICE to allow priorities from 19 to -20
setrlimit 13 40 40
class_start default
## Daemon processes to be run by init.
##
service ueventd /sbin/ueventd
critical
service console /sbin/sh
console
disabled
user shell
group log
on property:ro.secure=0
start console
service recovery /sbin/recovery
# adbd is controlled by the persist.service.adb.enable system property
service adbd /sbin/adbd
on property:persist.service.adb.enable=1
start adbd
on property:persist.service.adb.enable=0
stop adbd