From ef9c7de7bfc9b11942d61a5d92abedbe623cdb1c Mon Sep 17 00:00:00 2001 From: Qin Fandong Date: Fri, 22 Oct 2021 08:40:02 +0800 Subject: [PATCH 1/4] Add license_file in BUILD.gn Signed-off-by: Qin Fandong --- BUILD.gn | 3 +++ 1 file changed, 3 insertions(+) diff --git a/BUILD.gn b/BUILD.gn index 2d55429bb..edae61c09 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -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 无法支持五级系统目录,所以在此作出规避, -- Gitee From a9fc0320c2a36a498ee65f3d551e50c71838a02d Mon Sep 17 00:00:00 2001 From: Qin Fandong Date: Fri, 22 Oct 2021 09:07:59 +0800 Subject: [PATCH 2/4] Update README.md Signed-off-by: Qin Fandong --- README.md | 38 +------------------------------------- 1 file changed, 1 insertion(+), 37 deletions(-) diff --git a/README.md b/README.md index 1d8c1e858..45f72236b 100644 --- a/README.md +++ b/README.md @@ -68,7 +68,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 +87,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 。 -- Gitee From 391f24afcc69ec5ac938a8a461586db81c8c91c8 Mon Sep 17 00:00:00 2001 From: Qin Fandong Date: Fri, 22 Oct 2021 09:10:55 +0800 Subject: [PATCH 3/4] Update README.md Signed-off-by: Qin Fandong --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 45f72236b..ddfa5405e 100644 --- a/README.md +++ b/README.md @@ -67,7 +67,6 @@ SELinux (安全增强式 Linux , Security-Enhanced Linux )是 Linux 历史 首先配置好环境。 ``` -sudo apt update 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" -- Gitee From 280972fb20196e9392e073a01bd6d217fa780b40 Mon Sep 17 00:00:00 2001 From: Qin Fandong Date: Fri, 22 Oct 2021 09:21:08 +0800 Subject: [PATCH 4/4] Update Copyright for BUILD.gn Signed-off-by: Qin Fandong --- BUILD.gn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BUILD.gn b/BUILD.gn index edae61c09..6fbc6af35 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. -- Gitee