blob: f397b37007b7fc8ae10e13db37df398b3ab6c021 [file] [log] [blame]
Maciej Żenczykowski40dfe532023-10-08 20:21:11 -07001//
2// Copyright (C) 2023 The Android Open Source Project
3//
4// Licensed under the Apache License, Version 2.0 (the "License");
5// you may not use this file except in compliance with the License.
6// You may obtain a copy of the License at
7//
8// http://www.apache.org/licenses/LICENSE-2.0
9//
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13// See the License for the specific language governing permissions and
14// limitations under the License.
15//
16
Aditya Choudhary01b5ede2024-01-31 11:08:57 +000017package {
18 default_team: "trendy_team_fwk_core_networking",
19}
20
Maciej Żenczykowskie678f572024-02-28 11:58:49 -080021install_symlink {
22 name: "platform_ethtool_symlink",
23 symlink_target: "/apex/com.android.tethering/bin/ethtool",
24 // installed_location is relative to /system because that's the default partition for soong
25 // modules, unless we add something like `system_ext_specific: true` like in hwservicemanager.
26 installed_location: "bin/ethtool",
27}
28
29phony {
30 name: "mainline_tethering_platform_components",
31 required: [
Vaibhav Devmurarie636c612024-03-06 14:38:33 +000032 "netbpfload",
Maciej Żenczykowskie678f572024-02-28 11:58:49 -080033 "platform_ethtool_symlink",
34 ],
35}
36
Maciej Żenczykowski40dfe532023-10-08 20:21:11 -070037cc_binary {
38 name: "netbpfload",
39
40 defaults: ["bpf_defaults"],
41 cflags: [
42 "-Wall",
43 "-Werror",
44 "-Wthread-safety",
45 ],
46 sanitize: {
47 integer_overflow: true,
48 },
49
50 header_libs: ["bpf_headers"],
51 shared_libs: [
52 "libbase",
Maciej Żenczykowski40dfe532023-10-08 20:21:11 -070053 "liblog",
54 ],
55 srcs: [
56 "loader.cpp",
57 "NetBpfLoad.cpp",
58 ],
Maciej Żenczykowskia2a3d752023-10-10 15:24:13 -070059 apex_available: [
60 "com.android.tethering",
61 "//apex_available:platform",
62 ],
Maciej Żenczykowski03ef12c2024-02-10 21:34:22 +000063 // really should be Android 13/T (33), but we cannot include binaries built
Maciej Żenczykowskia2a3d752023-10-10 15:24:13 -070064 // against newer sdk in the apex, which still targets 30(R):
65 // module "netbpfload" variant "android_x86_apex30": should support
66 // min_sdk_version(30) for "com.android.tethering": newer SDK(34).
67 min_sdk_version: "30",
Vaibhav Devmurarie636c612024-03-06 14:38:33 +000068
69 init_rc: ["netbpfload.rc"],
70 required: ["bpfloader"],
Maciej Żenczykowski40dfe532023-10-08 20:21:11 -070071}
Maciej Żenczykowski041be522023-10-23 23:34:52 -070072
Maciej Żenczykowski03ef12c2024-02-10 21:34:22 +000073// Versioned netbpfload init rc: init system will process it only on api T/33+ devices
74// Note: R[30] S[31] Sv2[32] T[33] U[34] V[35])
Maciej Żenczykowski041be522023-10-23 23:34:52 -070075//
76// For details of versioned rc files see:
77// https://android.googlesource.com/platform/system/core/+/HEAD/init/README.md#versioned-rc-files-within-apexs
78prebuilt_etc {
79 name: "netbpfload.mainline.rc",
80 src: "netbpfload.mainline.rc",
Maciej Żenczykowski03ef12c2024-02-10 21:34:22 +000081 filename: "netbpfload.33rc",
Maciej Żenczykowski041be522023-10-23 23:34:52 -070082 installable: false,
83}