From patchwork Fri Sep 14 18:22:11 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [1/1] ybin: Update boot-device for pSeries Date: Fri, 14 Sep 2012 08:22:11 -0000 From: Brian King X-Patchwork-Id: 184014 Message-Id: <201209141822.q8EIMFhJ032277@d03av02.boulder.ibm.com> To: yaboot-devel@lists.ozlabs.org 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