From: Jo-Philipp Wich Date: Wed, 8 Apr 2015 05:05:14 +0000 (+0200) Subject: Remove unused mountpoint support X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=67cbf164c72c2916641e2d4900f7cf497375b4c3;p=project%2Fmake_ext4fs.git Remove unused mountpoint support Signed-off-by: Jo-Philipp Wich --- diff --git a/ext4_utils.h b/ext4_utils.h index 97eebc4..2ad05a0 100644 --- a/ext4_utils.h +++ b/ext4_utils.h @@ -156,7 +156,7 @@ typedef int (*fs_config_func_t)(const char *path, int dir, unsigned *uid, unsign struct selabel_handle; int make_ext4fs_internal(int fd, const char *directory, - const char *mountpoint, fs_config_func_t fs_config_func, int gzip, + fs_config_func_t fs_config_func, int gzip, int sparse, int crc, int wipe, int verbose, time_t fixed_time, FILE* block_list_file); diff --git a/make_ext4fs.c b/make_ext4fs.c index 553b066..d25dc0c 100644 --- a/make_ext4fs.c +++ b/make_ext4fs.c @@ -372,28 +372,24 @@ static char *canonicalize_rel_slashes(const char *str) } int make_ext4fs_internal(int fd, const char *_directory, - const char *_mountpoint, fs_config_func_t fs_config_func, int gzip, + fs_config_func_t fs_config_func, int gzip, int sparse, int crc, int wipe, int verbose, time_t fixed_time, FILE* block_list_file) { u32 root_inode_num; u16 root_mode; - char *mountpoint; char *directory = NULL; if (setjmp(setjmp_env)) return EXIT_FAILURE; /* Handle a call to longjmp() */ - if (_mountpoint == NULL) { - mountpoint = strdup(""); - } else { - mountpoint = canonicalize_abs_slashes(_mountpoint); + if (_directory == NULL) { + fprintf(stderr, "Need a source directory\n"); + return EXIT_FAILURE; } - if (_directory) { - directory = canonicalize_rel_slashes(_directory); - } + directory = canonicalize_rel_slashes(_directory); if (info.len <= 0) info.len = get_file_size(fd); @@ -477,11 +473,8 @@ int make_ext4fs_internal(int fd, const char *_directory, if (info.feat_compat & EXT4_FEATURE_COMPAT_RESIZE_INODE) ext4_create_resize_inode(); - if (directory) - root_inode_num = build_directory_structure(directory, mountpoint, 0, - fs_config_func, verbose, fixed_time); - else - root_inode_num = build_default_directory_structure(mountpoint); + root_inode_num = build_directory_structure(directory, "", 0, + fs_config_func, verbose, fixed_time); root_mode = S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH; inode_set_permissions(root_inode_num, root_mode, 0, 0, 0); @@ -491,12 +484,11 @@ int make_ext4fs_internal(int fd, const char *_directory, ext4_queue_sb(); if (block_list_file) { - size_t dirlen = directory ? strlen(directory) : 0; + size_t dirlen = strlen(directory); struct block_allocation* p = get_saved_allocation_chain(); while (p) { - if (directory && strncmp(p->filename, directory, dirlen) == 0) { - // substitute mountpoint for the leading directory in the filename, in the output file - fprintf(block_list_file, "%s%s", mountpoint, p->filename + dirlen); + if (strncmp(p->filename, directory, dirlen) == 0) { + fprintf(block_list_file, "%s", p->filename + dirlen); } else { fprintf(block_list_file, "%s", p->filename); } @@ -522,7 +514,6 @@ int make_ext4fs_internal(int fd, const char *_directory, sparse_file_destroy(ext4_sparse_file); ext4_sparse_file = NULL; - free(mountpoint); free(directory); return 0; diff --git a/make_ext4fs_main.c b/make_ext4fs_main.c index e22167f..b0edaa5 100644 --- a/make_ext4fs_main.c +++ b/make_ext4fs_main.c @@ -35,7 +35,7 @@ static void usage(char *path) { fprintf(stderr, "%s [ -l ] [ -j ] [ -b ]\n", basename(path)); fprintf(stderr, " [ -g ] [ -i ] [ -I ]\n"); - fprintf(stderr, " [ -L