tools: acrn-crashlog: New apis to replace debugfs

This patch impletement apis with libext2fs, which are for dumping and
reading files or dirs in extfs.

Signed-off-by: Liu, Xinwu <xinwu.liu@intel.com>
Acked-by: Chen Gang <gang.c.chen@intel.com>
This commit is contained in:
Liu, Xinwu
2018-07-17 15:55:25 +08:00
committed by lijinxia
parent db05675f38
commit 134e79aca2
4 changed files with 435 additions and 2 deletions

View File

@@ -0,0 +1,19 @@
/*
* Copyright (C) 2018 Intel Corporation
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <ext2fs/ext2fs.h>
int loopdev_num_get_free(void);
int loopdev_set_img_par(const char *loopdev, const char *img_path,
const char *parname);
int loopdev_check_parname(const char *loopdev, const char *parname);
int e2fs_dump_file_by_fpath(ext2_filsys fs, const char *in_fp,
const char *out_fp);
int e2fs_read_file_by_fpath(ext2_filsys fs, const char *in_fp,
void **out_data, unsigned long *size);
int e2fs_dump_dir_by_dpath(ext2_filsys fs, const char *in_dp,
const char *out_dp, int *count);
int e2fs_open(const char *dev, ext2_filsys *outfs);
void e2fs_close(ext2_filsys fs);