startup_init/services/etc/init.cfg
shiyu e6d587fa9c 创建A/B类目录
Signed-off-by: shiyu <shiyu52@huawei.com>
2023-12-03 14:22:22 +08:00

206 lines
9.3 KiB
INI
Executable File

{
"import" : [
"/etc/init.usb.cfg",
"/etc/init.usb.configfs.cfg",
"/vendor/etc/init.${ohos.boot.hardware}.cfg"
],
"jobs" : [{
"name" : "pre-init",
"cmds" : [
"write /proc/sys/kernel/sysrq 0",
"write /proc/sys/kernel/dmesg_restrict 1",
"write /proc/sys/kernel/kptr_restrict 1",
"start ueventd",
"start watchdog_service",
"mkdir /data",
"mount_fstab /vendor/etc/fstab.${ohos.boot.hardware}",
"restorecon /data",
"chown system system /data",
"chmod 0771 /data",
"mkdir /data/service 0711 root root",
"mkdir /data/service/el0 0711 root root",
"mkdir /data/service/el0/startup 0755 root root",
"mkdir /data/service/el0/startup/init 0755 root root",
"mkdir /data/vendor/log 0755 system log",
"mount configfs none /config nodev noexec nosuid",
"load_persist_params ",
"bootchart start",
"chown access_token access_token /dev/access_token_id",
"chmod 0666 /dev/access_token_id",
"trigger init-hitrace"
]
}, {
"name" : "init",
"cmds" : [
"mksandbox system",
"mksandbox chipset",
"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",
"write /proc/sys/net/ipv4/ping_group_range 0 2147483647",
"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",
"setrlimit RLIMIT_NICE 40 40",
"setrlimit RLIMIT_NOFILE 32768 32768",
"write /sys/class/leds/vibrator/trigger transient",
"chown system system /sys/power/state",
"chown system system /sys/power/wakeup_count",
"chmod 0660 /sys/power/state",
"mount pstore pstore /sys/fs/pstore nodev noexec nosuid",
"chown system log /sys/fs/pstore",
"chmod 0555 /sys/fs/pstore",
"ifup lo",
"hostname localhost",
"domainname localdomain",
"export TMPDIR /data/local/tmp"
]
}, {
"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",
"chmod 0444 /sys/fs/selinux/policy"
]
}, {
"name" : "late-fs",
"cmds" : [
"chmod 0755 /sys/kernel/debug/tracing"
]
}, {
"name" : "post-fs-data",
"cmds" : [
"init_global_key /data",
"mkdir /data/app 0711 root root",
"mkdir /data/app/el1 0711 root root",
"mkdir /data/app/el1/bundle 0711 root root",
"mkdir /data/app/el1/bundle/public 0711 root root",
"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",
"mkdir /data/service/el1/public/AbilityManagerService 0711 system system",
"mkdir /data/service/el2 0711 root root",
"mkdir /data/service/el2/public 0711 root root",
"mkdir /data/service/el3 0711 root root",
"mkdir /data/service/el4 0711 root root",
"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",
"init_main_user ",
"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/el2/0/log 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",
"mkdir /storage/media 0711 root root",
"mkdir /data/misc 01771 system misc",
"mkdir /data/misc/shared_relro 0771 nwebspawn nwebspawn",
"mkdir /data/local 0751 root root",
"mkdir /data/vendor 0771 root root",
"mkdir /data/local/ark-cache 0711 root root",
"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",
"chmod 0770 /dev/fscklogs/log",
"chmod 0660 /dev/fuse"
]
}, {
"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",
"chown update update /dev/block/by-name/misc",
"setparam net.tcp.default_init_rwnd 60"
]
}, {
"name" : "param:sys.sysctl.extra_free_kbytes=*",
"condition" : "sys.sysctl.extra_free_kbytes=*",
"cmds" : [
"write /proc/sys/vm/extra_free_kbytes ${sys.sysctl.extra_free_kbytes}"
]
}, {
"name" : "param:sys.sysctl.tcp_def_init_rwnd=*",
"condition" : "sys.sysctl.tcp_def_init_rwnd=*",
"cmds" : [
"write /proc/sys/net/ipv4/tcp_default_init_rwnd ${sys.sysctl.tcp_def_init_rwnd}"
]
}, {
"name" : "services:console",
"cmds" : [
"chmod 0773 /data/misc/trace",
"chmod 0775 /data/misc/wmtrace"
]
}, {
"name" : "init-trace",
"cmds" : [
"init_trace start"
]
}
]
}