blob: 69bbf12b3689cc5afa61f83145296863ba6d071f [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
17cc_binary {
18 name: "netbpfload",
19
20 defaults: ["bpf_defaults"],
21 cflags: [
22 "-Wall",
23 "-Werror",
24 "-Wthread-safety",
25 ],
26 sanitize: {
27 integer_overflow: true,
28 },
29
30 header_libs: ["bpf_headers"],
31 shared_libs: [
32 "libbase",
Maciej Żenczykowski40dfe532023-10-08 20:21:11 -070033 "liblog",
34 ],
35 srcs: [
36 "loader.cpp",
37 "NetBpfLoad.cpp",
38 ],
Maciej Żenczykowskia2a3d752023-10-10 15:24:13 -070039 apex_available: [
40 "com.android.tethering",
41 "//apex_available:platform",
42 ],
43 // really should be Android 14/U (34), but we cannot include binaries built
44 // against newer sdk in the apex, which still targets 30(R):
45 // module "netbpfload" variant "android_x86_apex30": should support
46 // min_sdk_version(30) for "com.android.tethering": newer SDK(34).
47 min_sdk_version: "30",
Maciej Żenczykowski7db65c62023-10-19 16:51:15 -070048
Maciej Żenczykowski7da54d92023-10-24 02:11:09 -070049 init_rc: ["netbpfload.rc"],
50 required: ["bpfloader"],
Maciej Żenczykowski40dfe532023-10-08 20:21:11 -070051}
Maciej Żenczykowski041be522023-10-23 23:34:52 -070052
53// Versioned netbpfload init rc: init system will process it only on api V/35+ devices
54// (TODO: consider reducing to T/33+ - adjust the comment up above in line 43 as well)
55// Note: S[31] Sv2[32] T[33] U[34] V[35])
56//
57// For details of versioned rc files see:
58// https://android.googlesource.com/platform/system/core/+/HEAD/init/README.md#versioned-rc-files-within-apexs
59prebuilt_etc {
60 name: "netbpfload.mainline.rc",
61 src: "netbpfload.mainline.rc",
62 filename: "netbpfload.35rc",
63 installable: false,
64}