From: Jeremy Katz Subject: [PATCH] reenable pygrub build Date: Fri, 07 Oct 2005 13:26:56 -0400 Message-ID: <1128706017.8393.8.camel@bree.local.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-L0VYoGBuEg8vWkZid9YU" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org --=-L0VYoGBuEg8vWkZid9YU Content-Type: text/plain Content-Transfer-Encoding: 7bit The attached re-enables the pygrub build and fixes the build with older e2fsprogs (tested on RHEL4 with e2fsprogs-1.35 and rawhide with e2fsprogs-1.38) Signed-off-by: Jeremy Katz Jeremy --=-L0VYoGBuEg8vWkZid9YU Content-Disposition: attachment; filename=xen-pygrub-reenable.patch Content-Type: text/x-patch; name=xen-pygrub-reenable.patch; charset=UTF-8 Content-Transfer-Encoding: 7bit diff -r 4b9c9b85b3a5 tools/Makefile --- a/tools/Makefile Fri Oct 7 14:49:33 2005 +++ b/tools/Makefile Fri Oct 7 13:21:37 2005 @@ -22,7 +22,7 @@ # These don't cross-compile ifeq ($(XEN_COMPILE_ARCH),$(XEN_TARGET_ARCH)) SUBDIRS += python -#SUBDIRS += pygrub +SUBDIRS += pygrub endif .PHONY: all install clean check check_clean ioemu eioemuinstall ioemuclean diff -r 4b9c9b85b3a5 tools/pygrub/Makefile --- a/tools/pygrub/Makefile Fri Oct 7 14:49:33 2005 +++ b/tools/pygrub/Makefile Fri Oct 7 13:21:37 2005 @@ -15,4 +15,4 @@ endif clean: - rm -rf build *.pyc *.pyo *.o *.a *~ + rm -rf build tmp *.pyc *.pyo *.o *.a *~ diff -r 4b9c9b85b3a5 tools/pygrub/setup.py --- a/tools/pygrub/setup.py Fri Oct 7 14:49:33 2005 +++ b/tools/pygrub/setup.py Fri Oct 7 13:21:37 2005 @@ -1,5 +1,8 @@ from distutils.core import setup, Extension +from distutils.ccompiler import new_compiler import os +import sys +import time extra_compile_args = [ "-fno-strict-aliasing", "-Wall", "-Werror" ] @@ -7,9 +10,20 @@ fsys_pkgs = [] if os.path.exists("/usr/include/ext2fs/ext2_fs.h"): + ext2defines = [] + cc = new_compiler() + cc.add_library("ext2fs") + if cc.has_function("ext2fs_open2"): + ext2defines.append( ("HAVE_EXT2FS_OPEN2", None) ) + else: + sys.stderr.write("WARNING: older version of e2fsprogs installed, not building full\n") + sys.stderr.write(" disk support for ext2.\n") + time.sleep(2) + ext2 = Extension("grub.fsys.ext2._pyext2", extra_compile_args = extra_compile_args, libraries = ["ext2fs"], + define_macros = ext2defines, sources = ["src/fsys/ext2/ext2module.c"]) fsys_mods.append(ext2) fsys_pkgs.append("grub.fsys.ext2") diff -r 4b9c9b85b3a5 tools/pygrub/src/fsys/ext2/ext2module.c --- a/tools/pygrub/src/fsys/ext2/ext2module.c Fri Oct 7 14:49:33 2005 +++ b/tools/pygrub/src/fsys/ext2/ext2module.c Fri Oct 7 13:21:37 2005 @@ -229,8 +229,13 @@ snprintf(offsetopt, 29, "offset=%d", offset); } +#ifdef HAVE_EXT2FS_OPEN2 err = ext2fs_open2(name, offsetopt, flags, superblock, block_size, unix_io_manager, &efs); +#else + err = ext2fs_open(name, flags, superblock, block_size, + unix_io_manager, &efs); +#endif if (err) { PyErr_SetString(PyExc_ValueError, "unable to open file"); return NULL; --=-L0VYoGBuEg8vWkZid9YU 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.xensource.com http://lists.xensource.com/xen-devel --=-L0VYoGBuEg8vWkZid9YU--