Compare commits

...

10 Commits

Author SHA1 Message Date
openeuler-ci-bot
09bcd8cac9
!15 将master分支内容同步至24.03分支
From: @yukaii 
Reviewed-by: @bugflyfly 
Signed-off-by: @bugflyfly
2024-04-27 08:45:25 +00:00
openeuler-ci-bot
4121daea46
!14 适配嵌入式环境,修复编译问题
From: @s-c-c 
Reviewed-by: @yukaii 
Signed-off-by: @yukaii
2024-04-10 09:54:03 +00:00
s_c_c
3a8d0a8f2e Fix BUILD.gn sysroot path for embedded 2024-04-02 16:31:32 +08:00
s_c_c
287bc1ee92 Fix config_safwk include_dirs for embedded 2024-04-01 20:16:22 +08:00
openeuler-ci-bot
be0a1965db
!13 update version and add change log for previous modification
From: @tian2020 
Reviewed-by: @bugflyfly 
Signed-off-by: @bugflyfly
2024-03-27 08:17:35 +00:00
tianhang
7fd85bd059 update version and add change log for previous modification 2024-03-27 13:47:58 +08:00
openeuler-ci-bot
a8075d1340
!11 Ajust the order of operations
From: @bugflyfly 
Reviewed-by: @tian2020, @yukaii 
Signed-off-by: @yukaii
2024-03-26 12:05:18 +00:00
openeuler-ci-bot
47fbcb6646
!12 update the order of stopping services
From: @bugflyfly 
Reviewed-by: @yukaii 
Signed-off-by: @yukaii
2024-03-26 12:05:08 +00:00
虫儿飞
4075b150bf update the order of stopping services
Services should be stopped in the reverse order in which they were created

Signed-off-by: 虫儿飞 <wei_jiangang@hoperun.com>
2024-03-26 16:37:08 +08:00
Wei Jiangang
6501cd5e86 Ajust the order of operations
Check parameters first.
rename library and then declare Env path
Check the path before calling /system/bin/<commands>.

Signed-off-by: Wei Jiangang <wei_jiangang@hoperun.com>
2024-03-25 18:31:13 +08:00
6 changed files with 68 additions and 23 deletions

View File

@ -0,0 +1,33 @@
From 17be025e940fea23e6fdb7019f08fe9b3d656b91 Mon Sep 17 00:00:00 2001
From: s_c_c <shichuchao@huawei.com>
Date: Mon, 1 Apr 2024 20:14:11 +0800
Subject: [PATCH] feat for embedded fix config_safwk include_dirs
---
services/safwk/BUILD.gn | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/services/safwk/BUILD.gn b/services/safwk/BUILD.gn
index e25ecb9..09a6acc 100644
--- a/services/safwk/BUILD.gn
+++ b/services/safwk/BUILD.gn
@@ -12,6 +12,7 @@
# limitations under the License.
import("//build/ohos.gni")
+import("//build/config/sysroot.gni")
################################################################################
config("config_safwk") {
@@ -20,7 +21,7 @@ config("config_safwk") {
"//foundation/systemabilitymgr/safwk/services/safwk/include",
"//foundation/systemabilitymgr/samgr/services/lsamgr/include",
"//foundation/systemabilitymgr/safwk/interfaces/innerkits/safwk",
- "//foundation/communication/ipc/interfaces/innerkits/ipc_core/include",
+ "${sysroot}/usr/include/ipc",
]
}
--
2.20.1 (Apple Git-117)

View File

@ -13,24 +13,24 @@
import("//build/ohos.gni")
import("//build/ohos_var.gni")
import("//build/config/sysroot.gni")
# 建立所需头文件链接
exec_script("//build/openeuler/script/link.py", [ "--src_target", "/usr/include/safwk/system_ability.h", "--dest_target",
exec_script("//build/openeuler/script/link.py", [ "--src_target", "${sysroot}/usr/include/safwk/system_ability.h", "--dest_target",
rebase_path("//foundation/systemabilitymgr/safwk/interfaces/innerkits/safwk/system_ability.h") ], "string")
exec_script("//build/openeuler/script/link.py", [ "--src_target", "/usr/include/safwk", "--dest_target",
exec_script("//build/openeuler/script/link.py", [ "--src_target", "${sysroot}/usr/include/safwk", "--dest_target",
rebase_path("//foundation/systemabilitymgr/safwk/services/safwk/include") ], "string")
config("system_ability_config") {
visibility = [ ":*" ]
include_dirs = [
"../../../services/safwk/include",
"//foundation/systemabilitymgr/safwk/interfaces/innerkits/safwk",
"${sysroot}/usr/include/safwk",
]
}
ohos_prebuilt_shared_library("system_ability_fwk") {
source = "/usr/lib64/libsystem_ability_fwk.z.so"
source = "${sysroot}/usr/lib64/libsystem_ability_fwk.z.so"
public_configs = [ ":system_ability_config" ]

View File

@ -6,7 +6,7 @@
Name: systemabilitymgr_safwk
Version: 1.0.0
Release: 2
Release: 5
Summary: System ability manager
License: Apache-2.0
Url: https://gitee.com/openharmony/systemabilitymgr_safwk
@ -18,6 +18,7 @@ Source5: start_services.sh
Source6: stop_services.sh
Patch1: 0000-remove-dependency-on-hitrace-safwk.patch
Patch2: 0001-feat-for-embedded-fix-config_safwk-include_dirs.patch
BuildRequires: gcc, make, hilog, libboundscheck
BuildRequires: libatomic,libicu-devel, libxml2-devel, cjson-devel
@ -51,6 +52,7 @@ mkdir -p %{samgr_dir}
%setup -q -D -T -a 1 -c -n %{samgr_dir}
# patch命令统一使用-P来指定第几个patch
%patch -P1 -p1 -d %{samgr_dir}/safwk
%patch -P2 -p1 -d %{samgr_dir}/safwk
%build
rm -rf %{_builddir}/out
@ -107,6 +109,15 @@ ln -s /usr/include/safwk/system_ability.h %{safwk_path}/interfaces/innerkits/saf
%{build_opt}/*
%changelog
* Tue Apr 2 2024 s_c_c <shichuchao@huawei.com> - 1.0.0-5
- Fix BUILD.gn sysroot path for embedded
* Mon Apr 1 2024 s_c_c <shichuchao@huawei.com> - 1.0.0-4
- Fix config_safwk include_dirs for embedded
* Wed Mar 27 2024 tianhang <tian_hang@hoperun.com> - 1.0.0-3
- update version to 1.0.0-3
-
* Mon Dec 18 2023 Peng He <hepeng68@huawei.com> - 1.0.0-2
- Add shell scripts for services start/stop

View File

@ -12,9 +12,10 @@
# limitations under the License.
import("//build/ohos.gni")
import("//build/config/sysroot.gni")
ohos_prebuilt_executable("sa_main") {
source = "/usr/bin/sa_main"
source = "${sysroot}/usr/bin/sa_main"
install_enable = true
part_name = "safwk"

View File

@ -92,17 +92,10 @@ start_process() {
fi
}
# 如果有进程还在,暂停服务防止双进程存在
if pgrep -x "samgr" > /dev/null; then
log info "service is running, stop it"
/system/bin/stop_services.sh all
sleep 2
fi
# 软链接动态库
if [ ! -e "/usr/lib64/libsec_shared.z.so" ]; then
log info "libsec_shared.z.so not exist, create it"
ln -s /usr/lib64/libboundscheck.so /usr/lib64/libsec_shared.z.so
# 判断参数是否为空
if [ -z "$1" ]; then
log error "Usage: $0 [all|samgr|huks|deviceauth|softbus|device_manager|dfs|datamgr]"
exit 1
fi
# 新建日志目录
@ -118,10 +111,10 @@ if [ ! -e "/etc/SN" ]; then
echo "$ipv4_address" | sudo tee /etc/SN > /dev/null
fi
# 判断参数是否为空
if [ -z "$1" ]; then
log error "Usage: $0 [all|samgr|huks|deviceauth|softbus|device_manager|dfs|datamgr]"
exit 1
# 软链接动态库
if [ ! -e "/usr/lib64/libsec_shared.z.so" ]; then
log info "libsec_shared.z.so not exist, create it"
ln -s /usr/lib64/libboundscheck.so /usr/lib64/libsec_shared.z.so
fi
# 检查 $LD_LIBRARY_PATH 是否包含 "/system/lib64",如果不包含则加入
@ -155,6 +148,13 @@ if [ ! -e "/dev/binder" ]; then
fi
cd ${BIN_PATH} || exit
# 如果有进程还在,暂停服务防止双进程存在
if pgrep -x "samgr" > /dev/null; then
log info "service is running, stop it"
/system/bin/stop_services.sh all
sleep 2
fi
# 验证参数并执行相应命令
if [ "$1" == "all" ]; then
log info "Starting all services..."

View File

@ -7,13 +7,13 @@
# 定义map保存参数和对应执行的shell命令
declare -A COMMAND_MAP=(
["datamgr"]="pkill -f distributeddata"
["dfs"]="pkill -f distributedfile"
["dm"]="pkill -f device_manager"
["softbus"]="pkill -f softbus_server"
["deviceauth"]="pkill -f deviceauth_service"
["huks"]="pkill -f huks_service"
["samgr"]="pkill -f samgr"
["datamgr"]="pkill -f distributeddata"\
)
# 日志打印函数