为什么bitbake selinux 而不是bitbake selinux_2.7
时间: 2023-09-18 21:08:58 浏览: 50
在OpenEmbedded/Yocto中,软件包的名称通常遵循以下模式:“名称_版本号”。然而,有时候软件包的版本号可能会被省略,这意味着默认情况下使用最新版本。在您的情况下,您只使用了“bitbake selinux”命令,而没有指定版本号,因此它默认使用最新版本的selinux软件包。如果您想使用特定版本的selinux软件包,您可以使用“bitbake selinux_版本号”命令。
相关问题
yocto rocko 中bitbake selinux 时出现ERROR: Nothing PROVIDES 'selinux'. Close matches: libselinux syslinux selinux-gui
在 Yocto Rocko 中,如果你想编译 selinux,需要确保在你的 local.conf 文件中设置了以下内容:
```
DISTRO_FEATURES_append = " selinux"
```
这会启用 selinux 功能,并将其作为一个构建选项添加到 Yocto 构建系统中。同时,为了确保可以找到 selinux,你可能还需要在你的 bblayers.conf 文件中包含相关的 meta 层,例如:
```
BBLAYERS ?= " \
/path/to/poky/meta \
/path/to/poky/meta-poky \
/path/to/poky/meta-yocto-bsp \
/path/to/meta-security \
"
```
其中,`meta-security` 就是包含 selinux 的 meta 层。
在设置好这些内容后,重新运行 `bitbake selinux` 命令,应该就可以编译成功了。如果还有其他问题,请随时问我。
selinux_status
以下是获取SELinux状态的方法:
1. 使用sestatus命令获取SELinux状态:
```shell
/usr/sbin/sestatus
```
输出示例:
```
SELinux status: enabled
SELinuxfs mount: /sys/fs/selinux
SELinux root directory: /etc/selinux
Loaded policy name: targeted
Current mode: enforcing
Mode from config file: enforcing
Policy MLS status: enabled
Policy deny_unknown status: allowed
Max kernel policy version: 28
```
2. 查看SELinux配置文件获取SELinux状态:
```shell
vim /etc/selinux/config
```
在配置文件中找到以下行:
```
SELINUX=enforcing
```
如果该行的值为enforcing,则表示SELinux处于强制模式。如果该行的值为permissive,则表示SELinux处于宽容模式。如果该行的值为disabled,则表示SELinux已禁用。