Skip to content

Commit

Permalink
wahoo: Make vendor script use vendor shell and vendor toybox
Browse files Browse the repository at this point in the history
This also enables us to remove the vendor_executes_system_violator
attribute from all the vendor scripts launched from init.

Bug: 37914554
Test: Build and boot and ensure all services exited with status 0.

Change-Id: If692b17b45f91ff128608c3f6e9524847c1af69f
Signed-off-by: Sandeep Patil <[email protected]>
  • Loading branch information
patils committed Jun 19, 2017
1 parent 99be275 commit 4a2b3af
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 23 deletions.
2 changes: 1 addition & 1 deletion init.insmod.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/system/bin/sh
#! /vendor/bin/sh

#########################################
### init.insmod.cfg format: ###
Expand Down
2 changes: 1 addition & 1 deletion init.power.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/system/bin/sh
#! /vendor/bin/sh

################################################################################
# helper functions to allow Android init like script
Expand Down
2 changes: 1 addition & 1 deletion init.qcom.devstart.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/system/bin/sh
#! /vendor/bin/sh

echo 1 > /sys/kernel/boot_adsp/boot
echo 1 > /sys/kernel/boot_slpi/boot
Expand Down
2 changes: 1 addition & 1 deletion init.qcom.ipastart.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/system/bin/sh
#! /vendor/bin/sh

echo 1 > /dev/ipa
2 changes: 1 addition & 1 deletion init.radio.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/system/bin/sh
#! /vendor/bin/sh

#
# Copy qcril.db if needed for RIL
Expand Down
8 changes: 3 additions & 5 deletions sepolicy/vendor/init-devstart-sh.te
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
type init-qcom-devstart-sh, domain, vendor_executes_system_violators;
type init-qcom-devstart-sh, domain;
type init-qcom-devstart-sh_exec, exec_type, vendor_file_type, file_type;

init_daemon_domain(init-qcom-devstart-sh)

allow init-qcom-devstart-sh shell_exec:file rx_file_perms;

# execute toybox/toolbox
allow init-qcom-devstart-sh toolbox_exec:file rx_file_perms;
allow init-qcom-devstart-sh vendor_shell_exec:file rx_file_perms;
allow init-qcom-devstart-sh vendor_toolbox_exec:file rx_file_perms;

# Set the sys.qcom.devup property
set_prop(init-qcom-devstart-sh, system_prop)
Expand Down
8 changes: 3 additions & 5 deletions sepolicy/vendor/init-insmod-sh.te
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
type init-insmod-sh, domain, vendor_executes_system_violators;
type init-insmod-sh, domain;
type init-insmod-sh_exec, exec_type, vendor_file_type, file_type;

init_daemon_domain(init-insmod-sh)

allow init-insmod-sh shell_exec:file rx_file_perms;

# execute toybox/toolbox
allow init-insmod-sh toolbox_exec:file rx_file_perms;
allow init-insmod-sh vendor_shell_exec:file rx_file_perms;
allow init-insmod-sh vendor_toolbox_exec:file rx_file_perms;

# Set the sys.touch.modules.ready property
set_prop(init-insmod-sh, system_prop)
Expand Down
5 changes: 3 additions & 2 deletions sepolicy/vendor/init-ipastart-sh.te
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
type init-qcom-ipastart-sh, domain, vendor_executes_system_violators;
type init-qcom-ipastart-sh, domain;
type init-qcom-ipastart-sh_exec, exec_type, vendor_file_type, file_type;

init_daemon_domain(init-qcom-ipastart-sh)

allow init-qcom-ipastart-sh shell_exec:file rx_file_perms;
allow init-qcom-ipastart-sh vendor_shell_exec:file rx_file_perms;
allow init-qcom-ipastart-sh vendor_toolbox_exec:file rx_file_perms;

# Set /dev/ipa to 1
allow init-qcom-ipastart-sh ipa_dev:chr_file w_file_perms;
6 changes: 3 additions & 3 deletions sepolicy/vendor/init_power.te
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
type init_power, domain, vendor_executes_system_violators;
type init_power, domain;
type init_power_exec, exec_type, vendor_file_type, file_type;

init_daemon_domain(init_power)

set_prop(init_power, post_boot_prop)

allow init_power shell_exec:file rx_file_perms;
allow init_power toolbox_exec:file rx_file_perms;
allow init_power vendor_shell_exec:file rx_file_perms;
allow init_power vendor_toolbox_exec:file rx_file_perms;

r_dir_file(init_power, sysfs_msm_subsys)

Expand Down
6 changes: 3 additions & 3 deletions sepolicy/vendor/init_radio.te
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# /vendor/bin/init.radio.sh
type init_radio, domain, vendor_executes_system_violators;
type init_radio, domain;
type init_radio_exec, exec_type, vendor_file_type, file_type;

init_daemon_domain(init_radio)

allow init_radio shell_exec:file r_file_perms;
allow init_radio toolbox_exec:file rx_file_perms;
allow init_radio vendor_shell_exec:file rx_file_perms;
allow init_radio vendor_toolbox_exec:file rx_file_perms;

allow init_radio radio_data_file:dir create_dir_perms;
allow init_radio radio_data_file:file create_file_perms;

0 comments on commit 4a2b3af

Please sign in to comment.