diff options
Diffstat (limited to 'external/poky/meta/recipes-devtools/e2fsprogs')
11 files changed, 519 insertions, 0 deletions
diff --git a/external/poky/meta/recipes-devtools/e2fsprogs/e2fsprogs.inc b/external/poky/meta/recipes-devtools/e2fsprogs/e2fsprogs.inc new file mode 100644 index 00000000..a54a11c3 --- /dev/null +++ b/external/poky/meta/recipes-devtools/e2fsprogs/e2fsprogs.inc @@ -0,0 +1,27 @@ +SUMMARY = "Ext2 Filesystem Utilities" +DESCRIPTION = "The Ext2 Filesystem Utilities (e2fsprogs) contain all of the standard utilities for creating, \ +fixing, configuring , and debugging ext2 filesystems." +HOMEPAGE = "http://e2fsprogs.sourceforge.net/" + +LICENSE = "GPLv2 & LGPLv2 & BSD & MIT" +LICENSE_e2fsprogs-e2fsck = "GPLv2" +LICENSE_e2fsprogs-mke2fs = "GPLv2" +LICENSE_e2fsprogs-fsck = "GPLv2" +LICENSE_e2fsprogs-tune2fs = "GPLv2" +LICENSE_e2fsprogs-badblocks = "GPLv2" +LIC_FILES_CHKSUM = "file://NOTICE;md5=d50be0580c0b0a7fbc7a4830bbe6c12b \ + 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 \ + file://lib/uuid/COPYING;md5=58dcd8452651fc8b07d1f65ce07ca8af \ + 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 attr" + +SRC_URI = "git://git.kernel.org/pub/scm/fs/ext2/e2fsprogs.git" +S = "${WORKDIR}/git" + +inherit autotools gettext texinfo pkgconfig multilib_header update-alternatives ptest + +BBCLASSEXTEND = "native nativesdk" diff --git a/external/poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/0001-create_inode-fix-copying-large-files.patch b/external/poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/0001-create_inode-fix-copying-large-files.patch new file mode 100644 index 00000000..c89581dc --- /dev/null +++ b/external/poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/0001-create_inode-fix-copying-large-files.patch @@ -0,0 +1,50 @@ +Upstream-Status: Submitted +Signed-off-by: Ross Burton <ross.burton@intel.com> + +From 674ab87b8338372338d20e21a350f88b4ff6c7c8 Mon Sep 17 00:00:00 2001 +From: Ross Burton <ross.burton@intel.com> +Date: Fri, 1 Feb 2019 10:59:59 +0000 +Subject: [PATCH] create_inode: fix copying large files + +When copying large files into a ext filesystem at mkfs time the copy fails at +2^31 bytes in. There are two problems: + +copy_file_chunk() passes an offset (off_t, 64-bit typically) to +ext2fs_file_lseek() which expects a ext2_off_t (typedef to __u32) so the value +is truncated. Solve by calling ext2fs_file_llseek() which takes a u64 offset +instead. + +try_lseek_copy() rounds the data and hole offsets as found by lseek() to block +boundaries, but the calculation gets truncated to 32-bits. Solve by casting the +32-bit blocksize to off_t to ensure this doesn't happen. + +Signed-off-by: Ross Burton <ross.burton@intel.com> +--- + misc/create_inode.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/misc/create_inode.c b/misc/create_inode.c +index 05aa6363..f106dcda 100644 +--- a/misc/create_inode.c ++++ b/misc/create_inode.c +@@ -438,7 +438,7 @@ static errcode_t copy_file_chunk(ext2_filsys fs, int fd, ext2_file_t e2_file, + ptr += blen; + continue; + } +- err = ext2fs_file_lseek(e2_file, off + bpos, ++ err = ext2fs_file_llseek(e2_file, off + bpos, + EXT2_SEEK_SET, NULL); + if (err) + goto fail; +@@ -481,7 +481,7 @@ static errcode_t try_lseek_copy(ext2_filsys fs, int fd, struct stat *statbuf, + return EXT2_ET_UNIMPLEMENTED; + + data_blk = data & ~(fs->blocksize - 1); +- hole_blk = (hole + (fs->blocksize - 1)) & ~(fs->blocksize - 1); ++ hole_blk = (hole + (off_t)(fs->blocksize - 1)) & ~(off_t)(fs->blocksize - 1); + err = copy_file_chunk(fs, fd, e2_file, data_blk, hole_blk, buf, + zerobuf); + if (err) +-- +2.11.0 + diff --git a/external/poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/0001-misc-create_inode.c-set-dir-s-mode-correctly.patch b/external/poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/0001-misc-create_inode.c-set-dir-s-mode-correctly.patch new file mode 100644 index 00000000..fc4a5409 --- /dev/null +++ b/external/poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/0001-misc-create_inode.c-set-dir-s-mode-correctly.patch @@ -0,0 +1,41 @@ +From f6d188580c2c9599319076fee22f2424652c711c Mon Sep 17 00:00:00 2001 +From: Robert Yang <liezhi.yang@windriver.com> +Date: Wed, 13 Sep 2017 19:55:35 -0700 +Subject: [PATCH] misc/create_inode.c: set dir's mode correctly + +The dir's mode has been set by ext2fs_mkdir() with umask, so +reset it to the source's mode in set_inode_extra(). + +Fixed when source dir's mode is 521, but tarball would be 721, this was +incorrect. + +Upstream-Status: Submitted + +Signed-off-by: Robert Yang <liezhi.yang@windriver.com> +--- + misc/create_inode.c | 9 ++++++++- + 1 file changed, 8 insertions(+), 1 deletion(-) + +diff --git a/misc/create_inode.c b/misc/create_inode.c +index 8ce3faf..50fbaa8 100644 +--- a/misc/create_inode.c ++++ b/misc/create_inode.c +@@ -116,7 +116,14 @@ static errcode_t set_inode_extra(ext2_filsys fs, ext2_ino_t ino, + + inode.i_uid = st->st_uid; + inode.i_gid = st->st_gid; +- inode.i_mode |= st->st_mode; ++ /* ++ * The dir's mode has been set by ext2fs_mkdir() with umask, so ++ * reset it to the source's mode ++ */ ++ if S_ISDIR(st->st_mode) ++ inode.i_mode = LINUX_S_IFDIR | st->st_mode; ++ else ++ inode.i_mode |= st->st_mode; + inode.i_atime = st->st_atime; + inode.i_mtime = st->st_mtime; + inode.i_ctime = st->st_ctime; +-- +2.10.2 + diff --git a/external/poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/Revert-mke2fs-enable-the-metadata_csum-and-64bit-fea.patch b/external/poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/Revert-mke2fs-enable-the-metadata_csum-and-64bit-fea.patch new file mode 100644 index 00000000..d7e09b6b --- /dev/null +++ b/external/poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/Revert-mke2fs-enable-the-metadata_csum-and-64bit-fea.patch @@ -0,0 +1,36 @@ +From 0a392baf1874964651115d9f77b0daa6851d1daa Mon Sep 17 00:00:00 2001 +From: Jonathan Liu <net147@gmail.com> +Date: Tue, 1 Mar 2016 14:28:01 +1100 +Subject: [PATCH] Revert "mke2fs: enable the metadata_csum and 64bit features + by default" + +This reverts commit cd27af3ecb83e8fd1e3eaa14994284a1818c7c15 as we +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 01e35cf..25105b3 100644 +--- a/misc/mke2fs.conf.in ++++ b/misc/mke2fs.conf.in +@@ -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,metadata_csum,dir_nlink,extra_isize + inode_size = 256 ++ auto_64-bit_support = 1 + } + small = { + blocksize = 1024 diff --git a/external/poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/e2fsprogs-fix-missing-check-for-permission-denied.patch b/external/poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/e2fsprogs-fix-missing-check-for-permission-denied.patch new file mode 100644 index 00000000..69c09bc1 --- /dev/null +++ b/external/poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/e2fsprogs-fix-missing-check-for-permission-denied.patch @@ -0,0 +1,36 @@ +From c7914309aeee6209ddb6995c084805a911d9cc82 Mon Sep 17 00:00:00 2001 +From: Jackie Huang <jackie.huang@windriver.com> +Date: Wed, 10 Aug 2016 11:19:44 +0800 +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 9e96673b..32d83002 100644 +--- a/lib/support/profile.c ++++ b/lib/support/profile.c +@@ -335,7 +335,7 @@ profile_init(const char * const *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.16.1 + diff --git a/external/poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/mkdir_p.patch b/external/poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/mkdir_p.patch new file mode 100644 index 00000000..b0fa4b8c --- /dev/null +++ b/external/poky/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/external/poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/ptest.patch b/external/poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/ptest.patch new file mode 100644 index 00000000..4e6b6292 --- /dev/null +++ b/external/poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/ptest.patch @@ -0,0 +1,100 @@ +From b8842065ad621a03a971dfd50db862c5bffdeb49 Mon Sep 17 00:00:00 2001 +From: Dmitry Eremin-Solenikov <dmitry_eremin@mentor.com> +Date: Sat, 18 Apr 2015 17:58:17 +0300 +Subject: [PATCH] e2fsprogs: add ptest + +Upstream-Status: Inappropriate + +--- + tests/Makefile.in | 4 ++-- + tests/test_config | 32 ++++++++++++++++---------------- + tests/test_script.in | 2 +- + 3 files changed, 19 insertions(+), 19 deletions(-) + +diff --git a/tests/Makefile.in b/tests/Makefile.in +index 8c4d2048..e021af32 100644 +--- a/tests/Makefile.in ++++ b/tests/Makefile.in +@@ -19,7 +19,7 @@ test_one: $(srcdir)/test_one.in Makefile mke2fs.conf + @echo "#!/bin/sh" > test_one + @echo "HTREE=y" >> test_one + @echo "QUOTA=y" >> test_one +- @echo "SRCDIR=@srcdir@" >> test_one ++ @echo "SRCDIR=${prefix}${libdir}/e2fsprogs/ptest/test" >> test_one + @echo "DIFF_OPTS=@UNI_DIFF_OPTS@" >> test_one + @echo "SIZEOF_TIME_T=@SIZEOF_TIME_T@" >> test_one + @echo "DD=@DD@" >>test_one +@@ -30,7 +30,7 @@ test_script: test_one test_script.in Makefile mke2fs.conf + @echo "Creating test_script..." + @[ -f test_script ] && chmod u+w test_script || true + @echo "#!/bin/sh" > test_script +- @echo "SRCDIR=@srcdir@" >> test_script ++ @echo "SRCDIR=${prefix}${libdir}/e2fsprogs/ptest/test" >> test_script + @cat $(srcdir)/test_script.in >> test_script + @chmod +x-w test_script + +diff --git a/tests/test_config b/tests/test_config +index 1f146ca2..05125f9c 100644 +--- a/tests/test_config ++++ b/tests/test_config +@@ -3,16 +3,16 @@ + # + + unset LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER LC_TELEPHONE LC_TIME PAGER +-FSCK="$USE_VALGRIND ../e2fsck/e2fsck" +-MKE2FS="$USE_VALGRIND ../misc/mke2fs" +-DUMPE2FS="$USE_VALGRIND ../misc/dumpe2fs" +-TUNE2FS="$USE_VALGRIND ../misc/tune2fs" +-CHATTR="$USE_VALGRIND../misc/chattr" +-LSATTR="$USE_VALGRIND ../misc/lsattr" +-E2IMAGE="$USE_VALGRIND ../misc/e2image" +-E2IMAGE_EXE="../misc/e2image" +-DEBUGFS="$USE_VALGRIND ../debugfs/debugfs" +-DEBUGFS_EXE="../debugfs/debugfs" ++FSCK="$USE_VALGRIND e2fsck" ++MKE2FS="$USE_VALGRIND mke2fs" ++DUMPE2FS="$USE_VALGRIND dumpe2fs" ++TUNE2FS="$USE_VALGRIND tune2fs" ++CHATTR="$USE_VALGRIND chattr" ++LSATTR="$USE_VALGRIND lsattr" ++E2IMAGE="$USE_VALGRIND e2image" ++E2IMAGE_EXE="/sbin/e2image" ++DEBUGFS="$USE_VALGRIND debugfs" ++DEBUGFS_EXE="/sbin/debugfs" + TEST_BITS="test_data.tmp" + if [ ! -s $TEST_BITS ]; then + # create a non-sparse test file if possible, since debugfs may be +@@ -21,14 +21,14 @@ if [ ! -s $TEST_BITS ]; then + dd if=/dev/urandom of=$TEST_BITS bs=128k count=1 > /dev/null 2>&1 || + TEST_BITS="$DEFBUGFS_EXE" + fi +-RESIZE2FS_EXE="../resize/resize2fs" ++RESIZE2FS_EXE="/sbin/resize2fs" + RESIZE2FS="$USE_VALGRIND $RESIZE2FS_EXE" +-E2UNDO_EXE="../misc/e2undo" ++E2UNDO_EXE="/sbin/e2undo" + E2UNDO="$USE_VALGRIND $E2UNDO_EXE" +-E2MMPSTATUS="$USE_VALGRIND ../misc/dumpe2fs -m" +-TEST_REL=../tests/progs/test_rel +-TEST_ICOUNT=../tests/progs/test_icount +-CRCSUM=../tests/progs/crcsum ++E2MMPSTATUS="$USE_VALGRIND dumpe2fs -m" ++TEST_REL=./progs/test_rel ++TEST_ICOUNT=./progs/test_icount ++CRCSUM=./progs/crcsum + CLEAN_OUTPUT="sed -f $cmd_dir/filter.sed" + LD_LIBRARY_PATH=../lib:../lib/ext2fs:../lib/e2p:../lib/et:../lib/ss:${LD_LIBRARY_PATH} + DYLD_LIBRARY_PATH=../lib:../lib/ext2fs:../lib/e2p:../lib/et:../lib/ss:${DYLD_LIBRARY_PATH} +diff --git a/tests/test_script.in b/tests/test_script.in +index 9959e308..442999db 100644 +--- a/tests/test_script.in ++++ b/tests/test_script.in +@@ -39,7 +39,7 @@ for i; do + done + + if test "$TESTS"x = x ; then +- if test -n "DO_FAILED"; then ++ if test -n "$DO_FAILED"; then + exit 0 + fi + TESTS=`ls -d $SRCDIR/[a-zA-Z]_*` diff --git a/external/poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/quiet-debugfs.patch b/external/poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/quiet-debugfs.patch new file mode 100644 index 00000000..830e9d57 --- /dev/null +++ b/external/poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/quiet-debugfs.patch @@ -0,0 +1,19 @@ +When executing a script don't echo every command, as we do this for entire +filesystems at rootfs time. + +Upstream-Status: Inappropriate +Signed-off-by: Ross Burton <ross.burton@intel.com> + +diff --git a/debugfs/debugfs.c b/debugfs/debugfs.c +index 5590295..ac57292 100644 +--- a/debugfs/debugfs.c ++++ b/debugfs/debugfs.c +@@ -2378,7 +2378,7 @@ static int source_file(const char *cmd_file, int ss_idx) + cp = strchr(buf, '\r'); + if (cp) + *cp = 0; +- printf("debugfs: %s\n", buf); ++ /*printf("debugfs: %s\n", buf);*/ + retval = ss_execute_line(ss_idx, buf); + if (retval) { + ss_perror(ss_idx, retval, buf); diff --git a/external/poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/remove.ldconfig.call.patch b/external/poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/remove.ldconfig.call.patch new file mode 100644 index 00000000..f3e6eb77 --- /dev/null +++ b/external/poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/remove.ldconfig.call.patch @@ -0,0 +1,44 @@ +From b139e03ac2f72e644e547c7ee9b1514383af4d97 Mon Sep 17 00:00:00 2001 +From: Andrei Dinu <andrei.adrianx.dinu@intel.com> +Date: Wed, 30 Jan 2013 15:22:04 +0200 +Subject: [PATCH] When /etc/ld.so.cache is writeable by user running bitbake + then it creates invalid cache (in my case libstdc++.so + cannot be found after building zlib(-native) and I have to + call touch */libstdc++.so && /sbin/ldconfig to fix it. + +So remove ldconfig call from make install-libs + +Patch authored by Martin Jansa. + +Upstream-Status: Inappropriate [disable feature] + +Signed-off-by: Scott Garman <scott.a.garman@intel.com> +Signed-off-by: Andrei Dinu <andrei.adrianx.dinu@intel.com> +--- + lib/Makefile.elf-lib | 3 --- + 1 file changed, 3 deletions(-) + +diff --git a/lib/Makefile.elf-lib b/lib/Makefile.elf-lib +index 78479d3..4a4a5ac 100644 +--- a/lib/Makefile.elf-lib ++++ b/lib/Makefile.elf-lib +@@ -50,8 +50,6 @@ install-shlibs install:: $(ELF_LIB) installdirs-elf-lib $(DEP_INSTALL_SYMLINK) + $(E) " SYMLINK $(libdir)/$(ELF_IMAGE).so" + $(Q) $(INSTALL_SYMLINK) $(ELF_INSTALL_DIR)/$(ELF_SONAME) \ + $(libdir)/$(ELF_IMAGE).so $(DESTDIR) +- $(E) " LDCONFIG" +- $(Q) -$(LDCONFIG) + + install-strip: install + $(E) " STRIP-LIB $(ELF_INSTALL_DIR)/$(ELF_LIB)" +@@ -67,7 +65,6 @@ uninstall-shlibs uninstall:: + $(RM) -f $(DESTDIR)$(ELF_INSTALL_DIR)/$(ELF_LIB) \ + $(DESTDIR)$(ELF_INSTALL_DIR)/$(ELF_SONAME) \ + $(DESTDIR)$(libdir)/$(ELF_IMAGE).so +- -$(LDCONFIG) + + clean:: + $(RM) -rf elfshared +-- +1.7.9.5 + diff --git a/external/poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/run-ptest b/external/poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/run-ptest new file mode 100644 index 00000000..c97c0377 --- /dev/null +++ b/external/poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/run-ptest @@ -0,0 +1,10 @@ +#!/bin/sh + +cd ./test +SKIP_SLOW_TESTS=yes ./test_script | sed -u -e '/:[[:space:]]ok/s/^/PASS: /' -e '/:[[:space:]]failed/s/^/FAIL: /' -e '/:[[:space:]]skipped/s/^/SKIP: /' +rm -rf /var/volatile/tmp/*e2fsprogs* +rm -f tmp-* +rm -f *.tmp +rm -f *.ok +rm -f *.failed +rm -f *.log diff --git a/external/poky/meta/recipes-devtools/e2fsprogs/e2fsprogs_1.44.3.bb b/external/poky/meta/recipes-devtools/e2fsprogs/e2fsprogs_1.44.3.bb new file mode 100644 index 00000000..cffb5362 --- /dev/null +++ b/external/poky/meta/recipes-devtools/e2fsprogs/e2fsprogs_1.44.3.bb @@ -0,0 +1,136 @@ +require e2fsprogs.inc + +SRC_URI += "file://remove.ldconfig.call.patch \ + file://run-ptest \ + file://ptest.patch \ + file://Revert-mke2fs-enable-the-metadata_csum-and-64bit-fea.patch \ + file://mkdir_p.patch \ + file://0001-misc-create_inode.c-set-dir-s-mode-correctly.patch \ + file://0001-create_inode-fix-copying-large-files.patch \ + " + +SRC_URI_append_class-native = " file://e2fsprogs-fix-missing-check-for-permission-denied.patch \ + file://quiet-debugfs.patch \ +" + +SRCREV = "85e53f42f98d5334914de01e972e9ed44bccd0a5" +UPSTREAM_CHECK_GITTAGREGEX = "v(?P<pver>\d+\.\d+(\.\d+)*)$" + +EXTRA_OECONF += "--libdir=${base_libdir} --sbindir=${base_sbindir} \ + --enable-elf-shlibs --disable-libuuid --disable-uuidd \ + --disable-libblkid --enable-verbose-makecmds" + +EXTRA_OECONF_darwin = "--libdir=${base_libdir} --sbindir=${base_sbindir} --enable-bsd-shlibs" + +PACKAGECONFIG ??= "" +PACKAGECONFIG[fuse] = '--enable-fuse2fs,--disable-fuse2fs,fuse' + +# make locale rules sometimes fire, sometimes don't as git doesn't preserve +# file mktime. Touch the files introducing non-determinism to the build +do_compile_prepend (){ + find ${S}/po -type f -name "*.po" -exec touch {} + +} + +do_install () { + oe_runmake 'DESTDIR=${D}' install + oe_runmake 'DESTDIR=${D}' install-libs + # We use blkid from util-linux now so remove from here + rm -f ${D}${base_libdir}/libblkid* + rm -rf ${D}${includedir}/blkid + rm -f ${D}${base_libdir}/pkgconfig/blkid.pc + rm -f ${D}${base_sbindir}/blkid + rm -f ${D}${base_sbindir}/fsck + rm -f ${D}${base_sbindir}/findfs + + # e2initrd_helper and the pkgconfig files belong in libdir + if [ ! ${D}${libdir} -ef ${D}${base_libdir} ]; then + install -d ${D}${libdir} + mv ${D}${base_libdir}/e2initrd_helper ${D}${libdir} + mv ${D}${base_libdir}/pkgconfig ${D}${libdir} + fi + + oe_multilib_header ext2fs/ext2_types.h + install -d ${D}${base_bindir} + 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; do + create_wrapper ${D}${base_sbindir}/$i MKE2FS_CONFIG=${sysconfdir}/mke2fs.conf + done +} + +do_install_append_class-native() { + e2fsprogs_conf_fixup +} + +do_install_append_class-nativesdk() { + e2fsprogs_conf_fixup +} + +do_install_append_class-target() { + mv ${D}${base_sbindir}/mke2fs ${D}${base_sbindir}/mke2fs.e2fsprogs + mv ${D}${base_sbindir}/mkfs.ext2 ${D}${base_sbindir}/mkfs.ext2.e2fsprogs + mv ${D}${base_sbindir}/tune2fs ${D}${base_sbindir}/tune2fs.e2fsprogs +} + +RDEPENDS_e2fsprogs = "e2fsprogs-badblocks" +RRECOMMENDS_e2fsprogs = "e2fsprogs-mke2fs e2fsprogs-e2fsck" + +PACKAGES =+ "e2fsprogs-e2fsck e2fsprogs-mke2fs e2fsprogs-tune2fs e2fsprogs-badblocks e2fsprogs-resize2fs" +PACKAGES =+ "libcomerr libss libe2p libext2fs" + +FILES_e2fsprogs-resize2fs = "${base_sbindir}/resize2fs*" +FILES_e2fsprogs-e2fsck = "${base_sbindir}/e2fsck ${base_sbindir}/fsck.ext*" +FILES_e2fsprogs-mke2fs = "${base_sbindir}/mke2fs.e2fsprogs ${base_sbindir}/mkfs.ext* ${sysconfdir}/mke2fs.conf" +FILES_e2fsprogs-tune2fs = "${base_sbindir}/tune2fs.e2fsprogs ${base_sbindir}/e2label" +FILES_e2fsprogs-badblocks = "${base_sbindir}/badblocks" +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 ${bindir}/compile_et ${bindir}/mk_cmds" + +ALTERNATIVE_${PN} = "chattr" +ALTERNATIVE_PRIORITY = "100" +ALTERNATIVE_LINK_NAME[chattr] = "${base_bindir}/chattr" +ALTERNATIVE_TARGET[chattr] = "${base_bindir}/chattr.e2fsprogs" + +ALTERNATIVE_${PN}-doc = "fsck.8" +ALTERNATIVE_LINK_NAME[fsck.8] = "${mandir}/man8/fsck.8" + +ALTERNATIVE_${PN}-mke2fs = "mke2fs mkfs.ext2" +ALTERNATIVE_LINK_NAME[mke2fs] = "${base_sbindir}/mke2fs" +ALTERNATIVE_LINK_NAME[mkfs.ext2] = "${base_sbindir}/mkfs.ext2" + +ALTERNATIVE_${PN}-tune2fs = "tune2fs" +ALTERNATIVE_LINK_NAME[tune2fs] = "${base_sbindir}/tune2fs" + +RDEPENDS_${PN}-ptest += "${PN} ${PN}-tune2fs coreutils procps bash bzip2 diffutils perl" + +do_compile_ptest() { + oe_runmake -C ${B}/tests +} + +do_install_ptest() { + cp -R --no-dereference --preserve=mode,links -v ${B}/tests ${D}${PTEST_PATH}/test + cp -R --no-dereference --preserve=mode,links -v ${S}/tests/* ${D}${PTEST_PATH}/test + sed -e 's!../e2fsck/e2fsck!e2fsck!g' \ + -e 's!../misc/tune2fs!tune2fs!g' -i ${D}${PTEST_PATH}/test/*/expect* + sed -e 's!../e2fsck/e2fsck!${base_sbindir}/e2fsck!g' -i ${D}${PTEST_PATH}/test/*/script + + # Remove various files + find "${D}${PTEST_PATH}" -type f \ + \( -name 'Makefile' -o -name 'Makefile.in' -o -name '*.o' -o -name '*.c' -o -name '*.h' \)\ + -exec rm -f {} + + + install -d ${D}${PTEST_PATH}/lib + install -m 0644 ${B}/lib/config.h ${D}${PTEST_PATH}/lib/ +} |