add startup.bundle.json startup.BUILD.gn and create soft link to /usr/include/init
This commit is contained in:
parent
eadba8801f
commit
445f401524
12
0001-fixbug_fd_leak_for_init.patch
Normal file
12
0001-fixbug_fd_leak_for_init.patch
Normal file
@ -0,0 +1,12 @@
|
||||
diff --git a/services/param/linux/param_request.c b/services/param/linux/param_request.c
|
||||
index 460486d..6bcd72d 100644
|
||||
--- a/services/param/linux/param_request.c
|
||||
+++ b/services/param/linux/param_request.c
|
||||
@@ -50,6 +50,7 @@ static int GetClientSocket()
|
||||
serverAddr.sun_family = PF_UNIX;
|
||||
strncpy(serverAddr.sun_path, PIPE_NAME, strlen(PIPE_NAME));
|
||||
if (connect(cfd, (struct sockaddr*)&serverAddr, sizeof(serverAddr)) < 0) {
|
||||
+ close(cfd);
|
||||
perror("Failed to connect");
|
||||
return -1;
|
||||
}
|
||||
BIN
beget-OpenHarmony-v3.2-Release.tar.gz
Normal file
BIN
beget-OpenHarmony-v3.2-Release.tar.gz
Normal file
Binary file not shown.
104
distributed-beget.spec
Normal file
104
distributed-beget.spec
Normal file
@ -0,0 +1,104 @@
|
||||
%define debug_package %{nil}
|
||||
%global build_opt /opt/distributed-middleware-build
|
||||
%global init_path %{build_opt}/openeuler/compiler_gn/base/startup/init
|
||||
%global openHarmony_source_release OpenHarmony-v3.2-Release
|
||||
|
||||
Name: distributed-beget
|
||||
Version: 1.0.0
|
||||
Release: 1
|
||||
Summary: openEuler embedded softbus capability support
|
||||
License: Apache License 2.0
|
||||
URL: https://gitee.com/openeuler/distributed-beget.git
|
||||
Source1: distributed-beget.tar.gz
|
||||
Source2: startup.bundle.json
|
||||
Source3: startup.BUILD.gn
|
||||
Patch1: 0001-fixbug_fd_leak_for_init.patch
|
||||
|
||||
BuildRequires: distributed-build, hilog, commonlibrary_c_utils
|
||||
|
||||
Requires: commonlibrary_c_utils
|
||||
Requires: hilog
|
||||
# Requires: libatomic
|
||||
|
||||
%description
|
||||
OpenEuler supports param service for distributed softbus capability
|
||||
|
||||
%prep
|
||||
# Create directory structure
|
||||
rm -rf %{_builddir}/*
|
||||
|
||||
cp -rf %{build_opt} %{_builddir}/build
|
||||
[ ! -L "%{_builddir}/build.sh" ] && ln -s %{_builddir}/build/build_scripts/build.sh %{_builddir}/build.sh
|
||||
[ ! -L "%{_builddir}/.gn" ] && ln -s %{_builddir}/build/core/gn/dotfile.gn %{_builddir}/.gn
|
||||
[ ! -L "%{_builddir}/build.py" ] && ln -s %{_builddir}/build/lite/build.py %{_builddir}/build.py
|
||||
cp -rf %{_builddir}/build/openeuler/vendor %{_builddir}/
|
||||
cp -rf %{_builddir}/build/openeuler/compiler_gn/* %{_builddir}
|
||||
|
||||
# mkdir -p %{_builddir}/base/startup
|
||||
%setup -q -D -T -a 1 -c -n %{_builddir}/base/startup
|
||||
%patch -P1 -p1 -d %{_builddir}/base/startup/init
|
||||
# exit 0
|
||||
|
||||
%build
|
||||
%ifarch x86_64
|
||||
bash %{_builddir}/build.sh --product-name openeuler --target-cpu x86_64
|
||||
%endif
|
||||
|
||||
%ifarch aarch64
|
||||
bash %{_builddir}/build.sh --product-name openeuler --target-cpu arm64
|
||||
%endif
|
||||
|
||||
%install
|
||||
install -d -m 0755 %{buildroot}/%{_includedir}/init/syspara
|
||||
install -d -m 0755 %{buildroot}/%{_includedir}/init/param
|
||||
install -d -m 0755 %{buildroot}/%{_libdir}
|
||||
install -d -m 0755 %{buildroot}/system/lib64/
|
||||
install -d -m 0755 %{buildroot}/%{_bindir}
|
||||
install -d -m 0755 %{buildroot}%{build_opt}/openeuler/compiler_gn/base/startup/init/interfaces/innerkits
|
||||
|
||||
%ifarch aarch64
|
||||
%define module_out_path out/openeuler/linux_clang_arm64
|
||||
%define so_out_path out/openeuler/linux_clang_arm64/startup/init/
|
||||
%endif
|
||||
%ifarch x86_64
|
||||
%define module_out_path out/openeuler/linux_clang_x86_64
|
||||
%define so_out_path out/openeuler/linux_clang_x86_64/startup/init/
|
||||
%endif
|
||||
|
||||
# bin
|
||||
install -m 0755 %{_builddir}/out/openeuler/packages/phone/system/bin/param_service %{buildroot}/%{_bindir}
|
||||
# shared library
|
||||
install -m 0755 %{_builddir}/%{so_out_path}/libbeget_proxy.z.so %{buildroot}/%{_libdir}
|
||||
install -m 0755 %{_builddir}/%{so_out_path}/libbegetutil.z.so %{buildroot}/%{_libdir}
|
||||
install -m 0755 %{_builddir}/%{so_out_path}/libbeget_proxy.z.so %{buildroot}/system/lib64/
|
||||
install -m 0755 %{_builddir}/%{so_out_path}/libbegetutil.z.so %{buildroot}/system/lib64/
|
||||
# header files
|
||||
%define interface_path base/startup/init/interfaces/innerkits/include
|
||||
%define service_path base/startup/init/services/include
|
||||
install -m 0755 %{_builddir}/%{interface_path}/{beget_ext.h,service_watcher.h,service_control.h} %{buildroot}/%{_includedir}/init
|
||||
install -m 0755 %{_builddir}/%{interface_path}/syspara/* %{buildroot}/%{_includedir}/init/syspara
|
||||
install -m 0755 %{_builddir}/%{interface_path}/syspara/* %{buildroot}/%{_includedir}/init
|
||||
install -m 0755 %{_builddir}/%{service_path}/init_utils.h %{buildroot}/%{_includedir}/init
|
||||
install -m 0755 %{_builddir}/%{service_path}/param/* %{buildroot}/%{_includedir}/init/param
|
||||
install -m 0755 %{_builddir}/%{service_path}/param/* %{buildroot}/%{_includedir}/init
|
||||
|
||||
# cp bundle.json
|
||||
mkdir -p %{buildroot}%{init_path}
|
||||
mkdir -p %{buildroot}%{init_path}/interfaces/innerkits/
|
||||
install -m 0755 %{SOURCE2} %{buildroot}%{init_path}/bundle.json
|
||||
# cp BUILD.gn
|
||||
install -m 0755 %{SOURCE3} %{buildroot}%{init_path}/interfaces/innerkits/BUILD.gn
|
||||
# create soft link
|
||||
ln -s /usr/include/init %{buildroot}%{build_opt}/openeuler/compiler_gn/%{interface_path}
|
||||
|
||||
%files
|
||||
%{_bindir}/*
|
||||
%{_libdir}/*
|
||||
%{_includedir}/init/*
|
||||
/system/lib64/*
|
||||
%{build_opt}/*
|
||||
|
||||
%changelog
|
||||
* Fri Nov 24 2023 muyuying <muyuying1@huawei.com> - 1.0.0-1
|
||||
- Init and Adapt to Openeule
|
||||
|
||||
BIN
distributed-beget.tar.gz
Normal file
BIN
distributed-beget.tar.gz
Normal file
Binary file not shown.
43
startup.BUILD.gn
Normal file
43
startup.BUILD.gn
Normal file
@ -0,0 +1,43 @@
|
||||
# Copyright (c) 2021-2022 Huawei Device Co., Ltd.
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
import("//build/ohos.gni")
|
||||
|
||||
config("libbegetutil_config") {
|
||||
include_dirs = [
|
||||
"//base/startup/init/interfaces/innerkits/include",
|
||||
"//base/startup/init/interfaces/innerkits/include/syspara",
|
||||
"//base/startup/init/services/include",
|
||||
"//base/hiviewdfx/hilog/interfaces/native/innerkits/include",
|
||||
]
|
||||
libs = [ "begetutil.z" ]
|
||||
}
|
||||
|
||||
config("libbeget_proxy_config") {
|
||||
include_dirs = [
|
||||
"//base/startup/init/interfaces/innerkits/include",
|
||||
"//base/startup/init/interfaces/innerkits/include/syspara",
|
||||
"//base/startup/init/services/include",
|
||||
"//base/hiviewdfx/hilog/interfaces/native/innerkits/include",
|
||||
]
|
||||
libs = [ "beget_proxy.z" ]
|
||||
}
|
||||
|
||||
group("libbegetutil") {
|
||||
public_configs = [ ":libbegetutil_config" ]
|
||||
}
|
||||
|
||||
# watcher lib must separate compilation avoid interdependence.
|
||||
group("libbeget_proxy") {
|
||||
public_configs = [ ":libbeget_proxy_config" ]
|
||||
}
|
||||
|
||||
77
startup.bundle.json
Normal file
77
startup.bundle.json
Normal file
@ -0,0 +1,77 @@
|
||||
{
|
||||
"name": "@ohos/startup_init_lite",
|
||||
"description": "ohos init process",
|
||||
"homePage": "https://gitee.com/openharmony",
|
||||
"version": "3.1",
|
||||
"license": "Apache License 2.0",
|
||||
"repository": "https://gitee.com/openharmony/startup_init_lite",
|
||||
"publishAs": "code-segment",
|
||||
"segment": {
|
||||
"destPath": "base/startup/init"
|
||||
},
|
||||
"dirs": {},
|
||||
"scripts": {},
|
||||
"component": {
|
||||
"name": "init",
|
||||
"subsystem": "startup",
|
||||
"syscap": [
|
||||
"SystemCapability.Startup.SystemInfo"
|
||||
],
|
||||
"adapted_system_type": [
|
||||
"standard"
|
||||
],
|
||||
"rom": "",
|
||||
"ram": "",
|
||||
"deps": {
|
||||
"components": [
|
||||
"startup",
|
||||
"c_utils"
|
||||
],
|
||||
"third_party": [
|
||||
"cJSON",
|
||||
"bounds_checking_function"
|
||||
]
|
||||
},
|
||||
"build": {
|
||||
"group_type": {
|
||||
"base_group": [
|
||||
],
|
||||
"fwk_group": [
|
||||
],
|
||||
"service_group": [
|
||||
]
|
||||
},
|
||||
"sub_component": [
|
||||
],
|
||||
"inner_kits": [
|
||||
{
|
||||
"header": {
|
||||
"header_base": "//base/startup/init/interfaces/innerkits/include/",
|
||||
"header_files": [
|
||||
"service_control.h",
|
||||
"beget_ext.h",
|
||||
"syspara/parameter.h",
|
||||
"syspara/parameters.h",
|
||||
"syspara/param_wrapper.h",
|
||||
"syspara/sysparam_errno.h"
|
||||
]
|
||||
},
|
||||
"name": "//base/startup/init/interfaces/innerkits:libbegetutil"
|
||||
},
|
||||
{
|
||||
"header": {
|
||||
"header_base": "//base/startup/init/interfaces/innerkits/include/",
|
||||
"header_files": [
|
||||
"service_watcher.h",
|
||||
"syspara/parameter.h",
|
||||
"syspara/sysparam_errno.h"
|
||||
]
|
||||
},
|
||||
"name": "//base/startup/init/interfaces/innerkits:libbeget_proxy"
|
||||
}
|
||||
],
|
||||
"test": [
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user