resolve merge conflicts of 645026c74 to oc-dr1-dev-plus-aosp

Test: I solemnly swear I tested this conflict resolution.
Merged-In: If8fc73e4ae4c2f8281c41a12f1c18079aab8baa2
Change-Id: Iadfcd7e75044d62f2015dc62c69ee68869b40cd7
This commit is contained in:
Jiyong Park 2017-06-28 22:45:51 +09:00
commit 28bd98999b
3 changed files with 134 additions and 87 deletions

View File

@ -21,18 +21,6 @@ cc_defaults {
},
local_include_dirs: ["include/"],
cppflags: ["-Werror"],
static_libs: [
"liblogwrap",
"libfec",
"libfec_rs",
"libbase",
"libcrypto_utils",
"libcrypto",
"libext4_utils",
"libsquashfs_utils",
"libselinux",
"libavb",
],
}
cc_library_static {
@ -44,12 +32,28 @@ cc_library_static {
"fs_mgr.cpp",
"fs_mgr_dm_ioctl.cpp",
"fs_mgr_format.cpp",
"fs_mgr_fstab.cpp",
"fs_mgr_slotselect.cpp",
"fs_mgr_verity.cpp",
"fs_mgr_avb.cpp",
"fs_mgr_avb_ops.cpp",
"fs_mgr_boot_config.cpp",
],
static_libs: [
"libfec",
"libfec_rs",
"libbase",
"libcrypto_utils",
"libcrypto",
"libext4_utils",
"libsquashfs_utils",
"libselinux",
"libavb",
"libfstab",
],
export_static_lib_headers: [
"libfstab",
],
whole_static_libs: [
"liblogwrap",
"libfstab",
],
product_variables: {
debuggable: {
@ -60,3 +64,16 @@ cc_library_static {
},
},
}
cc_library_static {
name: "libfstab",
vendor_available: true,
defaults: ["fs_mgr_defaults"],
srcs: [
"fs_mgr_fstab.cpp",
"fs_mgr_boot_config.cpp",
"fs_mgr_slotselect.cpp",
],
export_include_dirs: ["include_fstab"],
header_libs: ["libbase_headers"],
}

View File

@ -22,11 +22,7 @@
#include <stdbool.h>
#include <linux/dm-ioctl.h>
// C++ only headers
// TODO: move this into separate header files under include/fs_mgr/*.h
#ifdef __cplusplus
#include <string>
#endif
#include <fstab/fstab.h>
// Magic number at start of verity metadata
#define VERITY_METADATA_MAGIC_NUMBER 0xb001b001
@ -53,49 +49,10 @@ enum mount_mode {
MOUNT_MODE_LATE = 2
};
/*
* The entries must be kept in the same order as they were seen in the fstab.
* Unless explicitly requested, a lookup on mount point should always
* return the 1st one.
*/
struct fstab {
int num_entries;
struct fstab_rec *recs;
char *fstab_filename;
};
struct fstab_rec {
char *blk_device;
char *mount_point;
char *fs_type;
unsigned long flags;
char *fs_options;
int fs_mgr_flags;
char *key_loc;
char* key_dir;
char *verity_loc;
long long length;
char *label;
int partnum;
int swap_prio;
int max_comp_streams;
unsigned int zram_size;
uint64_t reserved_size;
unsigned int file_contents_mode;
unsigned int file_names_mode;
unsigned int erase_blk_size;
unsigned int logical_blk_size;
};
// Callback function for verity status
typedef void (*fs_mgr_verity_state_callback)(struct fstab_rec *fstab,
const char *mount_point, int mode, int status);
struct fstab *fs_mgr_read_fstab_default();
struct fstab *fs_mgr_read_fstab_dt();
struct fstab *fs_mgr_read_fstab(const char *fstab_path);
void fs_mgr_free_fstab(struct fstab *fstab);
#define FS_MGR_MNTALL_DEV_IS_METADATA_ENCRYPTED 7
#define FS_MGR_MNTALL_DEV_NEEDS_METADATA_ENCRYPTION 6
#define FS_MGR_MNTALL_DEV_FILE_ENCRYPTED 5
@ -120,28 +77,6 @@ struct fstab_rec const* fs_mgr_get_crypt_entry(struct fstab const* fstab);
void fs_mgr_get_crypt_info(struct fstab* fstab, char* key_loc, char* real_blk_device, size_t size);
bool fs_mgr_load_verity_state(int* mode);
bool fs_mgr_update_verity_state(fs_mgr_verity_state_callback callback);
int fs_mgr_add_entry(struct fstab *fstab,
const char *mount_point, const char *fs_type,
const char *blk_device);
struct fstab_rec *fs_mgr_get_entry_for_mount_point(struct fstab *fstab, const char *path);
int fs_mgr_is_voldmanaged(const struct fstab_rec *fstab);
int fs_mgr_is_nonremovable(const struct fstab_rec *fstab);
int fs_mgr_is_verified(const struct fstab_rec *fstab);
int fs_mgr_is_verifyatboot(const struct fstab_rec *fstab);
int fs_mgr_is_avb(const struct fstab_rec *fstab);
int fs_mgr_is_encryptable(const struct fstab_rec *fstab);
int fs_mgr_is_file_encrypted(const struct fstab_rec *fstab);
void fs_mgr_get_file_encryption_modes(const struct fstab_rec *fstab,
const char **contents_mode_ret,
const char **filenames_mode_ret);
int fs_mgr_is_convertible_to_fbe(const struct fstab_rec *fstab);
int fs_mgr_is_noemulatedsd(const struct fstab_rec *fstab);
int fs_mgr_is_notrim(struct fstab_rec *fstab);
int fs_mgr_is_formattable(struct fstab_rec *fstab);
int fs_mgr_is_slotselect(struct fstab_rec *fstab);
int fs_mgr_is_nofail(struct fstab_rec *fstab);
int fs_mgr_is_latemount(struct fstab_rec *fstab);
int fs_mgr_is_quota(struct fstab_rec *fstab);
int fs_mgr_swapon_all(struct fstab *fstab);
int fs_mgr_do_format(struct fstab_rec *fstab, bool reserve_footer);
@ -154,10 +89,4 @@ int fs_mgr_setup_verity(struct fstab_rec *fstab, bool wait_for_verity_dev);
__END_DECLS
// C++ only functions
// TODO: move this into separate header files under include/fs_mgr/*.h
#ifdef __cplusplus
std::string fs_mgr_get_slot_suffix();
#endif
#endif /* __CORE_FS_MGR_H */

View File

@ -0,0 +1,101 @@
/*
* Copyright (C) 2012 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.
*/
#ifndef __CORE_FS_TAB_H
#define __CORE_FS_TAB_H
#include <linux/dm-ioctl.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
// C++ only headers
// TODO: move this into separate header files under include/fs_mgr/*.h
#ifdef __cplusplus
#include <string>
#endif
__BEGIN_DECLS
/*
* The entries must be kept in the same order as they were seen in the fstab.
* Unless explicitly requested, a lookup on mount point should always
* return the 1st one.
*/
struct fstab {
int num_entries;
struct fstab_rec* recs;
char* fstab_filename;
};
struct fstab_rec {
char* blk_device;
char* mount_point;
char* fs_type;
unsigned long flags;
char* fs_options;
int fs_mgr_flags;
char* key_loc;
char* key_dir;
char* verity_loc;
long long length;
char* label;
int partnum;
int swap_prio;
int max_comp_streams;
unsigned int zram_size;
uint64_t reserved_size;
unsigned int file_contents_mode;
unsigned int file_names_mode;
unsigned int erase_blk_size;
unsigned int logical_blk_size;
};
struct fstab* fs_mgr_read_fstab_default();
struct fstab* fs_mgr_read_fstab_dt();
struct fstab* fs_mgr_read_fstab(const char* fstab_path);
void fs_mgr_free_fstab(struct fstab* fstab);
int fs_mgr_add_entry(struct fstab* fstab, const char* mount_point, const char* fs_type,
const char* blk_device);
struct fstab_rec* fs_mgr_get_entry_for_mount_point(struct fstab* fstab, const char* path);
int fs_mgr_is_voldmanaged(const struct fstab_rec* fstab);
int fs_mgr_is_nonremovable(const struct fstab_rec* fstab);
int fs_mgr_is_verified(const struct fstab_rec* fstab);
int fs_mgr_is_verifyatboot(const struct fstab_rec* fstab);
int fs_mgr_is_avb(const struct fstab_rec* fstab);
int fs_mgr_is_encryptable(const struct fstab_rec* fstab);
int fs_mgr_is_file_encrypted(const struct fstab_rec* fstab);
void fs_mgr_get_file_encryption_modes(const struct fstab_rec* fstab, const char** contents_mode_ret,
const char** filenames_mode_ret);
int fs_mgr_is_convertible_to_fbe(const struct fstab_rec* fstab);
int fs_mgr_is_noemulatedsd(const struct fstab_rec* fstab);
int fs_mgr_is_notrim(struct fstab_rec* fstab);
int fs_mgr_is_formattable(struct fstab_rec* fstab);
int fs_mgr_is_slotselect(struct fstab_rec* fstab);
int fs_mgr_is_nofail(struct fstab_rec* fstab);
int fs_mgr_is_latemount(struct fstab_rec* fstab);
int fs_mgr_is_quota(struct fstab_rec* fstab);
__END_DECLS
// C++ only functions
// TODO: move this into separate header files under include/fs_mgr/*.h
#ifdef __cplusplus
std::string fs_mgr_get_slot_suffix();
#endif
#endif /* __CORE_FS_TAB_H */