mirror of
https://gitee.com/openharmony/security_selinux
synced 2024-11-27 07:10:25 +00:00
!12 根据编译参数 enforce_selinux 来确定是否开启 enforce 模式
Merge pull request !12 from Qin Fandong/master
This commit is contained in:
commit
89fcf3fd96
8
BUILD.gn
8
BUILD.gn
@ -188,8 +188,8 @@ action("build_file_contexts_bin") {
|
|||||||
outputs += [ target_out_dir + "/file_contexts" ]
|
outputs += [ target_out_dir + "/file_contexts" ]
|
||||||
}
|
}
|
||||||
|
|
||||||
action("enable_selinux") {
|
action("enforce_selinux") {
|
||||||
script = "scripts/enable_selinux.sh"
|
script = "scripts/enforce_selinux.sh"
|
||||||
outputs = [ "$target_out_dir/" ]
|
outputs = [ "$target_out_dir/" ]
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -213,8 +213,8 @@ ohos_prebuilt_etc("config") {
|
|||||||
source = "$SELINUX_ROOT_DIR/config/config"
|
source = "$SELINUX_ROOT_DIR/config/config"
|
||||||
license_file = "$SELINUX_ROOT_DIR/LICENSE"
|
license_file = "$SELINUX_ROOT_DIR/LICENSE"
|
||||||
part_name = "selinux"
|
part_name = "selinux"
|
||||||
if (enable_selinux) {
|
if (enforce_selinux) {
|
||||||
deps = [ ":enable_selinux" ]
|
deps = [ ":enforce_selinux" ]
|
||||||
}
|
}
|
||||||
relative_install_dir = "selinux/"
|
relative_install_dir = "selinux/"
|
||||||
}
|
}
|
||||||
|
@ -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"
|
./build.sh --product-name Hi3516DV300 --gn-args "build_selinux=true"
|
||||||
|
Loading…
Reference in New Issue
Block a user