auto run script while boot up

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

auto run script while boot up

510 次查看
afreenmusarrath23
Contributor I

hi 

i'm facing issue in running simple script while boot up on imx8mm mini board

these are the changes i have made 

in init.imx8mm.rc --> 

on property:sys.boot_completed=1
start init-myservice-sh

service init-myservice-sh /vendor/bin/sh /vendor/bin/init.myscript.sh
class main
user root
group root system
disabled
oneshot

in evk8mm.mk

#Script
PRODUCT_COPY_FILES += \
device/fsl/imx8m/evk_8mm/init.myscript.sh:$(TARGET_COPY_OUT_VENDOR)/bin/init.myscript.sh

 

and my script is in vendor/bin/

 

what else changes do i need to make for running a script automtically

0 项奖励
1 回复

494 次查看
Zhiming_Liu
NXP TechSupport
NXP TechSupport

1.sepolicy/file_contexts

/vendor/bin/init.myscript.sh u:object_r:init-myservice-sh_exec:s0

2.te

 

type init-myservice-sh, domain;
type init-myservice-sh_exec, exec_type, file_type;
#init_daemon_domain(rftoolcopy)

allow init-myservice-sh shell_exec:file { getattr open read };
#allow rftoolcopy toolbox_exec:file { getattr execute read open execute_no_trans };
allow init-myservice-sh storage_file:lnk_file { read   };
allow init-myservice-sh tmpfs:dir { search  };
allow init-myservice-sh mnt_user_file:dir { search  };
allow init-myservice-sh mnt_user_file:lnk_file {  read };
.......
.......

 

 

0 项奖励