1

I have an old stock Android 5.1.1. It has custom twrp recovery and is rooted. I have the stock boot.img file and am able to edit the init.rc and repack and flash it back with fastboot flash boot boot.img. No problem there. And after flashing the boot.img, I can cat /init.rc and can see the changes that I made to run a script from /system/xbin/. However, the script does not execute at all. On the very end of init.rc, I placed this line of code

on property:sys.boot_completed=1
    start initAsic

service initAsic /system/xbin/script.sh
    seclabel u:r:init:s0
    user root
    group root
    oneshot
    disabled

The script.sh is already chmod to 755 in /system/xbin/script.sh and in script.sh, there this

echo "hello" > /data/local/tmp/file.test
iptables -P FORWARD DROP

The problem is, it doesn't work. So googling further revealed that I need to set selinux mode to permissive. And so I did with,

setenforce 0

It does set SELinux to permissive, however it's only temporary, because on reboot it goes back to enforcing mode. I was wondering if there was any way for me to modify the content within boot.img that would lead SELinux to be permissive always.And also, is permissive mode the real reason why my init script isn't running, or am I doing something wrong?

1

0

You must log in to answer this question.

Browse other questions tagged .