diff options
author | Elliott Hughes <enh@google.com> | 2021-05-12 00:59:16 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2021-05-12 00:59:16 +0000 |
commit | 9c9ce2caf4fe89227ce46a011d08d0b9eefecf14 (patch) | |
tree | 78c0c9f84843ab122bd616e7256ae45d500e73f0 | |
parent | 24cbb0e008214c65ab01aece4caaec3bfc50150c (diff) | |
parent | 8fe4f5452d86a6007e1f8fb9d349c0d2fcc96472 (diff) | |
download | erofs-utils-9c9ce2caf4fe89227ce46a011d08d0b9eefecf14.tar.gz |
Merge tag 'v1.2.1' into update am: 7269cd8246 am: 8fe4f5452d
Original change: https://android-review.googlesource.com/c/platform/external/erofs-utils/+/1703646
Change-Id: I88363ae8edd5b45088b03fdd5fc3552d96214168
-rw-r--r-- | AUTHORS | 2 | ||||
-rw-r--r-- | Android.bp | 10 | ||||
-rw-r--r-- | ChangeLog | 11 | ||||
-rw-r--r-- | METADATA | 2 | ||||
-rw-r--r-- | README | 2 | ||||
-rw-r--r-- | VERSION | 4 | ||||
-rw-r--r-- | configure.ac | 3 | ||||
-rw-r--r-- | fuse/Makefile.am | 4 | ||||
-rw-r--r-- | fuse/main.c | 8 | ||||
-rw-r--r-- | lib/config.c | 1 | ||||
-rw-r--r-- | lib/inode.c | 42 | ||||
-rw-r--r-- | lib/super.c | 2 | ||||
-rw-r--r-- | mkfs/main.c | 2 |
13 files changed, 61 insertions, 32 deletions
@@ -2,7 +2,7 @@ EROFS USERSPACE UTILITIES M: Li Guifu <bluce.liguifu@huawei.com> M: Miao Xie <miaoxie@huawei.com> M: Fang Wei <fangwei1@huawei.com> -R: Gao Xiang <gaoxiang25@huawei.com> +R: Gao Xiang <xiang@kernel.org> R: Chao Yu <yuchao0@huawei.com> S: Maintained L: linux-erofs@lists.ozlabs.org @@ -44,6 +44,13 @@ license { ], } +genrule { + name: "erofs-utils-version.h", + srcs: ["VERSION"], + out: ["erofs-utils-version.h"], + cmd: "sed -n '1p' $(in) | tr -d '\n' | sed 's/\\(.*\\)/#define PACKAGE_VERSION \"\\1\"/' > $(out)", +} + cc_defaults { name: "erofs-utils_defaults", @@ -53,7 +60,7 @@ cc_defaults { "-Wno-ignored-qualifiers", "-Wno-pointer-arith", "-Wno-unused-parameter", - "-DPACKAGE_VERSION=\"1.1\"", + "-include erofs-utils-version.h", "-DHAVE_FALLOCATE", "-DHAVE_LINUX_TYPES_H", "-DHAVE_LIBSELINUX", @@ -68,6 +75,7 @@ cc_defaults { include_dirs: [ "external/e2fsprogs/lib/", ], + generated_headers: ["erofs-utils-version.h"], shared_libs: [ "libcutils", "libext2_uuid", @@ -1,3 +1,12 @@ +erofs-utils (1.2.1-1) unstable; urgency=medium + + * A quick maintenance release includes the following updates: + - fix reported build issues due to different configurations; + - (mkfs.erofs, AOSP) fix sub-directory prefix for canned fs_config; + - update some obsoleted email address; + + -- Gao Xiang <xiang@kernel.org> Sun, 10 Jan 2021 00:00:00 +0800 + erofs-utils (1.2-1) unstable; urgency=medium * This release includes the following features and bugfixes: @@ -10,7 +19,7 @@ erofs-utils (1.2-1) unstable; urgency=medium - (mkfs.erofs, AOSP) support Android fs_config; - (experimental, disabled by default) add erofsfuse approach; - -- Gao Xiang <xiang@kernel.org> Tue, 06 Dec 2020 00:00:00 +0800 + -- Gao Xiang <xiang@kernel.org> Sun, 06 Dec 2020 00:00:00 +0800 erofs-utils (1.1-1) unstable; urgency=low @@ -5,7 +5,7 @@ third_party { type: GIT value: "https://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs-utils.git" } - version: "v1.2" + version: "v1.2.1" license_type: RESTRICTED last_upgrade_date { year: 2020 @@ -149,7 +149,7 @@ To: Fang Wei <fangwei1@huawei.com> Cc: - Gao Xiang <gaoxiang25@huawei.com> + Gao Xiang <xiang@kernel.org> Chao Yu <yuchao0@huawei.com> Comments @@ -1,2 +1,2 @@ -1.2 -2020-12-06 +1.2.1 +2021-01-10 diff --git a/configure.ac b/configure.ac index d5fdfb8..28926c3 100644 --- a/configure.ac +++ b/configure.ac @@ -96,6 +96,7 @@ AC_ARG_VAR([LZ4_LIBS], [linker flags for lz4]) # Checks for header files. AC_CHECK_HEADERS(m4_flatten([ dirent.h + execinfo.h fcntl.h getopt.h inttypes.h @@ -147,7 +148,7 @@ AC_CHECK_DECL(lseek64,[AC_DEFINE(HAVE_LSEEK64_PROTOTYPE, 1, #include <unistd.h>]) # Checks for library functions. -AC_CHECK_FUNCS([fallocate gettimeofday memset realpath strdup strerror strrchr strtoull]) +AC_CHECK_FUNCS([backtrace fallocate gettimeofday memset realpath strdup strerror strrchr strtoull]) # Configure libuuid AS_IF([test "x$with_uuid" != "xno"], [ diff --git a/fuse/Makefile.am b/fuse/Makefile.am index f14f6fd..e7757bc 100644 --- a/fuse/Makefile.am +++ b/fuse/Makefile.am @@ -5,6 +5,6 @@ AUTOMAKE_OPTIONS = foreign bin_PROGRAMS = erofsfuse erofsfuse_SOURCES = dir.c main.c erofsfuse_CFLAGS = -Wall -Werror -I$(top_srcdir)/include -erofsfuse_CFLAGS += -DFUSE_USE_VERSION=26 ${libfuse_CFLAGS} -erofsfuse_LDADD = $(top_builddir)/lib/liberofs.la ${libfuse_LIBS} ${liblz4_LIBS} +erofsfuse_CFLAGS += -DFUSE_USE_VERSION=26 ${libfuse_CFLAGS} ${libselinux_CFLAGS} +erofsfuse_LDADD = $(top_builddir)/lib/liberofs.la ${libfuse_LIBS} ${liblz4_LIBS} ${libselinux_LIBS} diff --git a/fuse/main.c b/fuse/main.c index 1e24efe..c162912 100644 --- a/fuse/main.c +++ b/fuse/main.c @@ -6,7 +6,6 @@ */ #include <stdlib.h> #include <string.h> -#include <execinfo.h> #include <signal.h> #include <libgen.h> #include <fuse.h> @@ -168,6 +167,9 @@ static int optional_opt_func(void *data, const char *arg, int key, return 1; } +#if defined(HAVE_EXECINFO_H) && defined(HAVE_BACKTRACE) +#include <execinfo.h> + static void signal_handle_sigsegv(int signal) { void *array[10]; @@ -187,7 +189,7 @@ static void signal_handle_sigsegv(int signal) erofs_dump("========================================\n"); abort(); } - +#endif int main(int argc, char *argv[]) { @@ -197,11 +199,13 @@ int main(int argc, char *argv[]) erofs_init_configure(); fprintf(stderr, "%s %s\n", basename(argv[0]), cfg.c_version); +#if defined(HAVE_EXECINFO_H) && defined(HAVE_BACKTRACE) if (signal(SIGSEGV, signal_handle_sigsegv) == SIG_ERR) { fprintf(stderr, "failed to initialize signals\n"); ret = -errno; goto err; } +#endif /* parse options */ ret = fuse_opt_parse(&args, &fusecfg, option_spec, optional_opt_func); diff --git a/lib/config.c b/lib/config.c index 3155112..3ecd481 100644 --- a/lib/config.c +++ b/lib/config.c @@ -11,6 +11,7 @@ #include "erofs/internal.h" struct erofs_configure cfg; +struct erofs_sb_info sbi; void erofs_init_configure(void) { diff --git a/lib/inode.c b/lib/inode.c index 3d634fc..d0b4d51 100644 --- a/lib/inode.c +++ b/lib/inode.c @@ -22,8 +22,6 @@ #include "erofs/xattr.h" #include "erofs/exclude.h" -struct erofs_sb_info sbi; - #define S_SHIFT 12 static unsigned char erofs_ftype_by_mode[S_IFMT >> S_SHIFT] = { [S_IFREG >> S_SHIFT] = EROFS_FT_REG_FILE, @@ -698,32 +696,42 @@ int erofs_droid_inode_fsconfig(struct erofs_inode *inode, /* filesystem_config does not preserve file type bits */ mode_t stat_file_type_mask = st->st_mode & S_IFMT; unsigned int uid = 0, gid = 0, mode = 0; - char *fspath; + const char *fspath; + char *decorated = NULL; inode->capabilities = 0; - if (cfg.fs_config_file) - canned_fs_config(erofs_fspath(path), - S_ISDIR(st->st_mode), - cfg.target_out_path, - &uid, &gid, &mode, &inode->capabilities); - else if (cfg.mount_point) { - if (asprintf(&fspath, "%s/%s", cfg.mount_point, + if (!cfg.fs_config_file && !cfg.mount_point) + return 0; + + if (!cfg.mount_point || + /* have to drop the mountpoint for rootdir of canned fsconfig */ + (cfg.fs_config_file && erofs_fspath(path)[0] == '\0')) { + fspath = erofs_fspath(path); + } else { + if (asprintf(&decorated, "%s/%s", cfg.mount_point, erofs_fspath(path)) <= 0) return -ENOMEM; + fspath = decorated; + } + if (cfg.fs_config_file) + canned_fs_config(fspath, S_ISDIR(st->st_mode), + cfg.target_out_path, + &uid, &gid, &mode, &inode->capabilities); + else fs_config(fspath, S_ISDIR(st->st_mode), cfg.target_out_path, &uid, &gid, &mode, &inode->capabilities); - free(fspath); - } - st->st_uid = uid; - st->st_gid = gid; - st->st_mode = mode | stat_file_type_mask; erofs_dbg("/%s -> mode = 0x%x, uid = 0x%x, gid = 0x%x, " "capabilities = 0x%" PRIx64 "\n", - erofs_fspath(path), - mode, uid, gid, inode->capabilities); + fspath, mode, uid, gid, inode->capabilities); + + if (decorated) + free(decorated); + st->st_uid = uid; + st->st_gid = gid; + st->st_mode = mode | stat_file_type_mask; return 0; } #else diff --git a/lib/super.c b/lib/super.c index 2d36692..025cefe 100644 --- a/lib/super.c +++ b/lib/super.c @@ -11,8 +11,6 @@ #include "erofs/io.h" #include "erofs/print.h" -struct erofs_sb_info sbi; - static bool check_layout_compatibility(struct erofs_sb_info *sbi, struct erofs_super_block *dsb) { diff --git a/mkfs/main.c b/mkfs/main.c index c63b274..abd48be 100644 --- a/mkfs/main.c +++ b/mkfs/main.c @@ -24,7 +24,7 @@ #include "erofs/exclude.h" #ifdef HAVE_LIBUUID -#include <uuid/uuid.h> +#include <uuid.h> #endif #define EROFS_SUPER_END (EROFS_SUPER_OFFSET + sizeof(struct erofs_super_block)) |