# Copyright (c) 2024-2024 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. if (defined(ohos_lite)) { executable("remount") { sources = [ "//base/startup/init/remount/remount.c" ] defines = [ "_GNU_SOURCE" ] if (ohos_kernel_type == "linux") { defines += [ "LINUX_REMOUNT" ] } } } else { import("//base/startup/init/begetd.gni") import("//build/ohos.gni") ohos_executable("remount") { sources = [ "remount.c" ] defines = [ "_GNU_SOURCE" ] install_enable = true part_name = "init" subsystem_name = "startup" if (init_startup_feature_erofs_overlay) { sources += [ "//base/startup/init/services/log/init_commlog.c", "remount_overlay.c", ] include_dirs = [ "//base/startup/init/remount/include" ] deps = [ "//base/startup/init/interfaces/innerkits/fs_manager:libfsmanager_static", "//base/startup/init/services/log:init_log", ] external_deps = [ "bounds_checking_function:libsec_shared" ] defines += [ "EROFS_OVERLAY" ] } } } group("overlayremount") { if (defined(ohos_lite)) { if (ohos_kernel_type == "linux" || ohos_kernel_type == "liteos_a") { deps = [ ":remount" ] } else { deps = [] } } else { deps = [ ":remount" ] } }