Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature disk swap2 #241

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions file_based_swap/create_swap.te
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
type create_swap, domain;
type create_swap_exec, exec_type, file_type, vendor_file_type;

init_daemon_domain(create_swap)

allow create_swap vendor_file:file rx_file_perms;
allow create_swap proc_meminfo:file r_file_perms;

# allow the create_swap domain to set prop sys.enable_swap
set_prop(create_swap, vendor_mem_prop)

not_full_treble(`
allow create_swap system_file:file rx_file_perms;
allow create_swap shell_exec:file rx_file_perms;
')

full_treble_only(`
allow create_swap vendor_shell_exec:file rx_file_perms;
allow create_swap vendor_toolbox_exec:file rx_file_perms;
')
1 change: 1 addition & 0 deletions file_based_swap/file_contexts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/vendor/bin/create_swap.sh u:object_r:create_swap_exec:s0
18 changes: 18 additions & 0 deletions partition_based_swap/create_swap.te
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
type create_swap, domain;
type create_swap_exec, exec_type, file_type, vendor_file_type;

init_daemon_domain(create_swap)

allow create_swap vendor_file:file rx_file_perms;
allow create_swap proc_meminfo:file r_file_perms;
# allow the create_swap domain to set prop sys.low_ram
set_prop(create_swap, vendor_mem_prop)

not_full_treble(`
allow create_swap system_file:file rx_file_perms;
allow create_swap shell_exec:file rx_file_perms;
')
full_treble_only(`
allow create_swap vendor_shell_exec:file rx_file_perms;
allow create_swap vendor_toolbox_exec:file rx_file_perms;
')
1 change: 1 addition & 0 deletions partition_based_swap/file_contexts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/vendor/bin/create_swap.sh u:object_r:create_swap_exec:s0
Loading