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