bundlemanager_bundle_framework/sa_profile/foundation.rc
linxiangzhi 98eafbf0cd 更新版本年份
Signed-off-by: linxiangzhi <linxiangzhi@huawei.com>
Change-Id: I9b454a3091419688b2237a7024d63085340f0f24
2022-03-01 15:32:18 +08:00

69 lines
2.3 KiB
Plaintext
Executable File

# Copyright (c) 2021-2022 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
on init
# cpuctl subsystem
# set background cpuctl
mkdir /dev/cpuctl/background
chmod 0755 /dev/cpuctl/background
chmod 0755 /dev/cpuctl/background/tasks
chown system system /dev/cpuctl/background
chown system system /dev/cpuctl/background/tasks
write /dev/cpuctl/background/cpu.shares 512
# cpuset subsystem
# write cpus in background
write /dev/cpuset/background/cpus 0
# freezer subsystem
# create freezer of cgroup point
mkdir /dev/freezer
chown system system /dev/freezer
chmod 0755 /dev/freezer
mount cgroup none /dev/freezer freezer
# create directory of frozen and thawed
mkdir /dev/freezer/frozen
mkdir /dev/freezer/thawed
# change permissions
chown system system /dev/freezer/frozen
chown system system /dev/freezer/frozen/tasks
chown system system /dev/freezer/thawed
chown system system /dev/freezer/thawed/tasks
chmod 0755 /dev/freezer/frozen
chmod 0755 /dev/freezer/frozen/tasks
chmod 0755 /dev/freezer/thawed
chmod 0755 /dev/freezer/thawed/tasks
# write freezer state
write /dev/freezer/frozen/freezer.state FROZEN
write /dev/freezer/thawed/freezer.state THAWED
on boot
# Add permision for powermanager to control suspend
# It should be executed before foundation started
# because powermanager will run in foundation process
chown radio system /sys/power/wake_lock
chown radio system /sys/power/wake_unlock
chmod 0664 /sys/power/wakeup_count
start foundation
service foundation /system/bin/sa_main /system/profile/foundation.xml
class foundation
priority -20
user system
group system
seclabel u:r:foundation:s0
capabilities SYS_PTRACE KILL SYS_BOOT