From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from smtprelay05.ispgateway.de ([80.67.31.98]) by metis.ext.pengutronix.de with esmtp (Exim 4.72) (envelope-from ) id 1Rnx7c-000854-UB for ptxdist@pengutronix.de; Thu, 19 Jan 2012 19:54:06 +0100 Received: from [88.217.119.226] (helo=galilei.fritz.box) by smtprelay05.ispgateway.de with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.68) (envelope-from ) id 1Rnx7c-0006TV-GB for ptxdist@pengutronix.de; Thu, 19 Jan 2012 19:54:04 +0100 From: Bernhard Walle Date: Thu, 19 Jan 2012 19:54:03 +0100 Message-Id: <1326999243-10642-1-git-send-email-bernhard@bwalle.de> Subject: [ptxdist] [PATCH] host-e2fsprogs: Fix build on Darwin Reply-To: ptxdist@pengutronix.de List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: ptxdist-bounces@pengutronix.de Errors-To: ptxdist-bounces@pengutronix.de To: ptxdist@pengutronix.de The O_DIRECT flag in e2fsprogs is relatively new. MacPorts is still using the old version of e2fsprogs. However, this patch from the upstream bug tracker fixes the build of e2fsprogs. Strictly direct I/O is not required for ptxdist because we're working on images only. So removing O_DIRECT here would also work, but this solution is cleaner. Signed-off-by: Bernhard Walle --- .../0003-darwin_directio_fix.patch | 46 ++++++++++++++++++++ patches/e2fsprogs-1.41.14/series | 1 + 2 files changed, 47 insertions(+), 0 deletions(-) create mode 100644 patches/e2fsprogs-1.41.14/0003-darwin_directio_fix.patch diff --git a/patches/e2fsprogs-1.41.14/0003-darwin_directio_fix.patch b/patches/e2fsprogs-1.41.14/0003-darwin_directio_fix.patch new file mode 100644 index 0000000..1e00c04 --- /dev/null +++ b/patches/e2fsprogs-1.41.14/0003-darwin_directio_fix.patch @@ -0,0 +1,46 @@ +Fix compilation on Darwin + +The patch is from upstream bug tracker [1]. However, it's not (yet) in the +upstream repository. + +[1] http://sourceforge.net/tracker/?func=detail&aid=3140289&group_id=2406&atid=102406 +--- + lib/ext2fs/unix_io.c | 12 ++++++++++++ + 1 file changed, 12 insertions(+) + +--- a/lib/ext2fs/unix_io.c ++++ b/lib/ext2fs/unix_io.c +@@ -428,6 +428,7 @@ static errcode_t unix_open(const char *n + struct unix_private_data *data = NULL; + errcode_t retval; + int open_flags; ++ int f_nocache = 0; + struct stat st; + #ifdef __linux__ + struct utsname ut; +@@ -464,7 +465,11 @@ static errcode_t unix_open(const char *n + if (flags & IO_FLAG_EXCLUSIVE) + open_flags |= O_EXCL; + if (flags & IO_FLAG_DIRECT_IO) ++#if !defined(O_DIRECT) && defined(F_NOCACHE) ++ f_nocache = F_NOCACHE; ++#else + open_flags |= O_DIRECT; ++#endif + data->flags = flags; + + #ifdef HAVE_OPEN64 +@@ -477,6 +482,13 @@ static errcode_t unix_open(const char *n + goto cleanup; + } + ++ if (f_nocache) { ++ if (fcntl(data->dev, f_nocache, 1) < 0) { ++ retval = errno; ++ goto cleanup; ++ } ++ } ++ + #ifdef BLKSSZGET + if (flags & IO_FLAG_DIRECT_IO) { + if (ioctl(data->dev, BLKSSZGET, &data->align) != 0) diff --git a/patches/e2fsprogs-1.41.14/series b/patches/e2fsprogs-1.41.14/series index fac473a..26e2c33 100644 --- a/patches/e2fsprogs-1.41.14/series +++ b/patches/e2fsprogs-1.41.14/series @@ -3,3 +3,4 @@ 0001-Fixed-bitops.h-for-Coldfire-V4E.patch 0002-fix-linking-problem.patch # ec0cc8b8677eb72a286f38e0e9ba63e9 - git-ptx-patches magic +0003-darwin_directio_fix.patch -- 1.7.7.4 -- ptxdist mailing list ptxdist@pengutronix.de