Compare commits
10 Commits
c1ba66a885
...
09bcd8cac9
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
09bcd8cac9 | ||
|
|
4121daea46 | ||
|
|
3a8d0a8f2e | ||
|
|
287bc1ee92 | ||
|
|
be0a1965db | ||
|
|
7fd85bd059 | ||
|
|
a8075d1340 | ||
|
|
47fbcb6646 | ||
|
|
4075b150bf | ||
|
|
6501cd5e86 |
33
0001-feat-for-embedded-fix-config_safwk-include_dirs.patch
Normal file
33
0001-feat-for-embedded-fix-config_safwk-include_dirs.patch
Normal 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)
|
||||
|
||||
@ -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" ]
|
||||
|
||||
|
||||
13
safwk.spec
13
safwk.spec
@ -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
|
||||
|
||||
|
||||
@ -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"
|
||||
|
||||
@ -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..."
|
||||
|
||||
@ -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"\
|
||||
)
|
||||
|
||||
# 日志打印函数
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user