Skip to contentSkip to conversation

patch to fail more gracefuly when nvsetenv doesn't work

openfirmware Robert Millan 2 participants 2 messages Jun 29, 2007 – Jul 4, 2007

lore
Share & tools
lore
#0 lore raw

Could someone test this on an OpenFirmware machine for which nvsetenv works?

The idea is that for those machines in which nvsetenv isn't usable, at least user gets to know what command to type.

Signature · 4 lines
Robert Millan

My spam trap is [email protected].  Note: this address is only intended
for spam harvesters.  Writing to it will get you added to my black list.
util/powerpc/ieee1275/grub-install.in +4 -2
diff -ur grub2-1.95+20070626.old/util/powerpc/ieee1275/grub-install.in grub2-1.95+20070626/util/powerpc/ieee1275/grub-install.in
@@ -180,9 +180,11 @@
     }
 
     # Point boot-device at the new grub install
-    "$nvsetenv" boot-device "$ofpath:$partno,"'\grub' || {
+    boot_device="boot-device $ofpath:$partno,\\grub"
+    "$nvsetenv" "$boot_device" || {
 	echo "$nvsetenv failed."
-	echo "You will have to set boot-device manually."
+	echo "You will have to set boot-device manually.  At the OpenFirmware prompt, type:"
+	echo "  ok setenv $boot_device"
 	exit 1
     }
 fi
#1 lore raw
Quoted 33 lines · Robert Millan

Could someone test this on an OpenFirmware machine for which nvsetenv works?

The idea is that for those machines in which nvsetenv isn't usable, at least
user gets to know what command to type.

Signature · 18 lines
Robert Millan

My spam trap is [email protected].  Note: this address is only
intended
for spam harvesters.  Writing to it will get you added to my black
list.







text/x-diff
attachment
(nvsetenv.diff)

diff -ur grub2-1.95+20070626.old/util/powerpc/ieee1275/grub-install.in grub2-1.95+20070626/util/powerpc/ieee1275/grub-install.in
util/powerpc/ieee1275/grub-install.in 2007-06-29 20:51:41.000000000 +0200 renamed from util/powerpc/ieee1275/grub-install.in 2007-05-05 13:55:20.000000000 +0200 +0 -0
@@ -180,9 +180,11 @@
     }
 
     # Point boot-device at the new grub install

util/powerpc/ieee1275/grub-install.in 2007-06-29 20:51:41.000000000 +0200 line 190

Quoted 10 lines
util/powerpc/ieee1275/grub-install.in 2007-06-29 20:51:41.000000000 +0200 renamed from util/powerpc/ieee1275/grub-install.in 2007-05-05 13:55:20.000000000 +0200 +4 -2
-    "$nvsetenv" boot-device "$ofpath:$partno,"'\grub' || {
+    boot_device="boot-device $ofpath:$partno,\\grub"
+    "$nvsetenv" "$boot_device" || {
        echo "$nvsetenv failed."
-       echo "You will have to set boot-device manually."
+       echo "You will have to set boot-device manually.  At the OpenFirmware prompt, type:"
+       echo "  ok setenv $boot_device"
        exit 1
     }
 fi 

I would omit the " ok " here, since the user should not type that. Also, the name is "Open Firmware", not "OpenFirmware".

-Hollis