diff --git a/BUILD.gn b/BUILD.gn index 2d55429bb996034566c4c577974bc6b8f0054072..6fbc6af35cdf0cfd3e9b2fcb9a32ddf0cdf46c7b 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright 2021 北京万里红科技有限公司 +# Copyright (c) 2021 北京万里红科技有限公司 # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -151,18 +151,21 @@ action("build_policy") { ohos_prebuilt_etc("build_sepolicy") { deps = [ ":build_policy" ] source = "$SELINUX_ROOT_DIR/sepolicy/policy.31" + license_file = "$SELINUX_ROOT_DIR/LICENSE.txt" part_name = "selinux" relative_install_dir = "selinux/targeted/policy/" } ohos_prebuilt_etc("config") { source = "$SELINUX_ROOT_DIR/config/config" + license_file = "$SELINUX_ROOT_DIR/LICENSE.txt" part_name = "selinux" relative_install_dir = "selinux/" } ohos_prebuilt_etc("file_contexts") { source = "$SELINUX_ROOT_DIR/sepolicy/file_contexts" + license_file = "$SELINUX_ROOT_DIR/LICENSE.txt" part_name = "selinux" # FIXME 此处不应该改变 file_contexts 的约定路径! # 因为 OpenHarmony 的 e2fsdroid 无法支持五级系统目录,所以在此作出规避, diff --git a/README.md b/README.md index 1d8c1e85899a3949e356621809427bb4c6348baf..ddfa5405e57a5a319de1f9469c3472b2472996ca 100644 --- a/README.md +++ b/README.md @@ -67,8 +67,7 @@ SELinux (安全增强式 Linux , Security-Enhanced Linux )是 Linux 历史 首先配置好环境。 ``` -sudo apt update -sudo apt install binutils git git-lfs gnupg flex bison gperf build-essential zip curl zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z1-dev ccache libgl1-mesa-dev libxml2-utils xsltproc unzip m4 bc gnutls-bin python3.8 python3-pip ruby +sudo apt-get update && sudo apt-get install binutils git git-lfs gnupg flex bison gperf build-essential zip curl zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z1-dev ccache libgl1-mesa-dev libxml2-utils xsltproc unzip m4 bc gnutls-bin python3.8 python3-pip ruby git config --global user.name "yourname" git config --global user.email "your-email-address" git config --global credential.helper store @@ -87,42 +86,6 @@ repo sync -c repo forall -c 'git lfs pull' ``` -### 同步相关仓库 - -代码同步完毕后,依次同步以下仓库。 - -| 目录 | 仓库 | -| --- | --- | -| `base/security/selinux/` | `https://gitee.com/openharmony-sig/security_selinux.git` | -| `third_party/selinux/` | `https://gitee.com/openharmony-sig/third_party_selinux.git` | -| `productdefine/common/` | `https://gitee.com/shell_way/productdefine_common.git` | -| `base/startup/init_lite/` | `https://gitee.com/shell_way/startup_init_lite.git` | -| `third_party/pcre` | `https://gitee.com/openharmony-sig/third_party_pcre.git` | - -可以进入到同步好的 OpenHarmony 代码目录,执行以下命令。 - -``` -pushd ./base/security/ -git clone https://gitee.com/openharmony-sig/security_selinux.git ./selinux/ -popd - -pushd ./third_party/ -git clone https://gitee.com/openharmony-sig/third_party_selinux.git ./selinux/ -popd - -pushd ./productdefine/common/ -git pull https://gitee.com/shell_way/productdefine_common.git -popd - -pushd ./base/startup/init_lite/ -git pull https://gitee.com/shell_way/startup_init_lite.git -popd - -pushd ./third_party/ -git clone https://gitee.com/openharmony-sig/third_party_pcre2.git ./pcre2/ -popd -``` - ### 进行编译 同步完成后,执行下面的命令编译项目,注意需要使用参数 `--gn-args "build_selinux=true"` 启用 SELinux 。