summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2015-05-17 05:02:02 +0000
committerMike Frysinger <vapier@gentoo.org>2015-05-17 05:02:02 +0000
commitc79cc648e6fc85e106ea7155f45506130d17ff74 (patch)
tree240952f51b1cb868ffb8cf66d282037a07d1892a /sys-boot
parentrm old -1.4.13, add comment re failure of test under pypy (diff)
downloadgentoo-2-c79cc648e6fc85e106ea7155f45506130d17ff74.tar.gz
gentoo-2-c79cc648e6fc85e106ea7155f45506130d17ff74.tar.bz2
gentoo-2-c79cc648e6fc85e106ea7155f45506130d17ff74.zip
Add pread/pwrite stubs that newer ext2 libs use #527974 by Agostino Sarubbo.
(Portage version: 2.2.19/cvs/Linux x86_64, signed Manifest commit with key D2E96200)
Diffstat (limited to 'sys-boot')
-rw-r--r--sys-boot/yaboot/ChangeLog6
-rw-r--r--sys-boot/yaboot/files/yaboot-stubfuncs.patch61
-rw-r--r--sys-boot/yaboot/yaboot-1.3.17-r2.ebuild9
3 files changed, 52 insertions, 24 deletions
diff --git a/sys-boot/yaboot/ChangeLog b/sys-boot/yaboot/ChangeLog
index 5ade98f6d90d..fc582d76f7ab 100644
--- a/sys-boot/yaboot/ChangeLog
+++ b/sys-boot/yaboot/ChangeLog
@@ -1,6 +1,10 @@
# ChangeLog for sys-boot/yaboot
# Copyright 1999-2015 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-boot/yaboot/ChangeLog,v 1.52 2015/05/17 04:33:12 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-boot/yaboot/ChangeLog,v 1.53 2015/05/17 05:02:02 vapier Exp $
+
+ 17 May 2015; Mike Frysinger <vapier@gentoo.org> files/yaboot-stubfuncs.patch,
+ yaboot-1.3.17-r2.ebuild:
+ Add pread/pwrite stubs that newer ext2 libs use #527974 by Agostino Sarubbo.
17 May 2015; Mike Frysinger <vapier@gentoo.org>
files/yaboot-1.3.17-nopiessp-gcc4.patch, files/yaboot-nopiessp-gcc4.patch:
diff --git a/sys-boot/yaboot/files/yaboot-stubfuncs.patch b/sys-boot/yaboot/files/yaboot-stubfuncs.patch
index 55724c3edda2..6b1d5218251f 100644
--- a/sys-boot/yaboot/files/yaboot-stubfuncs.patch
+++ b/sys-boot/yaboot/files/yaboot-stubfuncs.patch
@@ -1,3 +1,5 @@
+Stub out some functions that are not provided (and unneeded)
+
--- lib/malloc.c
+++ lib/malloc.c
@@ -64,6 +64,15 @@ void *malloc (unsigned int size)
@@ -16,32 +18,41 @@
/* Do not fall back to the malloc above as posix_memalign is needed by
* external libraries not yaboot */
int posix_memalign(void **memptr, size_t alignment, size_t size)
---- lib/nonstd.c 2012-06-20 09:38:54.000000000 -0400
-+++ lib/nonstd.c 2012-06-20 09:38:57.000000000 -0400
-@@ -65,3 +65,178 @@
+--- lib/nonstd.c
++++ lib/nonstd.c
+@@ -65,3 +65,203 @@
{
return NULL;
}
+
-+// I tried to use prom functions for these...
++int lseek(int fd, int offset, int whence) {
++ // XXX: This whence addition seems wrong ..
++ return prom_lseek((void *)fd, whence + offset);
++}
++
++int lseek64(int fd, int64_t offset, int whence) {
++ return lseek(fd, offset, whence);
++}
++
+int open(const char *pathname, int flags) {
+ return (int) prom_open((char *)pathname);
+}
+
+int open64(const char *pathname, int flags) {
-+ return (int) prom_open((char *)pathname);
++ return open(pathname, flags);
+}
+
-+int __open64_2 (__const char *__path, int __oflag) {
-+ return (int) prom_open((char *)__path);
++// Internal glibc fortify calls.
++int __open64_2(const char *path, int flags) {
++ return open64(path, flags);
+}
+
+int read(int fd, void *buf, size_t count) {
+ return prom_read((void *)fd, buf, count);
+}
+
-+int write(int fd, void *buf, size_t count) {
-+ return prom_write((void *)fd, buf, count);
++int write(int fd, const void *buf, size_t count) {
++ return prom_write((void *)fd, (void *)buf, count);
+}
+
+int close(int fd) {
@@ -49,6 +60,30 @@
+ return 0;
+}
+
++int pread(int fd, void *buf, size_t count, int32_t offset) {
++ int curr = lseek(fd, 0, 0 /*SEEK_CUR*/);
++ lseek(fd, offset, 0 /*SEEK_SET*/);
++ int ret = read(fd, buf, count);
++ lseek(fd, curr, 0 /*SEEK_SET*/);
++ return ret;
++}
++
++int pread64(int fd, void *buf, int64_t count, int64_t offset) {
++ return pread(fd, buf, count, offset);
++}
++
++int pwrite(int fd, const void *buf, size_t count, int32_t offset) {
++ int curr = lseek(fd, 0, 0 /*SEEK_CUR*/);
++ lseek(fd, offset, 0 /*SEEK_SET*/);
++ int ret = write(fd, buf, count);
++ lseek(fd, curr, 0 /*SEEK_SET*/);
++ return ret;
++}
++
++int pwrite64(int fd, const void *buf, int64_t count, int64_t offset) {
++ return pwrite(fd, buf, count, offset);
++}
++
+// No fsync, just assume we've sync'd
+int fsync(int fd) {
+ return 0;
@@ -159,14 +194,6 @@
+ return 0;
+}
+
-+int lseek(int fd, int offset, int whence) {
-+ return prom_lseek ((void *)fd, whence + offset);
-+}
-+
-+int lseek64(int fd, int offset, int whence) {
-+ return prom_lseek ((void *)fd, whence + offset);
-+}
-+
+size_t fwrite(const void *ptr, size_t size, size_t nmemb, void *stream) {
+ return 0;
+}
diff --git a/sys-boot/yaboot/yaboot-1.3.17-r2.ebuild b/sys-boot/yaboot/yaboot-1.3.17-r2.ebuild
index ad93a575bbc7..224b23f67270 100644
--- a/sys-boot/yaboot/yaboot-1.3.17-r2.ebuild
+++ b/sys-boot/yaboot/yaboot-1.3.17-r2.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-boot/yaboot/yaboot-1.3.17-r2.ebuild,v 1.8 2015/05/17 04:27:34 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-boot/yaboot/yaboot-1.3.17-r2.ebuild,v 1.9 2015/05/17 05:02:02 vapier Exp $
EAPI="5"
@@ -32,19 +32,16 @@ src_unpack() {
src_prepare() {
# No need to hardcode this path -- the compiler already knows to use it.
+ # Error only on real errors, for prom printing format compile failure.
sed -i \
-e 's:-I/usr/include::' \
+ -e 's:-Werror:-Wno-error:g' \
Makefile || die
# dual boot patch
epatch "${FILESDIR}/yabootconfig-1.3.13.patch"
epatch "${FILESDIR}/chrpfix.patch"
epatch "${FILESDIR}/${P}-nopiessp-gcc4.patch"
-
- # Error only on real errors, for prom printing format compile failure
- sed -i "s:-Werror:-Wno-error:g" Makefile
-
- # Stub out some functions that are not provided (and unneeded)
epatch "${FILESDIR}/${PN}-stubfuncs.patch"
# Fix the devspec path on newer kernels