From patchwork Fri Sep 14 18:22:11 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brian King X-Patchwork-Id: 184014 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 B8ACB2C00C3 for ; Sat, 15 Sep 2012 04:24:28 +1000 (EST) Received: from e35.co.us.ibm.com (e35.co.us.ibm.com [32.97.110.153]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "e35.co.us.ibm.com", Issuer "GeoTrust SSL CA" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 368F02C00AC for ; Sat, 15 Sep 2012 04:24:21 +1000 (EST) Received: from /spool/local by e35.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 14 Sep 2012 12:24:06 -0600 Received: from d03dlp02.boulder.ibm.com (9.17.202.178) by e35.co.us.ibm.com (192.168.1.135) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 14 Sep 2012 12:23:16 -0600 Received: from d03relay05.boulder.ibm.com (d03relay05.boulder.ibm.com [9.17.195.107]) by d03dlp02.boulder.ibm.com (Postfix) with ESMTP id 2EDE63E40039 for ; Fri, 14 Sep 2012 12:22:43 -0600 (MDT) Received: from d03av02.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.195.168]) by d03relay05.boulder.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q8EIMJlG128534 for ; Fri, 14 Sep 2012 12:22:23 -0600 Received: from d03av02.boulder.ibm.com (loopback [127.0.0.1]) by d03av02.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q8EIMHcM032375 for ; Fri, 14 Sep 2012 12:22:18 -0600 Received: from localhost.localdomain ([9.49.222.94]) by d03av02.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id q8EIMFhJ032277; Fri, 14 Sep 2012 12:22:16 -0600 Message-Id: <201209141822.q8EIMFhJ032277@d03av02.boulder.ibm.com> Subject: [PATCH 1/1] ybin: Update boot-device for pSeries To: yaboot-devel@lists.ozlabs.org From: Brian King Date: Fri, 14 Sep 2012 13:22:11 -0500 X-Content-Scanned: Fidelis XPS MAILER x-cbid: 12091418-6148-0000-0000-000009A8B57B X-BeenThere: yaboot-devel@lists.ozlabs.org X-Mailman-Version: 2.1.15 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" ybin/mkofboot was not updating the boot-device OF path, which results in pSeries users needing to manually set the boot device in SMS in many scenarios. This is easily fixed with the following small change. Signed-off-by: Brian King --- ybin/ybin | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff -puN ybin/ybin~ybin_set_ofbootdev ybin/ybin --- yaboot/ybin/ybin~ybin_set_ofbootdev 2012-09-14 09:13:47.000000000 -0500 +++ yaboot-bjking1/ybin/ybin 2012-09-14 09:34:11.000000000 -0500 @@ -507,12 +507,8 @@ checkconf() [ "$nonvram" = 0 ] && echo 1>&2 "$PRG: OldWorld PowerMac, nvram will not be updated" nonvram=1 elif (cat /proc/cpuinfo 2> /dev/null | grep ^platform | grep -q 'pSeries') ; then - ## IBM hardware does not need nvram update AFAICT - nonvram=1 ADDNOTE=yes elif (cat /proc/cpuinfo 2> /dev/null | grep ^platform | grep -q 'PowerNV') ; then - ## IBM hardware does not need nvram update AFAICT - nonvram=1 ADDNOTE=yes else #echo 1>&2 "$PRG: Warning: Unknown archetecture, $boot may not be bootable on this machine" @@ -1156,6 +1152,17 @@ raw_install() echo 1>&2 "$PRG: Installation failed." return 1 fi + + ## update the boot-device variable in OF nvram. + if [ "$nonvram" = 0 ] ; then + [ "$VERBOSE" = 1 ] && echo "$PRG: Updating OpenFirmware boot-device variable in nvram..." + [ "$DEBUG" = 1 ] && echo 1>&2 "$PRG: DEBUG: boot-device=${ofboot}" + nvsetenv boot-device "${ofboot}" + if [ $? != 0 ] ; then + echo 1>&2 "$PRG: An error occured while updating nvram, we'll ignore it" + fi + fi + sync ; sync [ "$VERBOSE" = 1 ] && echo "$PRG: Installation successful" return 0