aboutsummaryrefslogtreecommitdiffstats
path: root/meta/recipes-bsp/grub/files/0001-Remove-direct-_llseek-code-and-require-long-filesyst.patch
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2016-01-12 23:43:13 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-01-29 18:14:51 +0000
commita290429c8415042cb8c2f4258e76a3cc6815a172 (patch)
treea4c6c3bf5ca1f45679d97d7f47b854e97899f390 /meta/recipes-bsp/grub/files/0001-Remove-direct-_llseek-code-and-require-long-filesyst.patch
parentaeee86050019caae5da3af8d31cf57bc811c5e80 (diff)
downloadopenembedded-core-a290429c8415042cb8c2f4258e76a3cc6815a172.tar.gz
grub: Backport fix for largefile detection/use
This is inspired by musl porting, where grub's configure is enabling largefile support based on glibc versions, instead an upstream patch turns it into autoconf check Update git version recipe arm platforms use this recipe to provide grub and it needed fixes from upstream so upgrade to latest tip of git and forward port patches as well as drop the ones already applied upstream Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta/recipes-bsp/grub/files/0001-Remove-direct-_llseek-code-and-require-long-filesyst.patch')
-rw-r--r--meta/recipes-bsp/grub/files/0001-Remove-direct-_llseek-code-and-require-long-filesyst.patch81
1 files changed, 81 insertions, 0 deletions
diff --git a/meta/recipes-bsp/grub/files/0001-Remove-direct-_llseek-code-and-require-long-filesyst.patch b/meta/recipes-bsp/grub/files/0001-Remove-direct-_llseek-code-and-require-long-filesyst.patch
new file mode 100644
index 0000000000..9eabce977b
--- /dev/null
+++ b/meta/recipes-bsp/grub/files/0001-Remove-direct-_llseek-code-and-require-long-filesyst.patch
@@ -0,0 +1,81 @@
+From 3bac4caa2bc64db313aaee54fffb90383e118517 Mon Sep 17 00:00:00 2001
+From: Felix Janda <felix.janda@posteo.de>
+Date: Thu, 22 Jan 2015 19:54:36 +0100
+Subject: [PATCH] Remove direct _llseek code and require long filesystem libc.
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Backport
+ configure.ac | 8 ++++++++
+ grub-core/osdep/unix/hostdisk.c | 24 ------------------------
+ 4 files changed, 13 insertions(+), 24 deletions(-)
+
+Index: grub-2.00/configure.ac
+===================================================================
+--- grub-2.00.orig/configure.ac
++++ grub-2.00/configure.ac
+@@ -306,6 +306,14 @@ if test x$grub_cv_apple_cc = xyes ; then
+ HOST_LDFLAGS="$HOST_LDFLAGS -Wl,-allow_stack_execute"
+ fi
+
++case "$host_os" in
++ cygwin | windows* | mingw32* | aros*)
++ ;;
++ *)
++ AC_CHECK_SIZEOF(off_t)
++ test x"$ac_cv_sizeof_off_t" = x8 || AC_MSG_ERROR([Large file support is required]);;
++esac
++
+ if test x$USE_NLS = xno; then
+ HOST_CFLAGS="$HOST_CFLAGS -fno-builtin-gettext"
+ fi
+Index: grub-2.00/grub-core/kern/emu/hostdisk.c
+===================================================================
+--- grub-2.00.orig/grub-core/kern/emu/hostdisk.c
++++ grub-2.00/grub-core/kern/emu/hostdisk.c
+@@ -44,11 +44,6 @@
+ #ifdef __linux__
+ # include <sys/ioctl.h> /* ioctl */
+ # include <sys/mount.h>
+-# if !defined(__GLIBC__) || \
+- ((__GLIBC__ < 2) || ((__GLIBC__ == 2) && (__GLIBC_MINOR__ < 1)))
+-/* Maybe libc doesn't have large file support. */
+-# include <linux/unistd.h> /* _llseek */
+-# endif /* (GLIBC < 2) || ((__GLIBC__ == 2) && (__GLIBC_MINOR < 1)) */
+ # ifndef BLKFLSBUF
+ # define BLKFLSBUF _IO (0x12,97) /* flush buffer cache */
+ # endif /* ! BLKFLSBUF */
+@@ -761,25 +756,6 @@ linux_find_partition (char *dev, grub_di
+ }
+ #endif /* __linux__ */
+
+-#if defined(__linux__) && (!defined(__GLIBC__) || \
+- ((__GLIBC__ < 2) || ((__GLIBC__ == 2) && (__GLIBC_MINOR__ < 1))))
+- /* Maybe libc doesn't have large file support. */
+-grub_err_t
+-grub_util_fd_seek (int fd, const char *name, grub_uint64_t off)
+-{
+- loff_t offset, result;
+- static int _llseek (uint filedes, ulong hi, ulong lo,
+- loff_t *res, uint wh);
+- _syscall5 (int, _llseek, uint, filedes, ulong, hi, ulong, lo,
+- loff_t *, res, uint, wh);
+-
+- offset = (loff_t) off;
+- if (_llseek (fd, offset >> 32, offset & 0xffffffff, &result, SEEK_SET))
+- return grub_error (GRUB_ERR_BAD_DEVICE, N_("cannot seek `%s': %s"),
+- name, strerror (errno));
+- return GRUB_ERR_NONE;
+-}
+-#else
+ grub_err_t
+ grub_util_fd_seek (int fd, const char *name, grub_uint64_t off)
+ {
+@@ -790,7 +766,6 @@ grub_util_fd_seek (int fd, const char *n
+ name, strerror (errno));
+ return 0;
+ }
+-#endif
+
+ static void
+ flush_initial_buffer (const char *os_dev __attribute__ ((unused)))