diff mbox

Support for YDL PowerStation.

Message ID 1314506637-14667-1-git-send-email-milan@physics.harvard.edu
State Under Review
Headers show

Commit Message

Milan Kupcevic Aug. 28, 2011, 4:43 a.m. UTC
Support for YDL PowerStation. Apply on top of
http://patchwork.ozlabs.org/patch/108566/

Signed-off-by: Milan Kupcevic <milan@physics.harvard.edu>
---
 ybin/ofpath |    4 +++-
 ybin/ybin   |   18 ++++++++++++++++++
 2 files changed, 21 insertions(+), 1 deletions(-)

Comments

Tony Breeds Oct. 18, 2011, 4:39 a.m. UTC | #1
On Sun, Aug 28, 2011 at 12:43:57AM -0400, Milan Kupcevic wrote:
> Support for YDL PowerStation. Apply on top of
> http://patchwork.ozlabs.org/patch/108566/

Is there a code dependance on this patch?

Yours Tony
Milan Kupcevic Oct. 18, 2011, 12:26 p.m. UTC | #2
On 10/18/2011 12:39 AM, Tony Breeds wrote:
> On Sun, Aug 28, 2011 at 12:43:57AM -0400, Milan Kupcevic wrote:
>> Support for YDL PowerStation. Apply on top of
>> http://patchwork.ozlabs.org/patch/108566/
> 
> Is there a code dependance on this patch?
> 
> Yours Tony

There is no direct code dependance. But, to support YDL Powerstation's
built-in Obsidian SAS controller you will need [0]. To properly set
boot-device variable in nvram and correct partition type in ybin you
need [1]. Therefore, to boot YDL Powerstation off, you need both.

[0] http://patchwork.ozlabs.org/patch/108566/
[1] http://patchwork.ozlabs.org/patch/111893/


Milan
Tony Breeds Oct. 19, 2011, 12:52 a.m. UTC | #3
On Tue, Oct 18, 2011 at 08:26:00AM -0400, Milan Kupcevic wrote:

> There is no direct code dependance. But, to support YDL Powerstation's
> built-in Obsidian SAS controller you will need [0]. To properly set
> boot-device variable in nvram and correct partition type in ybin you
> need [1]. Therefore, to boot YDL Powerstation off, you need both.

Thanks for the clarification.  As I said in the relase for .17 I'm
going to focus on adding sysfs support to ofpath.  It needs some love.

It's goign to be tough to add the /sys support without breaking the many
"legacy" systems out there.

I have acces to a YDL Powerstation so I'll certainly be looking at these
patches on that system.

Yours Tony
diff mbox

Patch

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
 }