selinux 开关在parameter文件中指定。

androidboot.selinux=enforcing
或者
androidboot.selinux=permissive

parameter 在 mkimage.sh 脚本中有指定:

if [[ $TARGET_BOARD_PLATFORM = "rk3399" ]]; then
PARAMETER=device/rockchip/$TARGET_BOARD_PLATFORM/$TARGET_PRODUCT/parameter.txt
else
PARAMETER=RKTools/AndroidTool/rockdev/parameter
fi

pandora生效的配置是:

PARAMETER=RKTools/AndroidTool/rockdev/parameter
/RKTools/AndroidTool/rockdev$ cat parameter

FIRMWARE_VER:6.0.0
MACHINE_MODEL:RK3368
MACHINE_ID:007
MANUFACTURER:RK3368
MAGIC: 0x5041524B
ATAG: 0x00200800
MACHINE: 3368
CHECK_MASK: 0x80
KERNEL_IMG: 0x60408000
PWR_HLD: 0,0,A,0,1
#COMBINATION_KEY: 0,6,A,1,0
CMDLINE: console=ttyS2 androidboot.baseband=N/A androidboot.selinux=enforcing androidboot.hardware=rk30board androidboot.console=ttyS2 init=/init mtdparts=rk29xxnand:[email protected](uboot),[email protected](trust),[email protected](misc),[email protected](resource),[email protected](kernel),[email protected](boot),[email protected](recovery),[email protected](backup),[email protected](cache),[email protected](kpanic),[email protected](system),[email protected](metadata),[email protected](baseparamer),[email protected](radical_update),[email protected](userdata)

小技巧:

调试selinux权限的时候,可以将 androidboot.selinux 改为 permissive,这样就会提示权限错误,但是不会终止程序的执行,方便看到所有需要配置的selinux权限,而不是碰到一个改一个,提高效率。

烧录 androidboot.selinux=permissive 的paramter文件:

RK3368 selinux 权限调测小技巧

查看需要配置哪些selinux权限:

logcat -b all | grep avc
或者
logcat -b all | grep denied

 

 

相关文章: