From patchwork Sun Aug 28 04:43:57 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Milan Kupcevic X-Patchwork-Id: 111893 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from ozlabs.org (localhost [IPv6:::1]) by ozlabs.org (Postfix) with ESMTP id 4C5F8B6F8F for ; Sun, 28 Aug 2011 14:44:53 +1000 (EST) Received: from mail.physics.harvard.edu (mail.physics.harvard.edu [128.103.101.12]) by ozlabs.org (Postfix) with ESMTP id 4A134B6F76 for ; Sun, 28 Aug 2011 14:44:50 +1000 (EST) Received: from pool-96-252-37-189.bstnma.fios.verizon.net ([96.252.37.189] helo=black.newton.home) by mail.physics.harvard.edu with esmtpsa (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.69) (envelope-from ) id 1QxXEj-00028S-Lj; Sun, 28 Aug 2011 00:44:45 -0400 Received: from mico by black.newton.home with local (Exim 4.72) (envelope-from ) id 1QxXEj-0003pX-5a; Sun, 28 Aug 2011 00:44:45 -0400 From: Milan Kupcevic To: yaboot-devel@lists.ozlabs.org Subject: [PATCH] Support for YDL PowerStation. Date: Sun, 28 Aug 2011 00:43:57 -0400 Message-Id: <1314506637-14667-1-git-send-email-milan@physics.harvard.edu> X-Mailer: git-send-email 1.7.2.5 X-BeenThere: yaboot-devel@lists.ozlabs.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Technical and development discussion regarding yaboot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: yaboot-devel-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: yaboot-devel-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Support for YDL PowerStation. Apply on top of http://patchwork.ozlabs.org/patch/108566/ Signed-off-by: Milan Kupcevic --- ybin/ofpath | 4 +++- ybin/ybin | 18 ++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletions(-) diff --git a/ybin/ofpath b/ybin/ofpath index 7557484..fc841c5 100755 --- a/ybin/ofpath +++ b/ybin/ofpath @@ -899,6 +899,8 @@ elif (cat /proc/cpuinfo 2>/dev/null | grep ^motherboard | grep -q AAPL) ; then SUBARCH=OldWorld elif (cat /proc/cpuinfo 2> /dev/null | grep ^machine | grep -q 'CHRP IBM') ; then SUBARCH=CHRP +elif (cat /proc/cpuinfo 2> /dev/null | grep ^platform | grep -q 'Maple') ; then + SUBARCH=Maple elif (cat /proc/cpuinfo 2>/dev/null | grep ^machine | grep -q 'CHRP Pegasos') ; then SUBARCH=Pegasos else @@ -930,7 +932,7 @@ case "$SUBARCH" in OldWorld) oldworld || exit 1 ;; - CHRP) + CHRP|Maple) chrp || exit 1 ;; esac diff --git a/ybin/ybin b/ybin/ybin index cbc14f4..16bfc6b 100755 --- a/ybin/ybin +++ b/ybin/ybin @@ -75,6 +75,8 @@ fi usemount=no if (cat /proc/cpuinfo 2> /dev/null | grep ^machine | grep -q 'CHRP IBM') ; then fstype=raw +elif (cat /proc/cpuinfo 2> /dev/null | grep ^platform | grep -q 'Maple') ; then + fstype=raw else fstype=hfs fi @@ -508,6 +510,8 @@ checkconf() ## IBM hardware does not need nvram update AFAICT nonvram=1 ADDNOTE=yes + elif (cat /proc/cpuinfo 2> /dev/null | grep ^platform | grep -q 'Maple') ; then + true else #echo 1>&2 "$PRG: Warning: Unknown archetecture, $boot may not be bootable on this machine" [ "$nonvram" = 0 ] && echo 1>&2 "$PRG: Warning: Unknown architecture, nvram will not be updated" @@ -1151,6 +1155,20 @@ raw_install() return 1 fi sync ; sync + + ## update the boot-device variable in OF nvram. + if [ "$nonvram" = 0 ] ; then + chrp_ofboot=${ofboot%%:*} + [ "$VERBOSE" = 1 ] && echo "$PRG: Updating OpenFirmware boot-device variable in nvram..." + [ "$DEBUG" = 1 ] && echo 1>&2 "$PRG: DEBUG: boot-device=${chrp_ofboot}" + nvsetenv boot-device "${chrp_ofboot}" + if [ $? != 0 ] ; then + echo 1>&2 "$PRG: An error occured while updating nvram, we'll ignore it" + fi + else + echo 1>&2 "$PRG: Warning: You must manually configure OpenFirmware to boot." + fi + [ "$VERBOSE" = 1 ] && echo "$PRG: Installation successful" return 0 }