2019-07-03 20:59:47 +00:00
|
|
|
//
|
|
|
|
// Copyright (C) 2018 The Android Open Source Project
|
|
|
|
//
|
|
|
|
// 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.
|
|
|
|
//
|
|
|
|
|
2021-02-17 03:02:14 +00:00
|
|
|
package {
|
|
|
|
default_applicable_licenses: ["Android-Apache-2.0"],
|
|
|
|
}
|
|
|
|
|
2019-08-01 21:37:35 +00:00
|
|
|
cc_defaults {
|
|
|
|
name: "libsnapshot_defaults",
|
2019-07-03 20:59:47 +00:00
|
|
|
defaults: ["fs_mgr_defaults"],
|
2019-08-01 21:37:35 +00:00
|
|
|
cflags: [
|
2019-07-03 20:59:47 +00:00
|
|
|
"-D_FILE_OFFSET_BITS=64",
|
2019-08-01 21:37:35 +00:00
|
|
|
"-Wall",
|
|
|
|
"-Werror",
|
2019-07-03 20:59:47 +00:00
|
|
|
],
|
|
|
|
shared_libs: [
|
|
|
|
"libbase",
|
2020-12-10 20:29:42 +00:00
|
|
|
"libchrome",
|
2020-01-29 13:57:23 +00:00
|
|
|
"libcutils",
|
2019-07-03 20:59:47 +00:00
|
|
|
"liblog",
|
|
|
|
],
|
|
|
|
static_libs: [
|
2020-09-25 22:23:48 +00:00
|
|
|
"libbrotli",
|
2019-07-03 20:59:47 +00:00
|
|
|
"libdm",
|
2019-07-26 00:52:08 +00:00
|
|
|
"libfstab",
|
2019-09-13 21:49:53 +00:00
|
|
|
"update_metadata-protos",
|
2019-08-01 21:37:35 +00:00
|
|
|
],
|
|
|
|
whole_static_libs: [
|
libsnapshot: Add support for first-to-second-stage transitions of snapuserd.
This patch introduces the fundamentals needed to support booting off
dm-user. First, a method has been added to start snapuserd in
first-stage init. It simply forks and execs, creates a specially named
first-stage socket, then waits for requests.
Next, a new method has been added to SnapshotManager to perform a
second-stage handoff. This works by first launching a second copy of
snapuserd using init's normal service management functionality. The new
snapuserd runs alongside the original, but has correct privileges and a
correct selinux context. Next, we inspect each COW device, and if its
table uses dm-user, we replace the table with a renamed control
device. The new control device is bound to the new snapuserd.
device-mapper guarantees that such a table swap is safe. It flushes I/O
to the old table and then replaces it with the new table. Once the new
table is in place, the old dm-user control devices are automatically
destroyed. Thus, once all dm-user devices has been transitioned, the
first-stage daemon is idle and can gracefully exit.
This patch does not modify init. A few changes will be needed on top of
this patch:
(1) CreateLogicalAndSnapshotPartitions will need further changes to
start the first-stage daemon and track its pid. Additionally, it will
need to ensure the named socket file is deleted, so there is no further
IPC allowed after partitions are completed.
(2) init will need to propagate the pid to second-stage init so the
process can be killed (or signalled).
(3) first-stage snapuserd will need to gracefully exit once it has no
active handler threads.
(4) second-stage init will need to invoke the transition helper on
SnapshotMaanager, ideally as soon as feasible.
Bug: 168259959
Test: manual test
Change-Id: I54dec2edf85ed95f11ab4518eb3d7dbaf0bdcbfd
2020-10-29 00:02:25 +00:00
|
|
|
"libbrotli",
|
2020-10-20 22:56:57 +00:00
|
|
|
"libcutils",
|
2019-07-03 20:59:47 +00:00
|
|
|
"libext2_uuid",
|
2019-08-01 21:37:35 +00:00
|
|
|
"libext4_utils",
|
2019-08-09 23:26:31 +00:00
|
|
|
"libfstab",
|
2020-10-20 22:56:57 +00:00
|
|
|
"libsnapshot_snapuserd",
|
libsnapshot: Add support for first-to-second-stage transitions of snapuserd.
This patch introduces the fundamentals needed to support booting off
dm-user. First, a method has been added to start snapuserd in
first-stage init. It simply forks and execs, creates a specially named
first-stage socket, then waits for requests.
Next, a new method has been added to SnapshotManager to perform a
second-stage handoff. This works by first launching a second copy of
snapuserd using init's normal service management functionality. The new
snapuserd runs alongside the original, but has correct privileges and a
correct selinux context. Next, we inspect each COW device, and if its
table uses dm-user, we replace the table with a renamed control
device. The new control device is bound to the new snapuserd.
device-mapper guarantees that such a table swap is safe. It flushes I/O
to the old table and then replaces it with the new table. Once the new
table is in place, the old dm-user control devices are automatically
destroyed. Thus, once all dm-user devices has been transitioned, the
first-stage daemon is idle and can gracefully exit.
This patch does not modify init. A few changes will be needed on top of
this patch:
(1) CreateLogicalAndSnapshotPartitions will need further changes to
start the first-stage daemon and track its pid. Additionally, it will
need to ensure the named socket file is deleted, so there is no further
IPC allowed after partitions are completed.
(2) init will need to propagate the pid to second-stage init so the
process can be killed (or signalled).
(3) first-stage snapuserd will need to gracefully exit once it has no
active handler threads.
(4) second-stage init will need to invoke the transition helper on
SnapshotMaanager, ideally as soon as feasible.
Bug: 168259959
Test: manual test
Change-Id: I54dec2edf85ed95f11ab4518eb3d7dbaf0bdcbfd
2020-10-29 00:02:25 +00:00
|
|
|
"libz",
|
2019-07-03 20:59:47 +00:00
|
|
|
],
|
2019-08-14 00:21:32 +00:00
|
|
|
header_libs: [
|
|
|
|
"libfiemap_headers",
|
2020-10-31 01:47:13 +00:00
|
|
|
"libstorage_literals_headers",
|
2020-09-17 21:41:30 +00:00
|
|
|
"libupdate_engine_headers",
|
2019-08-14 00:21:32 +00:00
|
|
|
],
|
2019-09-13 21:49:53 +00:00
|
|
|
export_static_lib_headers: [
|
|
|
|
"update_metadata-protos",
|
|
|
|
],
|
2019-08-14 00:21:32 +00:00
|
|
|
export_header_lib_headers: [
|
|
|
|
"libfiemap_headers",
|
|
|
|
],
|
2019-07-03 20:59:47 +00:00
|
|
|
export_include_dirs: ["include"],
|
2019-10-01 20:59:56 +00:00
|
|
|
proto: {
|
|
|
|
type: "lite",
|
|
|
|
export_proto_headers: true,
|
|
|
|
canonical_path_from_root: false,
|
|
|
|
},
|
2019-07-03 20:59:47 +00:00
|
|
|
}
|
2019-08-01 21:37:35 +00:00
|
|
|
|
2019-10-09 23:24:03 +00:00
|
|
|
cc_defaults {
|
|
|
|
name: "libsnapshot_hal_deps",
|
|
|
|
cflags: [
|
|
|
|
"-DLIBSNAPSHOT_USE_HAL",
|
|
|
|
],
|
|
|
|
shared_libs: [
|
|
|
|
"android.hardware.boot@1.0",
|
|
|
|
"android.hardware.boot@1.1",
|
2022-06-21 21:20:54 +00:00
|
|
|
"android.hardware.boot-V1-ndk",
|
|
|
|
"libboot_control_client",
|
2019-10-09 23:24:03 +00:00
|
|
|
],
|
|
|
|
}
|
|
|
|
|
2019-08-01 21:37:35 +00:00
|
|
|
filegroup {
|
|
|
|
name: "libsnapshot_sources",
|
|
|
|
srcs: [
|
2019-10-01 20:59:56 +00:00
|
|
|
"android/snapshot/snapshot.proto",
|
2019-10-15 20:14:53 +00:00
|
|
|
"device_info.cpp",
|
2019-08-01 21:37:35 +00:00
|
|
|
"snapshot.cpp",
|
2020-09-22 21:03:41 +00:00
|
|
|
"snapshot_reader.cpp",
|
2020-01-21 19:10:47 +00:00
|
|
|
"snapshot_stats.cpp",
|
2020-04-15 19:54:20 +00:00
|
|
|
"snapshot_stub.cpp",
|
2019-09-13 21:49:53 +00:00
|
|
|
"snapshot_metadata_updater.cpp",
|
2020-09-21 23:34:25 +00:00
|
|
|
"snapshot_writer.cpp",
|
2019-07-26 00:52:08 +00:00
|
|
|
"partition_cow_creator.cpp",
|
2020-01-16 23:10:35 +00:00
|
|
|
"return.cpp",
|
2019-08-28 01:37:41 +00:00
|
|
|
"utility.cpp",
|
2019-08-01 21:37:35 +00:00
|
|
|
],
|
|
|
|
}
|
|
|
|
|
2019-08-29 23:29:22 +00:00
|
|
|
cc_library_headers {
|
|
|
|
name: "libsnapshot_headers",
|
|
|
|
recovery_available: true,
|
|
|
|
defaults: ["libsnapshot_defaults"],
|
|
|
|
}
|
|
|
|
|
2019-08-01 21:37:35 +00:00
|
|
|
cc_library_static {
|
|
|
|
name: "libsnapshot",
|
2019-10-09 23:24:03 +00:00
|
|
|
defaults: [
|
|
|
|
"libsnapshot_defaults",
|
|
|
|
"libsnapshot_hal_deps",
|
|
|
|
],
|
2019-08-01 21:37:35 +00:00
|
|
|
srcs: [":libsnapshot_sources"],
|
2019-12-18 16:01:32 +00:00
|
|
|
static_libs: [
|
|
|
|
"libfs_mgr_binder"
|
2019-08-01 21:37:35 +00:00
|
|
|
],
|
|
|
|
}
|
|
|
|
|
|
|
|
cc_library_static {
|
2019-10-09 23:24:03 +00:00
|
|
|
name: "libsnapshot_init",
|
2020-04-23 01:45:34 +00:00
|
|
|
native_coverage : true,
|
2019-08-01 21:37:35 +00:00
|
|
|
defaults: ["libsnapshot_defaults"],
|
|
|
|
srcs: [":libsnapshot_sources"],
|
2021-06-11 03:58:53 +00:00
|
|
|
ramdisk_available: true,
|
2019-08-01 21:37:35 +00:00
|
|
|
recovery_available: true,
|
2020-09-25 22:23:48 +00:00
|
|
|
cflags: [
|
|
|
|
"-DLIBSNAPSHOT_NO_COW_WRITE",
|
|
|
|
],
|
2019-12-18 16:01:32 +00:00
|
|
|
static_libs: [
|
|
|
|
"libfs_mgr",
|
2019-08-14 00:21:32 +00:00
|
|
|
],
|
2019-08-01 21:37:35 +00:00
|
|
|
}
|
|
|
|
|
2019-10-09 23:24:03 +00:00
|
|
|
cc_library_static {
|
|
|
|
name: "libsnapshot_nobinder",
|
|
|
|
defaults: [
|
|
|
|
"libsnapshot_defaults",
|
|
|
|
"libsnapshot_hal_deps",
|
|
|
|
],
|
|
|
|
srcs: [":libsnapshot_sources"],
|
|
|
|
recovery_available: true,
|
2020-09-25 22:23:48 +00:00
|
|
|
cflags: [
|
|
|
|
"-DLIBSNAPSHOT_NO_COW_WRITE",
|
|
|
|
],
|
2019-12-18 16:01:32 +00:00
|
|
|
static_libs: [
|
|
|
|
"libfs_mgr",
|
2019-10-09 23:24:03 +00:00
|
|
|
],
|
|
|
|
}
|
|
|
|
|
2020-08-19 20:22:43 +00:00
|
|
|
cc_defaults {
|
|
|
|
name: "libsnapshot_cow_defaults",
|
|
|
|
defaults: [
|
|
|
|
"fs_mgr_defaults",
|
|
|
|
],
|
|
|
|
cflags: [
|
|
|
|
"-D_FILE_OFFSET_BITS=64",
|
|
|
|
"-Wall",
|
|
|
|
"-Werror",
|
|
|
|
],
|
2022-04-12 00:29:27 +00:00
|
|
|
shared_libs: [
|
|
|
|
"libbase",
|
|
|
|
"liblog",
|
2020-08-19 20:22:43 +00:00
|
|
|
],
|
2022-04-12 00:29:27 +00:00
|
|
|
static_libs: [
|
|
|
|
"libbrotli",
|
|
|
|
"libz",
|
|
|
|
"liblz4",
|
|
|
|
],
|
|
|
|
export_include_dirs: ["include"],
|
2020-08-19 20:22:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
cc_library_static {
|
|
|
|
name: "libsnapshot_cow",
|
|
|
|
defaults: [
|
|
|
|
"libsnapshot_cow_defaults",
|
|
|
|
],
|
2022-04-12 00:29:27 +00:00
|
|
|
srcs: [
|
2022-10-18 06:56:22 +00:00
|
|
|
"libsnapshot_cow/cow_decompress.cpp",
|
|
|
|
"libsnapshot_cow/cow_reader.cpp",
|
|
|
|
"libsnapshot_cow/cow_writer.cpp",
|
|
|
|
"libsnapshot_cow/cow_format.cpp",
|
2022-10-18 16:45:18 +00:00
|
|
|
"libsnapshot_cow/cow_compress.cpp",
|
2022-04-12 00:29:27 +00:00
|
|
|
],
|
2020-08-19 20:22:43 +00:00
|
|
|
host_supported: true,
|
2020-09-01 14:19:52 +00:00
|
|
|
recovery_available: true,
|
2020-08-26 00:55:59 +00:00
|
|
|
ramdisk_available: true,
|
2020-11-17 02:13:19 +00:00
|
|
|
vendor_ramdisk_available: true,
|
2020-08-19 20:22:43 +00:00
|
|
|
}
|
|
|
|
|
2019-12-06 23:57:54 +00:00
|
|
|
cc_library_static {
|
|
|
|
name: "libsnapshot_test_helpers",
|
|
|
|
defaults: ["libsnapshot_defaults"],
|
|
|
|
export_include_dirs: [
|
|
|
|
"include_test",
|
|
|
|
],
|
|
|
|
srcs: [
|
2020-01-07 17:28:38 +00:00
|
|
|
"android/snapshot/snapshot.proto",
|
2019-12-06 23:57:54 +00:00
|
|
|
"test_helpers.cpp",
|
|
|
|
],
|
|
|
|
shared_libs: [
|
|
|
|
"android.hardware.boot@1.1",
|
|
|
|
"libcrypto",
|
|
|
|
],
|
|
|
|
export_shared_lib_headers: [
|
|
|
|
"android.hardware.boot@1.1",
|
|
|
|
],
|
|
|
|
header_libs: [
|
|
|
|
"libstorage_literals_headers",
|
|
|
|
],
|
|
|
|
export_header_lib_headers: [
|
|
|
|
"libstorage_literals_headers",
|
|
|
|
],
|
|
|
|
static_libs: [
|
2019-12-18 16:01:32 +00:00
|
|
|
"libfs_mgr",
|
2019-12-06 23:57:54 +00:00
|
|
|
"libgmock",
|
2020-01-29 13:57:23 +00:00
|
|
|
"libgtest",
|
2019-12-06 23:57:54 +00:00
|
|
|
],
|
|
|
|
}
|
|
|
|
|
2020-02-01 14:15:05 +00:00
|
|
|
cc_defaults {
|
|
|
|
name: "libsnapshot_test_defaults",
|
2022-04-12 00:29:27 +00:00
|
|
|
defaults: ["libsnapshot_defaults", "libsnapshot_cow_defaults"],
|
2019-08-01 21:37:35 +00:00
|
|
|
srcs: [
|
2019-07-26 00:52:08 +00:00
|
|
|
"partition_cow_creator_test.cpp",
|
2019-09-13 21:49:53 +00:00
|
|
|
"snapshot_metadata_updater_test.cpp",
|
2020-09-29 22:52:53 +00:00
|
|
|
"snapshot_reader_test.cpp",
|
2020-01-29 13:57:23 +00:00
|
|
|
"snapshot_test.cpp",
|
2021-05-04 17:49:33 +00:00
|
|
|
"snapshot_writer_test.cpp",
|
2019-08-01 21:37:35 +00:00
|
|
|
],
|
|
|
|
shared_libs: [
|
|
|
|
"libbinder",
|
2019-10-21 21:16:44 +00:00
|
|
|
"libcrypto",
|
2019-10-09 23:24:03 +00:00
|
|
|
"libhidlbase",
|
2019-09-13 21:49:53 +00:00
|
|
|
"libprotobuf-cpp-lite",
|
2019-08-01 21:37:35 +00:00
|
|
|
"libutils",
|
2020-01-29 13:57:23 +00:00
|
|
|
"libz",
|
2019-08-01 21:37:35 +00:00
|
|
|
],
|
|
|
|
static_libs: [
|
2020-04-27 22:39:35 +00:00
|
|
|
"android.hardware.boot@1.0",
|
|
|
|
"android.hardware.boot@1.1",
|
2022-06-21 21:20:54 +00:00
|
|
|
"android.hardware.boot-V1-ndk",
|
2020-09-25 22:23:48 +00:00
|
|
|
"libbrotli",
|
2021-04-08 04:43:03 +00:00
|
|
|
"libc++fs",
|
2021-05-13 01:47:39 +00:00
|
|
|
"libfs_mgr_binder",
|
2021-12-02 02:18:46 +00:00
|
|
|
"libgflags",
|
2021-11-18 23:00:29 +00:00
|
|
|
"libgsi",
|
|
|
|
"libgmock",
|
|
|
|
"liblp",
|
|
|
|
"libsnapshot",
|
|
|
|
"libsnapshot_cow",
|
|
|
|
"libsnapshot_test_helpers",
|
|
|
|
"libsparse",
|
|
|
|
],
|
|
|
|
header_libs: [
|
|
|
|
"libstorage_literals_headers",
|
|
|
|
],
|
|
|
|
test_suites: [
|
|
|
|
"vts",
|
|
|
|
"device-tests"
|
|
|
|
],
|
|
|
|
test_options: {
|
|
|
|
min_shipping_api_level: 29,
|
|
|
|
},
|
|
|
|
auto_gen_config: true,
|
|
|
|
require_root: true,
|
2022-11-01 04:32:40 +00:00
|
|
|
compile_multilib: "first",
|
2021-11-18 23:00:29 +00:00
|
|
|
}
|
|
|
|
|
2020-02-01 14:15:05 +00:00
|
|
|
cc_test {
|
|
|
|
name: "vts_libsnapshot_test",
|
2022-06-21 21:20:54 +00:00
|
|
|
defaults: ["libsnapshot_test_defaults", "libsnapshot_hal_deps"],
|
2020-02-01 14:15:05 +00:00
|
|
|
}
|
|
|
|
|
2023-01-24 22:08:46 +00:00
|
|
|
cc_test {
|
|
|
|
name: "vab_legacy_tests",
|
|
|
|
defaults: ["libsnapshot_test_defaults", "libsnapshot_hal_deps"],
|
|
|
|
cppflags: [
|
|
|
|
"-DLIBSNAPSHOT_TEST_VAB_LEGACY",
|
2021-12-02 02:18:46 +00:00
|
|
|
],
|
2023-01-24 22:08:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
cc_test {
|
|
|
|
name: "vabc_legacy_tests",
|
|
|
|
defaults: ["libsnapshot_test_defaults", "libsnapshot_hal_deps"],
|
|
|
|
cppflags: [
|
|
|
|
"-DLIBSNAPSHOT_TEST_VABC_LEGACY",
|
2021-12-02 02:18:46 +00:00
|
|
|
],
|
2021-11-18 23:00:29 +00:00
|
|
|
}
|
|
|
|
|
2022-02-18 22:15:46 +00:00
|
|
|
cc_test {
|
|
|
|
name: "vts_ota_config_test",
|
|
|
|
srcs: [
|
|
|
|
"vts_ota_config_test.cpp",
|
|
|
|
],
|
|
|
|
shared_libs: [
|
|
|
|
"libbase",
|
|
|
|
],
|
|
|
|
test_suites: [
|
|
|
|
"vts",
|
|
|
|
],
|
|
|
|
test_options: {
|
|
|
|
min_shipping_api_level: 33,
|
|
|
|
},
|
|
|
|
auto_gen_config: true,
|
|
|
|
require_root: true,
|
|
|
|
}
|
|
|
|
|
2019-09-17 01:49:43 +00:00
|
|
|
cc_binary {
|
|
|
|
name: "snapshotctl",
|
2022-04-12 00:29:27 +00:00
|
|
|
defaults: ["libsnapshot_cow_defaults", "libsnapshot_hal_deps"],
|
2019-09-17 01:49:43 +00:00
|
|
|
srcs: [
|
|
|
|
"snapshotctl.cpp",
|
|
|
|
],
|
|
|
|
static_libs: [
|
2020-09-25 22:23:48 +00:00
|
|
|
"libbrotli",
|
2021-04-08 04:43:03 +00:00
|
|
|
"libc++fs",
|
2019-09-17 01:49:43 +00:00
|
|
|
"libfstab",
|
|
|
|
"libsnapshot",
|
2020-09-21 23:34:25 +00:00
|
|
|
"libsnapshot_cow",
|
2020-09-25 22:23:48 +00:00
|
|
|
"libz",
|
2020-04-16 18:05:16 +00:00
|
|
|
"update_metadata-protos",
|
2019-09-17 01:49:43 +00:00
|
|
|
],
|
|
|
|
shared_libs: [
|
|
|
|
"libbase",
|
2020-01-29 13:57:23 +00:00
|
|
|
"libext2_uuid",
|
2019-09-17 01:49:43 +00:00
|
|
|
"libext4_utils",
|
2019-12-18 16:01:32 +00:00
|
|
|
"libfs_mgr_binder",
|
2019-10-09 23:24:03 +00:00
|
|
|
"libhidlbase",
|
2019-09-17 01:49:43 +00:00
|
|
|
"liblog",
|
|
|
|
"liblp",
|
2019-10-01 20:59:56 +00:00
|
|
|
"libprotobuf-cpp-lite",
|
2020-01-21 20:38:46 +00:00
|
|
|
"libstatslog",
|
2019-10-01 20:59:56 +00:00
|
|
|
"libutils",
|
2019-09-17 01:49:43 +00:00
|
|
|
],
|
2022-10-22 00:45:55 +00:00
|
|
|
header_libs: [
|
|
|
|
"libstorage_literals_headers",
|
|
|
|
],
|
|
|
|
product_variables: {
|
|
|
|
debuggable: {
|
|
|
|
cppflags: [
|
|
|
|
"-DSNAPSHOTCTL_USERDEBUG_OR_ENG",
|
|
|
|
],
|
|
|
|
shared_libs: [
|
|
|
|
"android.hardware.boot@1.0",
|
|
|
|
"android.hardware.boot@1.1",
|
|
|
|
"android.hardware.boot-V1-ndk",
|
|
|
|
"libboot_control_client",
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
2019-09-17 01:49:43 +00:00
|
|
|
}
|
2020-03-19 22:56:51 +00:00
|
|
|
|
|
|
|
cc_test {
|
|
|
|
name: "snapshot_power_test",
|
|
|
|
srcs: [
|
|
|
|
"power_test.cpp",
|
|
|
|
],
|
|
|
|
static_libs: [
|
2021-04-08 04:43:03 +00:00
|
|
|
"libc++fs",
|
2020-03-19 22:56:51 +00:00
|
|
|
"libsnapshot",
|
2020-04-16 18:05:16 +00:00
|
|
|
"update_metadata-protos",
|
2020-03-19 22:56:51 +00:00
|
|
|
],
|
|
|
|
shared_libs: [
|
|
|
|
"libbase",
|
|
|
|
"libfs_mgr_binder",
|
|
|
|
"liblog",
|
|
|
|
],
|
|
|
|
gtest: false,
|
|
|
|
}
|
2020-04-23 01:45:34 +00:00
|
|
|
|
2020-08-19 20:22:43 +00:00
|
|
|
cc_test {
|
|
|
|
name: "cow_api_test",
|
|
|
|
defaults: [
|
|
|
|
"fs_mgr_defaults",
|
2022-04-12 00:29:27 +00:00
|
|
|
"libsnapshot_cow_defaults",
|
2020-08-19 20:22:43 +00:00
|
|
|
],
|
|
|
|
srcs: [
|
2022-10-18 06:56:22 +00:00
|
|
|
"libsnapshot_cow/cow_api_test.cpp",
|
2020-08-19 20:22:43 +00:00
|
|
|
],
|
|
|
|
cflags: [
|
2020-08-25 05:49:39 +00:00
|
|
|
"-D_FILE_OFFSET_BITS=64",
|
2020-08-19 20:22:43 +00:00
|
|
|
"-Wall",
|
|
|
|
"-Werror",
|
|
|
|
],
|
|
|
|
shared_libs: [
|
|
|
|
"libbase",
|
|
|
|
"libcrypto",
|
|
|
|
"liblog",
|
|
|
|
"libz",
|
|
|
|
],
|
|
|
|
static_libs: [
|
2020-09-04 22:47:04 +00:00
|
|
|
"libbrotli",
|
2020-08-19 20:22:43 +00:00
|
|
|
"libgtest",
|
|
|
|
"libsnapshot_cow",
|
|
|
|
],
|
2021-04-05 20:54:33 +00:00
|
|
|
test_suites: [
|
|
|
|
"device-tests"
|
|
|
|
],
|
2021-09-28 11:35:09 +00:00
|
|
|
test_options: {
|
|
|
|
min_shipping_api_level: 30,
|
|
|
|
},
|
2020-08-19 20:22:43 +00:00
|
|
|
auto_gen_config: true,
|
|
|
|
require_root: false,
|
2020-09-15 00:05:04 +00:00
|
|
|
host_supported: true,
|
2020-08-19 20:22:43 +00:00
|
|
|
}
|
2020-08-19 20:35:11 +00:00
|
|
|
|
|
|
|
cc_binary {
|
|
|
|
name: "make_cow_from_ab_ota",
|
|
|
|
host_supported: true,
|
|
|
|
device_supported: false,
|
2020-08-25 05:49:39 +00:00
|
|
|
cflags: [
|
|
|
|
"-D_FILE_OFFSET_BITS=64",
|
|
|
|
"-Wall",
|
|
|
|
"-Werror",
|
|
|
|
],
|
2020-08-19 20:35:11 +00:00
|
|
|
static_libs: [
|
|
|
|
"libbase",
|
|
|
|
"libbspatch",
|
|
|
|
"libbrotli",
|
|
|
|
"libbz",
|
|
|
|
"libchrome",
|
|
|
|
"libcrypto",
|
|
|
|
"libgflags",
|
|
|
|
"liblog",
|
|
|
|
"libprotobuf-cpp-lite",
|
|
|
|
"libpuffpatch",
|
|
|
|
"libsnapshot_cow",
|
|
|
|
"libsparse",
|
|
|
|
"libxz",
|
|
|
|
"libz",
|
2022-04-12 00:29:27 +00:00
|
|
|
"liblz4",
|
2020-08-19 20:35:11 +00:00
|
|
|
"libziparchive",
|
|
|
|
"update_metadata-protos",
|
|
|
|
],
|
|
|
|
srcs: [
|
|
|
|
"make_cow_from_ab_ota.cpp",
|
|
|
|
],
|
|
|
|
target: {
|
|
|
|
darwin: {
|
|
|
|
enabled: false,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
2020-08-25 05:49:39 +00:00
|
|
|
|
|
|
|
cc_binary {
|
|
|
|
name: "estimate_cow_from_nonab_ota",
|
2022-04-12 00:29:27 +00:00
|
|
|
defaults: [
|
|
|
|
"libsnapshot_cow_defaults",
|
|
|
|
],
|
2020-08-25 05:49:39 +00:00
|
|
|
host_supported: true,
|
|
|
|
device_supported: false,
|
|
|
|
cflags: [
|
|
|
|
"-D_FILE_OFFSET_BITS=64",
|
|
|
|
"-Wall",
|
|
|
|
"-Werror",
|
|
|
|
],
|
|
|
|
static_libs: [
|
|
|
|
"libbase",
|
|
|
|
"libbrotli",
|
|
|
|
"libbz",
|
|
|
|
"libcrypto",
|
|
|
|
"libgflags",
|
|
|
|
"liblog",
|
|
|
|
"libsnapshot_cow",
|
|
|
|
"libsparse",
|
|
|
|
"libz",
|
|
|
|
"libziparchive",
|
|
|
|
],
|
|
|
|
srcs: [
|
|
|
|
"estimate_cow_from_nonab_ota.cpp",
|
|
|
|
],
|
|
|
|
target: {
|
|
|
|
darwin: {
|
|
|
|
enabled: false,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
2020-08-26 00:55:59 +00:00
|
|
|
|
2020-10-27 01:21:08 +00:00
|
|
|
cc_binary {
|
|
|
|
name: "inspect_cow",
|
|
|
|
host_supported: true,
|
|
|
|
device_supported: true,
|
2022-04-12 00:29:27 +00:00
|
|
|
defaults: ["libsnapshot_cow_defaults"],
|
2020-10-27 01:21:08 +00:00
|
|
|
cflags: [
|
|
|
|
"-D_FILE_OFFSET_BITS=64",
|
|
|
|
"-Wall",
|
|
|
|
"-Werror",
|
|
|
|
],
|
|
|
|
static_libs: [
|
|
|
|
"libbase",
|
|
|
|
"libbrotli",
|
|
|
|
"libcrypto_static",
|
|
|
|
"liblog",
|
|
|
|
"libsnapshot_cow",
|
|
|
|
"libz",
|
|
|
|
],
|
|
|
|
shared_libs: [
|
|
|
|
],
|
|
|
|
srcs: [
|
2022-10-18 06:56:22 +00:00
|
|
|
"libsnapshot_cow/inspect_cow.cpp",
|
2020-10-27 01:21:08 +00:00
|
|
|
],
|
|
|
|
}
|
2021-07-30 23:47:53 +00:00
|
|
|
|
|
|
|
python_library_host {
|
|
|
|
name: "snapshot_proto_python",
|
|
|
|
srcs: [
|
|
|
|
"android/snapshot/snapshot.proto",
|
|
|
|
],
|
|
|
|
proto: {
|
|
|
|
canonical_path_from_root: false,
|
|
|
|
},
|
|
|
|
}
|