Android AOSP boot.img 编辑 Seliunx 规则时未更新
Android AOSP boot.img not updated while Editing Seliunx Rule
我正在尝试编译AOSP,编译成功一次后,由于Android SElinux implementation,我更改了一些selinux规则,然后进入AOSP根目录和运行 m
,它确实找到了一些差异并且似乎编译了一个新的 boot.img(由于它生成的时间),但是在我用 fastboot flashall -w
刷新它之后,dmesg 仍然显示我的 avc sepolicy 失败刚刚添加
所以问题是我的例程做错了吗?
有什么简单的方法可以确定我修改后的 sepolicy 是否被编译到 boot.img?
也许我误解或忽略了某些机制?
PS:分支是 android-9.0.0_r2 午餐 42
我先尝试 运行 mm 在 /system/sepolicy 下(我改变了 te)然后 运行 m 它仍然是问题
通常是的,boot.img 应该在更改 .te 文件后更新,但我不确定构建脚本是否会检查这一点,因此您可以在删除与 sepolicy 相关的中间文件后重建启动映像。
检查 policy.conf
文件是否已使用新规则更新,在 out
文件夹中。
您可能还想阅读 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
回答你的第二个问题:你可以unpack the boot.img and check whether your rules have been added with sepolicy-analyze。
示例:
. build/envsetup.sh
lunch
# List all known attributes
sepolicy-analyze <path-to-your-extracted-sepolicy-file> attribute -l
我正在尝试编译AOSP,编译成功一次后,由于Android SElinux implementation,我更改了一些selinux规则,然后进入AOSP根目录和运行 m
,它确实找到了一些差异并且似乎编译了一个新的 boot.img(由于它生成的时间),但是在我用 fastboot flashall -w
刷新它之后,dmesg 仍然显示我的 avc sepolicy 失败刚刚添加
所以问题是我的例程做错了吗? 有什么简单的方法可以确定我修改后的 sepolicy 是否被编译到 boot.img?
也许我误解或忽略了某些机制?
PS:分支是 android-9.0.0_r2 午餐 42 我先尝试 运行 mm 在 /system/sepolicy 下(我改变了 te)然后 运行 m 它仍然是问题
通常是的,boot.img 应该在更改 .te 文件后更新,但我不确定构建脚本是否会检查这一点,因此您可以在删除与 sepolicy 相关的中间文件后重建启动映像。
检查 policy.conf
文件是否已使用新规则更新,在 out
文件夹中。
您可能还想阅读 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
回答你的第二个问题:你可以unpack the boot.img and check whether your rules have been added with sepolicy-analyze。
示例:
. build/envsetup.sh
lunch
# List all known attributes
sepolicy-analyze <path-to-your-extracted-sepolicy-file> attribute -l