summaryrefslogtreecommitdiff
path: root/sys-boot/yaboot
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /sys-boot/yaboot
reinit the tree, so we can have metadata
Diffstat (limited to 'sys-boot/yaboot')
-rw-r--r--sys-boot/yaboot/Manifest18
-rw-r--r--sys-boot/yaboot/files/chrpfix.patch23
-rw-r--r--sys-boot/yaboot/files/new-ofpath143
-rw-r--r--sys-boot/yaboot/files/new-ofpath-devspec.patch28
-rw-r--r--sys-boot/yaboot/files/sysfs-ofpath.patch105
-rw-r--r--sys-boot/yaboot/files/yaboot-1.3.16-memalign.patch41
-rw-r--r--sys-boot/yaboot/files/yaboot-1.3.17-nopiessp-gcc4.patch38
-rw-r--r--sys-boot/yaboot/files/yaboot-nopiessp-gcc4.patch38
-rw-r--r--sys-boot/yaboot/files/yaboot-stubfuncs.patch231
-rw-r--r--sys-boot/yaboot/files/yabootconfig-1.3.13.patch42
-rw-r--r--sys-boot/yaboot/metadata.xml8
-rw-r--r--sys-boot/yaboot/yaboot-1.3.14-r2.ebuild47
-rw-r--r--sys-boot/yaboot/yaboot-1.3.16.ebuild56
-rw-r--r--sys-boot/yaboot/yaboot-1.3.17-r2.ebuild59
14 files changed, 877 insertions, 0 deletions
diff --git a/sys-boot/yaboot/Manifest b/sys-boot/yaboot/Manifest
new file mode 100644
index 000000000000..d93bfde5cd43
--- /dev/null
+++ b/sys-boot/yaboot/Manifest
@@ -0,0 +1,18 @@
+AUX chrpfix.patch 979 SHA256 cbd5d5e1df0111619b58975d8605d36ce30767a129dd9de53fc302d750e03045 SHA512 e9be3e0a49b24c6b3879f45b29a14e186df95ebcfb2f4960b38c96c341de5123bc0bb8d42ed6ccab9a0bfb6632d1a5424b2167b4c6b566ee2a914a6594b80510 WHIRLPOOL 22168cd2916be096504c5c3b0a8833e4f98180caebfa834985e90f727dbcb384e34388b0dda9836f66de5a1be525319c6f0eb8faf105663b5c3682f3b3ea9043
+AUX new-ofpath 4319 SHA256 7a20474bdb92f0f99b1142c45583883932807bcb3534cdc14c1238a438152dcc SHA512 8095d1e085a38d3c058e750acabaaf58464117f1af03fcc4604e86c58cd305e138b340420d3f1a5da5e3752dea59cc823599a6cc7a585195011f0030f1b80787 WHIRLPOOL 4599f740b20bb45afde6088a5c89052d31b5d671f8ce3a36182dd37b3d3f806e2edf3f7922ba1881f4fb8a04887f26c690f04b8ebd4d85b087433e8d3ca65732
+AUX new-ofpath-devspec.patch 936 SHA256 dc01e8fbfcd90a6361ee77c7d8e21a8f94e415155c2101dbd0d381bee1559e5b SHA512 4848ebb10a3879224a5748741ed7134c3ae54f7425b786eae7ab6a9f13bdc893c70c15c2e1986a4a2d1f3f26fdc20c0da92c81c9f47e42c061670963d5cb82f0 WHIRLPOOL 367370688c1f79e00879c4fcd36c959c4487a24736a5533276615752e1c34b198ebda187fd2f90bbb852eee789cde9314f2f7c43b12cf1071b82bbf0ceddfaa5
+AUX sysfs-ofpath.patch 3432 SHA256 a00601f12a361f19ec6ab7ef38c65b1f424624d65f80e30d9591618dc22a1f0e SHA512 e99946565708581ac0c606b4490f129eb7fd3687ef30350c4fd5a184a296cf8803d9ea4429a8c00011e7a491040ac2369185bd56cc327437755ce533e4749e38 WHIRLPOOL 08620422b67f26bbe79b755d026c2b3c07d88ed46c677981b136ffc077e1ce656b675bbc804ef033d107cabc7c8a9085153338664229a1c4b5de78714078382e
+AUX yaboot-1.3.16-memalign.patch 889 SHA256 babf5a43e40197a234cb4c637e8f542b89c26ab801175f1977aaf05882d8592f SHA512 d80c9c9d8592f33d39b900c86dbda3a13ec23f8d6b1a6d9612ba59b6c38218b9e41b9f3a3aa01bd39c8b91ae01d7ea4693ae93b0e7cf9c0912f7243e1364820c WHIRLPOOL 94606fabdbcb854141642e2bb7c6a5b7d0a571dedc489b22b3de658bd2c3e74118cdfbb44f100faaacb48b34b7162fd4313e8f66d3b389efff317b1f93b693ac
+AUX yaboot-1.3.17-nopiessp-gcc4.patch 1229 SHA256 0c00ec6c191723d2bd5621ee193ab4b0483cb3bb2443d7ac4b7f8ba859952917 SHA512 32e41b33a1e7109ec0a7ba9ca97ff0d45144d9499aa7657bc93a8007c6c6fa8206a6b406729cbb27407c84ef004b4cdb85e4664d9a4666cbde7700e7b3e82231 WHIRLPOOL cb1f12289c4217b01b6810b5ba21b44a57f450eb734b3af37293b0668934f1973261cd7aee73d2c3cbd2f62319cd7c43acd63878a15333085c04a43191d19f65
+AUX yaboot-nopiessp-gcc4.patch 1355 SHA256 b877f5e21ca658fbfe23ecf7c0053c0db585df72c18348e8aeb249048353bb0e SHA512 413b2353735d82a81e2831d1e51a995096eadfb3c17feb51b6b75035057557ed8c9adebd58fa1635fcaae36fd25c1783e491b85b4437dfb73e1569cf48a51359 WHIRLPOOL 14b8531069c1af0eb19291f0425544254ca3737df8eb74fa79d7beba83b4045fad6f0451de20b8424e7b6e9a457289a9674ca348d3d95ae593425ac9d21ff80c
+AUX yaboot-stubfuncs.patch 4602 SHA256 bd9ec796349c5711cd832b848b7f615bbfbe53e2f1775a32289eab343ef423e9 SHA512 599b0c0e1b1907ace9e0d449bddd934cf1d96364ff446e1cbbe5e743f46b44412a38b169f896a0a6fa51c19652b751089643331196ae66f0314bedc689ef04b8 WHIRLPOOL 9de4aa95b9ebb0eb1f352cde359620ae3bc57143f709f84c63b33bbc21e479151c7d3f83c2a90b8c928a2fa67f6ca26830d7854cffead7f320dcc3a30fd646d1
+AUX yabootconfig-1.3.13.patch 1655 SHA256 ee662c068ba7800d1d0c85a927f3990658cc488ebd3672e40740b7473ba3bb20 SHA512 0efcae987f7cc9b93a86bbcbe1e74b3ee6228b0db3937adea1f6c8b2e48c58cab35db80209ae6e79ff3e9f992c374b65a7786adf46787c0bbe400270ae006e98 WHIRLPOOL 28fb906a0de9bab0d383de289d25ab5be5941c1be51d2348f2c4bd12ee7c6259785eb948b5239be5d19a0c32c3962f05cfa7bad52fad1b889dfa09ea2633f5cd
+DIST yaboot-1.3.14.tar.gz 219089 SHA256 b1b0ddc798e332dc03065bac871b05f700b6f8383951a05dee68a7438f644933 SHA512 7542073159a15787e27fd8246fe4c84c48cec5cc6fe76be06f4591bb9ca459ad0c81f0085f08d944745a186da005a5ace0d3d0b2598711ca3309fad1c5a00e74 WHIRLPOOL 5eb364684b5628ea241719f2ac8c18ef2ee3daa7355da91fc69992187c01b1decce95144eb0d7cbd3a481124a3ff81880261b8e5e5aedf6f87499c3c3c95940c
+DIST yaboot-1.3.16.tar.gz 220360 SHA256 16635d5ed0298d46e26e1da8f7a793e185ddb796e3e567554869676650a44650 SHA512 9cd98335c8b32787567253e628549fe88af5ebe4b81fb6b99741fbbcc0ae3b44dc4fdad527ed27da00103bc0482d9a33d3f128f542884387f5aa754546624e14 WHIRLPOOL 5cd42ff0c041135c53cdd852ca227aba75e154cd557fdc6a740218982f5033da6f4428bda5934b6227dd726f31d2d97e2c37d3706076ecad77969678fe7c8eb4
+DIST yaboot-1.3.17.tar.gz 224325 SHA256 2fb738d8fd48b94ab2534a4fdf63738ad02c1a30f4b2add91f837baff8fa2aa1 SHA512 da910c4c6ca2de817342bf4dbcefe2857606043e614782581a86bae206cf6cfe5597ad47aea15369feb60e02d8a4f9f4aa3b12863d715c757584c1f4d7ffb9de WHIRLPOOL 8440faadd955aae0484a2d05c4b712d40b9f438224bbf26b2cf9e178944a007aeac779ae7a9ef2431f2404b24440930d34a63b36f46d8c58d4b7ce98af5c92bc
+EBUILD yaboot-1.3.14-r2.ebuild 1090 SHA256 506f35782a5c1cf30cfd0856289a087528d6abe9f4c108870eb718ae6064e608 SHA512 e400c540823a82924328d46385fcc5aac8b72aa29e7a0f85daf8d9ba7a87461300cc95acb9c01547c0209b4274e28447772e84aa94df18d53108da303eb9b4e3 WHIRLPOOL 0ce4155e4aa8ba5c925fbb45473975aa93b28a1d2d0b9cd1721b86a06346262bd9d83553acd3f459d04db872fced6a5ace78656b9d451f38c9940b5aacf80852
+EBUILD yaboot-1.3.16.ebuild 1258 SHA256 b312c265fbbcbfeb99e691db9dfbb89e48ad1909fc4741d23e1e51267c64b5dc SHA512 447724cc4ad94e30c9cfa1520f599edce8363b127d244ac98c9680089af9a598f330fc33f954adafd764527e5b4bbfb85fcdcdf9ae192c941ab2b039d907a770 WHIRLPOOL 1e6a77d6d62d62d4019482e7198e8756b4c5bc2ac4e22a8a175f59cf3b4165b7d61812b1042dd652f2daf58749d65fcdc3824741ec7898ff0628ee0d3c3fc75e
+EBUILD yaboot-1.3.17-r2.ebuild 1422 SHA256 6c8bca5c6fe45e259102b6dfb68e11bf68793a4ff8da8c1d44f8891a2b86a07a SHA512 06714ef51cb0a8597a8fd548a53c0c50390e9e6b89eec2bcc307cbb3d2fe88c1c6af98e07cee325d6b84e30aa6a53c5fd4c4d9a4588c7ce9814ee018d1c09c58 WHIRLPOOL d762b95bf8204e4d51fc5d63efbcda8c923399a4c5bed710bf1631b70f715322fa122ca55f80f8e7fdb42d44652907ede1c558abe8f09ae5608cac8d9814e118
+MISC ChangeLog 3049 SHA256 97a347d04bacac9f1315e3a221e94e7ff596c175d1ccf6db9de2587a6e68a4d2 SHA512 c586d0ced641b8b471fc26a06384eb1c772a34d5b9b8d5438ab14093b74caa6b4145a489378d5ae7b4696185db2cdbe16ce53c16461587cb3c83b3c7e82d8476 WHIRLPOOL 6ad66fdc00a6065b2ffe149308dece3669dc2c91f7f8ba99e173ef864dd2d319147a7bb5baf64b86f84f9f9d272fc4e2587883d9ab8d0c73774ee34eb1c05332
+MISC ChangeLog-2015 13000 SHA256 a08e401b4d758e61014357c25c5b75f2bb2193328b2a12073ffd9abf5805a661 SHA512 834ec93164092b8e4da6c349ac4b4c6e82b43dbd442553cc816f8cf143dddbdfcf9fdbcb47060a119586799895bd3677cb36ebfbdee614c4012f21e17ee4e940 WHIRLPOOL 2a52a985d0d7070970776fefd0d203135fb4a31feced94603b6032f8b20963d61454b0618e05898a88ddf638acc851aa1695d2d61dc60b6a85936fa79d4fc2fb
+MISC metadata.xml 259 SHA256 e7ac6b67c4c89040a00b23bda7a3b2fd4ac8affc1055daf3015ccc8580640f6f SHA512 ca71b1781806d20022c238e5b5d10f9154c78e0fa51f2603de34c48ecbe4cbc2c3190cf046526840546743644c691ee7fe51e31a4617b01bb7602dde803c1538 WHIRLPOOL 2a2aa19a448eca4dea84d129fd194a7ee4d77bdc1b5120abd3b667ce156cdeeb4616a7c7cd23fbccb7ba08e6e166aaba0fac63a6afa208d826acee37b0e560fe
diff --git a/sys-boot/yaboot/files/chrpfix.patch b/sys-boot/yaboot/files/chrpfix.patch
new file mode 100644
index 000000000000..e64369ba899a
--- /dev/null
+++ b/sys-boot/yaboot/files/chrpfix.patch
@@ -0,0 +1,23 @@
+--- Makefile.orig 2004-03-22 12:04:32.056149336 -0600
++++ Makefile 2004-03-22 12:05:51.824138328 -0600
+@@ -103,9 +103,11 @@
+
+ all: yaboot addnote mkofboot
+
+-yaboot: $(OBJS)
++yaboot: $(OBJS) addnote
+ $(LD) $(LFLAGS) $(OBJS) $(LLIBS) $(lgcc) -o second/$@
+ chmod -x second/yaboot
++ cp second/yaboot second/yaboot.chrp
++ util/addnote second/yaboot.chrp
+
+ addnote:
+ $(CC) $(UCFLAGS) -o util/addnote util/addnote.c
+@@ -185,6 +187,7 @@
+ install -d -o root -g root -m 0755 ${ROOT}/${PREFIX}/${MANDIR}/man5/
+ install -d -o root -g root -m 0755 ${ROOT}/${PREFIX}/${MANDIR}/man8/
+ install -o root -g root -m 0644 second/yaboot ${ROOT}/$(PREFIX)/lib/yaboot
++ install -o root -g root -m 0644 second/yaboot.chrp ${ROOT}/$(PREFIX)/lib/yaboot
+ install -o root -g root -m 0755 util/addnote ${ROOT}/${PREFIX}/lib/yaboot/addnote
+ install -o root -g root -m 0644 first/ofboot ${ROOT}/${PREFIX}/lib/yaboot/ofboot
+ install -o root -g root -m 0755 ybin/ofpath ${ROOT}/${PREFIX}/sbin/ofpath
diff --git a/sys-boot/yaboot/files/new-ofpath b/sys-boot/yaboot/files/new-ofpath
new file mode 100644
index 000000000000..5e395b251a8e
--- /dev/null
+++ b/sys-boot/yaboot/files/new-ofpath
@@ -0,0 +1,143 @@
+#!/bin/sh
+###############################################################################
+# Determines the Open Firmware path based on the linux device name
+#
+# Joseph Jezak <josejx@gentoo.org> Copyright (C) 2010
+# Rewrite of OFPath for newer kernels/scsi configurations
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+###############################################################################
+
+### Set this to 1 to turn on debugging messages
+DEBUG=0
+
+### Find the device tree
+if [ ! -e /proc/device-tree ]; then
+ echo 1>&2 "ofpath: Cannot find the device tree!"
+ exit 1
+fi
+DEV_TREE="/proc/device-tree"
+
+### Check if sys is mounted
+if ! (grep -q '.* .* sysfs ' /proc/mounts 2> /dev/null) ; then
+ echo 1>&2 "ofpath: sysfs must be mounted for ofpath to support this system"
+ exit 1
+fi
+
+### Get the sysfs mount point
+SYS="$(m=`grep '.* .* sysfs ' /proc/mounts | head -n 1` ; echo `d=${m#* };echo ${d%% *}`)"
+if [ -z "$SYS" -o ! -d "$SYS" ] ; then
+ echo 1>&2 "ofpath: Unable to determine sysfs mountpoint"
+ exit 1
+fi
+
+
+### Get the device from the user
+### We dereference links to support devices like /dev/cdrom1
+DEVICE=$1
+if [ -z "$DEVICE" ]; then
+ echo 1>&2 "ofpath: No device specified!"
+ exit 1
+fi
+DEVICE=$(readlink -f "$DEVICE")
+DEVICE=$(basename $DEVICE)
+if [ -z "$DEVICE" ] || [ ! -e "/dev/$DEVICE" ]; then
+ echo 1>&2 "ofpath: Invalid device: /dev/$DEVICE"
+ exit 1
+fi
+[ "$DEBUG" = 1 ] && echo "Device is: $DEVICE"
+
+### Get the partition if we have it
+case ${DEVICE} in
+ sd*) PARTITION="${DEVICE#sd?}" ;;
+ ### No partition for sr/sg devices
+ sr*|sg*) PARTITION="${DEVICE#sr?}" ;;
+ hd*) PARTITION="${DEVICE#hd?}" ;;
+ *) echo "Unknown device string."; exit 1;;
+esac
+if [ ! -z "$PARTITION" ] && [ "$DEBUG" = 1 ]; then
+ echo "Partition: $PARTITION"
+fi
+
+### Get the disk device name
+DISK_NAME="${DEVICE%%${PARTITION}}"
+[ "$DEBUG" = 1 ] && echo "Disk Name: $DISK_NAME"
+
+### Find the devspec for the controller
+DEVPATH=$(cd -P "$SYS/block/${DISK_NAME}/device" && pwd)
+if [ -z "$DEVPATH" ]; then
+ echo "Unable to determine device path!"
+ exit 1
+fi
+[ "$DEBUG" = 1 ] && echo "Devpath is: $DEVPATH"
+
+### Get the OF Path of the controller
+case ${DISK_NAME} in
+ sd*|sg*|sr*) CONTROLLER_PATH=$(cat ${DEVPATH}/../../../devspec) ;;
+ hd*) CONTROLLER_PATH=$(cat ${DEVPATH}/../../devspec) ;;
+ *) CONTROLLER_PATH="" ;;
+esac
+if [ -z "$CONTROLLER_PATH" ]; then
+ echo "Unable to determine controller path!"
+ exit 1
+fi
+[ "$DEBUG" = 1 ] && echo "Controller Path is: $CONTROLLER_PATH"
+
+### Generate the disk number and partition info
+case ${DISK_NAME} in
+ sd*|sg*|sr*)
+ DISK_NO="$(cd ${DEVPATH}/../; pwd)";
+ DISK_NO="${DISK_NO##*:}";
+ ;;
+ hd*)
+ DISK_NO="$(cd ${DEVPATH}/../; pwd)";
+ DISK_NO="${DISK_NO##*ide}";
+ ;;
+ *) echo "Unsupported disk type!"; exit 1 ;;
+esac
+DISK_NO="disk@${DISK_NO}:"
+[ "$DEBUG" = 1 ] && echo "Disk Number: ${DISK_NO}"
+
+### We need to get the controller port path (if it has one)
+if [ ! -d "$DEV_TREE/$CONTROLLER_PATH/disk" ] && [ ! -d "$DEV_TREE/$CONTROLLER_PATH/$DISK_NO" ]; then
+ ### FIXME I don't know if every scsi device uses the host nomenclature
+ case ${DISK_NAME} in
+ sd*|sg*|sr*)
+ PORT="$(cd ${DEVPATH}/../../; pwd)";
+ PORT="${PORT##*host}";
+ CTL_PORT="${CONTROLLER_PATH##*/}";
+ CTL_PORT="${CTL_PORT%%-root*}";
+ PORT="$CTL_PORT@$PORT"
+ [ "$DEBUG" = 1 ] && echo "Port: $PORT"
+ ;;
+ *) echo "Unsupported disk type!"; exit 1 ;;
+ esac
+fi
+
+### Add the partition information if required
+if [ ! -z $PARTITION ]; then
+ DISK_NO="$DISK_NO$PARTITION"
+fi
+
+### Build the OF Path
+if [ -z "$PORT" ]; then
+ OFPATH="$CONTROLLER_PATH/$DISK_NO"
+else
+ OFPATH="$CONTROLLER_PATH/${PORT}/$DISK_NO"
+fi
+
+### Print out the ofpath
+echo $OFPATH
diff --git a/sys-boot/yaboot/files/new-ofpath-devspec.patch b/sys-boot/yaboot/files/new-ofpath-devspec.patch
new file mode 100644
index 000000000000..ac03c15d8dd7
--- /dev/null
+++ b/sys-boot/yaboot/files/new-ofpath-devspec.patch
@@ -0,0 +1,28 @@
+--- ybin/ofpath.bak 2012-05-09 12:24:51.709911981 -0400
++++ ybin/ofpath 2012-05-09 12:32:19.661560544 -0400
+@@ -85,11 +85,20 @@
+ [ "$DEBUG" = 1 ] && echo "Devpath is: $DEVPATH"
+
+ ### Get the OF Path of the controller
+-case ${DISK_NAME} in
+- sd*|sg*|sr*) CONTROLLER_PATH=$(cat ${DEVPATH}/../../../devspec) ;;
+- hd*) CONTROLLER_PATH=$(cat ${DEVPATH}/../../devspec) ;;
+- *) CONTROLLER_PATH="" ;;
+-esac
++if [ -e "${DEVPATH}/../../devspec" ]; then
++ ### /dev/hd*
++ CONTROLLER_PATH=$(cat ${DEVPATH}/../../devspec);
++elif [ -e "${DEVPATH}/../../../devspec" ]; then
++ ### /dev/sd* on kernel <3.3
++ CONTROLLER_PATH=$(cat ${DEVPATH}/../../../devspec);
++elif [ -e "${DEVPATH}/../../../../devspec" ]; then
++ ### /dev/sd* on kernel 3.3+
++ CONTROLLER_PATH=$(cat ${DEVPATH}/../../../../devspec);
++else
++ ### None of the above...
++ CONTROLLER_PATH="";
++fi
++
+ if [ -z "$CONTROLLER_PATH" ]; then
+ echo "Unable to determine controller path!"
+ exit 1
diff --git a/sys-boot/yaboot/files/sysfs-ofpath.patch b/sys-boot/yaboot/files/sysfs-ofpath.patch
new file mode 100644
index 000000000000..7ebc0bfac86f
--- /dev/null
+++ b/sys-boot/yaboot/files/sysfs-ofpath.patch
@@ -0,0 +1,105 @@
+--- ybin/ofpath 2008-08-03 04:00:35.000000000 -0400
++++ ybin/ofpath 2009-01-09 13:46:12.000000000 -0500
+@@ -337,15 +337,18 @@
+
+ ide_ofpath()
+ {
+- if [ ! -L "/proc/ide/$DEVNODE" ] ; then
++ if [ ! -L "/proc/ide/$DEVNODE" ] && [ ! -e "/sys/block/$DEVNODE" ] ; then
+ echo 1>&2 "$PRG: /dev/$DEVNODE: Device not configured"
+ return 1
+ fi
+
+- local IDEBUS="$(v=`readlink /proc/ide/$DEVNODE` ; echo ${v%%/*} )"
+- if [ -z "$IDEBUS" ] ; then
+- echo 1>&2 "$PRG: BUG: IDEBUS == NULL"
+- return 1
++ if [ -L "/proc/ide/$DEVNODE" ] ; then
++ local USE_OLD_PROC=1
++ local IDEBUS="$(v=`readlink /proc/ide/$DEVNODE` ; echo ${v%%/*} )"
++ if [ -z "$IDEBUS" ] ; then
++ echo 1>&2 "$PRG: BUG: IDEBUS == NULL"
++ return 1
++ fi
+ fi
+
+ case "$(uname -r)" in
+@@ -363,7 +366,8 @@
+ echo 1>&2 "$PRG: Unable to determine sysfs mountpoint"
+ return 1
+ fi
+- local OF1275IDE="${SYS}/block/${DEVNODE}/device/../../devspec"
++ local OF1275IDE=$(cd -P "${SYS}/block/${DEVNODE}/device" && pwd)
++ OF1275IDE="${OF1275IDE}/../../devspec"
+ ;;
+ *)
+ local OF1275IDE="/proc/ide/$IDEBUS/devspec"
+@@ -402,34 +406,41 @@
+ return 1
+ fi
+
+- if [ ! -f "/proc/ide/${IDEBUS}/channel" ] ; then
+- echo 1>&2 "$PRG: KERNEL BUG: /proc/ide/${IDEBUS}/channel does not exist"
+- return 1
+- fi
+-
+- case "$(cat /proc/device-tree${DEVSPEC}/device_type 2> /dev/null)" in
+- ide|ata)
+- local MASTER="/disk@0"
+- local SLAVE="/disk@1"
+- ;;
+- pci-ide|pci-ata)
+- local MASTER="/@$(cat /proc/ide/${IDEBUS}/channel)/disk@0"
+- local SLAVE="/@$(cat /proc/ide/${IDEBUS}/channel)/disk@1"
+- ;;
+- scsi) ## some lame controllers pretend they are scsi, hopefully all kludges are created equal.
+- local MASTER="/@$(($(cat /proc/ide/${IDEBUS}/channel) * 2 + 0))"
+- local SLAVE="/@$(($(cat /proc/ide/${IDEBUS}/channel) * 2 + 1))"
+- ;;
+- spi)
+- local MASTER="/disk@$(cat /proc/ide/${IDEBUS}/channel),0"
+- local SLAVE="/disk@$(cat /proc/ide/${IDEBUS}/channel),1"
+- ;;
+- *)
+- echo 1>&2 "$PRG: Unsupported IDE device type: \"$(cat /proc/device-tree${DEVSPEC}/device_type 2> /dev/null)\""
+- return 1
+- ;;
+- esac
++
++ if [ "${USE_OLD_PROC}" = "1" ] ; then
++ if [ ! -f "/proc/ide/${IDEBUS}/channel" ] ; then
++ echo 1>&2 "$PRG: KERNEL BUG: /proc/ide/${IDEBUS}/channel does not exist"
++ return 1
++ fi
+
++ case "$(cat /proc/device-tree${DEVSPEC}/device_type 2> /dev/null)" in
++ ide|ata)
++ local MASTER="/disk@0"
++ local SLAVE="/disk@1"
++ ;;
++ pci-ide|pci-ata)
++ local MASTER="/@$(cat /proc/ide/${IDEBUS}/channel)/disk@0"
++ local SLAVE="/@$(cat /proc/ide/${IDEBUS}/channel)/disk@1"
++ ;;
++ scsi) ## some lame controllers pretend they are scsi, hopefully all kludges are created equal.
++ local MASTER="/@$(($(cat /proc/ide/${IDEBUS}/channel) * 2 + 0))"
++ local SLAVE="/@$(($(cat /proc/ide/${IDEBUS}/channel) * 2 + 1))"
++ ;;
++ spi)
++ local MASTER="/disk@$(cat /proc/ide/${IDEBUS}/channel),0"
++ local SLAVE="/disk@$(cat /proc/ide/${IDEBUS}/channel),1"
++ ;;
++ *)
++ echo 1>&2 "$PRG: Unsupported IDE device type: \"$(cat /proc/device-tree${DEVSPEC}/device_type 2> /dev/null)\""
++ return 1
++ ;;
++ esac
++ else
++ ### I don't know what other disks would look like... FIXME
++ local MASTER="/disk@0"
++ local SLAVE="/disk@1"
++ fi
++
+ case "$DEVNODE" in
+ hda|hdc|hde|hdg|hdi|hdk|hdm|hdo)
+ echo "${DEVSPEC}${MASTER}:$PARTITION"
diff --git a/sys-boot/yaboot/files/yaboot-1.3.16-memalign.patch b/sys-boot/yaboot/files/yaboot-1.3.16-memalign.patch
new file mode 100644
index 000000000000..0fe4e250f292
--- /dev/null
+++ b/sys-boot/yaboot/files/yaboot-1.3.16-memalign.patch
@@ -0,0 +1,41 @@
+diff -uNr yaboot/lib/malloc.c yaboot-1.3.16//lib/malloc.c
+--- yaboot/lib/malloc.c 2010-07-09 03:18:17.000000000 +0100
++++ yaboot-1.3.16//lib/malloc.c 2011-01-23 16:57:13.000000000 +0000
+@@ -42,6 +42,37 @@
+ last_alloc = 0;
+ }
+
++static char *align_ptr_to(char *ptr, unsigned long align)
++{
++ return (char *)((((unsigned long)ptr) + (align - 1UL)) &
++ ~(align - 1UL));
++}
++
++int posix_memalign(void **memptr, unsigned long alignment, unsigned long size)
++{
++ char *caddr;
++
++ if (alignment & (alignment - 1UL))
++ return -1;
++
++ if (alignment & (sizeof(void *) - 1UL))
++ return -1;
++
++ if (size == 0)
++ {
++ *memptr = (void *)0;
++ return 0;
++ }
++
++ caddr = align_ptr_to(malloc_ptr, alignment);
++ malloc_ptr = (caddr + size);
++ last_alloc = caddr;
++ malloc_ptr = align_ptr_to(malloc_ptr, 8UL);
++
++ *memptr = caddr;
++ return 0;
++}
++
+ void *malloc (unsigned int size)
+ {
+ char *caddr;
diff --git a/sys-boot/yaboot/files/yaboot-1.3.17-nopiessp-gcc4.patch b/sys-boot/yaboot/files/yaboot-1.3.17-nopiessp-gcc4.patch
new file mode 100644
index 000000000000..1ab2a3eecc3e
--- /dev/null
+++ b/sys-boot/yaboot/files/yaboot-1.3.17-nopiessp-gcc4.patch
@@ -0,0 +1,38 @@
+disable ssp usage in yaboot itself
+
+unfortunately, since we link against external libs that themselves were built
+with ssp turned on, we have to provide stubs to keep the linking from failing
+
+--- yaboot-1.3.13/Config.gentoo
++++ yaboot-1.3.13/Config.gentoo
+@@ -0,0 +1,6 @@
++check_gcc=$(shell if $(CC) $(1) -S -o /dev/null -xc /dev/null > /dev/null 2>&1; \
++ then echo "$(1)"; else echo "$(2)"; fi)
++
++CFLAGS += $(call check_gcc, -fno-stack-protector)
++CFLAGS += $(call check_gcc, --nopie)
++
+--- yaboot-1.3.13/Makefile
++++ yaboot-1.3.13/Makefile
+@@ -1,6 +1,7 @@
+ ## Setup
+
+ include Config
++include Config.gentoo
+
+ VERSION = 1.3.13
+ # Debug mode (spam/verbose)
+@@ -79,7 +80,7 @@ HOSTCFLAGS = -O2 $(CFLAGS) -Wall -I/usr/
+ second/fs_of.o second/fs_ext2.o second/fs_iso.o second/fs_swap.o \
+ second/iso_util.o \
+ lib/nonstd.o \
+- lib/nosys.o lib/string.o lib/strtol.o lib/vsprintf.o lib/ctype.o lib/malloc.o lib/strstr.o
++ lib/nosys.o lib/string.o lib/strtol.o lib/vsprintf.o lib/ctype.o lib/malloc.o lib/strstr.o lib/ssp.o
+
+ ifeq ($(USE_MD5_PASSWORDS),y)
+ OBJS += second/md5.o
+--- yaboot-1.3.14/lib/ssp.c
++++ yaboot-1.3.14/lib/ssp.c
+@@ -0,0 +1,2 @@
++void __stack_chk_fail(void) {}
++void __stack_chk_fail_local(void) {}
diff --git a/sys-boot/yaboot/files/yaboot-nopiessp-gcc4.patch b/sys-boot/yaboot/files/yaboot-nopiessp-gcc4.patch
new file mode 100644
index 000000000000..ed1755b72b33
--- /dev/null
+++ b/sys-boot/yaboot/files/yaboot-nopiessp-gcc4.patch
@@ -0,0 +1,38 @@
+disable ssp usage in yaboot itself
+
+unfortunately, since we link against external libs that themselves were built
+with ssp turned on, we have to provide stubs to keep the linking from failing
+
+--- yaboot-1.3.13/Config.gentoo
++++ yaboot-1.3.13/Config.gentoo
+@@ -0,0 +1,6 @@
++check_gcc=$(shell if $(CC) $(1) -S -o /dev/null -xc /dev/null > /dev/null 2>&1; \
++ then echo "$(1)"; else echo "$(2)"; fi)
++
++CFLAGS += $(call check_gcc, -fno-stack-protector)
++CFLAGS += $(call check_gcc, --nopie)
++
+--- yaboot-1.3.13/Makefile
++++ yaboot-1.3.13/Makefile
+@@ -1,6 +1,7 @@
+ ## Setup
+
+ include Config
++include Config.gentoo
+
+ VERSION = 1.3.13
+ # Debug mode (spam/verbose)
+@@ -79,7 +80,7 @@ HOSTCFLAGS = -O2 $(CFLAGS) -Wall -I/usr/
+ OBJS = second/crt0.o second/yaboot.o second/cache.o second/prom.o second/file.o \
+ second/partition.o second/fs.o second/cfg.o second/setjmp.o second/cmdline.o \
+ second/fs_of.o second/fs_ext2.o second/fs_iso.o second/iso_util.o \
+- lib/nosys.o lib/string.o lib/strtol.o lib/vsprintf.o lib/ctype.o lib/malloc.o lib/strstr.o
++ lib/nosys.o lib/string.o lib/strtol.o lib/vsprintf.o lib/ctype.o lib/malloc.o lib/strstr.o lib/ssp.o
+
+ ifeq ($(USE_MD5_PASSWORDS),y)
+ OBJS += second/md5.o
+--- yaboot-1.3.14/lib/ssp.c
++++ yaboot-1.3.14/lib/ssp.c
+@@ -0,0 +1,2 @@
++void __stack_chk_fail(void) {}
++void __stack_chk_fail_local(void) {}
diff --git a/sys-boot/yaboot/files/yaboot-stubfuncs.patch b/sys-boot/yaboot/files/yaboot-stubfuncs.patch
new file mode 100644
index 000000000000..8ae522b7d4eb
--- /dev/null
+++ b/sys-boot/yaboot/files/yaboot-stubfuncs.patch
@@ -0,0 +1,231 @@
+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)
+ 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)
+--- lib/nonstd.c
++++ lib/nonstd.c
+@@ -65,3 +65,208 @@
+ {
+ return NULL;
+ }
++
++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 open(pathname, flags);
++}
++
++// 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, const void *buf, size_t count) {
++ return prom_write((void *)fd, (void *)buf, count);
++}
++
++int close(int fd) {
++ prom_close((void *)fd);
++ 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;
++}
++
++// ext2 libs only use this to turn off caches currently
++int fcntl(int fd, int cmd, ...) {
++ 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);
++}
++
++// But these are all dummy functions
++int __xstat64 (int __ver, const char *__filename, void *__stat_buf) {
++ return 0;
++}
++
++int stat64(const char *path, void *stat_buf) {
++ return 0;
++}
++
++int fstat64(int fildes, void *stat_buf) {
++ return 0;
++}
++
++int __fxstat64 (int __ver, int __filedesc, void *__stat_buf) {
++ return 0;
++}
++
++signed int random(void) {
++ return 0;
++}
++
++void srandom(unsigned int seed) {
++ return;
++}
++
++int rand(void) {
++ return 0;
++}
++
++void srand(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;
++}
++
++size_t fwrite(const void *ptr, size_t size, size_t nmemb, void *stream) {
++ return 0;
++}
++
++int ioctl(int d, int request, ...) {
++ return 0;
++}
++
++int fallocate(int fd, int mode, unsigned int offset, unsigned int len) {
++ return 0;
++}
++
++int uname(void *buf) {
++ return 0;
++}
++
++int setrlimit(int resource, void *rlim) {
++ return 0;
++}
++
++unsigned long long int strtoull(const char *nptr, char **endptr, int base) {
++ return 0;
++}
++
++int getrlimit(int resource, void *rlim) {
++ return 0;
++}
++
++int stderr = 0;
++int perror = 0;
diff --git a/sys-boot/yaboot/files/yabootconfig-1.3.13.patch b/sys-boot/yaboot/files/yabootconfig-1.3.13.patch
new file mode 100644
index 000000000000..4bc13eef8b18
--- /dev/null
+++ b/sys-boot/yaboot/files/yabootconfig-1.3.13.patch
@@ -0,0 +1,42 @@
+--- yaboot-1.3.13.orig/ybin/yabootconfig 2004-11-04 21:57:17.000000000 -0500
++++ yaboot-1.3.13/ybin/yabootconfig 2004-11-04 22:40:45.503060512 -0500
+@@ -5,6 +5,8 @@
+ ## yabootconfig generates a simple /etc/yaboot.conf
+ ## Copyright (C) 2001, 2002, 2003 Ethan Benson
+ ##
++## Patched for Gentoo and dual boot - Mark Guertin <gerk@gentoo.org>
++##
+ ## This program is free software; you can redistribute it and/or
+ ## modify it under the terms of the GNU General Public License
+ ## as published by the Free Software Foundation; either version 2
+@@ -264,6 +266,30 @@
+ return 0
+ }
+
++dualboot()
++{
++ DRIVELIST=`ls -d /dev/?d?* | grep "[sh]d[abcdefghijkl]" | cut -b 6-8 | sort -u`
++
++ for i in $DRIVELIST
++ do
++ HFS=`mac-fdisk -l "/dev/$i" | grep '\<Apple_HFS\>' | grep -v "CDROM" | cut -d" " -f1`
++ for h in $HFS
++ do
++ if [ !-x `hpmount -r $h` > /dev/null 2>&1 ] ; then
++ if [ `hpls mach_kernel 2>/dev/null` ] ; then
++ [ "$QUIET" = 0 ] && echo "Found possible OS X/Darwin partition at $h"
++ OSX=$h
++ fi
++ if [ "`hpls "System Folder" 2>/dev/null`" ] ; then
++ [ "$QUIET" = 0 ] && echo "Found possible Mac OS partition at $h"
++ MACOS=$h
++ fi
++ hpumount $h > /dev/null 2>&1
++ fi
++ done
++ done
++}
++
+ ##########
+ ## Main ##
+ ##########
diff --git a/sys-boot/yaboot/metadata.xml b/sys-boot/yaboot/metadata.xml
new file mode 100644
index 000000000000..5eb05198076b
--- /dev/null
+++ b/sys-boot/yaboot/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer type="project">
+ <email>ppc@gentoo.org</email>
+ <name>Gentoo Linux PowerPC Development</name>
+</maintainer>
+</pkgmetadata>
diff --git a/sys-boot/yaboot/yaboot-1.3.14-r2.ebuild b/sys-boot/yaboot/yaboot-1.3.14-r2.ebuild
new file mode 100644
index 000000000000..dae3363bec71
--- /dev/null
+++ b/sys-boot/yaboot/yaboot-1.3.14-r2.ebuild
@@ -0,0 +1,47 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+inherit eutils toolchain-funcs
+
+DESCRIPTION="PPC Bootloader"
+HOMEPAGE="http://yaboot.ozlabs.org"
+SRC_URI="http://yaboot.ozlabs.org/releases/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="-* ppc -ppc64"
+IUSE="ibm"
+
+DEPEND="sys-apps/powerpc-utils
+ sys-fs/e2fsprogs[static-libs]"
+RDEPEND="!sys-boot/yaboot-static
+ !ibm? (
+ sys-fs/hfsutils
+ sys-fs/hfsplusutils
+ sys-fs/mac-fdisk
+ )"
+
+src_prepare() {
+ # No need to hardcode this path -- the compiler already knows to use it.
+ sed -i \
+ -e 's:-I/usr/include::' \
+ Makefile || die
+
+ # dual boot patch
+ epatch "${FILESDIR}/yabootconfig-1.3.13.patch"
+ epatch "${FILESDIR}/chrpfix.patch"
+ epatch "${FILESDIR}/yaboot-nopiessp-gcc4.patch"
+ epatch "${FILESDIR}/sysfs-ofpath.patch"
+}
+
+src_compile() {
+ unset CFLAGS CXXFLAGS CPPFLAGS LDFLAGS
+ emake PREFIX=/usr MANDIR=share/man CC="$(tc-getCC)" LD="$(tc-getLD)"
+}
+
+src_install() {
+ sed -i -e 's/\/local//' etc/yaboot.conf
+ emake ROOT="${D}" PREFIX=/usr MANDIR=share/man install
+}
diff --git a/sys-boot/yaboot/yaboot-1.3.16.ebuild b/sys-boot/yaboot/yaboot-1.3.16.ebuild
new file mode 100644
index 000000000000..d7c35c1ef85b
--- /dev/null
+++ b/sys-boot/yaboot/yaboot-1.3.16.ebuild
@@ -0,0 +1,56 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+inherit eutils toolchain-funcs
+
+DESCRIPTION="PPC Bootloader"
+HOMEPAGE="http://yaboot.ozlabs.org"
+SRC_URI="http://yaboot.ozlabs.org/releases/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="-* ppc -ppc64"
+IUSE="ibm"
+
+DEPEND="sys-apps/powerpc-utils
+ sys-fs/e2fsprogs[static-libs]"
+RDEPEND="!sys-boot/yaboot-static
+ !ibm? (
+ sys-fs/hfsutils
+ sys-fs/hfsplusutils
+ sys-fs/mac-fdisk
+ )"
+
+src_unpack() {
+ default
+ cd "${S}"
+ cp "${FILESDIR}/new-ofpath" "${S}/ybin/ofpath"
+}
+
+src_prepare() {
+ # No need to hardcode this path -- the compiler already knows to use it.
+ sed -i \
+ -e 's:-I/usr/include::' \
+ Makefile || die
+
+ # dual boot patch
+ epatch "${FILESDIR}/yabootconfig-1.3.13.patch"
+ epatch "${FILESDIR}/chrpfix.patch"
+ epatch "${FILESDIR}/yaboot-nopiessp-gcc4.patch"
+
+ # e2fsprogs memalign patch
+ epatch "${FILESDIR}/${P}-memalign.patch"
+}
+
+src_compile() {
+ unset CFLAGS CXXFLAGS CPPFLAGS LDFLAGS
+ emake PREFIX=/usr MANDIR=share/man CC="$(tc-getCC)" LD="$(tc-getLD)"
+}
+
+src_install() {
+ sed -i -e 's/\/local//' etc/yaboot.conf || die
+ emake ROOT="${D}" PREFIX=/usr MANDIR=share/man install
+ mv "${ED}"/etc/yaboot.conf{,.sample} || die
+}
diff --git a/sys-boot/yaboot/yaboot-1.3.17-r2.ebuild b/sys-boot/yaboot/yaboot-1.3.17-r2.ebuild
new file mode 100644
index 000000000000..388d67bca957
--- /dev/null
+++ b/sys-boot/yaboot/yaboot-1.3.17-r2.ebuild
@@ -0,0 +1,59 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+inherit eutils toolchain-funcs
+
+DESCRIPTION="PPC Bootloader"
+HOMEPAGE="http://yaboot.ozlabs.org"
+SRC_URI="http://yaboot.ozlabs.org/releases/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="-* ppc -ppc64"
+IUSE="ibm"
+
+DEPEND="sys-apps/powerpc-utils
+ sys-fs/e2fsprogs[static-libs]"
+RDEPEND="!sys-boot/yaboot-static
+ !ibm? (
+ sys-fs/hfsutils
+ sys-fs/hfsplusutils
+ sys-fs/mac-fdisk
+ )"
+
+src_unpack() {
+ default
+ cd "${S}"
+ cp "${FILESDIR}/new-ofpath" "${S}/ybin/ofpath"
+}
+
+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"
+ epatch "${FILESDIR}/${PN}-stubfuncs.patch"
+
+ # Fix the devspec path on newer kernels
+ epatch "${FILESDIR}/new-ofpath-devspec.patch"
+}
+
+src_compile() {
+ unset CFLAGS CXXFLAGS CPPFLAGS LDFLAGS
+ emake PREFIX=/usr MANDIR=share/man CC="$(tc-getCC)" LD="$(tc-getLD)"
+}
+
+src_install() {
+ sed -i -e 's/\/local//' etc/yaboot.conf || die
+ emake ROOT="${D}" PREFIX=/usr MANDIR=share/man install
+ mv "${ED}"/etc/yaboot.conf{,.sample} || die
+}