do_install failing with monolithic policy in meta-selinux refpolicy
Hi Yocto team,
I'm trying to enable SELinux in my custom image with meta-selinux layer. I have poky & meta-openembedded also in place. The refpolicy I have used is "refpolicy-standard" & mode as "enforcing". I have enabled monolithic by setting POLICY_MONOLITHIC to "y" in https://git.yoctoproject.org/meta-selinux/tree/recipes-security/refpolicy/refpolicy_common.inc#n111
But compiling refpolicy-standard is failing at do_install with following error :
Creating policy.xml
Updating policy/booleans.conf and policy/modules.confsupport/sedoctool.py:269: SyntaxWarning: "is not" with a literal. Did you mean "!="?
if desc.data is not '':
Installing local.users
Failed to open /yocto/build/tmp/work/qemuarm64-gnu-linux/refpolicy-standard/2.20190201+gitAUTOINC+df696a3254-r0/image/usr/share/selinux/standard/*.*: No such file or directory
bzip2: Can't open input file /yocto/build/tmp/work/qemuarm64-gnu-linux/refpolicy-standard/2.20190201+gitAUTOINC+df696a3254-r0/image/usr/share/selinux/standard/*.*: No such file or directory.
cp: cannot stat '/yocto/build/tmp/work/qemuarm64-gnu-linux/refpolicy-standard/2.20190201+gitAUTOINC+df696a3254-r0/image/usr/share/selinux/standard/*.*': No such file or directory
WARNING: exit code 1 from a shell command.
ERROR: Execution of '/yocto/build/tmp/work/qemuarm64-gnu-linux/refpolicy-standard/2.20190201+gitAUTOINC+df696a3254-r0/temp/run.do_install.2247013' failed with exit code 1:
Compiling and installing standard /yocto/build/tmp/work/qemuarm64-gnu-li
This seems like an issue with prepare_policy_store function in https://git.yoctoproject.org/meta-selinux/tree/recipes-security/refpolicy/refpolicy_common.inc#n161
which is trying to access each .pp file, but these files will not be present when using monolithic option.
Any help on the installation failure? Thanks in advance!
Quoted 5 lines · PS
Hi Yocto team,
I'm trying to enable SELinux in my custom image with meta-selinux layer. I have poky & meta-openembedded also in place. The refpolicy I have used is "refpolicy-standard" & mode as "enforcing". I have enabled monolithic by setting
POLICY_MONOLITHICto "y" in https://git.yoctoproject.org/meta-selinux/tree/recipes-security/refpolicy/refpolicy_common.inc#n111 <https://urldefense.com/v3/__https://git.yoctoproject.org/meta-selinux/tree/recipes-security/refpolicy/refpolicy_common.inc*n111__;Iw!!AjveYdw8EvQ!e9-FLE_IzDF9nwjbscOzjcOhx36-DN7PF5033coGG60GxIN-jQJNPwP8lUYlMs8DUy6dadU5lrWY1ALECnM5aEXZCSu9WIY$>
But compiling refpolicy-standard is failing atdo_installwith following error :
Quoted 14 lines
Creating policy.xml
Updatingpolicy/booleans.confandpolicy/modules.confsupport/sedoctool.py<https://urldefense.com/v3/__http://sedoctool.py__;!!AjveYdw8EvQ!e9-FLE_IzDF9nwjbscOzjcOhx36-DN7PF5033coGG60GxIN-jQJNPwP8lUYlMs8DUy6dadU5lrWY1ALECnM5aEXZ5h4hUuI$>:269: SyntaxWarning: "is not" with a literal. Did you mean "!="?
if desc.data <https://urldefense.com/v3/__http://desc.data__;!!AjveYdw8EvQ!e9-FLE_IzDF9nwjbscOzjcOhx36-DN7PF5033coGG60GxIN-jQJNPwP8lUYlMs8DUy6dadU5lrWY1ALECnM5aEXZAGi5ISQ$> is not '':
Installing local.users
Failed to open /yocto/build/tmp/work/qemuarm64-gnu-linux/refpolicy-standard/2.20190201+gitAUTOINC+df696a3254-r0/image/usr/share/selinux/standard/*.*: No such file or directory
bzip2: Can't open input file /yocto/build/tmp/work/qemuarm64-gnu-linux/refpolicy-standard/2.20190201+gitAUTOINC+df696a3254-r0/image/usr/share/selinux/standard/*.*: No such file or directory.
cp: cannot stat '/yocto/build/tmp/work/qemuarm64-gnu-linux/refpolicy-standard/2.20190201+gitAUTOINC+df696a3254-r0/image/usr/share/selinux/standard/*.*': No such file or directory
WARNING: exit code 1 from a shell command.
ERROR: Execution of '/yocto/build/tmp/work/qemuarm64-gnu-linux/refpolicy-standard/2.20190201+gitAUTOINC+df696a3254-r0/temp/run.do_install.2247013' failed with exit code 1:
Compiling and installing standard /yocto/build/tmp/work/qemuarm64-gnu-li
This seems like an issue withprepare_policy_storefunction in https://git.yoctoproject.org/meta-selinux/tree/recipes-security/refpolicy/refpolicy_common.inc#n161 <https://urldefense.com/v3/__https://git.yoctoproject.org/meta-selinux/tree/recipes-security/refpolicy/refpolicy_common.inc*n161__;Iw!!AjveYdw8EvQ!e9-FLE_IzDF9nwjbscOzjcOhx36-DN7PF5033coGG60GxIN-jQJNPwP8lUYlMs8DUy6dadU5lrWY1ALECnM5aEXZ4_GY0Ik$>
which is trying to access each .pp file, but these files will not be present when using monolithic option.
Any help on the installation failure? Thanks in advance!
Thanks for reporting this issue. We haven't considered POLICY_MONOLITHIC = "y" in meta-selinux yet, so it should not be supported. I'll look at it.
//Yi
Quoted 9 lines
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#63905):https://lists.yoctoproject.org/g/yocto/message/63905 Mute This Topic:https://lists.yoctoproject.org/mt/108691326/7283133 Group Owner:[email protected] Unsubscribe:https://lists.yoctoproject.org/g/yocto/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-
Thanks Yi Zhao. By when can we expect it to be working on latest branch?