Nick Kralevich | 9f6af08 | 2014-07-02 16:18:16 -0700 | [diff] [blame] | 1 | # service flash_recovery in init.rc |
Nick Kralevich | 0c8101b | 2017-01-06 16:54:25 -0800 | [diff] [blame] | 2 | type install_recovery, domain; |
Nick Kralevich | 9f6af08 | 2014-07-02 16:18:16 -0700 | [diff] [blame] | 3 | type install_recovery_exec, exec_type, file_type; |
| 4 | |
Benjamin Gordon | 342362a | 2018-09-06 16:19:40 -0600 | [diff] [blame] | 5 | allow install_recovery self:global_capability_class_set { dac_override dac_read_search }; |
Nick Kralevich | 9f6af08 | 2014-07-02 16:18:16 -0700 | [diff] [blame] | 6 | |
| 7 | # /system/bin/install-recovery.sh is a shell script. |
| 8 | # Needs to execute /system/bin/sh |
| 9 | allow install_recovery shell_exec:file rx_file_perms; |
| 10 | |
| 11 | # Execute /system/bin/applypatch |
| 12 | allow install_recovery system_file:file rx_file_perms; |
Jeff Vander Stoep | 2db1cd4 | 2017-04-21 09:33:39 -0700 | [diff] [blame] | 13 | not_full_treble(`allow install_recovery vendor_file:file rx_file_perms;') |
Nick Kralevich | 9f6af08 | 2014-07-02 16:18:16 -0700 | [diff] [blame] | 14 | |
Stephen Smalley | a3c97a7 | 2015-08-25 11:38:29 -0400 | [diff] [blame] | 15 | allow install_recovery toolbox_exec:file rx_file_perms; |
Stephen Smalley | a3c97a7 | 2015-08-25 11:38:29 -0400 | [diff] [blame] | 16 | |
Nick Kralevich | a8e073c | 2015-02-27 17:39:09 -0800 | [diff] [blame] | 17 | # Update the recovery block device based off a diff of the boot block device |
Nick Kralevich | 9f6af08 | 2014-07-02 16:18:16 -0700 | [diff] [blame] | 18 | allow install_recovery block_device:dir search; |
Nick Kralevich | a8e073c | 2015-02-27 17:39:09 -0800 | [diff] [blame] | 19 | allow install_recovery boot_block_device:blk_file r_file_perms; |
Stephen Smalley | 206b1a6 | 2014-09-30 12:53:12 -0400 | [diff] [blame] | 20 | allow install_recovery recovery_block_device:blk_file rw_file_perms; |
Nick Kralevich | 9f6af08 | 2014-07-02 16:18:16 -0700 | [diff] [blame] | 21 | |
| 22 | # Create and delete /cache/saved.file |
Nick Kralevich | ff2bf40 | 2016-03-29 09:20:41 -0700 | [diff] [blame] | 23 | allow install_recovery cache_file:dir rw_dir_perms; |
| 24 | allow install_recovery cache_file:file create_file_perms; |
Nick Kralevich | 9f6af08 | 2014-07-02 16:18:16 -0700 | [diff] [blame] | 25 | |
| 26 | # Write to /proc/sys/vm/drop_caches |
Jeff Sharkey | c960596 | 2015-05-14 20:55:31 -0700 | [diff] [blame] | 27 | allow install_recovery proc_drop_caches:file w_file_perms; |