summaryrefslogtreecommitdiff
path: root/rootdir/init.rc
diff options
context:
space:
mode:
Diffstat (limited to 'rootdir/init.rc')
-rw-r--r--rootdir/init.rc40
1 files changed, 25 insertions, 15 deletions
diff --git a/rootdir/init.rc b/rootdir/init.rc
index 2c81dcb41..69cff30d1 100644
--- a/rootdir/init.rc
+++ b/rootdir/init.rc
@@ -43,19 +43,6 @@ on init
mount cgroup none /acct cpuacct
mkdir /acct/uid
- # Create cgroup mount point for memory
- mount tmpfs none /sys/fs/cgroup mode=0750,uid=0,gid=1000
- mkdir /sys/fs/cgroup/memory 0750 root system
- mount cgroup none /sys/fs/cgroup/memory memory
- write /sys/fs/cgroup/memory/memory.move_charge_at_immigrate 1
- chown root system /sys/fs/cgroup/memory/tasks
- chmod 0660 /sys/fs/cgroup/memory/tasks
- mkdir /sys/fs/cgroup/memory/sw 0750 root system
- write /sys/fs/cgroup/memory/sw/memory.swappiness 100
- write /sys/fs/cgroup/memory/sw/memory.move_charge_at_immigrate 1
- chown root system /sys/fs/cgroup/memory/sw/tasks
- chmod 0660 /sys/fs/cgroup/memory/sw/tasks
-
# Create energy-aware scheduler tuning nodes
mkdir /sys/fs/cgroup/stune
mount cgroup none /sys/fs/cgroup/stune schedtune
@@ -95,9 +82,11 @@ on init
symlink /storage/self/primary /sdcard
symlink /mnt/user/0/primary /mnt/runtime/default/self/primary
- # memory control cgroup
+ # root memory control cgroup, used by lmkd
mkdir /dev/memcg 0700 root system
mount cgroup none /dev/memcg memory
+ # app mem cgroups, used by activity manager and lmkd
+ mkdir /dev/memcg/apps/ 0755 system system
write /proc/sys/kernel/panic_on_oops 1
write /proc/sys/kernel/hung_task_timeout_secs 0
@@ -173,17 +162,23 @@ on init
write /dev/cpuset/system-background/cpus 0
write /dev/cpuset/system-background/mems 0
+ mkdir /dev/cpuset/top-app
+ write /dev/cpuset/top-app/cpus 0
+ write /dev/cpuset/top-app/mems 0
+
# change permissions for all cpusets we'll touch at runtime
chown system system /dev/cpuset
chown system system /dev/cpuset/foreground
chown system system /dev/cpuset/foreground/boost
chown system system /dev/cpuset/background
chown system system /dev/cpuset/system-background
+ chown system system /dev/cpuset/top-app
chown system system /dev/cpuset/tasks
chown system system /dev/cpuset/foreground/tasks
chown system system /dev/cpuset/foreground/boost/tasks
chown system system /dev/cpuset/background/tasks
chown system system /dev/cpuset/system-background/tasks
+ chown system system /dev/cpuset/top-app/tasks
# set system-background to 0775 so SurfaceFlinger can touch it
chmod 0775 /dev/cpuset/system-background
@@ -192,6 +187,7 @@ on init
chmod 0664 /dev/cpuset/foreground/boost/tasks
chmod 0664 /dev/cpuset/background/tasks
chmod 0664 /dev/cpuset/system-background/tasks
+ chmod 0664 /dev/cpuset/top-app/tasks
chmod 0664 /dev/cpuset/tasks
@@ -219,6 +215,10 @@ on init
# enable armv8_deprecated instruction hooks
write /proc/sys/abi/swp 1
+ # Linux's execveat() syscall may construct paths containing /dev/fd
+ # expecting it to point to /proc/self/fd
+ symlink /proc/self/fd /dev/fd
+
# Healthd can trigger a full boot from charger mode by signaling this
# property when the power button is held.
on property:sys.boot_from_charger_mode=1
@@ -283,6 +283,10 @@ on post-fs
# permissions if created by the recovery system.
mkdir /cache/recovery 0770 system cache
+ # Backup/restore mechanism uses the cache partition
+ mkdir /cache/backup_stage 0700 system system
+ mkdir /cache/backup 0700 system system
+
#change permissions on vmallocinfo so we can grab it from bugreports
chown root log /proc/vmallocinfo
chmod 0440 /proc/vmallocinfo
@@ -311,8 +315,12 @@ on post-fs-data
# We restorecon /data in case the userdata partition has been reset.
restorecon /data
- # Make sure we have the device encryption key
+ # Start logd, then start debuggerd to make debugging early-boot crashes easier.
start logd
+ start debuggerd
+ start debuggerd64
+
+ # Make sure we have the device encryption key.
start vold
installkey /data
@@ -418,6 +426,8 @@ on post-fs-data
symlink /data/data /data/user/0
+ init_user0
+
# Reload policy from /data/security if present.
setprop selinux.reload_policy 1