diff options
Diffstat (limited to 'meta/recipes-devtools/e2fsprogs')
| -rw-r--r-- | meta/recipes-devtools/e2fsprogs/e2fsprogs.inc | 4 | ||||
| -rw-r--r-- | meta/recipes-devtools/e2fsprogs/e2fsprogs/0001-e2fsck-exit-with-exit-status-0-if-no-errors-were-fix.patch | 255 | ||||
| -rw-r--r-- | meta/recipes-devtools/e2fsprogs/e2fsprogs/Revert-mke2fs-enable-the-metadata_csum-and-64bit-fea.patch | 18 | ||||
| -rw-r--r-- | meta/recipes-devtools/e2fsprogs/e2fsprogs/e2fsprogs-1.43-sysmacros.patch | 130 | ||||
| -rw-r--r-- | meta/recipes-devtools/e2fsprogs/e2fsprogs/e2fsprogs-fix-missing-check-for-permission-denied.patch | 32 | ||||
| -rw-r--r-- | meta/recipes-devtools/e2fsprogs/e2fsprogs/mkdir_p.patch | 20 | ||||
| -rw-r--r-- | meta/recipes-devtools/e2fsprogs/e2fsprogs/xattr_ordering.patch | 219 | ||||
| -rw-r--r-- | meta/recipes-devtools/e2fsprogs/e2fsprogs_1.43.4.bb (renamed from meta/recipes-devtools/e2fsprogs/e2fsprogs_git.bb) | 23 |
8 files changed, 461 insertions, 240 deletions
diff --git a/meta/recipes-devtools/e2fsprogs/e2fsprogs.inc b/meta/recipes-devtools/e2fsprogs/e2fsprogs.inc index 09e4ea5bb6..81d90a134c 100644 --- a/meta/recipes-devtools/e2fsprogs/e2fsprogs.inc +++ b/meta/recipes-devtools/e2fsprogs/e2fsprogs.inc @@ -9,7 +9,7 @@ LICENSE_e2fsprogs-mke2fs = "GPLv2" LICENSE_e2fsprogs-fsck = "GPLv2" LICENSE_e2fsprogs-tune2fs = "GPLv2" LICENSE_e2fsprogs-badblocks = "GPLv2" -LIC_FILES_CHKSUM = "file://COPYING;md5=b48f21d765b875bd10400975d12c1ca2 \ +LIC_FILES_CHKSUM = "file://NOTICE;md5=b48f21d765b875bd10400975d12c1ca2 \ file://lib/ext2fs/ext2fs.h;beginline=1;endline=9;md5=596a8dedcb4e731c6b21c7a46fba6bef \ file://lib/e2p/e2p.h;beginline=1;endline=7;md5=8a74ade8f9d65095d70ef2d4bf48e36a \ file://lib/uuid/uuid.h.in;beginline=1;endline=32;md5=dbb8079e114a5f841934b99e59c8820a \ @@ -17,7 +17,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=b48f21d765b875bd10400975d12c1ca2 \ file://lib/et/et_name.c;beginline=1;endline=11;md5=ead236447dac7b980dbc5b4804d8c836 \ file://lib/ss/ss.h;beginline=1;endline=20;md5=6e89ad47da6e75fecd2b5e0e81e1d4a6" SECTION = "base" -DEPENDS = "util-linux" +DEPENDS = "util-linux attr" SRC_URI = "git://git.kernel.org/pub/scm/fs/ext2/e2fsprogs.git" S = "${WORKDIR}/git" diff --git a/meta/recipes-devtools/e2fsprogs/e2fsprogs/0001-e2fsck-exit-with-exit-status-0-if-no-errors-were-fix.patch b/meta/recipes-devtools/e2fsprogs/e2fsprogs/0001-e2fsck-exit-with-exit-status-0-if-no-errors-were-fix.patch new file mode 100644 index 0000000000..1d17520252 --- /dev/null +++ b/meta/recipes-devtools/e2fsprogs/e2fsprogs/0001-e2fsck-exit-with-exit-status-0-if-no-errors-were-fix.patch @@ -0,0 +1,255 @@ +From bf9f3b6d5b10d19218b4ed904c12b22e36ec57dd Mon Sep 17 00:00:00 2001 +From: Theodore Ts'o <tytso@mit.edu> +Date: Thu, 16 Feb 2017 22:02:35 -0500 +Subject: [PATCH] e2fsck: exit with exit status 0 if no errors were fixed + +Previously, e2fsck would exit with a status code of 1 even though the +only changes that it made to the file system were various +optimziations and not fixing file system corruption. Since the man +page states that an exit status of 1 means "file system errors +corrupted", fix e2fsck to return an exit status of 0. + +Upstream-Status: Backport + +Signed-off-by: Theodore Ts'o <tytso@mit.edu> +Signed-off-by: Daniel Schultz <d.schultz@phytec.de> +--- + e2fsck/e2fsck.conf.5.in | 7 +++++++ + e2fsck/journal.c | 1 + + e2fsck/problem.c | 8 +++++--- + e2fsck/problemP.h | 1 + + e2fsck/unix.c | 20 ++++++++++++++++---- + tests/f_collapse_extent_tree/expect.1 | 2 +- + tests/f_compress_extent_tree_level/expect.1 | 2 +- + tests/f_convert_bmap/expect.1 | 2 +- + tests/f_convert_bmap_and_extent/expect.1 | 2 +- + tests/f_extent_htree/expect.1 | 2 +- + tests/f_jnl_errno/expect.1 | 2 +- + tests/f_journal/expect.1 | 2 +- + tests/f_orphan/expect.1 | 2 +- + tests/f_orphan_extents_inode/expect.1 | 2 +- + tests/f_rehash_dir/expect.1 | 2 +- + tests/f_unsorted_EAs/expect.1 | 2 +- + 16 files changed, 41 insertions(+), 18 deletions(-) + +diff --git a/e2fsck/e2fsck.conf.5.in b/e2fsck/e2fsck.conf.5.in +index 1848bdb..0bfc76a 100644 +--- a/e2fsck/e2fsck.conf.5.in ++++ b/e2fsck/e2fsck.conf.5.in +@@ -303,6 +303,13 @@ of 'should this problem be fixed?'. The + option even overrides the + .B -y + option given on the command-line (just for the specific problem, of course). ++.TP ++.I not_a_fix ++This boolean option, it set to true, marks the problem as ++one where if the user gives permission to make the requested change, ++it does not mean that the file system had a problem which has since ++been fixed. This is used for requests to optimize the file system's ++data structure, such as pruning an extent tree. + @TDB_MAN_COMMENT@.SH THE [scratch_files] STANZA + @TDB_MAN_COMMENT@The following relations are defined in the + @TDB_MAN_COMMENT@.I [scratch_files] +diff --git a/e2fsck/journal.c b/e2fsck/journal.c +index 46fe7b4..c4f58f1 100644 +--- a/e2fsck/journal.c ++++ b/e2fsck/journal.c +@@ -572,6 +572,7 @@ static void clear_v2_journal_fields(journal_t *journal) + if (!fix_problem(ctx, PR_0_CLEAR_V2_JOURNAL, &pctx)) + return; + ++ ctx->flags |= E2F_FLAG_PROBLEMS_FIXED; + memset(((char *) journal->j_superblock) + V1_SB_SIZE, 0, + ctx->fs->blocksize-V1_SB_SIZE); + mark_buffer_dirty(journal->j_sb_buffer); +diff --git a/e2fsck/problem.c b/e2fsck/problem.c +index 34a671e..4b25069 100644 +--- a/e2fsck/problem.c ++++ b/e2fsck/problem.c +@@ -1276,12 +1276,12 @@ static struct e2fsck_problem problem_table[] = { + /* Inode extent tree could be shorter */ + { PR_1E_CAN_COLLAPSE_EXTENT_TREE, + N_("@i %i @x tree (at level %b) could be shorter. "), +- PROMPT_FIX, PR_NO_OK | PR_PREEN_NO | PR_PREEN_OK }, ++ PROMPT_FIX, PR_NO_OK | PR_PREEN_NO | PR_PREEN_OK | PR_NOT_A_FIX }, + + /* Inode extent tree could be narrower */ + { PR_1E_CAN_NARROW_EXTENT_TREE, + N_("@i %i @x tree (at level %b) could be narrower. "), +- PROMPT_FIX, PR_NO_OK | PR_PREEN_NO | PR_PREEN_OK }, ++ PROMPT_FIX, PR_NO_OK | PR_PREEN_NO | PR_PREEN_OK | PR_NOT_A_FIX }, + + /* Pass 2 errors */ + +@@ -2166,6 +2166,7 @@ int fix_problem(e2fsck_t ctx, problem_t code, struct problem_context *pctx) + reconfigure_bool(ctx, ptr, key, PR_NO_NOMSG, "no_nomsg"); + reconfigure_bool(ctx, ptr, key, PR_PREEN_NOHDR, "preen_noheader"); + reconfigure_bool(ctx, ptr, key, PR_FORCE_NO, "force_no"); ++ reconfigure_bool(ctx, ptr, key, PR_NOT_A_FIX, "not_a_fix"); + profile_get_integer(ctx->profile, "options", + "max_count_problems", 0, 0, + &ptr->max_count); +@@ -2283,7 +2284,8 @@ int fix_problem(e2fsck_t ctx, problem_t code, struct problem_context *pctx) + if (ptr->flags & PR_AFTER_CODE) + answer = fix_problem(ctx, ptr->second_code, pctx); + +- if (answer && (ptr->prompt != PROMPT_NONE)) ++ if (answer && (ptr->prompt != PROMPT_NONE) && ++ !(ptr->flags & PR_NOT_A_FIX)) + ctx->flags |= E2F_FLAG_PROBLEMS_FIXED; + + return answer; +diff --git a/e2fsck/problemP.h b/e2fsck/problemP.h +index 7944cd6..63bb8df 100644 +--- a/e2fsck/problemP.h ++++ b/e2fsck/problemP.h +@@ -44,3 +44,4 @@ struct latch_descr { + #define PR_CONFIG 0x080000 /* This problem has been customized + from the config file */ + #define PR_FORCE_NO 0x100000 /* Force the answer to be no */ ++#define PR_NOT_A_FIX 0x200000 /* Yes doesn't mean a problem was fixed */ +diff --git a/e2fsck/unix.c b/e2fsck/unix.c +index eb9f311..9e4d31a 100644 +--- a/e2fsck/unix.c ++++ b/e2fsck/unix.c +@@ -1901,11 +1901,23 @@ no_journal: + fix_problem(ctx, PR_6_IO_FLUSH, &pctx); + + if (was_changed) { +- exit_value |= FSCK_NONDESTRUCT; +- if (!(ctx->options & E2F_OPT_PREEN)) +- log_out(ctx, _("\n%s: ***** FILE SYSTEM WAS " +- "MODIFIED *****\n"), ++ int fs_fixed = (ctx->flags & E2F_FLAG_PROBLEMS_FIXED); ++ ++ if (fs_fixed) ++ exit_value |= FSCK_NONDESTRUCT; ++ if (!(ctx->options & E2F_OPT_PREEN)) { ++#if 0 /* Do this later; it breaks too many tests' golden outputs */ ++ log_out(ctx, fs_fixed ? ++ _("\n%s: ***** FILE SYSTEM ERRORS " ++ "CORRECTED *****\n") : ++ _("%s: File system was modified.\n"), + ctx->device_name); ++#else ++ log_out(ctx, ++ _("\n%s: ***** FILE SYSTEM WAS MODIFIED *****\n"), ++ ctx->device_name); ++#endif ++ } + if (ctx->mount_flags & EXT2_MF_ISROOT) { + log_out(ctx, _("%s: ***** REBOOT SYSTEM *****\n"), + ctx->device_name); +diff --git a/tests/f_collapse_extent_tree/expect.1 b/tests/f_collapse_extent_tree/expect.1 +index e2eb65e..8165a58 100644 +--- a/tests/f_collapse_extent_tree/expect.1 ++++ b/tests/f_collapse_extent_tree/expect.1 +@@ -13,4 +13,4 @@ Pass 5: Checking group summary information + + test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** + test_filesys: 12/128 files (0.0% non-contiguous), 19/512 blocks +-Exit status is 1 ++Exit status is 0 +diff --git a/tests/f_compress_extent_tree_level/expect.1 b/tests/f_compress_extent_tree_level/expect.1 +index a359c99..dd33f63 100644 +--- a/tests/f_compress_extent_tree_level/expect.1 ++++ b/tests/f_compress_extent_tree_level/expect.1 +@@ -20,4 +20,4 @@ Pass 5: Checking group summary information + + test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** + test_filesys: 12/128 files (8.3% non-contiguous), 26/512 blocks +-Exit status is 1 ++Exit status is 0 +diff --git a/tests/f_convert_bmap/expect.1 b/tests/f_convert_bmap/expect.1 +index 7d2ca86..c387962 100644 +--- a/tests/f_convert_bmap/expect.1 ++++ b/tests/f_convert_bmap/expect.1 +@@ -23,4 +23,4 @@ Pass 5: Checking group summary information + + test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** + test_filesys: 12/128 files (8.3% non-contiguous), 570/2048 blocks +-Exit status is 1 ++Exit status is 0 +diff --git a/tests/f_convert_bmap_and_extent/expect.1 b/tests/f_convert_bmap_and_extent/expect.1 +index 7af91aa..c86c571 100644 +--- a/tests/f_convert_bmap_and_extent/expect.1 ++++ b/tests/f_convert_bmap_and_extent/expect.1 +@@ -30,4 +30,4 @@ Pass 5: Checking group summary information + + test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** + test_filesys: 13/128 files (15.4% non-contiguous), 574/2048 blocks +-Exit status is 1 ++Exit status is 0 +diff --git a/tests/f_extent_htree/expect.1 b/tests/f_extent_htree/expect.1 +index 223ca69..ea48405 100644 +--- a/tests/f_extent_htree/expect.1 ++++ b/tests/f_extent_htree/expect.1 +@@ -26,4 +26,4 @@ test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** + 0 sockets + ------------ + 343 files +-Exit status is 1 ++Exit status is 0 +diff --git a/tests/f_jnl_errno/expect.1 b/tests/f_jnl_errno/expect.1 +index c572951..4134234 100644 +--- a/tests/f_jnl_errno/expect.1 ++++ b/tests/f_jnl_errno/expect.1 +@@ -6,4 +6,4 @@ Pass 5: Checking group summary information + + test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** + test_filesys: 11/2048 files (9.1% non-contiguous), 1330/8192 blocks +-Exit status is 1 ++Exit status is 0 +diff --git a/tests/f_journal/expect.1 b/tests/f_journal/expect.1 +index a202c80..0a18654 100644 +--- a/tests/f_journal/expect.1 ++++ b/tests/f_journal/expect.1 +@@ -59,4 +59,4 @@ Pass 5: Checking group summary information + + test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** + test_filesys: 53/2048 files (1.9% non-contiguous), 1409/8192 blocks +-Exit status is 1 ++Exit status is 0 +diff --git a/tests/f_orphan/expect.1 b/tests/f_orphan/expect.1 +index eddc1f8..087ebee 100644 +--- a/tests/f_orphan/expect.1 ++++ b/tests/f_orphan/expect.1 +@@ -11,4 +11,4 @@ Pass 5: Checking group summary information + + test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** + test_filesys: 12/2048 files (0.0% non-contiguous), 1303/8192 blocks +-Exit status is 1 ++Exit status is 0 +diff --git a/tests/f_orphan_extents_inode/expect.1 b/tests/f_orphan_extents_inode/expect.1 +index 2eaab78..5d713b3 100644 +--- a/tests/f_orphan_extents_inode/expect.1 ++++ b/tests/f_orphan_extents_inode/expect.1 +@@ -7,4 +7,4 @@ Pass 5: Checking group summary information + + test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** + test_filesys: 12/16 files (0.0% non-contiguous), 21/100 blocks +-Exit status is 1 ++Exit status is 0 +diff --git a/tests/f_rehash_dir/expect.1 b/tests/f_rehash_dir/expect.1 +index 6076765..c1449ba 100644 +--- a/tests/f_rehash_dir/expect.1 ++++ b/tests/f_rehash_dir/expect.1 +@@ -7,4 +7,4 @@ Pass 5: Checking group summary information + + test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** + test_filesys: 105/2048 files (2.9% non-contiguous), 336/512 blocks +-Exit status is 1 ++Exit status is 0 +diff --git a/tests/f_unsorted_EAs/expect.1 b/tests/f_unsorted_EAs/expect.1 +index 7d588d7..64b9045 100644 +--- a/tests/f_unsorted_EAs/expect.1 ++++ b/tests/f_unsorted_EAs/expect.1 +@@ -8,4 +8,4 @@ Pass 5: Checking group summary information + + test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** + test_filesys: 12/2048 files (0.0% non-contiguous), 1294/2048 blocks +-Exit status is 1 ++Exit status is 0 +-- +1.9.1 + diff --git a/meta/recipes-devtools/e2fsprogs/e2fsprogs/Revert-mke2fs-enable-the-metadata_csum-and-64bit-fea.patch b/meta/recipes-devtools/e2fsprogs/e2fsprogs/Revert-mke2fs-enable-the-metadata_csum-and-64bit-fea.patch index 656fb6efbd..38fb07e6e6 100644 --- a/meta/recipes-devtools/e2fsprogs/e2fsprogs/Revert-mke2fs-enable-the-metadata_csum-and-64bit-fea.patch +++ b/meta/recipes-devtools/e2fsprogs/e2fsprogs/Revert-mke2fs-enable-the-metadata_csum-and-64bit-fea.patch @@ -9,26 +9,28 @@ don't want to enable features by default that are not supported by the latest stable e2fsprogs release. Upstream-Status: Inappropriate [configuration] - Signed-off-by: Jonathan Liu <net147@gmail.com> + +Rebase to 1.43: +The upstream has disabled metadata_csum by default +this rebase just revert 64bit feature. +Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> --- misc/mke2fs.conf.in | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/misc/mke2fs.conf.in b/misc/mke2fs.conf.in -index a049d61..106ee80 100644 +index 812f7c7..0280398 100644 --- a/misc/mke2fs.conf.in +++ b/misc/mke2fs.conf.in -@@ -11,7 +11,8 @@ +@@ -11,8 +11,9 @@ features = has_journal } ext4 = { -- features = has_journal,extent,huge_file,flex_bg,metadata_csum,64bit,dir_nlink,extra_isize +- features = has_journal,extent,huge_file,flex_bg,uninit_bg,64bit,dir_nlink,extra_isize + features = has_journal,extent,huge_file,flex_bg,uninit_bg,dir_nlink,extra_isize -+ auto_64-bit_support = 1 inode_size = 256 ++ auto_64-bit_support = 1 } ext4dev = { --- -2.7.2 - + features = has_journal,extent,huge_file,flex_bg,uninit_bg,inline_data,64bit,dir_nlink,extra_isize diff --git a/meta/recipes-devtools/e2fsprogs/e2fsprogs/e2fsprogs-1.43-sysmacros.patch b/meta/recipes-devtools/e2fsprogs/e2fsprogs/e2fsprogs-1.43-sysmacros.patch new file mode 100644 index 0000000000..abbf2bad26 --- /dev/null +++ b/meta/recipes-devtools/e2fsprogs/e2fsprogs/e2fsprogs-1.43-sysmacros.patch @@ -0,0 +1,130 @@ +From 30ef41f68703b6a16027cc8787118b87f1462dff Mon Sep 17 00:00:00 2001 +From: Mike Frysinger <vapier@gentoo.org> +Date: Mon, 28 Mar 2016 20:31:33 -0400 +Subject: [PATCH e2fsprogs] include sys/sysmacros.h as needed + +The minor/major/makedev macros are not entirely standard. glibc has had +the definitions in sys/sysmacros.h since the start, and wants to move away +from always defining them implicitly via sys/types.h (as this pollutes the +namespace in violation of POSIX). Other C libraries have already dropped +them. Since the configure script already checks for this header, use that +to pull in the header in files that use these macros. + +Signed-off-by: Mike Frysinger <vapier@gentoo.org> + +Taken from gentoo portage. + +Upstream-Status: Pending + +--- + debugfs/debugfs.c | 3 +++ + lib/blkid/devname.c | 3 +++ + lib/blkid/devno.c | 3 +++ + lib/ext2fs/finddev.c | 3 +++ + lib/ext2fs/ismounted.c | 3 +++ + misc/create_inode.c | 4 ++++ + misc/mk_hugefiles.c | 3 +++ + 7 files changed, 22 insertions(+) + +diff --git a/debugfs/debugfs.c b/debugfs/debugfs.c +index ba8be40..7d481bc 100644 +--- a/debugfs/debugfs.c ++++ b/debugfs/debugfs.c +@@ -26,6 +26,9 @@ extern char *optarg; + #include <errno.h> + #endif + #include <fcntl.h> ++#ifdef HAVE_SYS_SYSMACROS_H ++#include <sys/sysmacros.h> ++#endif + + #include "debugfs.h" + #include "uuid/uuid.h" +diff --git a/lib/blkid/devname.c b/lib/blkid/devname.c +index 3e2efa9..671e781 100644 +--- a/lib/blkid/devname.c ++++ b/lib/blkid/devname.c +@@ -36,6 +36,9 @@ + #if HAVE_SYS_MKDEV_H + #include <sys/mkdev.h> + #endif ++#ifdef HAVE_SYS_SYSMACROS_H ++#include <sys/sysmacros.h> ++#endif + #include <time.h> + + #include "blkidP.h" +diff --git a/lib/blkid/devno.c b/lib/blkid/devno.c +index 479d977..61e6fc7 100644 +--- a/lib/blkid/devno.c ++++ b/lib/blkid/devno.c +@@ -31,6 +31,9 @@ + #if HAVE_SYS_MKDEV_H + #include <sys/mkdev.h> + #endif ++#ifdef HAVE_SYS_SYSMACROS_H ++#include <sys/sysmacros.h> ++#endif + + #include "blkidP.h" + +diff --git a/lib/ext2fs/finddev.c b/lib/ext2fs/finddev.c +index 311608d..62fa0db 100644 +--- a/lib/ext2fs/finddev.c ++++ b/lib/ext2fs/finddev.c +@@ -31,6 +31,9 @@ + #if HAVE_SYS_MKDEV_H + #include <sys/mkdev.h> + #endif ++#ifdef HAVE_SYS_SYSMACROS_H ++#include <sys/sysmacros.h> ++#endif + + #include "ext2_fs.h" + #include "ext2fs.h" +diff --git a/lib/ext2fs/ismounted.c b/lib/ext2fs/ismounted.c +index e0f69dd..7404996 100644 +--- a/lib/ext2fs/ismounted.c ++++ b/lib/ext2fs/ismounted.c +@@ -49,6 +49,9 @@ + #if HAVE_SYS_TYPES_H + #include <sys/types.h> + #endif ++#ifdef HAVE_SYS_SYSMACROS_H ++#include <sys/sysmacros.h> ++#endif + + #include "ext2_fs.h" + #include "ext2fs.h" +diff --git a/misc/create_inode.c b/misc/create_inode.c +index 4dbd8e5..98aeb41 100644 +--- a/misc/create_inode.c ++++ b/misc/create_inode.c +@@ -22,6 +22,10 @@ + #include <attr/xattr.h> + #endif + #include <sys/ioctl.h> ++#ifdef HAVE_SYS_SYSMACROS_H ++#include <sys/sysmacros.h> ++#endif ++ + #include <ext2fs/ext2fs.h> + #include <ext2fs/ext2_types.h> + #include <ext2fs/fiemap.h> +diff --git a/misc/mk_hugefiles.c b/misc/mk_hugefiles.c +index 71a15c5..00e95cd 100644 +--- a/misc/mk_hugefiles.c ++++ b/misc/mk_hugefiles.c +@@ -35,6 +35,9 @@ extern int optind; + #include <sys/ioctl.h> + #include <sys/types.h> + #include <sys/stat.h> ++#ifdef HAVE_SYS_SYSMACROS_H ++#include <sys/sysmacros.h> ++#endif + #include <libgen.h> + #include <limits.h> + #include <blkid/blkid.h> +-- +2.8.2 + diff --git a/meta/recipes-devtools/e2fsprogs/e2fsprogs/e2fsprogs-fix-missing-check-for-permission-denied.patch b/meta/recipes-devtools/e2fsprogs/e2fsprogs/e2fsprogs-fix-missing-check-for-permission-denied.patch new file mode 100644 index 0000000000..33054c61fa --- /dev/null +++ b/meta/recipes-devtools/e2fsprogs/e2fsprogs/e2fsprogs-fix-missing-check-for-permission-denied.patch @@ -0,0 +1,32 @@ +Subject: [PATCH] Fix missing check for permission denied. + +If the path to "ROOT_SYSCONFDIR/mke2fs.conf" has a permission denied problem, +then the get_dirlist() call will return EACCES. But the code in profile_init +will treat that as a fatal error and all executions will fail with: + Couldn't init profile successfully (error: 13). + +Upstream-Status: Pending + +Written-by: Henrik Wallin <henrik.b.wallin@ericsson.com> + +Signed-off-by: Jackie Huang <jackie.huang@windriver.com> +--- + lib/support/profile.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/lib/support/profile.c b/lib/support/profile.c +index 51a3314..1c1039f 100644 +--- a/lib/support/profile.c ++++ b/lib/support/profile.c +@@ -335,7 +335,7 @@ profile_init(const char **files, profile_t *ret_profile) + *last = new_file; + last = &new_file->next; + } +- } else if ((retval != ENOTDIR) && ++ } else if ((retval != ENOTDIR) && (retval != EACCES) && + strcmp(*fs, default_filename)) + goto errout; + +-- +2.7.4 + diff --git a/meta/recipes-devtools/e2fsprogs/e2fsprogs/mkdir_p.patch b/meta/recipes-devtools/e2fsprogs/e2fsprogs/mkdir_p.patch new file mode 100644 index 0000000000..b0fa4b8cc5 --- /dev/null +++ b/meta/recipes-devtools/e2fsprogs/e2fsprogs/mkdir_p.patch @@ -0,0 +1,20 @@ +e2fsprogs: expand @mkdir_p@ + +Add AC_SUBST to configure.ac. @mkdir_p@ is currently +not expanded so no locale data is written into usr/share/locale. + +Upstream-Status: Pending + +Signed-off-by: Joe Slater <jslater@windriver.com> + +--- a/configure.ac ++++ b/configure.ac +@@ -811,6 +811,8 @@ AC_SUBST(PACKAGE) + AC_SUBST(VERSION) + + AM_GNU_GETTEXT ++dnl @MKDIR_P@ is expanded in AM_GNU_GETTEXT ++AC_SUBST([mkdir_p],['$(MKDIR_P)']) + dnl + dnl End of configuration options + dnl diff --git a/meta/recipes-devtools/e2fsprogs/e2fsprogs/xattr_ordering.patch b/meta/recipes-devtools/e2fsprogs/e2fsprogs/xattr_ordering.patch deleted file mode 100644 index 782a7b187e..0000000000 --- a/meta/recipes-devtools/e2fsprogs/e2fsprogs/xattr_ordering.patch +++ /dev/null @@ -1,219 +0,0 @@ -From: "Darrick J. Wong" <darrick.wong@oracle.com> -To: tytso@mit.edu, darrick.wong@oracle.com -Cc: linux-ext4@vger.kernel.org, Darren Hart <dvhart@linux.intel.com>, - Richard Purdie <richard.purdie@linuxfoundation.org> -Date: Sat, 13 Feb 2016 14:38:24 -0800 -Message-ID: <20160213223824.25381.8002.stgit@birch.djwong.org> -In-Reply-To: <20160213223725.25381.20929.stgit@birch.djwong.org> -References: <20160213223725.25381.20929.stgit@birch.djwong.org> -User-Agent: StGit/0.17.1-dirty -MIME-Version: 1.0 -Content-Type: text/plain; charset="utf-8" -X-Source-IP: aserv0022.oracle.com [141.146.126.234] -X-Evolution-Source: 1358860361.4566.33@ted -Content-Transfer-Encoding: 8bit - -Richard Purdie reports that libext2fs doesn't sort attribute keys in -the xattr block correctly, causing the kernel to return -ENODATA when -querying attributes that should be there. Therefore, sort attributes -so that whatever ends up in the xattr block is sorted according to -what the kernel expects. - -Cc: Darren Hart <dvhart@linux.intel.com> -Reported-by: Richard Purdie <richard.purdie@linuxfoundation.org> -Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> ---- - lib/ext2fs/ext_attr.c | 24 +++++++++++- - tests/d_xattr_sorting/expect | 29 ++++++++++++++ - tests/d_xattr_sorting/name | 1 - tests/d_xattr_sorting/script | 86 ++++++++++++++++++++++++++++++++++++++++++ - 4 files changed, 139 insertions(+), 1 deletion(-) - create mode 100644 tests/d_xattr_sorting/expect - create mode 100644 tests/d_xattr_sorting/name - create mode 100644 tests/d_xattr_sorting/script - -Upstream-Status: Submitted - - -diff --git a/lib/ext2fs/ext_attr.c b/lib/ext2fs/ext_attr.c -index 0a4f8c0..b121837 100644 ---- a/lib/ext2fs/ext_attr.c -+++ b/lib/ext2fs/ext_attr.c -@@ -254,10 +254,15 @@ static struct ea_name_index ea_names[] = { - {0, NULL}, - }; - -+static int find_ea_index(char *fullname, char **name, int *index); -+ - /* Push empty attributes to the end and inlinedata to the front. */ - static int attr_compare(const void *a, const void *b) - { - const struct ext2_xattr *xa = a, *xb = b; -+ char *xa_suffix, *xb_suffix; -+ int xa_idx, xb_idx; -+ int cmp; - - if (xa->name == NULL) - return +1; -@@ -267,7 +272,24 @@ static int attr_compare(const void *a, const void *b) - return -1; - else if (!strcmp(xb->name, "system.data")) - return +1; -- return 0; -+ -+ /* -+ * Duplicate the kernel's sorting algorithm because xattr blocks -+ * require sorted keys. -+ */ -+ xa_suffix = xa->name; -+ xb_suffix = xb->name; -+ xa_idx = xb_idx = 0; -+ find_ea_index(xa->name, &xa_suffix, &xa_idx); -+ find_ea_index(xb->name, &xb_suffix, &xb_idx); -+ cmp = xa_idx - xb_idx; -+ if (cmp) -+ return cmp; -+ cmp = strlen(xa_suffix) - strlen(xb_suffix); -+ if (cmp) -+ return cmp; -+ cmp = strcmp(xa_suffix, xb_suffix); -+ return cmp; - } - - static const char *find_ea_prefix(int index) -diff --git a/tests/d_xattr_sorting/expect b/tests/d_xattr_sorting/expect -new file mode 100644 -index 0000000..17da663 ---- /dev/null -+++ b/tests/d_xattr_sorting/expect -@@ -0,0 +1,29 @@ -+debugfs sort extended attributes -+mke2fs -Fq -b 1024 test.img 512 -+Exit status is 0 -+ea_set / security.SMEG64 -f /tmp/b -+Exit status is 0 -+ea_set / security.imb -f /tmp/b -+Exit status is 0 -+ea_set / user.moo cow -+Exit status is 0 -+ea_list / -+Extended attributes: -+ user.moo = "cow" (3) -+ security.imb = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" (256) -+ security.SMEG64 = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" (256) -+Exit status is 0 -+ea_get / security.imb -+xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx -+Exit status is 0 -+ea_get / nosuchea -+ea_get: Extended attribute key not found while getting extended attribute -+Exit status is 0 -+e2fsck -yf -N test_filesys -+Pass 1: Checking inodes, blocks, and sizes -+Pass 2: Checking directory structure -+Pass 3: Checking directory connectivity -+Pass 4: Checking reference counts -+Pass 5: Checking group summary information -+test_filesys: 11/64 files (0.0% non-contiguous), 29/512 blocks -+Exit status is 0 -diff --git a/tests/d_xattr_sorting/name b/tests/d_xattr_sorting/name -new file mode 100644 -index 0000000..dde8926 ---- /dev/null -+++ b/tests/d_xattr_sorting/name -@@ -0,0 +1 @@ -+sort extended attributes in debugfs -diff --git a/tests/d_xattr_sorting/script b/tests/d_xattr_sorting/script -new file mode 100644 -index 0000000..30c189a ---- /dev/null -+++ b/tests/d_xattr_sorting/script -@@ -0,0 +1,86 @@ -+if test -x $DEBUGFS_EXE; then -+ -+OUT=$test_name.log -+EXP=$test_dir/expect -+VERIFY_FSCK_OPT=-yf -+ -+TEST_DATA=$test_name.tmp -+VERIFY_DATA=$test_name.ver.tmp -+ -+echo "debugfs sort extended attributes" > $OUT -+ -+dd if=/dev/zero of=$TMPFILE bs=1k count=512 > /dev/null 2>&1 -+ -+echo "mke2fs -Fq -b 1024 test.img 512" >> $OUT -+ -+$MKE2FS -Fq $TMPFILE 512 > /dev/null 2>&1 -+status=$? -+echo Exit status is $status >> $OUT -+ -+perl -e 'print "x" x 256;' > /tmp/b -+ -+echo "ea_set / security.SMEG64 -f /tmp/b" > $OUT.new -+$DEBUGFS -w -R "ea_set / security.SMEG64 -f /tmp/b" $TMPFILE >> $OUT.new 2>&1 -+status=$? -+echo Exit status is $status >> $OUT.new -+sed -f $cmd_dir/filter.sed $OUT.new >> $OUT -+ -+echo "ea_set / security.imb -f /tmp/b" > $OUT.new -+$DEBUGFS -w -R "ea_set / security.imb -f /tmp/b" $TMPFILE >> $OUT.new 2>&1 -+status=$? -+echo Exit status is $status >> $OUT.new -+sed -f $cmd_dir/filter.sed $OUT.new >> $OUT -+ -+echo "ea_set / user.moo cow" > $OUT.new -+$DEBUGFS -w -R "ea_set / user.moo cow" $TMPFILE >> $OUT.new 2>&1 -+status=$? -+echo Exit status is $status >> $OUT.new -+sed -f $cmd_dir/filter.sed $OUT.new >> $OUT -+ -+rm -rf /tmp/b -+ -+echo "ea_list /" > $OUT.new -+$DEBUGFS -w -R "ea_list /" $TMPFILE >> $OUT.new 2>&1 -+status=$? -+echo Exit status is $status >> $OUT.new -+sed -f $cmd_dir/filter.sed $OUT.new >> $OUT -+ -+echo "ea_get / security.imb" > $OUT.new -+$DEBUGFS -w -R "ea_get / security.imb" $TMPFILE >> $OUT.new 2>&1 -+status=$? -+echo Exit status is $status >> $OUT.new -+sed -f $cmd_dir/filter.sed $OUT.new >> $OUT -+ -+echo "ea_get / nosuchea" > $OUT.new -+$DEBUGFS -w -R "ea_get / nosuchea" $TMPFILE >> $OUT.new 2>&1 -+status=$? -+echo Exit status is $status >> $OUT.new -+sed -f $cmd_dir/filter.sed $OUT.new >> $OUT -+ -+echo e2fsck $VERIFY_FSCK_OPT -N test_filesys > $OUT.new -+$FSCK $VERIFY_FSCK_OPT -N test_filesys $TMPFILE >> $OUT.new 2>&1 -+status=$? -+echo Exit status is $status >> $OUT.new -+sed -f $cmd_dir/filter.sed $OUT.new >> $OUT -+ -+# -+# Do the verification -+# -+ -+rm -f $TMPFILE $OUT.new -+cmp -s $OUT $EXP -+status=$? -+ -+if [ "$status" = 0 ] ; then -+ echo "$test_name: $test_description: ok" -+ touch $test_name.ok -+else -+ echo "$test_name: $test_description: failed" -+ diff $DIFF_OPTS $EXP $OUT > $test_name.failed -+fi -+ -+unset VERIFY_FSCK_OPT NATIVE_FSCK_OPT OUT EXP TEST_DATA VERIFY_DATA -+ -+else #if test -x $DEBUGFS_EXE; then -+ echo "$test_name: $test_description: skipped" -+fi - - diff --git a/meta/recipes-devtools/e2fsprogs/e2fsprogs_git.bb b/meta/recipes-devtools/e2fsprogs/e2fsprogs_1.43.4.bb index 9cde8e46b7..5216c7027c 100644 --- a/meta/recipes-devtools/e2fsprogs/e2fsprogs_git.bb +++ b/meta/recipes-devtools/e2fsprogs/e2fsprogs_1.43.4.bb @@ -6,12 +6,15 @@ SRC_URI += "file://acinclude.m4 \ file://run-ptest \ file://ptest.patch \ file://mkdir.patch \ - file://xattr_ordering.patch \ file://Revert-mke2fs-enable-the-metadata_csum-and-64bit-fea.patch \ + file://e2fsprogs-1.43-sysmacros.patch \ + file://mkdir_p.patch \ + file://0001-e2fsck-exit-with-exit-status-0-if-no-errors-were-fix.patch \ " -SRCREV = "0f26747167cc9d82df849b0aad387bf824f04544" -PV = "1.42.99+1.43+git${SRCPV}" +SRC_URI_append_class-native = " file://e2fsprogs-fix-missing-check-for-permission-denied.patch" + +SRCREV = "3d66c4b20f09f923078c1e6eb9b549865b549674" UPSTREAM_CHECK_GITTAGREGEX = "v(?P<pver>\d+\.\d+(\.\d+)*)$" EXTRA_OECONF += "--libdir=${base_libdir} --sbindir=${base_sbindir} \ @@ -50,21 +53,19 @@ do_install () { mv ${D}${bindir}/chattr ${D}${base_bindir}/chattr.e2fsprogs install -v -m 755 ${S}/contrib/populate-extfs.sh ${D}${base_sbindir}/ + + # Clean host path (build directory) in compile_et, mk_cmds + sed -i -e "s,\(ET_DIR=.*\)${S}/lib/et\(.*\),\1${datadir}/et\2,g" ${D}${bindir}/compile_et + sed -i -e "s,\(SS_DIR=.*\)${S}/lib/ss\(.*\),\1${datadir}/ss\2,g" ${D}${bindir}/mk_cmds } # Need to find the right mke2fs.conf file e2fsprogs_conf_fixup () { - for i in mke2fs mkfs.ext2 mkfs.ext3 mkfs.ext4 mkfs.ext4dev; do + for i in mke2fs mkfs.ext2 mkfs.ext3 mkfs.ext4; do create_wrapper ${D}${base_sbindir}/$i MKE2FS_CONFIG=${sysconfdir}/mke2fs.conf done } -do_install_append_class-target() { - # Clean host path in compile_et, mk_cmds - sed -i -e "s,ET_DIR=\"${S}/lib/et\",ET_DIR=\"${datadir}/et\",g" ${D}${bindir}/compile_et - sed -i -e "s,SS_DIR=\"${S}/lib/ss\",SS_DIR=\"${datadir}/ss\",g" ${D}${bindir}/mk_cmds -} - do_install_append_class-native() { e2fsprogs_conf_fixup } @@ -88,7 +89,7 @@ FILES_libcomerr = "${base_libdir}/libcom_err.so.*" FILES_libss = "${base_libdir}/libss.so.*" FILES_libe2p = "${base_libdir}/libe2p.so.*" FILES_libext2fs = "${libdir}/e2initrd_helper ${base_libdir}/libext2fs.so.*" -FILES_${PN}-dev += "${datadir}/*/*.awk ${datadir}/*/*.sed ${base_libdir}/*.so" +FILES_${PN}-dev += "${datadir}/*/*.awk ${datadir}/*/*.sed ${base_libdir}/*.so ${bindir}/compile_et ${bindir}/mk_cmds" ALTERNATIVE_${PN} = "chattr" ALTERNATIVE_PRIORITY = "100" |
