summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoseph Jezak <josejx@gentoo.org>2012-05-02 06:09:57 +0000
committerJoseph Jezak <josejx@gentoo.org>2012-05-02 06:09:57 +0000
commit227765be76a5f03516758fa562c501b8cb67a50d (patch)
treeef65df2fb4b9f1daaa69931067b88f451a579ed4 /sys-boot/yaboot
parentx86 stable, see bug 413657. Thanks Mikle Kolyada. (diff)
downloadgentoo-2-227765be76a5f03516758fa562c501b8cb67a50d.tar.gz
gentoo-2-227765be76a5f03516758fa562c501b8cb67a50d.tar.bz2
gentoo-2-227765be76a5f03516758fa562c501b8cb67a50d.zip
Added stubbed function patch to fix building with e2fsprogs-1.42.
(Portage version: 2.1.10.57/cvs/Linux x86_64)
Diffstat (limited to 'sys-boot/yaboot')
-rw-r--r--sys-boot/yaboot/ChangeLog8
-rw-r--r--sys-boot/yaboot/files/yaboot-stubfuncs.patch158
-rw-r--r--sys-boot/yaboot/yaboot-1.3.17-r1.ebuild52
3 files changed, 217 insertions, 1 deletions
diff --git a/sys-boot/yaboot/ChangeLog b/sys-boot/yaboot/ChangeLog
index 8c1f839f9b86..21cab31e68cb 100644
--- a/sys-boot/yaboot/ChangeLog
+++ b/sys-boot/yaboot/ChangeLog
@@ -1,6 +1,12 @@
# ChangeLog for sys-boot/yaboot
# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-boot/yaboot/ChangeLog,v 1.38 2012/02/24 15:15:33 josejx Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-boot/yaboot/ChangeLog,v 1.39 2012/05/02 06:09:57 josejx Exp $
+
+*yaboot-1.3.17-r1 (02 May 2012)
+
+ 02 May 2012; Joseph Jezak <josejx@gentoo.org> +yaboot-1.3.17-r1.ebuild,
+ +files/yaboot-stubfuncs.patch:
+ Added stubbed function patch to fix building with e2fsprogs-1.42.
*yaboot-1.3.17 (24 Feb 2012)
diff --git a/sys-boot/yaboot/files/yaboot-stubfuncs.patch b/sys-boot/yaboot/files/yaboot-stubfuncs.patch
new file mode 100644
index 000000000000..b315cc684c7d
--- /dev/null
+++ b/sys-boot/yaboot/files/yaboot-stubfuncs.patch
@@ -0,0 +1,158 @@
+diff --git a/lib/malloc.c b/lib/malloc.c
+index 0121112..d077630 100644
+--- a/lib/malloc.c
++++ b/lib/malloc.c
+@@ -64,6 +64,17 @@ void *malloc (unsigned int size)
+ return caddr;
+ }
+
++/* Calloc wrapper for malloc */
++void *memset(void *s, int c, size_t n);
++void *calloc(size_t nmemb, size_t size) {
++ void *caddr;
++ caddr = malloc(nmemb * size);
++ memset(caddr, 0, nmemb * size);
++ return caddr;
++}
++
++
++
+ /* 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)
+diff --git a/lib/nonstd.c b/lib/nonstd.c
+index 5aeb0cb..0a13246 100644
+--- a/lib/nonstd.c
++++ b/lib/nonstd.c
+@@ -65,3 +65,131 @@ char *getenv(const char *name)
+ {
+ return NULL;
+ }
++
++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);
++}
++
++int __open64_2 (__const char *__path, int __oflag) {
++ return (int) prom_open((char *)__path);
++}
++
++int __xstat64 (int __ver, const char *__filename, struct stat64 *__stat_buf) {
++ return 0;
++}
++
++int __fxstat64 (int __ver, int __filedesc, struct stat64 *__stat_buf) {
++ return 0;
++}
++
++int read(int fd, void *buf, size_t count) {
++ return prom_read((void *)fd, buf, count);
++}
++
++int close(int fd) {
++ prom_close((void *)fd);
++ return 0;
++}
++
++void exit(int status) {
++ prom_exit();
++}
++
++int __printf_chk(int flag, const char *format, ...) {
++ va_list ap;
++ va_start (ap, format);
++ prom_vfprintf (prom_stdout, format, ap);
++ va_end (ap);
++
++ return 0;
++}
++
++int __sprintf_chk(char * str, int flag, size_t strlen, const char * format, ...) {
++ va_list ap;
++ va_start(ap, format);
++ // No sprintf? :(
++ va_end(ap);
++ return 0;
++
++}
++
++int __fprintf_chk(FILE *stream, int flag, const char *format, ...) {
++ va_list ap;
++ va_start (ap, format);
++ prom_vfprintf (prom_stdout, format, ap);
++ va_end (ap);
++
++ return 0;
++}
++
++void *memcpy(void *dest, const void *src, size_t n);
++void *__memcpy_chk(void *dest, const void *src, size_t n, size_t destlen) {
++ return memcpy(dest, src, n);
++}
++
++
++// Dummy functions
++signed int random(void) {
++ return 0;
++}
++
++void srandom(unsigned int seed) {
++ return;
++}
++
++unsigned int sleep(unsigned int seconds) {
++ return 0;
++}
++
++int gettimeofday(void *tv, void *tz) {
++ return 0;
++}
++
++long sysconf(int name) {
++ return 0;
++}
++
++int getpagesize(void) {
++ return 0;
++}
++
++int gethostname(char *name, size_t len) {
++ return 0;
++}
++
++int getpid(void) {
++ return 0;
++}
++
++int getuid(void) {
++ return 0;
++}
++
++void qsort(void *base, size_t nmemb, size_t size, int(*compar)(const void *, const void *)) {
++ return;
++}
++
++int * __errno_location(void) {
++ 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);
++}
++
++// Stubbed ...
++size_t fwrite(const void *ptr, size_t size, size_t nmemb, void *stream) {
++ return 0;
++}
++
++
++int stderr = 0;
++int perror = 0;
diff --git a/sys-boot/yaboot/yaboot-1.3.17-r1.ebuild b/sys-boot/yaboot/yaboot-1.3.17-r1.ebuild
new file mode 100644
index 000000000000..2a874563bc9c
--- /dev/null
+++ b/sys-boot/yaboot/yaboot-1.3.17-r1.ebuild
@@ -0,0 +1,52 @@
+# Copyright 1999-2012 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-r1.ebuild,v 1.1 2012/05/02 06:09:57 josejx Exp $
+
+inherit eutils toolchain-funcs
+
+DESCRIPTION="PPC Bootloader"
+SRC_URI="http://yaboot.ozlabs.org/releases/${P}.tar.gz"
+HOMEPAGE="http://yaboot.ozlabs.org"
+SLOT="0"
+LICENSE="GPL-2"
+KEYWORDS="-* ~ppc -ppc64"
+IUSE="ibm"
+
+DEPEND="sys-apps/powerpc-utils"
+RDEPEND="!ibm? ( sys-fs/hfsutils
+ sys-fs/hfsplusutils
+ sys-fs/mac-fdisk )"
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+ cp "${FILESDIR}/new-ofpath" "${S}/ybin/ofpath"
+
+ # dual boot patch
+ epatch "${FILESDIR}/yabootconfig-1.3.13.patch"
+ epatch "${FILESDIR}/chrpfix.patch"
+ if [[ "$(gcc-major-version)" -eq "3" ]]; then
+ epatch "${FILESDIR}/${PN}-nopiessp.patch"
+ fi
+ if [[ "$(gcc-major-version)" -eq "4" ]]; then
+ epatch "${FILESDIR}/${P}-nopiessp-gcc4.patch"
+ fi
+
+ # Error only on real errors, for prom printing format compile failure
+ sed -i "s:-Werror:-Wno-error:g" Makefile
+
+ epatch "${FILESDIR}/${PN}-stubfuncs.patch"
+}
+
+src_compile() {
+ export -n CFLAGS
+ export -n CXXFLAGS
+ [ -n "$(tc-getCC)" ] || CC="gcc"
+ emake PREFIX=/usr MANDIR=share/man CC="$(tc-getCC)" || die
+}
+
+src_install() {
+ sed -i -e 's/\/local//' etc/yaboot.conf
+ make ROOT="${D}" PREFIX=/usr MANDIR=share/man install || die
+ mv "${D}/etc/yaboot.conf" "${D}/etc/yaboot.conf.sample"
+}