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

Commit 7d9d79a2 authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 4471243 from dffc94f6 to pi-release

Change-Id: I54c446e0320a7d5fc17226ef2bbd3e464d066097
parents d791373b dffc94f6
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -62,7 +62,7 @@ static bool update_capabilities(const char* path, uint64_t capabilities) {
    }

    vfs_cap_data cap_data = {};
    cap_data.magic_etc = VFS_CAP_REVISION | VFS_CAP_FLAGS_EFFECTIVE;
    cap_data.magic_etc = VFS_CAP_REVISION_2 | VFS_CAP_FLAGS_EFFECTIVE;
    cap_data.data[0].permitted = (capabilities & 0xffffffff);
    cap_data.data[0].inheritable = 0;
    cap_data.data[1].permitted = (capabilities >> 32);
+2 −3
Original line number Diff line number Diff line
@@ -39,7 +39,7 @@ LOCAL_MODULE := fastboot
LOCAL_MODULE_TAGS := debug
LOCAL_MODULE_HOST_OS := darwin linux windows
LOCAL_CFLAGS += -Wall -Wextra -Werror -Wunreachable-code
LOCAL_REQUIRED_MODULES := mke2fs e2fsdroid
LOCAL_REQUIRED_MODULES := mke2fs e2fsdroid make_f2fs

LOCAL_SRC_FILES_linux := usb_linux.cpp
LOCAL_STATIC_LIBRARIES_linux := libselinux
@@ -66,8 +66,6 @@ LOCAL_STATIC_LIBRARIES := \
    libcutils \
    libgtest_host \

LOCAL_CFLAGS_linux := -DUSE_F2FS

LOCAL_CXX_STL := libc++_static

# Don't add anything here, we don't want additional shared dependencies
@@ -80,6 +78,7 @@ include $(BUILD_HOST_EXECUTABLE)
my_dist_files := $(LOCAL_BUILT_MODULE)
my_dist_files += $(HOST_OUT_EXECUTABLES)/mke2fs$(HOST_EXECUTABLE_SUFFIX)
my_dist_files += $(HOST_OUT_EXECUTABLES)/e2fsdroid$(HOST_EXECUTABLE_SUFFIX)
my_dist_files += $(HOST_OUT_EXECUTABLES)/make_f2fs$(HOST_EXECUTABLE_SUFFIX)
$(call dist-for-goals,dist_files sdk win_sdk,$(my_dist_files))
ifdef HOST_CROSS_OS
# Archive fastboot.exe for win_sdk build.
+7 −6
Original line number Diff line number Diff line
@@ -154,10 +154,10 @@ static int generate_ext4_image(const char* fileName, long long partSize,
    return 0;
}

#ifdef USE_F2FS
static int generate_f2fs_image(const char* fileName, long long partSize, const std::string& initial_dir,
                               unsigned /* unused */, unsigned /* unused */)
{
#ifndef WIN32
    const std::string exec_dir = android::base::GetExecutableDirectory();
    const std::string mkf2fs_path = exec_dir + "/make_f2fs";
    std::vector<const char*> mkf2fs_args = {mkf2fs_path.c_str()};
@@ -180,12 +180,15 @@ static int generate_f2fs_image(const char* fileName, long long partSize, const s
    }

    if (!initial_dir.empty()) {
        fprintf(stderr, "Unable to set initial directory on F2FS filesystem: %s\n", strerror(errno));
        return -1;
    }
        fprintf(stderr, "sload.f2s not supported yet\n");
        return 0;
    }
    return 0;
#else
    fprintf(stderr, "make_f2fs not supported on Windows\n");
    return -1;
#endif
}

static const struct fs_generator {
    const char* fs_type;  //must match what fastboot reports for partition type
@@ -196,9 +199,7 @@ static const struct fs_generator {

} generators[] = {
    { "ext4", generate_ext4_image},
#ifdef USE_F2FS
    { "f2fs", generate_f2fs_image},
#endif
};

const struct fs_generator* fs_get_generator(const std::string& fs_type) {
+13 −0
Original line number Diff line number Diff line
@@ -194,5 +194,18 @@ bool SetCapsForExec(const CapSet& to_keep) {
    return SetAmbientCaps(to_keep);
}

bool DropInheritableCaps() {
    ScopedCaps caps(cap_get_proc());
    if (cap_clear_flag(caps.get(), CAP_INHERITABLE) == -1) {
        PLOG(ERROR) << "cap_clear_flag(INHERITABLE) failed";
        return false;
    }
    if (cap_set_proc(caps.get()) != 0) {
        PLOG(ERROR) << "cap_set_proc() failed";
        return false;
    }
    return true;
}

}  // namespace init
}  // namespace android
+1 −0
Original line number Diff line number Diff line
@@ -35,6 +35,7 @@ int LookupCap(const std::string& cap_name);
bool CapAmbientSupported();
unsigned int GetLastValidCap();
bool SetCapsForExec(const CapSet& to_keep);
bool DropInheritableCaps();

}  // namespace init
}  // namespace android
Loading