2018-05-29 19:54:16 +02:00
|
|
|
typeattribute fastbootd coredomain;
|
2020-03-04 09:20:35 +01:00
|
|
|
|
|
|
|
# The allow rules are only included in the recovery policy.
|
|
|
|
# Otherwise fastbootd is only allowed the domain rules.
|
|
|
|
recovery_only(`
|
|
|
|
# Reboot the device
|
|
|
|
set_prop(fastbootd, powerctl_prop)
|
|
|
|
|
|
|
|
# Read serial number of the device from system properties
|
|
|
|
get_prop(fastbootd, serialno_prop)
|
|
|
|
|
|
|
|
# Set sys.usb.ffs.ready.
|
2020-04-27 16:49:15 +02:00
|
|
|
get_prop(fastbootd, ffs_config_prop)
|
|
|
|
set_prop(fastbootd, ffs_control_prop)
|
2020-03-04 09:20:35 +01:00
|
|
|
|
|
|
|
userdebug_or_eng(`
|
|
|
|
get_prop(fastbootd, persistent_properties_ready_prop)
|
|
|
|
')
|
|
|
|
|
|
|
|
set_prop(fastbootd, gsid_prop)
|
|
|
|
|
|
|
|
# Determine allocation scheme (whether B partitions needs to be
|
|
|
|
# at the second half of super.
|
|
|
|
get_prop(fastbootd, virtual_ab_prop)
|
2021-07-28 03:51:18 +02:00
|
|
|
get_prop(fastbootd, snapuserd_prop)
|
2020-04-24 08:43:13 +02:00
|
|
|
|
|
|
|
# Needed for TCP protocol
|
|
|
|
allow fastbootd node:tcp_socket node_bind;
|
|
|
|
allow fastbootd port:tcp_socket name_bind;
|
|
|
|
allow fastbootd self:tcp_socket { create_socket_perms_no_ioctl listen accept };
|
|
|
|
|
2021-02-05 05:24:23 +01:00
|
|
|
# Start snapuserd for merging VABC updates
|
|
|
|
set_prop(fastbootd, ctl_snapuserd_prop)
|
|
|
|
|
|
|
|
# Needed to communicate with snapuserd to complete merges.
|
|
|
|
allow fastbootd snapuserd_socket:sock_file write;
|
|
|
|
allow fastbootd snapuserd:unix_stream_socket connectto;
|
|
|
|
allow fastbootd dm_user_device:dir r_dir_perms;
|
|
|
|
|
2020-04-24 08:43:13 +02:00
|
|
|
# Get fastbootd protocol property
|
|
|
|
get_prop(fastbootd, fastbootd_protocol_prop)
|
2021-05-06 01:33:48 +02:00
|
|
|
|
|
|
|
# Mount /metadata to interact with Virtual A/B snapshots.
|
|
|
|
allow fastbootd labeledfs:filesystem { mount unmount };
|
2023-04-28 04:57:28 +02:00
|
|
|
set_prop(fastbootd, boottime_prop)
|
2021-06-08 03:38:53 +02:00
|
|
|
|
|
|
|
# Needed for reading boot properties.
|
|
|
|
allow fastbootd proc_bootconfig:file r_file_perms;
|
2022-11-09 00:57:09 +01:00
|
|
|
# Let this domain use the hal fastboot service
|
|
|
|
binder_use(fastbootd)
|
|
|
|
hal_client_domain(fastbootd, hal_fastboot)
|
2020-03-04 09:20:35 +01:00
|
|
|
')
|
2022-09-02 22:01:24 +02:00
|
|
|
|
2022-11-14 23:06:36 +01:00
|
|
|
# This capability allows fastbootd to circumvent memlock rlimits while using
|
|
|
|
# io_uring. An Alternative would be to up the memlock rlimit for the fastbootd service.
|
2022-09-02 22:01:24 +02:00
|
|
|
allow fastbootd self:capability ipc_lock;
|
2022-11-14 23:06:36 +01:00
|
|
|
io_uring_use(fastbootd)
|