Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a637416a authored by David Anderson's avatar David Anderson
Browse files

libsnapshot: Introduce a dynamically linked version of libsnapshot.

This will cut down on the binary sizes of update_engine, snapshotctl,
and lpdumpd.

Bug: 291688516
Test: treehugger
Change-Id: Idae5ea075ab21c2bd4fdb839eb065d865cb07d58
parent 17df69eb
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -27,6 +27,7 @@
#include <sys/vfs.h>
#include <unistd.h>

#include <cstring>
#include <string>
#include <utility>

@@ -518,7 +519,8 @@ class FsTest : public ::testing::Test {
        ASSERT_EQ(ret, 0);

        // mount the file system
        ASSERT_EQ(mount(loop_dev.device().c_str(), mntpoint_.c_str(), "f2fs", 0, nullptr), 0);
        ASSERT_EQ(mount(loop_dev.device().c_str(), mntpoint_.c_str(), "f2fs", 0, nullptr), 0)
                << strerror(errno);
    }

    void TearDown() override {
+22 −4
Original line number Diff line number Diff line
@@ -101,7 +101,7 @@ cc_library_headers {
}

cc_library_static {
    name: "libsnapshot",
    name: "libsnapshot_static",
    defaults: [
        "libsnapshot_defaults",
        "libsnapshot_hal_deps",
@@ -112,6 +112,25 @@ cc_library_static {
    ],
}

cc_library {
    name: "libsnapshot",
    defaults: [
        "libsnapshot_defaults",
        "libsnapshot_cow_defaults",
        "libsnapshot_hal_deps",
    ],
    srcs: [":libsnapshot_sources"],
    shared_libs: [
        "libfs_mgr_binder",
        "liblp",
        "libprotobuf-cpp-lite",
    ],
    static_libs: [
        "libc++fs",
        "libsnapshot_cow",
    ]
}

cc_library_static {
    name: "libsnapshot_init",
    native_coverage : true,
@@ -247,7 +266,7 @@ cc_defaults {
        "libgsi",
        "libgmock",
        "liblp",
        "libsnapshot",
        "libsnapshot_static",
        "libsnapshot_cow",
        "libsnapshot_test_helpers",
        "libsparse",
@@ -330,8 +349,6 @@ cc_binary {
        "libbrotli",
        "libc++fs",
        "libfstab",
        "libsnapshot",
        "libsnapshot_cow",
        "libz",
        "update_metadata-protos",
    ],
@@ -344,6 +361,7 @@ cc_binary {
        "liblog",
        "liblp",
        "libprotobuf-cpp-lite",
        "libsnapshot",
        "libstatslog",
        "libutils",
    ],