diff --git a/ueventd/BUILD.gn b/ueventd/BUILD.gn index 00cc772ffd772cdd45b4d59319a1878cb5e04149..c344c6ee94ca1bc0462689eb1c7f2ec8c17ba1c6 100755 --- a/ueventd/BUILD.gn +++ b/ueventd/BUILD.gn @@ -10,8 +10,50 @@ # 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. +if (defined(ohos_lite)) { + if (ohos_kernel_type == "linux") { + executable("ueventd_linux") { + sources = [ + "//base/startup/init_lite/services/utils/init_utils.c", + "//base/startup/init_lite/services/utils/list.c", + "//base/startup/init_lite/ueventd/ueventd.c", + "//base/startup/init_lite/ueventd/ueventd_device_handler.c", + "//base/startup/init_lite/ueventd/ueventd_firmware_handler.c", + "//base/startup/init_lite/ueventd/ueventd_read_cfg.c", + "//base/startup/init_lite/ueventd/ueventd_socket.c", + ] -if (!defined(ohos_lite)) { + defines = [ "__MUSL__" ] + defines += [ "_GNU_SOURCE" ] + + include_dirs = [ + ".", + "//third_party/bounds_checking_function/include", + "//base/startup/init_lite/services/log", + "//base/startup/init_lite/services/include", + "//base/startup/init_lite/services/utils", + "//kernel/linux-4.19/include/uapi", + ] + + deps = [ + "//base/startup/init_lite/services/log:init_log", + "//third_party/bounds_checking_function:libsec_static", + ] + } + copy("ueventd.config") { + sources = [ "etc/ueventd_l1.config" ] + outputs = [ "$root_out_dir/etc/ueventd.config" ] + } + } + + group("ueventd") { + if (ohos_kernel_type == "linux") { + deps = [ ":ueventd_linux" ] + } else { + deps = [] + } + } +} else { import("//build/ohos.gni") ohos_executable("ueventd") { diff --git a/ueventd/etc/ueventd_l1.config b/ueventd/etc/ueventd_l1.config new file mode 100755 index 0000000000000000000000000000000000000000..4081506d0f079adf34a484b0a9130c9a5b929fa6 --- /dev/null +++ b/ueventd/etc/ueventd_l1.config @@ -0,0 +1,17 @@ +# Copyright (c) 2021 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. + +[device] +# +/dev/binder 0666 0 0 +/dev/mmz_userdev 0666 0 0