• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1{
2    "import" : [
3            "/etc/init.usb.cfg",
4            "/etc/init.usb.configfs.cfg",
5            "/vendor/etc/init.${ohos.boot.hardware}.cfg"
6    ],
7    "jobs" : [{
8            "name" : "pre-init",
9            "cmds" : [
10                "write /proc/sys/kernel/sysrq 0",
11                "write /proc/sys/kernel/dmesg_restrict 1",
12                "write /proc/sys/kernel/kptr_restrict 1",
13                "start ueventd",
14                "start watchdog_service",
15                "mkdir /data",
16                "mount_fstab /vendor/etc/fstab.${ohos.boot.hardware}",
17                "restorecon /data --skip-ELX",
18                "chown system system /data",
19                "chmod 0771 /data",
20                "mkdir /data/service 0711 root root",
21                "mkdir /data/service/el0 0711 root root",
22                "mkdir /data/service/el0/startup 0755 root root",
23                "mkdir /data/service/el0/startup/init 0755 root root",
24                "mkdir /data/vendor/log 0755 system log",
25                "mount configfs none /config nodev noexec nosuid",
26                "load_persist_params ",
27                "bootchart start",
28                "chown access_token access_token /dev/access_token_id",
29                "chmod 0666 /dev/access_token_id",
30                "trigger init-hitrace"
31            ]
32        }, {
33            "name" : "init",
34            "cmds" : [
35                "mksandbox system",
36                "mksandbox chipset",
37                "copy /proc/cmdline /dev/urandom",
38                "copy /system/etc/prop.default /dev/urandom",
39                "symlink /proc/self/fd/0 /dev/stdin",
40                "symlink /proc/self/fd/1 /dev/stdout",
41                "symlink /proc/self/fd/2 /dev/stderr",
42                "write /proc/sys/kernel/panic_on_oops 1",
43                "write /proc/sys/kernel/hung_task_timeout_secs 0",
44                "write /proc/cpu/alignment 4",
45                "write /proc/sys/kernel/sched_tunable_scaling 0",
46                "write /proc/sys/kernel/sched_latency_ns 10000000",
47                "write /proc/sys/kernel/sched_wakeup_granularity_ns 2000000",
48                "write /proc/sys/kernel/sched_child_runs_first 0",
49                "write /proc/sys/kernel/randomize_va_space 2",
50                "write /proc/sys/vm/mmap_min_addr 32768",
51                "write /proc/sys/net/ipv4/ping_group_range 0 2147483647",
52                "write /proc/sys/net/unix/max_dgram_qlen 600",
53                "write /proc/sys/kernel/sched_rt_runtime_us 950000",
54                "write /proc/sys/kernel/sched_rt_period_us 1000000",
55                "write /proc/sys/net/core/rmem_max 262144",
56                "write /proc/sys/net/core/wmem_max 262144",
57                "write /proc/sys/net/ipv4/fwmark_reflect 1",
58                "write /proc/sys/net/ipv6/fwmark_reflect 1",
59                "write /proc/sys/net/ipv4/tcp_fwmark_accept 1",
60                "write /proc/sys/net/ipv4/conf/all/accept_redirects 0",
61                "write /proc/sys/net/ipv6/conf/all/accept_redirects 0",
62                "chmod 0400 /proc/net/fib_trie",
63                "chown system system /proc/pressure/memory",
64                "chmod 0664 /proc/pressure/memory",
65                "mkdir /dev/fscklogs 0770 root system",
66                "write /proc/sys/abi/swp 1",
67                "symlink /proc/self/fd /dev/fd",
68                "export DOWNLOAD_CACHE /data/cache",
69                "setrlimit RLIMIT_NICE 40 40",
70                "setrlimit RLIMIT_NOFILE 32768 32768",
71                "write /sys/class/leds/vibrator/trigger transient",
72                "chown system system /sys/power/state",
73                "chown system system /sys/power/wakeup_count",
74                "chmod 0660 /sys/power/state",
75                "mount pstore pstore /sys/fs/pstore nodev noexec nosuid",
76                "chown system log /sys/fs/pstore",
77                "chmod 0555 /sys/fs/pstore",
78                "ifup lo",
79                "hostname localhost",
80                "domainname localdomain",
81                "export TMPDIR /data/local/tmp"
82            ]
83        }, {
84            "name" : "post-init",
85            "cmds" : [
86                "trigger early-fs",
87                "trigger fs",
88                "trigger post-fs",
89                "trigger late-fs",
90                "trigger post-fs-data",
91                "trigger firmware_mounts_complete",
92                "trigger early-boot",
93                "trigger boot"
94            ]
95        }, {
96            "name" : "fs",
97            "cmds" : [
98            ]
99        }, {
100            "name" : "post-fs",
101            "cmds" : [
102                "mount rootfs rootfs / remount bind ro nodev",
103                "chown root log /proc/vmallocinfo",
104                "chmod 0440 /proc/vmallocinfo",
105                "chown root log /proc/slabinfo",
106                "chmod 0440 /proc/slabinfo",
107                "chown root system /proc/kmsg",
108                "chmod 0440 /proc/kmsg",
109                "chmod 0444 /sys/fs/selinux/policy"
110            ]
111        }, {
112            "name" : "late-fs",
113            "cmds" : [
114                "chmod 0755 /sys/kernel/debug/tracing"
115            ]
116        }, {
117            "name" : "post-fs-data",
118            "cmds" : [
119                "init_global_key /data",
120                "mkdir /data/app 0711 root root",
121                "mkdir /data/app/el1 0711 root root",
122                "mkdir /data/app/el1/bundle 0711 root root",
123                "mkdir /data/app/el1/bundle/public 0711 root root",
124                "mkdir /data/app/el2 0711 root root",
125                "mkdir /data/app/el3 0711 root root",
126                "mkdir /data/app/el4 0711 root root",
127                "mkdir /data/app/el5 0711 root root",
128                "mkdir /data/service/el1 0711 root root",
129                "mkdir /data/service/el1/public 0711 root root",
130                "mkdir /data/service/el1/public/AbilityManagerService 0711 system system",
131                "mkdir /data/service/el2 0711 root root",
132                "mkdir /data/service/el2/public 0711 root root",
133                "mkdir /data/service/el3 0711 root root",
134                "mkdir /data/service/el4 0711 root root",
135                "mkdir /data/service/el5 0711 root root",
136                "mkdir /data/chipset 0711 root root",
137                "mkdir /data/chipset/el1 0711 root root",
138                "mkdir /data/chipset/el1/public 0711 root root",
139                "mkdir /data/chipset/el2 0711 root root",
140                "init_main_user ",
141                "mkdir /data/app/el1/0 0711 root root",
142                "mkdir /data/app/el1/0/base 0711 root root",
143                "mkdir /data/app/el1/0/database 0711 system system",
144                "mkdir /data/app/el2/0 0711 root root",
145                "mkdir /data/app/el2/0/base 0711 root root",
146                "mkdir /data/app/el2/0/database 0711 system system",
147                "mkdir /data/app/el2/0/log 0711 system system",
148                "mkdir /data/app/el3/0 0711 root root",
149                "mkdir /data/app/el3/0/base 0711 root root",
150                "mkdir /data/app/el4/0 0711 root root",
151                "mkdir /data/app/el4/0/base 0711 root root",
152                "mkdir /data/service/el2/0 0711 root root",
153                "mkdir /data/service/el2/0/hmdfs 0711 system system",
154                "mkdir /data/chipset/el2/0 0711 root root",
155                "mkdir /storage/media 0711 root root",
156                "mkdir /data/misc 01771 system misc",
157                "mkdir /data/misc/shared_relro 0771 nwebspawn nwebspawn",
158                "mkdir /data/local 0751 root root",
159                "mkdir /data/vendor 0771 root root",
160                "mkdir /data/local/ark-cache 0711 root root",
161                "mkdir /data/local/tmp 0771 shell shell",
162                "mkdir /data/local/tmp/debugserver 0755 shell shell",
163                "mkdir /data/local/traces 0777 shell shell",
164                "mkdir /data/data 0771 system system",
165                "mkdir /data/app 0771 system system",
166                "mkdir /data/nfc 0770 nfc nfc",
167                "mkdir /data/nfc/param 0770 nfc nfc",
168                "setparam sys.use_memfd false",
169                "chown root system /dev/fscklogs/log",
170                "chmod 0770 /dev/fscklogs/log",
171                "chmod 0660 /dev/fuse",
172                "restorecon -F /data/service/el1/public",
173                "restorecon -F /data/service/el1/public/activation_lock",
174                "restorecon -F /data/service/el1/startup/parameters"
175            ]
176        }, {
177            "name" : "boot",
178            "cmds" : [
179                "write /proc/sys/net/core/xfrm_acq_expires 3600",
180                "write /proc/sys/vm/overcommit_memory 1",
181                "write /proc/sys/vm/min_free_order_shift 4",
182                "chown root system /sys/block/zram0/idle",
183                "chmod 0664 /sys/block/zram0/idle",
184                "write /proc/sys/vm/dirty_expire_centisecs 200",
185                "write /proc/sys/vm/dirty_background_ratio 5",
186                "chown root radio /proc/cmdline",
187                "chown update update /dev/block/by-name/misc",
188                "setparam net.tcp.default_init_rwnd 60"
189            ]
190        }, {
191            "name" : "param:sys.sysctl.extra_free_kbytes=*",
192            "condition" : "sys.sysctl.extra_free_kbytes=*",
193            "cmds" : [
194                "write /proc/sys/vm/extra_free_kbytes ${sys.sysctl.extra_free_kbytes}"
195            ]
196        }, {
197            "name" : "param:sys.sysctl.tcp_def_init_rwnd=*",
198            "condition" : "sys.sysctl.tcp_def_init_rwnd=*",
199            "cmds" : [
200                "write /proc/sys/net/ipv4/tcp_default_init_rwnd ${sys.sysctl.tcp_def_init_rwnd}"
201            ]
202        }, {
203            "name" : "services:console",
204            "cmds" : [
205                "chmod 0773 /data/misc/trace",
206                "chmod 0775 /data/misc/wmtrace"
207            ]
208        }, {
209            "name" : "init-trace",
210            "cmds" : [
211                "init_trace start"
212            ]
213        }
214    ]
215}
216