Pasi Kärkkäinen
2012-Sep-05 03:02 UTC
Xen 4.2 (missing) pygrub support for ext4 on rhel5/centos5 e4fsprogs..
Hello, Roger: If I didn''t mix up people we had a chat about this at XenSummit :) so here''s some info about the ext4 stuff on rhel5/centos5. # yum search e4fsprogs e4fsprogs.x86_64 : Utilities for managing the fourth extended (ext4) filesystem e4fsprogs-devel.i386 : Ext4 filesystem-specific static libraries and headers e4fsprogs-devel.x86_64 : Ext4 filesystem-specific static libraries and headers e4fsprogs-libs.i386 : Ext4 filesystem-specific static libraries and headers e4fsprogs-libs.x86_64 : Ext4 filesystem-specific static libraries and headers # rpm -ql e4fsprogs-libs.i386 /lib/libe4p.so.2 /lib/libe4p.so.2.3 /lib/libext4fs.so.2 /lib/libext4fs.so.2.4 # rpm -ql e4fsprogs-libs.x86_64 /lib64/libe4p.so.2 /lib64/libe4p.so.2.3 /lib64/libext4fs.so.2 /lib64/libext4fs.so.2.4 # rpm -ql e4fsprogs-devel.i386 /usr/include/e4p /usr/include/e4p/e2p.h /usr/include/ext4fs /usr/include/ext4fs/bitops.h /usr/include/ext4fs/ext2_err.h /usr/include/ext4fs/ext2_ext_attr.h /usr/include/ext4fs/ext2_fs.h /usr/include/ext4fs/ext2_io.h /usr/include/ext4fs/ext2_types-i386.h /usr/include/ext4fs/ext2_types.h /usr/include/ext4fs/ext2fs.h /usr/include/ext4fs/ext3_extents.h /usr/include/ext4fs/tdb.h /usr/lib/libe4p.a /usr/lib/libe4p.so /usr/lib/libext4fs.a /usr/lib/libext4fs.so /usr/lib/pkgconfig/e4p.pc /usr/lib/pkgconfig/ext4fs.pc /usr/share/info/libext4fs.info.gz # rpm -ql e4fsprogs-devel.x86_64 /usr/include/e4p /usr/include/e4p/e2p.h /usr/include/ext4fs /usr/include/ext4fs/bitops.h /usr/include/ext4fs/ext2_err.h /usr/include/ext4fs/ext2_ext_attr.h /usr/include/ext4fs/ext2_fs.h /usr/include/ext4fs/ext2_io.h /usr/include/ext4fs/ext2_types-x86_64.h /usr/include/ext4fs/ext2_types.h /usr/include/ext4fs/ext2fs.h /usr/include/ext4fs/ext3_extents.h /usr/include/ext4fs/tdb.h /usr/lib64/libe4p.a /usr/lib64/libe4p.so /usr/lib64/libext4fs.a /usr/lib64/libext4fs.so /usr/lib64/pkgconfig/e4p.pc /usr/lib64/pkgconfig/ext4fs.pc /usr/share/info/libext4fs.info.gz And then some info about the included files in the stock rhel5/centos5 Xen rpms (Xen 3.1.2), where pygrub does support ext4 using e4fsprogs-libs: # rpm -ql xen-libs | grep fsimage /usr/lib64/fs/ext2fs-lib/fsimage.so /usr/lib64/fs/fat/fsimage.so /usr/lib64/fs/iso9660/fsimage.so /usr/lib64/fs/reiserfs/fsimage.so /usr/lib64/fs/ufs/fsimage.so /usr/lib64/libfsimage.so.1.0 /usr/lib64/libfsimage.so.1.0.0 /usr/lib/fs/ext2fs-lib/fsimage.so /usr/lib/fs/fat/fsimage.so /usr/lib/fs/iso9660/fsimage.so /usr/lib/fs/reiserfs/fsimage.so /usr/lib/fs/ufs/fsimage.so /usr/lib/libfsimage.so.1.0 /usr/lib/libfsimage.so.1.0.0 # ldd /usr/lib/fs/ext2fs-lib/fsimage.so linux-gate.so.1 => (0xffffe000) libfsimage.so.1.0 => /usr/lib/libfsimage.so.1.0 (0xf7f09000) libext4fs.so.2 => /lib/libext4fs.so.2 (0xf7edb000) libc.so.6 => /lib/libc.so.6 (0xf7d82000) libpthread.so.0 => /lib/libpthread.so.0 (0xf7d68000) libcom_err.so.2 => /lib/libcom_err.so.2 (0xf7d64000) /lib/ld-linux.so.2 (0x00778000) # ldd /usr/lib64/fs/ext2fs-lib/fsimage.so linux-vdso.so.1 => (0x00007fff9cffd000) libfsimage.so.1.0 => /usr/lib64/libfsimage.so.1.0 (0x00002adbbef0e000) libext4fs.so.2 => /lib64/libext4fs.so.2 (0x00002adbbf111000) libc.so.6 => /lib64/libc.so.6 (0x00002adbbf340000) libpthread.so.0 => /lib64/libpthread.so.0 (0x00002adbbf697000) libcom_err.so.2 => /lib64/libcom_err.so.2 (0x00002adbbf8b2000) /lib64/ld-linux-x86-64.so.2 (0x00000039dce00000) So el5 stock Xen rpms provide ext2fs-lib/fsimage.so, which is linked against libext4fs.so.2, and pygrub loads/uses fsimage.so. Can you guys please post the patch/hack you''re currently using with XenServer/XCP, so we can decide what''d be the best way to get Xen 4.2 pygrub supporting ext4 also on el5 ? Thanks, -- Pasi
Andrew Cooper
2012-Sep-05 09:05 UTC
Re: Xen 4.2 (missing) pygrub support for ext4 on rhel5/centos5 e4fsprogs..
On 05/09/12 04:02, Pasi Kärkkäinen wrote:> Hello, > > Roger: If I didn''t mix up people we had a chat about this at XenSummit :) > so here''s some info about the ext4 stuff on rhel5/centos5. > > # yum search e4fsprogs > e4fsprogs.x86_64 : Utilities for managing the fourth extended (ext4) filesystem > e4fsprogs-devel.i386 : Ext4 filesystem-specific static libraries and headers > e4fsprogs-devel.x86_64 : Ext4 filesystem-specific static libraries and headers > e4fsprogs-libs.i386 : Ext4 filesystem-specific static libraries and headers > e4fsprogs-libs.x86_64 : Ext4 filesystem-specific static libraries and headers > > # rpm -ql e4fsprogs-libs.i386 > /lib/libe4p.so.2 > /lib/libe4p.so.2.3 > /lib/libext4fs.so.2 > /lib/libext4fs.so.2.4 > > # rpm -ql e4fsprogs-libs.x86_64 > /lib64/libe4p.so.2 > /lib64/libe4p.so.2.3 > /lib64/libext4fs.so.2 > /lib64/libext4fs.so.2.4 > > # rpm -ql e4fsprogs-devel.i386 > /usr/include/e4p > /usr/include/e4p/e2p.h > /usr/include/ext4fs > /usr/include/ext4fs/bitops.h > /usr/include/ext4fs/ext2_err.h > /usr/include/ext4fs/ext2_ext_attr.h > /usr/include/ext4fs/ext2_fs.h > /usr/include/ext4fs/ext2_io.h > /usr/include/ext4fs/ext2_types-i386.h > /usr/include/ext4fs/ext2_types.h > /usr/include/ext4fs/ext2fs.h > /usr/include/ext4fs/ext3_extents.h > /usr/include/ext4fs/tdb.h > /usr/lib/libe4p.a > /usr/lib/libe4p.so > /usr/lib/libext4fs.a > /usr/lib/libext4fs.so > /usr/lib/pkgconfig/e4p.pc > /usr/lib/pkgconfig/ext4fs.pc > /usr/share/info/libext4fs.info.gz > > # rpm -ql e4fsprogs-devel.x86_64 > /usr/include/e4p > /usr/include/e4p/e2p.h > /usr/include/ext4fs > /usr/include/ext4fs/bitops.h > /usr/include/ext4fs/ext2_err.h > /usr/include/ext4fs/ext2_ext_attr.h > /usr/include/ext4fs/ext2_fs.h > /usr/include/ext4fs/ext2_io.h > /usr/include/ext4fs/ext2_types-x86_64.h > /usr/include/ext4fs/ext2_types.h > /usr/include/ext4fs/ext2fs.h > /usr/include/ext4fs/ext3_extents.h > /usr/include/ext4fs/tdb.h > /usr/lib64/libe4p.a > /usr/lib64/libe4p.so > /usr/lib64/libext4fs.a > /usr/lib64/libext4fs.so > /usr/lib64/pkgconfig/e4p.pc > /usr/lib64/pkgconfig/ext4fs.pc > /usr/share/info/libext4fs.info.gz > > > And then some info about the included files in the stock rhel5/centos5 Xen rpms (Xen 3.1.2), > where pygrub does support ext4 using e4fsprogs-libs: > > > # rpm -ql xen-libs | grep fsimage > /usr/lib64/fs/ext2fs-lib/fsimage.so > /usr/lib64/fs/fat/fsimage.so > /usr/lib64/fs/iso9660/fsimage.so > /usr/lib64/fs/reiserfs/fsimage.so > /usr/lib64/fs/ufs/fsimage.so > /usr/lib64/libfsimage.so.1.0 > /usr/lib64/libfsimage.so.1.0.0 > /usr/lib/fs/ext2fs-lib/fsimage.so > /usr/lib/fs/fat/fsimage.so > /usr/lib/fs/iso9660/fsimage.so > /usr/lib/fs/reiserfs/fsimage.so > /usr/lib/fs/ufs/fsimage.so > /usr/lib/libfsimage.so.1.0 > /usr/lib/libfsimage.so.1.0.0 > > # ldd /usr/lib/fs/ext2fs-lib/fsimage.so > linux-gate.so.1 => (0xffffe000) > libfsimage.so.1.0 => /usr/lib/libfsimage.so.1.0 (0xf7f09000) > libext4fs.so.2 => /lib/libext4fs.so.2 (0xf7edb000) > libc.so.6 => /lib/libc.so.6 (0xf7d82000) > libpthread.so.0 => /lib/libpthread.so.0 (0xf7d68000) > libcom_err.so.2 => /lib/libcom_err.so.2 (0xf7d64000) > /lib/ld-linux.so.2 (0x00778000) > > > # ldd /usr/lib64/fs/ext2fs-lib/fsimage.so > linux-vdso.so.1 => (0x00007fff9cffd000) > libfsimage.so.1.0 => /usr/lib64/libfsimage.so.1.0 (0x00002adbbef0e000) > libext4fs.so.2 => /lib64/libext4fs.so.2 (0x00002adbbf111000) > libc.so.6 => /lib64/libc.so.6 (0x00002adbbf340000) > libpthread.so.0 => /lib64/libpthread.so.0 (0x00002adbbf697000) > libcom_err.so.2 => /lib64/libcom_err.so.2 (0x00002adbbf8b2000) > /lib64/ld-linux-x86-64.so.2 (0x00000039dce00000) > > So el5 stock Xen rpms provide ext2fs-lib/fsimage.so, which is linked against libext4fs.so.2, > and pygrub loads/uses fsimage.so. > > > Can you guys please post the patch/hack you''re currently using with XenServer/XCP, > so we can decide what''d be the best way to get Xen 4.2 pygrub supporting ext4 also on el5 ?Attached, but it is very brutal as far as hacks go, and not suitable for upstreaming in its current form. ~Andrew> > > Thanks, > > -- Pasi > > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xen.org > http://lists.xen.org/xen-devel-- Andrew Cooper - Dom0 Kernel Engineer, Citrix XenServer T: +44 (0)1223 225 900, http://www.citrix.com --------------070909050506070504080108 Content-Type: text/x-patch; name="centos5-libe4fs-hack.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="centos5-libe4fs-hack.patch" # HG changeset patch # Parent d341f05a3640a1f4cd92f7b8eefb4d221c13b408 Work around RHEL5''s ext2fs/ext4fs split. We need to link against a new enough version of libext2fs to be able to read ext4 partitions. This is only needed because RHEL5 puts the latest ext2 libs in their own directory. Other distros (and other RHELs) work fine already. This a hard-hack; a proper fix would add the check to configure. This patch can be simply removed when we move to Centos 6. diff --git a/tools/libfsimage/ext2fs-lib/Makefile b/tools/libfsimage/ext2fs-lib/Makefile --- a/tools/libfsimage/ext2fs-lib/Makefile +++ b/tools/libfsimage/ext2fs-lib/Makefile @@ -4,7 +4,7 @@ LIB_SRCS-y = ext2fs-lib.c FS = ext2fs-lib -FS_LIBDEPS = -lext2fs +FS_LIBDEPS = -lext4fs .PHONY: all all: fs-all diff --git a/tools/libfsimage/ext2fs-lib/ext2fs-lib.c b/tools/libfsimage/ext2fs-lib/ext2fs-lib.c --- a/tools/libfsimage/ext2fs-lib/ext2fs-lib.c +++ b/tools/libfsimage/ext2fs-lib/ext2fs-lib.c @@ -22,7 +22,7 @@ */ #include <fsimage_plugin.h> -#include <ext2fs/ext2fs.h> +#include <ext4fs/ext2fs.h> #include <errno.h> #include <inttypes.h> --------------070909050506070504080108 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel --------------070909050506070504080108--
CentOS 5.x forked e2fs ext4 support into a different package called e4fs, and so headers and library names changed from ext2fs to ext4fs. Check if ext4fs/ext2fs.h and -lext4fs work, and use that instead of ext2fs to build libfsimage. This patch assumes that if the ext4fs library is present it should always be used instead of ext2fs. This patch includes a rework of the ext2fs check, a new ext4fs check and a minor modification in libfsimage to use the correct library. Signed-off-by: Roger Pau Monne <roger.pau@citrix.com> --- Please re-run autogen.sh after applying --- config/Tools.mk.in | 2 +- tools/config.h.in | 3 +++ tools/configure.ac | 4 ++-- tools/libfsimage/Makefile | 2 +- tools/libfsimage/ext2fs-lib/Makefile | 5 ++++- tools/libfsimage/ext2fs-lib/ext2fs-lib.c | 5 ++++- tools/m4/extfs.m4 | 20 ++++++++++++++++++++ 7 files changed, 35 insertions(+), 6 deletions(-) create mode 100644 tools/m4/extfs.m4 diff --git a/config/Tools.mk.in b/config/Tools.mk.in index 8a52bcc..0859b36 100644 --- a/config/Tools.mk.in +++ b/config/Tools.mk.in @@ -56,5 +56,5 @@ CONFIG_SYSTEM_LIBAIO:= @system_aio@ ZLIB := @zlib@ CONFIG_LIBICONV := @libiconv@ CONFIG_GCRYPT := @libgcrypt@ -CONFIG_EXT2FS := @libext2fs@ +EXTFS_LIBS := @EXTFS_LIBS@ CURSES_LIBS := @CURSES_LIBS@ diff --git a/tools/config.h.in b/tools/config.h.in index bc1ed10..ab726f6 100644 --- a/tools/config.h.in +++ b/tools/config.h.in @@ -45,6 +45,9 @@ /* libutil header file name */ #undef INCLUDE_LIBUTIL_H +/* e2fs/e4fs header file name */ +#undef INCLUDE_EXTFS_H + /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT diff --git a/tools/configure.ac b/tools/configure.ac index bb497cc..938bc8b 100644 --- a/tools/configure.ac +++ b/tools/configure.ac @@ -35,6 +35,7 @@ m4_include([m4/pkg.m4]) m4_include([m4/curses.m4]) m4_include([m4/pthread.m4]) m4_include([m4/ptyfuncs.m4]) +m4_include([m4/extfs.m4]) # Enable/disable options AX_ARG_DEFAULT_DISABLE([githttp], [Download GIT repositories via HTTP]) @@ -138,8 +139,7 @@ AC_SUBST(zlib) AC_CHECK_LIB([aio], [io_setup], [system_aio="y"], [system_aio="n"]) AC_SUBST(system_aio) AC_CHECK_LIB([crypto], [MD5], [], [AC_MSG_ERROR([Could not find libcrypto])]) -AC_CHECK_LIB([ext2fs], [ext2fs_open2], [libext2fs="y"], [libext2fs="n"]) -AC_SUBST(libext2fs) +AX_CHECK_EXTFS AC_CHECK_LIB([gcrypt], [gcry_md_hash_buffer], [libgcrypt="y"], [libgcrypt="n"]) AC_SUBST(libgcrypt) AX_CHECK_PTHREAD diff --git a/tools/libfsimage/Makefile b/tools/libfsimage/Makefile index 5a506f3..69fd18a 100644 --- a/tools/libfsimage/Makefile +++ b/tools/libfsimage/Makefile @@ -3,7 +3,7 @@ include $(XEN_ROOT)/tools/Rules.mk SUBDIRS-y = common ufs reiserfs iso9660 fat zfs SUBDIRS-$(CONFIG_X86) += xfs -ifeq ($(CONFIG_EXT2FS), y) +ifneq ($(EXTFS_LIBS), ) SUBDIRS-y += ext2fs-lib else SUBDIRS-y += ext2fs diff --git a/tools/libfsimage/ext2fs-lib/Makefile b/tools/libfsimage/ext2fs-lib/Makefile index 142207f..671fbff 100644 --- a/tools/libfsimage/ext2fs-lib/Makefile +++ b/tools/libfsimage/ext2fs-lib/Makefile @@ -4,7 +4,10 @@ LIB_SRCS-y = ext2fs-lib.c FS = ext2fs-lib -FS_LIBDEPS = -lext2fs +FS_LIBDEPS = $(EXTFS_LIBS) + +# Include configure output (config.h) to headers search path +CFLAGS += -I$(XEN_ROOT)/tools .PHONY: all all: fs-all diff --git a/tools/libfsimage/ext2fs-lib/ext2fs-lib.c b/tools/libfsimage/ext2fs-lib/ext2fs-lib.c index 36a27dc..ed47146 100644 --- a/tools/libfsimage/ext2fs-lib/ext2fs-lib.c +++ b/tools/libfsimage/ext2fs-lib/ext2fs-lib.c @@ -21,8 +21,11 @@ * Use is subject to license terms. */ +/* Include output from configure */ +#include <config.h> + #include <fsimage_plugin.h> -#include <ext2fs/ext2fs.h> +#include INCLUDE_EXTFS_H #include <errno.h> #include <inttypes.h> diff --git a/tools/m4/extfs.m4 b/tools/m4/extfs.m4 new file mode 100644 index 0000000..7309da9 --- /dev/null +++ b/tools/m4/extfs.m4 @@ -0,0 +1,20 @@ +AC_DEFUN([AX_CHECK_EXTFS], [ +AC_CHECK_HEADER([ext2fs/ext2fs.h], [ +AC_CHECK_LIB([ext2fs], [ext2fs_open2], [ + AC_DEFINE([INCLUDE_EXTFS_H], [<ext2fs/ext2fs.h>], + [Define extfs header to use]) + EXTFS_LIBS="-lext2fs" +]) +]) +dnl This is a temporary hack for CentOS 5.x, which split the ext4 support +dnl of ext2fs in a different package. Once CentOS 5.x is no longer supported +dnl we can remove this. +AC_CHECK_HEADER([ext4fs/ext2fs.h], [ +AC_CHECK_LIB([ext4fs], [ext2fs_open2], [ + AC_DEFINE([INCLUDE_EXTFS_H], [<ext4fs/ext2fs.h>], + [Define extfs header to use]) + EXTFS_LIBS="-lext4fs" +]) +]) +AC_SUBST(EXTFS_LIBS) +]) -- 1.7.7.5 (Apple Git-26)
Ian Campbell
2012-Sep-05 18:04 UTC
Re: [PATCH] libfsimage: add ext4 support for CentOS 5.x
On Wed, 2012-09-05 at 13:03 +0100, Roger Pau Monne wrote:> CentOS 5.x forked e2fs ext4 support into a different package called > e4fs, and so headers and library names changed from ext2fs to ext4fs. > Check if ext4fs/ext2fs.h and -lext4fs work, and use that instead of > ext2fs to build libfsimage. This patch assumes that if the ext4fs > library is present it should always be used instead of ext2fs. > > This patch includes a rework of the ext2fs check, a new ext4fs check > and a minor modification in libfsimage to use the correct library. > > Signed-off-by: Roger Pau Monne <roger.pau@citrix.com>Thanks. Any patch which is intended for 4.2 at this stage needs to come with some rationale as to why it is acceptable at this late stage. Therefore unless someone can argue convincingly for it this is 4.3 material. Ian.> --- > Please re-run autogen.sh after applying > --- > config/Tools.mk.in | 2 +- > tools/config.h.in | 3 +++ > tools/configure.ac | 4 ++-- > tools/libfsimage/Makefile | 2 +- > tools/libfsimage/ext2fs-lib/Makefile | 5 ++++- > tools/libfsimage/ext2fs-lib/ext2fs-lib.c | 5 ++++- > tools/m4/extfs.m4 | 20 ++++++++++++++++++++ > 7 files changed, 35 insertions(+), 6 deletions(-) > create mode 100644 tools/m4/extfs.m4 > > diff --git a/config/Tools.mk.in b/config/Tools.mk.in > index 8a52bcc..0859b36 100644 > --- a/config/Tools.mk.in > +++ b/config/Tools.mk.in > @@ -56,5 +56,5 @@ CONFIG_SYSTEM_LIBAIO:= @system_aio@ > ZLIB := @zlib@ > CONFIG_LIBICONV := @libiconv@ > CONFIG_GCRYPT := @libgcrypt@ > -CONFIG_EXT2FS := @libext2fs@ > +EXTFS_LIBS := @EXTFS_LIBS@ > CURSES_LIBS := @CURSES_LIBS@ > diff --git a/tools/config.h.in b/tools/config.h.in > index bc1ed10..ab726f6 100644 > --- a/tools/config.h.in > +++ b/tools/config.h.in > @@ -45,6 +45,9 @@ > /* libutil header file name */ > #undef INCLUDE_LIBUTIL_H > > +/* e2fs/e4fs header file name */ > +#undef INCLUDE_EXTFS_H > + > /* Define to the address where bug reports for this package should be sent. */ > #undef PACKAGE_BUGREPORT > > diff --git a/tools/configure.ac b/tools/configure.ac > index bb497cc..938bc8b 100644 > --- a/tools/configure.ac > +++ b/tools/configure.ac > @@ -35,6 +35,7 @@ m4_include([m4/pkg.m4]) > m4_include([m4/curses.m4]) > m4_include([m4/pthread.m4]) > m4_include([m4/ptyfuncs.m4]) > +m4_include([m4/extfs.m4]) > > # Enable/disable options > AX_ARG_DEFAULT_DISABLE([githttp], [Download GIT repositories via HTTP]) > @@ -138,8 +139,7 @@ AC_SUBST(zlib) > AC_CHECK_LIB([aio], [io_setup], [system_aio="y"], [system_aio="n"]) > AC_SUBST(system_aio) > AC_CHECK_LIB([crypto], [MD5], [], [AC_MSG_ERROR([Could not find libcrypto])]) > -AC_CHECK_LIB([ext2fs], [ext2fs_open2], [libext2fs="y"], [libext2fs="n"]) > -AC_SUBST(libext2fs) > +AX_CHECK_EXTFS > AC_CHECK_LIB([gcrypt], [gcry_md_hash_buffer], [libgcrypt="y"], [libgcrypt="n"]) > AC_SUBST(libgcrypt) > AX_CHECK_PTHREAD > diff --git a/tools/libfsimage/Makefile b/tools/libfsimage/Makefile > index 5a506f3..69fd18a 100644 > --- a/tools/libfsimage/Makefile > +++ b/tools/libfsimage/Makefile > @@ -3,7 +3,7 @@ include $(XEN_ROOT)/tools/Rules.mk > > SUBDIRS-y = common ufs reiserfs iso9660 fat zfs > SUBDIRS-$(CONFIG_X86) += xfs > -ifeq ($(CONFIG_EXT2FS), y) > +ifneq ($(EXTFS_LIBS), ) > SUBDIRS-y += ext2fs-lib > else > SUBDIRS-y += ext2fs > diff --git a/tools/libfsimage/ext2fs-lib/Makefile b/tools/libfsimage/ext2fs-lib/Makefile > index 142207f..671fbff 100644 > --- a/tools/libfsimage/ext2fs-lib/Makefile > +++ b/tools/libfsimage/ext2fs-lib/Makefile > @@ -4,7 +4,10 @@ LIB_SRCS-y = ext2fs-lib.c > > FS = ext2fs-lib > > -FS_LIBDEPS = -lext2fs > +FS_LIBDEPS = $(EXTFS_LIBS) > + > +# Include configure output (config.h) to headers search path > +CFLAGS += -I$(XEN_ROOT)/tools > > .PHONY: all > all: fs-all > diff --git a/tools/libfsimage/ext2fs-lib/ext2fs-lib.c b/tools/libfsimage/ext2fs-lib/ext2fs-lib.c > index 36a27dc..ed47146 100644 > --- a/tools/libfsimage/ext2fs-lib/ext2fs-lib.c > +++ b/tools/libfsimage/ext2fs-lib/ext2fs-lib.c > @@ -21,8 +21,11 @@ > * Use is subject to license terms. > */ > > +/* Include output from configure */ > +#include <config.h> > + > #include <fsimage_plugin.h> > -#include <ext2fs/ext2fs.h> > +#include INCLUDE_EXTFS_H > #include <errno.h> > #include <inttypes.h> > > diff --git a/tools/m4/extfs.m4 b/tools/m4/extfs.m4 > new file mode 100644 > index 0000000..7309da9 > --- /dev/null > +++ b/tools/m4/extfs.m4 > @@ -0,0 +1,20 @@ > +AC_DEFUN([AX_CHECK_EXTFS], [ > +AC_CHECK_HEADER([ext2fs/ext2fs.h], [ > +AC_CHECK_LIB([ext2fs], [ext2fs_open2], [ > + AC_DEFINE([INCLUDE_EXTFS_H], [<ext2fs/ext2fs.h>], > + [Define extfs header to use]) > + EXTFS_LIBS="-lext2fs" > +]) > +]) > +dnl This is a temporary hack for CentOS 5.x, which split the ext4 support > +dnl of ext2fs in a different package. Once CentOS 5.x is no longer supported > +dnl we can remove this. > +AC_CHECK_HEADER([ext4fs/ext2fs.h], [ > +AC_CHECK_LIB([ext4fs], [ext2fs_open2], [ > + AC_DEFINE([INCLUDE_EXTFS_H], [<ext4fs/ext2fs.h>], > + [Define extfs header to use]) > + EXTFS_LIBS="-lext4fs" > +]) > +]) > +AC_SUBST(EXTFS_LIBS) > +])
Pasi Kärkkäinen
2012-Sep-05 20:55 UTC
Re: [PATCH] libfsimage: add ext4 support for CentOS 5.x
On Wed, Sep 05, 2012 at 07:04:49PM +0100, Ian Campbell wrote:> On Wed, 2012-09-05 at 13:03 +0100, Roger Pau Monne wrote: > > CentOS 5.x forked e2fs ext4 support into a different package called > > e4fs, and so headers and library names changed from ext2fs to ext4fs. > > Check if ext4fs/ext2fs.h and -lext4fs work, and use that instead of > > ext2fs to build libfsimage. This patch assumes that if the ext4fs > > library is present it should always be used instead of ext2fs. > > > > This patch includes a rework of the ext2fs check, a new ext4fs check > > and a minor modification in libfsimage to use the correct library. > > > > Signed-off-by: Roger Pau Monne <roger.pau@citrix.com> > > Thanks. > > Any patch which is intended for 4.2 at this stage needs to come with > some rationale as to why it is acceptable at this late stage. >rhel5/centos5 has a lot of Xen users, so it''d be nice if those people could build Xen 4.2 from sources and still have pygrub ext4 support. (the stock redhat el5 Xen 3.1.2 rpms have similar tweaks and they do provide pygrub ext4 support out-of-the-box on el5). Also XenServer/XCP has hacks to get pygrub ext4 support enabled in similar way, so it''d make sense to fix/workaround this properly in Xen upstream.> Therefore unless someone can argue convincingly for it this is 4.3 > material. >I''m not expecting that was convincing enough :) so if not 4.2.0 then 4.3 and 4.2.1 ? -- Pasi
Ian Campbell
2012-Sep-06 07:23 UTC
Re: [PATCH] libfsimage: add ext4 support for CentOS 5.x
On Wed, 2012-09-05 at 21:55 +0100, Pasi Kärkkäinen wrote:> On Wed, Sep 05, 2012 at 07:04:49PM +0100, Ian Campbell wrote: > > On Wed, 2012-09-05 at 13:03 +0100, Roger Pau Monne wrote: > > > CentOS 5.x forked e2fs ext4 support into a different package called > > > e4fs, and so headers and library names changed from ext2fs to ext4fs. > > > Check if ext4fs/ext2fs.h and -lext4fs work, and use that instead of > > > ext2fs to build libfsimage. This patch assumes that if the ext4fs > > > library is present it should always be used instead of ext2fs. > > > > > > This patch includes a rework of the ext2fs check, a new ext4fs check > > > and a minor modification in libfsimage to use the correct library. > > > > > > Signed-off-by: Roger Pau Monne <roger.pau@citrix.com> > > > > Thanks. > > > > Any patch which is intended for 4.2 at this stage needs to come with > > some rationale as to why it is acceptable at this late stage. > > > > rhel5/centos5 has a lot of Xen users, so it''d be nice if those people > could build Xen 4.2 from sources and still have pygrub ext4 support.I''m sorry but two days (now one day) before the final RC we need more justification than "it would be nice". Who are these people? How many of them are there? Why are they doing this? If you are building from source what reason is there to be using RHEL5? We certainly don''t seem to be getting bugs reports (either on -devel@ or -users@) about this problem.> (the stock redhat el5 Xen 3.1.2 rpms have similar tweaks and > they do provide pygrub ext4 support out-of-the-box on el5). > > Also XenServer/XCP has hacks to get pygrub ext4 support enabled in similar way, > so it''d make sense to fix/workaround this properly in Xen upstream.This seems right and proper to me and isn''t an argument for us taking and carry this hack in our tree. IMHO the presence of libe4fs in RHEL5 is a distro specific packaging hack and it is appropriate that the fallout be dealt with via RHEL5 specific packaging hacks.> > Therefore unless someone can argue convincingly for it this is 4.3 > > material. > > > > I''m not expecting that was convincing enough :) so if not 4.2.0 then 4.3 and 4.2.1 ?Perhaps. I''m not entirely convinced of the need at all though. If RHEL5 was the current release then maybe, but RHEL6 is nearly two years old at this point. Ian.
Pasi Kärkkäinen
2012-Sep-06 14:39 UTC
Re: [PATCH] libfsimage: add ext4 support for CentOS 5.x
On Thu, Sep 06, 2012 at 08:23:05AM +0100, Ian Campbell wrote:> On Wed, 2012-09-05 at 21:55 +0100, Pasi Kärkkäinen wrote: > > On Wed, Sep 05, 2012 at 07:04:49PM +0100, Ian Campbell wrote: > > > On Wed, 2012-09-05 at 13:03 +0100, Roger Pau Monne wrote: > > > > CentOS 5.x forked e2fs ext4 support into a different package called > > > > e4fs, and so headers and library names changed from ext2fs to ext4fs. > > > > Check if ext4fs/ext2fs.h and -lext4fs work, and use that instead of > > > > ext2fs to build libfsimage. This patch assumes that if the ext4fs > > > > library is present it should always be used instead of ext2fs. > > > > > > > > This patch includes a rework of the ext2fs check, a new ext4fs check > > > > and a minor modification in libfsimage to use the correct library. > > > > > > > > Signed-off-by: Roger Pau Monne <roger.pau@citrix.com> > > > > > > Thanks. > > > > > > Any patch which is intended for 4.2 at this stage needs to come with > > > some rationale as to why it is acceptable at this late stage. > > > > > > > rhel5/centos5 has a lot of Xen users, so it''d be nice if those people > > could build Xen 4.2 from sources and still have pygrub ext4 support. > > I''m sorry but two days (now one day) before the final RC we need more > justification than "it would be nice". >I understand that.> Who are these people? How many of them are there? Why are they doing > this? If you are building from source what reason is there to be using > RHEL5? > > We certainly don''t seem to be getting bugs reports (either on -devel@ or > -users@) about this problem. >Ok, so it''d be mostly *CentOS5* users, who don''t have the support contracts anyway. I''m not able to give you any numbers. I hit this issue myself, so I thought it''d be nice to get it fixed in upstream Xen aswell.> > (the stock redhat el5 Xen 3.1.2 rpms have similar tweaks and > > they do provide pygrub ext4 support out-of-the-box on el5). > > > > Also XenServer/XCP has hacks to get pygrub ext4 support enabled in similar way, > > so it''d make sense to fix/workaround this properly in Xen upstream. > > This seems right and proper to me and isn''t an argument for us taking > and carry this hack in our tree. > > IMHO the presence of libe4fs in RHEL5 is a distro specific packaging > hack and it is appropriate that the fallout be dealt with via RHEL5 > specific packaging hacks. >The patch that Roger submitted is dealing with this in a nice way though.. Or was there something wrong with the patch?> > > Therefore unless someone can argue convincingly for it this is 4.3 > > > material. > > > > > > > I''m not expecting that was convincing enough :) so if not 4.2.0 then 4.3 and 4.2.1 ? > > Perhaps. I''m not entirely convinced of the need at all though. If RHEL5 > was the current release then maybe, but RHEL6 is nearly two years old at > this point. >RHEL5 has "Production Phase" support until 2017. It''s still getting improvements and new features in 5.x point releases, and still keeping the ABI stable and compatible with earlier 5.x versions; that''s why the e4fs stuff exists in the first place - to not break the ABI. Next year it''ll transform into "security maintenance and minor fixes"-mode. -- Pasi
Ian Campbell
2012-Sep-14 09:05 UTC
Re: [PATCH] libfsimage: add ext4 support for CentOS 5.x
On Wed, 2012-09-05 at 13:03 +0100, Roger Pau Monne wrote:> CentOS 5.x forked e2fs ext4 support into a different package called > e4fs, and so headers and library names changed from ext2fs to ext4fs. > Check if ext4fs/ext2fs.h and -lext4fs work, and use that instead of > ext2fs to build libfsimage. This patch assumes that if the ext4fs > library is present it should always be used instead of ext2fs. > > This patch includes a rework of the ext2fs check, a new ext4fs check > and a minor modification in libfsimage to use the correct library. > > Signed-off-by: Roger Pau Monne <roger.pau@citrix.com> > --- > Please re-run autogen.sh after applyingDone & acked + applied. Thanks.> diff --git a/tools/libfsimage/ext2fs-lib/Makefile b/tools/libfsimage/ext2fs-lib/Makefile > index 142207f..671fbff 100644 > --- a/tools/libfsimage/ext2fs-lib/Makefile > +++ b/tools/libfsimage/ext2fs-lib/Makefile > @@ -4,7 +4,10 @@ LIB_SRCS-y = ext2fs-lib.c > > FS = ext2fs-lib > > -FS_LIBDEPS = -lext2fs > +FS_LIBDEPS = $(EXTFS_LIBS) > + > +# Include configure output (config.h) to headers search path > +CFLAGS += -I$(XEN_ROOT)/toolsIs there any way to move config.h from tools to under tools/include somewhere?> > .PHONY: all > all: fs-all > diff --git a/tools/libfsimage/ext2fs-lib/ext2fs-lib.c b/tools/libfsimage/ext2fs-lib/ext2fs-lib.c > index 36a27dc..ed47146 100644 > --- a/tools/libfsimage/ext2fs-lib/ext2fs-lib.c > +++ b/tools/libfsimage/ext2fs-lib/ext2fs-lib.c > @@ -21,8 +21,11 @@ > * Use is subject to license terms. > */ > > +/* Include output from configure */ > +#include <config.h> > + > #include <fsimage_plugin.h> > -#include <ext2fs/ext2fs.h> > +#include INCLUDE_EXTFS_H > #include <errno.h> > #include <inttypes.h> > > diff --git a/tools/m4/extfs.m4 b/tools/m4/extfs.m4 > new file mode 100644 > index 0000000..7309da9 > --- /dev/null > +++ b/tools/m4/extfs.m4 > @@ -0,0 +1,20 @@ > +AC_DEFUN([AX_CHECK_EXTFS], [ > +AC_CHECK_HEADER([ext2fs/ext2fs.h], [ > +AC_CHECK_LIB([ext2fs], [ext2fs_open2], [ > + AC_DEFINE([INCLUDE_EXTFS_H], [<ext2fs/ext2fs.h>], > + [Define extfs header to use]) > + EXTFS_LIBS="-lext2fs" > +]) > +]) > +dnl This is a temporary hack for CentOS 5.x, which split the ext4 support > +dnl of ext2fs in a different package. Once CentOS 5.x is no longer supported > +dnl we can remove this. > +AC_CHECK_HEADER([ext4fs/ext2fs.h], [ > +AC_CHECK_LIB([ext4fs], [ext2fs_open2], [ > + AC_DEFINE([INCLUDE_EXTFS_H], [<ext4fs/ext2fs.h>], > + [Define extfs header to use]) > + EXTFS_LIBS="-lext4fs" > +]) > +]) > +AC_SUBST(EXTFS_LIBS) > +])
Roger Pau Monne
2012-Sep-14 10:19 UTC
Re: [PATCH] libfsimage: add ext4 support for CentOS 5.x
Ian Campbell wrote:> On Wed, 2012-09-05 at 13:03 +0100, Roger Pau Monne wrote: >> CentOS 5.x forked e2fs ext4 support into a different package called >> e4fs, and so headers and library names changed from ext2fs to ext4fs. >> Check if ext4fs/ext2fs.h and -lext4fs work, and use that instead of >> ext2fs to build libfsimage. This patch assumes that if the ext4fs >> library is present it should always be used instead of ext2fs. >> >> This patch includes a rework of the ext2fs check, a new ext4fs check >> and a minor modification in libfsimage to use the correct library. >> >> Signed-off-by: Roger Pau Monne <roger.pau@citrix.com> >> --- >> Please re-run autogen.sh after applying > > Done & acked + applied. Thanks. > >> diff --git a/tools/libfsimage/ext2fs-lib/Makefile b/tools/libfsimage/ext2fs-lib/Makefile >> index 142207f..671fbff 100644 >> --- a/tools/libfsimage/ext2fs-lib/Makefile >> +++ b/tools/libfsimage/ext2fs-lib/Makefile >> @@ -4,7 +4,10 @@ LIB_SRCS-y = ext2fs-lib.c >> >> FS = ext2fs-lib >> >> -FS_LIBDEPS = -lext2fs >> +FS_LIBDEPS = $(EXTFS_LIBS) >> + >> +# Include configure output (config.h) to headers search path >> +CFLAGS += -I$(XEN_ROOT)/tools > > Is there any way to move config.h from tools to under tools/include > somewhere?Yes, but config.h should then be renamed to xen_config.h or something different from config.h, since a lot of utilities we pack with Xen include their own config.h and also include the tools/include folder, so we might have a collision there. If renaming it to xen_config.h is fine I will send a patch.
Ian Campbell
2012-Sep-14 10:21 UTC
Re: [PATCH] libfsimage: add ext4 support for CentOS 5.x
On Fri, 2012-09-14 at 11:19 +0100, Roger Pau Monne wrote:> Ian Campbell wrote: > > On Wed, 2012-09-05 at 13:03 +0100, Roger Pau Monne wrote: > >> CentOS 5.x forked e2fs ext4 support into a different package called > >> e4fs, and so headers and library names changed from ext2fs to ext4fs. > >> Check if ext4fs/ext2fs.h and -lext4fs work, and use that instead of > >> ext2fs to build libfsimage. This patch assumes that if the ext4fs > >> library is present it should always be used instead of ext2fs. > >> > >> This patch includes a rework of the ext2fs check, a new ext4fs check > >> and a minor modification in libfsimage to use the correct library. > >> > >> Signed-off-by: Roger Pau Monne <roger.pau@citrix.com> > >> --- > >> Please re-run autogen.sh after applying > > > > Done & acked + applied. Thanks. > > > >> diff --git a/tools/libfsimage/ext2fs-lib/Makefile b/tools/libfsimage/ext2fs-lib/Makefile > >> index 142207f..671fbff 100644 > >> --- a/tools/libfsimage/ext2fs-lib/Makefile > >> +++ b/tools/libfsimage/ext2fs-lib/Makefile > >> @@ -4,7 +4,10 @@ LIB_SRCS-y = ext2fs-lib.c > >> > >> FS = ext2fs-lib > >> > >> -FS_LIBDEPS = -lext2fs > >> +FS_LIBDEPS = $(EXTFS_LIBS) > >> + > >> +# Include configure output (config.h) to headers search path > >> +CFLAGS += -I$(XEN_ROOT)/tools > > > > Is there any way to move config.h from tools to under tools/include > > somewhere? > > Yes, but config.h should then be renamed to xen_config.h or something > different from config.h, since a lot of utilities we pack with Xen > include their own config.h and also include the tools/include folder, so > we might have a collision there. > > If renaming it to xen_config.h is fine I will send a patch.I was imagining it would go in one of the subdirs but none of them really look suitable, so xen_config.h is fine IMHO. Might want to see what Ian J thinks first? Ian.
Pasi Kärkkäinen
2012-Oct-14 11:10 UTC
Re: [PATCH] libfsimage: add ext4 support for CentOS 5.x / Xen 4.2.1 backport
On Fri, Sep 14, 2012 at 10:05:34AM +0100, Ian Campbell wrote:> On Wed, 2012-09-05 at 13:03 +0100, Roger Pau Monne wrote: > > CentOS 5.x forked e2fs ext4 support into a different package called > > e4fs, and so headers and library names changed from ext2fs to ext4fs. > > Check if ext4fs/ext2fs.h and -lext4fs work, and use that instead of > > ext2fs to build libfsimage. This patch assumes that if the ext4fs > > library is present it should always be used instead of ext2fs. > > > > This patch includes a rework of the ext2fs check, a new ext4fs check > > and a minor modification in libfsimage to use the correct library. > > > > Signed-off-by: Roger Pau Monne <roger.pau@citrix.com> > > --- > > Please re-run autogen.sh after applying > > Done & acked + applied. Thanks. >Hello, Now that this patch has been in xen-unstable for a while I''d like to request Xen 4.2.1 backport.. Thanks, -- Pasi
Steven Haigh
2012-Oct-14 11:26 UTC
Re: [PATCH] libfsimage: add ext4 support for CentOS 5.x / Xen 4.2.1 backport
On 14/10/2012 10:10 PM, Pasi Kärkkäinen wrote:> On Fri, Sep 14, 2012 at 10:05:34AM +0100, Ian Campbell wrote: >> On Wed, 2012-09-05 at 13:03 +0100, Roger Pau Monne wrote: >>> CentOS 5.x forked e2fs ext4 support into a different package called >>> e4fs, and so headers and library names changed from ext2fs to ext4fs. >>> Check if ext4fs/ext2fs.h and -lext4fs work, and use that instead of >>> ext2fs to build libfsimage. This patch assumes that if the ext4fs >>> library is present it should always be used instead of ext2fs. >>> >>> This patch includes a rework of the ext2fs check, a new ext4fs check >>> and a minor modification in libfsimage to use the correct library. >>> >>> Signed-off-by: Roger Pau Monne <roger.pau@citrix.com> >>> --- >>> Please re-run autogen.sh after applying >> >> Done & acked + applied. Thanks. >> > > Hello, > > Now that this patch has been in xen-unstable for a while > I''d like to request Xen 4.2.1 backport..I agree. I''ve been slamming my head against a wall trying to package 4.2.0 for CentOS 5 for a few days now. Its kinda working, but not really. Having some fixes like this may end up making a few headaches I''m having go away... -- Steven Haigh Email: netwiz@crc.id.au Web: http://www.crc.id.au Phone: (03) 9001 6090 - 0412 935 897 Fax: (03) 8338 0299 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel
Ian Campbell
2012-Oct-15 07:52 UTC
Re: [PATCH] libfsimage: add ext4 support for CentOS 5.x / Xen 4.2.1 backport
On Sun, 2012-10-14 at 12:10 +0100, Pasi Kärkkäinen wrote:> On Fri, Sep 14, 2012 at 10:05:34AM +0100, Ian Campbell wrote: > > On Wed, 2012-09-05 at 13:03 +0100, Roger Pau Monne wrote: > > > CentOS 5.x forked e2fs ext4 support into a different package called > > > e4fs, and so headers and library names changed from ext2fs to ext4fs. > > > Check if ext4fs/ext2fs.h and -lext4fs work, and use that instead of > > > ext2fs to build libfsimage. This patch assumes that if the ext4fs > > > library is present it should always be used instead of ext2fs. > > > > > > This patch includes a rework of the ext2fs check, a new ext4fs check > > > and a minor modification in libfsimage to use the correct library. > > > > > > Signed-off-by: Roger Pau Monne <roger.pau@citrix.com> > > > --- > > > Please re-run autogen.sh after applying > > > > Done & acked + applied. Thanks. > > > > Hello, > > Now that this patch has been in xen-unstable for a while > I''d like to request Xen 4.2.1 backport..Ian Jackson deals with backports, not me. Ian.
Pasi Kärkkäinen
2012-Oct-15 13:12 UTC
Re: [PATCH] libfsimage: add ext4 support for CentOS 5.x / Xen 4.2.1 backport
On Mon, Oct 15, 2012 at 08:52:33AM +0100, Ian Campbell wrote:> On Sun, 2012-10-14 at 12:10 +0100, Pasi Kärkkäinen wrote: > > On Fri, Sep 14, 2012 at 10:05:34AM +0100, Ian Campbell wrote: > > > On Wed, 2012-09-05 at 13:03 +0100, Roger Pau Monne wrote: > > > > CentOS 5.x forked e2fs ext4 support into a different package called > > > > e4fs, and so headers and library names changed from ext2fs to ext4fs. > > > > Check if ext4fs/ext2fs.h and -lext4fs work, and use that instead of > > > > ext2fs to build libfsimage. This patch assumes that if the ext4fs > > > > library is present it should always be used instead of ext2fs. > > > > > > > > This patch includes a rework of the ext2fs check, a new ext4fs check > > > > and a minor modification in libfsimage to use the correct library. > > > > > > > > Signed-off-by: Roger Pau Monne <roger.pau@citrix.com> > > > > --- > > > > Please re-run autogen.sh after applying > > > > > > Done & acked + applied. Thanks. > > > > > > > Hello, > > > > Now that this patch has been in xen-unstable for a while > > I''d like to request Xen 4.2.1 backport.. > > Ian Jackson deals with backports, not me. >Added IanJ to CC list.. -- Pasi