!12 根据编译参数 enforce_selinux 来确定是否开启 enforce 模式

Merge pull request !12 from Qin Fandong/master
This commit is contained in:
openharmony_ci 2022-01-06 03:07:24 +00:00 committed by Gitee
commit 89fcf3fd96
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
3 changed files with 9 additions and 6 deletions

View File

@ -188,8 +188,8 @@ action("build_file_contexts_bin") {
outputs += [ target_out_dir + "/file_contexts" ]
}
action("enable_selinux") {
script = "scripts/enable_selinux.sh"
action("enforce_selinux") {
script = "scripts/enforce_selinux.sh"
outputs = [ "$target_out_dir/" ]
}
@ -213,8 +213,8 @@ ohos_prebuilt_etc("config") {
source = "$SELINUX_ROOT_DIR/config/config"
license_file = "$SELINUX_ROOT_DIR/LICENSE"
part_name = "selinux"
if (enable_selinux) {
deps = [ ":enable_selinux" ]
if (enforce_selinux) {
deps = [ ":enforce_selinux" ]
}
relative_install_dir = "selinux/"
}

View File

@ -62,9 +62,12 @@ SELinux (安全增强式 Linux Security-Enhanced Linux )是 Linux 历史
### 编译代码
根据文档[《搭建Ubuntu环境(获取源码及编译,安装包方式)》](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/quick-start/quickstart-standard-package-environment.md)编译主线代码。
1. 根据文档[《获取源码》](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/quick-start/quickstart-standard-sourcecode-acquire.md)获取主线代码。
1. 根据文档[《源码编译》](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/quick-start/quickstart-standard-running-hi3516-build.md)编译主线代码。
### 进行编译
### 编译镜像
运行以下命令编译打包支持 SELinux 的镜像。
```
./build.sh --product-name Hi3516DV300 --gn-args "build_selinux=true"