summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoseph Jezak <josejx@gentoo.org>2010-10-03 17:09:39 +0000
committerJoseph Jezak <josejx@gentoo.org>2010-10-03 17:09:39 +0000
commitfce240dbc87a669d1816e8bc1a34f1986d0548d7 (patch)
tree62b98a555d42dc040d36e4121d82d05aec734d35 /sys-boot
parentStable on amd64 wrt bug #335430 (diff)
downloadgentoo-2-fce240dbc87a669d1816e8bc1a34f1986d0548d7.tar.gz
gentoo-2-fce240dbc87a669d1816e8bc1a34f1986d0548d7.tar.bz2
gentoo-2-fce240dbc87a669d1816e8bc1a34f1986d0548d7.zip
Removed old versions. Added latest version, including a new ofpath.
(Portage version: 2.1.9.13/cvs/Linux x86_64)
Diffstat (limited to 'sys-boot')
-rw-r--r--sys-boot/yaboot/ChangeLog9
-rwxr-xr-xsys-boot/yaboot/files/new-ofpath143
-rw-r--r--sys-boot/yaboot/yaboot-1.3.14-r2.ebuild10
-rw-r--r--sys-boot/yaboot/yaboot-1.3.14.ebuild38
-rw-r--r--sys-boot/yaboot/yaboot-1.3.16.ebuild (renamed from sys-boot/yaboot/yaboot-1.3.14-r1.ebuild)15
5 files changed, 169 insertions, 46 deletions
diff --git a/sys-boot/yaboot/ChangeLog b/sys-boot/yaboot/ChangeLog
index 4efa8bb008e7..3ee17e1d479c 100644
--- a/sys-boot/yaboot/ChangeLog
+++ b/sys-boot/yaboot/ChangeLog
@@ -1,6 +1,13 @@
# ChangeLog for sys-boot/yaboot
# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-boot/yaboot/ChangeLog,v 1.32 2010/07/19 19:10:19 josejx Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-boot/yaboot/ChangeLog,v 1.33 2010/10/03 17:09:38 josejx Exp $
+
+*yaboot-1.3.16 (03 Oct 2010)
+
+ 03 Oct 2010; Joseph Jezak <josejx@gentoo.org> -yaboot-1.3.14.ebuild,
+ -yaboot-1.3.14-r1.ebuild, yaboot-1.3.14-r2.ebuild, +yaboot-1.3.16.ebuild,
+ +files/new-ofpath:
+ Removed old versions. Added latest version, including a new ofpath.
19 Jul 2010; Joseph Jezak <josejx@gentoo.org> yaboot-1.3.14-r2.ebuild:
Marked ppc stable for bug #328879.
diff --git a/sys-boot/yaboot/files/new-ofpath b/sys-boot/yaboot/files/new-ofpath
new file mode 100755
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/yaboot-1.3.14-r2.ebuild b/sys-boot/yaboot/yaboot-1.3.14-r2.ebuild
index 57eeaae34da2..ec87de29004f 100644
--- a/sys-boot/yaboot/yaboot-1.3.14-r2.ebuild
+++ b/sys-boot/yaboot/yaboot-1.3.14-r2.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-boot/yaboot/yaboot-1.3.14-r2.ebuild,v 1.2 2010/07/19 19:10:19 josejx Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-boot/yaboot/yaboot-1.3.14-r2.ebuild,v 1.3 2010/10/03 17:09:38 josejx Exp $
inherit eutils toolchain-funcs
@@ -26,12 +26,12 @@ src_compile() {
# dual boot patch
epatch "${FILESDIR}/yabootconfig-1.3.13.patch"
epatch "${FILESDIR}/chrpfix.patch"
- if [[ "$(gcc-major-version)" -eq "3" ]]; then
+ if [[ "$(gcc-major-version)" -eq "3" ]]; then
epatch "${FILESDIR}/yaboot-nopiessp.patch"
- fi
- if [[ "$(gcc-major-version)" -eq "4" ]]; then
+ fi
+ if [[ "$(gcc-major-version)" -eq "4" ]]; then
epatch "${FILESDIR}/yaboot-nopiessp-gcc4.patch"
- fi
+ fi
epatch "${FILESDIR}/sysfs-ofpath.patch"
emake PREFIX=/usr MANDIR=share/man CC="$(tc-getCC)" || die
}
diff --git a/sys-boot/yaboot/yaboot-1.3.14.ebuild b/sys-boot/yaboot/yaboot-1.3.14.ebuild
deleted file mode 100644
index ee50d1f5ab98..000000000000
--- a/sys-boot/yaboot/yaboot-1.3.14.ebuild
+++ /dev/null
@@ -1,38 +0,0 @@
-# Copyright 1999-2008 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-boot/yaboot/yaboot-1.3.14.ebuild,v 1.4 2008/05/13 05:10:54 mr_bones_ 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 )"
-
-PROVIDE="virtual/bootloader"
-
-src_compile() {
- export -n CFLAGS
- export -n CXXFLAGS
- [ -n "$(tc-getCC)" ] || CC="gcc"
- # dual boot patch
- epatch "${FILESDIR}/yabootconfig-1.3.13.patch"
- epatch "${FILESDIR}/chrpfix.patch"
- epatch "${FILESDIR}/yaboot-nopiessp.patch"
- emake PREFIX=/usr MANDIR=share/man CC="$(tc-getCC)" || die
-}
-
-src_install() {
- cp etc/yaboot.conf etc/yaboot.conf.bak
- sed -e 's/\/local//' etc/yaboot.conf >| etc/yaboot.conf.edit
- mv -f etc/yaboot.conf.edit etc/yaboot.conf
- make ROOT="${D}" PREFIX=/usr MANDIR=share/man install || die
-}
diff --git a/sys-boot/yaboot/yaboot-1.3.14-r1.ebuild b/sys-boot/yaboot/yaboot-1.3.16.ebuild
index 3a910c6ee1da..807b3fbeb1b6 100644
--- a/sys-boot/yaboot/yaboot-1.3.14-r1.ebuild
+++ b/sys-boot/yaboot/yaboot-1.3.16.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-boot/yaboot/yaboot-1.3.14-r1.ebuild,v 1.1 2010/05/31 23:47:51 josejx Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-boot/yaboot/yaboot-1.3.16.ebuild,v 1.1 2010/10/03 17:09:38 josejx Exp $
inherit eutils toolchain-funcs
@@ -19,6 +19,12 @@ RDEPEND="!ibm? ( sys-fs/hfsutils
PROVIDE="virtual/bootloader"
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+ cp "${FILESDIR}/new-ofpath" "${S}/ybin/ofpath"
+}
+
src_compile() {
export -n CFLAGS
export -n CXXFLAGS
@@ -26,7 +32,12 @@ src_compile() {
# dual boot patch
epatch "${FILESDIR}/yabootconfig-1.3.13.patch"
epatch "${FILESDIR}/chrpfix.patch"
- epatch "${FILESDIR}/yaboot-nopiessp.patch"
+ if [[ "$(gcc-major-version)" -eq "3" ]]; then
+ epatch "${FILESDIR}/yaboot-nopiessp.patch"
+ fi
+ if [[ "$(gcc-major-version)" -eq "4" ]]; then
+ epatch "${FILESDIR}/yaboot-nopiessp-gcc4.patch"
+ fi
epatch "${FILESDIR}/sysfs-ofpath.patch"
emake PREFIX=/usr MANDIR=share/man CC="$(tc-getCC)" || die
}