Search code examples
androidandroid-sourceselinux

Android AOSP boot.img not updated while Editing Seliunx Rule


I'm trying to compile the AOSP, And After compiled success once, I changed some selinux rule due to Android SElinux implementation, And after that, I turn into AOSP root directory and run m, It indeed find some diff and seems compiled a new boot.img(due to time it generated), But After I flash it with fastboot flashall -w the dmesg still showing the avc sepolicy failed which I was just added

So the question is Am I doing wrong with the routine? And Is there some easy way I could identify whether my modified sepolicy was compiled into the boot.img?

Maybe there are mechanisms I've to misunderstand or ignored ?

PS: Branch is android-9.0.0_r2 with lunch 42 I've tried firstly run mm under /system/sepolicy (where I changed the te) and then run m it still remains the issue


Solution

  • Generally yes, boot.img should be updated after changing .te files, but I'm not sure the build script checks that, so you may just rebuild boot image after deleting intermediate files related to sepolicy.

    Check if policy.conf file was updated with the new rule, in out folder.

    related topic here: https://android.stackexchange.com/questions/69954/how-to-unpack-and-edit-boot-img-for-rom-porting/154621#154621

    Also you may want to read https://www.whitewinterwolf.com/posts/2016/08/15/examine-android-selinux-policy/ and https://ge0n0sis.github.io/posts/2015/12/exploring-androids-selinux-kernel-policy/#dumping-sepolicy-back-to-policyconf