diff options
author | Ross Burton <ross.burton@intel.com> | 2014-06-30 13:17:01 +0100 |
---|---|---|
committer | Kévin THIERRY <kevin.thierry@open.eurogiciel.org> | 2014-07-04 11:57:24 +0200 |
commit | e946e436fd209bf1fdd04f459e004fb671ac9d76 (patch) | |
tree | 2d8d5c409bb6a34c533c2feb0594afc67f71775c /recipes-devtools | |
parent | d22fc0c3319dfe9d26266b7e04afede8f6cb9804 (diff) | |
download | meta-tizen-e946e436fd209bf1fdd04f459e004fb671ac9d76.tar.gz meta-tizen-e946e436fd209bf1fdd04f459e004fb671ac9d76.tar.bz2 meta-tizen-e946e436fd209bf1fdd04f459e004fb671ac9d76.zip |
e2fsprogs: add git recipe, copy xattrs into filesystem
Fork the recipe in oe-core and fetch source from git master, removing all merged
patches, and add a submitted patch to copy extended attributes from the source
directories into the target filesystem.
Change-Id: I8185be8640a818dff6b74c8e4f2ad19724d97c5e
Signed-off-by: Ross Burton <ross.burton@intel.com>
Diffstat (limited to 'recipes-devtools')
4 files changed, 210 insertions, 0 deletions
diff --git a/recipes-devtools/e2fsprogs/e2fsprogs/cross-compile.patch b/recipes-devtools/e2fsprogs/e2fsprogs/cross-compile.patch new file mode 100644 index 00000000..9f9b9580 --- /dev/null +++ b/recipes-devtools/e2fsprogs/e2fsprogs/cross-compile.patch @@ -0,0 +1,13 @@ +diff --git a/configure.in b/configure.in +index 448a292..31ca001 100644 +--- a/configure.in ++++ b/configure.in +@@ -1382,7 +1382,7 @@ if test $cross_compiling = no; then + BUILD_CFLAGS="$CFLAGS $CPPFLAGS $INCLUDES -DHAVE_CONFIG_H" + BUILD_LDFLAGS="$LDFLAGS" + else +- BUILD_CFLAGS= ++ BUILD_CFLAGS='-I. -I$(top_builddir)/lib -I$(top_srcdir)/lib -DHAVE_CONFIG_H' + BUILD_LDFLAGS= + fi + AC_SUBST(BUILD_CFLAGS) diff --git a/recipes-devtools/e2fsprogs/e2fsprogs/populate-fs-xattr.patch b/recipes-devtools/e2fsprogs/e2fsprogs/populate-fs-xattr.patch new file mode 100644 index 00000000..b6457f1d --- /dev/null +++ b/recipes-devtools/e2fsprogs/e2fsprogs/populate-fs-xattr.patch @@ -0,0 +1,88 @@ +Upstream-Status: Submitted +Signed-off-by: Ross Burton <ross.burton@intel.com> + +commit 582b4ceda06456f8e33492dd0f87a3d2a5ff1514 +Author: Ross Burton <ross.burton@intel.com> +Date: Fri Jun 27 19:44:35 2014 +0100 + + misc: copy extended attributes in populate_fs + + When creating a file system using a source directory, also copy any extended + attributes that have been set. + + Signed-off-by: Ross Burton <ross.burton@intel.com> + +diff --git a/misc/create_inode.c b/misc/create_inode.c +index c9c99b5..2795f9e 100644 +--- a/misc/create_inode.c ++++ b/misc/create_inode.c +@@ -103,6 +103,55 @@ static errcode_t set_inode_extra(ext2_filsys fs, ext2_ino_t cwd, + return retval; + } + ++static errcode_t set_inode_xattr(ext2_filsys fs, ext2_ino_t ino, const char *filename) ++{ ++ errcode_t retval; ++ struct ext2_inode inode; ++ struct ext2_xattr_handle *handle; ++ ssize_t size, value_size; ++ char *list; ++ int i; ++ ++ size = llistxattr(filename, NULL, 0); ++ if (size == -1) { ++ com_err(__func__, errno, "listxattr failed on %s", filename); ++ return errno; ++ } else if (size == 0) { ++ return 0; ++ } ++ ++ retval = ext2fs_xattrs_open(fs, ino, &handle); ++ if (retval) { ++ com_err(__func__, errno, "while opening inode %u", ino); ++ return errno; ++ } ++ ++ list = malloc(size); ++ size = llistxattr(filename, list, size); ++ ++ for (i = 0; i < size; i += strlen(&list[i]) + 1) { ++ const char *name = &list[i]; ++ char *value; ++ ++ value_size = getxattr(filename, name, NULL, 0); ++ value = malloc(value_size); ++ value_size = getxattr(filename, name, value, value_size); ++ ++ retval = ext2fs_xattr_set(handle, name, value, value_size); ++ if (retval) ++ com_err(__func__, retval, "while writing xattr %u", ino); ++ ++ free (value); ++ } ++ free(list); ++ ++ retval = ext2fs_xattrs_close(&handle); ++ if (retval) ++ com_err(__func__, errno, "while closing inode %u", ino); ++ ++ return retval; ++} ++ + /* Make a special files (block and character devices), fifo's, and sockets */ + errcode_t do_mknod_internal(ext2_filsys fs, ext2_ino_t cwd, const char *name, + struct stat *st) +@@ -615,6 +664,13 @@ static errcode_t __populate_fs(ext2_filsys fs, ext2_ino_t parent_ino, + goto out; + } + ++ retval = set_inode_xattr(fs, ino, name); ++ if (retval) { ++ com_err(__func__, retval, ++ _("while setting xattrs for \"%s\""), name); ++ goto out; ++ } ++ + /* Save the hardlink ino */ + if (save_inode) { + /* diff --git a/recipes-devtools/e2fsprogs/e2fsprogs/remove-ldconfig-call.patch b/recipes-devtools/e2fsprogs/e2fsprogs/remove-ldconfig-call.patch new file mode 100644 index 00000000..66e4e370 --- /dev/null +++ b/recipes-devtools/e2fsprogs/e2fsprogs/remove-ldconfig-call.patch @@ -0,0 +1,35 @@ +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> + +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 diff --git a/recipes-devtools/e2fsprogs/e2fsprogs_git.bb b/recipes-devtools/e2fsprogs/e2fsprogs_git.bb new file mode 100644 index 00000000..0e5a7fc9 --- /dev/null +++ b/recipes-devtools/e2fsprogs/e2fsprogs_git.bb @@ -0,0 +1,74 @@ +COREDIR = "${COREBASE}/meta/recipes-devtools/e2fsprogs" + +FILESEXTRAPATHS_append := ":${COREDIR}/e2fsprogs" + +require ${COREDIR}/e2fsprogs.inc + +SRC_URI = "git://git.kernel.org/pub/scm/fs/ext2/e2fsprogs.git \ + file://acinclude.m4 \ + file://mkdir.patch \ + file://remove-ldconfig-call.patch \ + file://quiet-debugfs.patch \ + file://populate-fs-xattr.patch \ + file://cross-compile.patch \ +" + +SRCREV = "bb9cca2ca91b46e820f77dda38e01fb2860dc5d2" +PV = "1.42.9+git${SRCPV}" + +S = "${WORKDIR}/git" + +EXTRA_OECONF += "--libdir=${base_libdir} --sbindir=${base_sbindir} --enable-elf-shlibs --disable-libuuid --disable-uuidd --enable-verbose-makecmds" +EXTRA_OECONF_darwin = "--libdir=${base_libdir} --sbindir=${base_sbindir} --enable-bsd-shlibs" + +do_configure_prepend () { + cp ${WORKDIR}/acinclude.m4 ${S}/ +} + +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 +} + +RDEPENDS_e2fsprogs = "e2fsprogs-badblocks" +RRECOMMENDS_e2fsprogs = "e2fsprogs-mke2fs e2fsprogs-e2fsck" + +PACKAGES =+ "e2fsprogs-e2fsck e2fsprogs-mke2fs e2fsprogs-tune2fs e2fsprogs-badblocks" +PACKAGES =+ "libcomerr libss libe2p libext2fs" + +FILES_e2fsprogs-e2fsck = "${base_sbindir}/e2fsck ${base_sbindir}/fsck.ext*" +FILES_e2fsprogs-mke2fs = "${base_sbindir}/mke2fs ${base_sbindir}/mkfs.ext* ${sysconfdir}/mke2fs.conf" +FILES_e2fsprogs-tune2fs = "${base_sbindir}/tune2fs ${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" + +BBCLASSEXTEND = "native" + +inherit update-alternatives + +ALTERNATIVE_${PN} = "chattr" +ALTERNATIVE_PRIORITY = "100" +ALTERNATIVE_LINK_NAME[chattr] = "${base_bindir}/chattr" +ALTERNATIVE_TARGET[chattr] = "${base_bindir}/chattr.e2fsprogs" |