OK, I was able to restart and test whether this works:
Code:
Select all
sudo nvram use-nvramrc\?=true nvramrc='dev enet " "(aa bb cc dd ee ff)" encode-bytes " local-mac-address" property'
Short answer: it doesn't.
The escaped double-quotes in the version
supra
cause problems with csh (it complains they don't balance). With ksh they work ok. You can force them to work in tcsh with the backslash_quote shell variable. But using single-quotes is a cleaner solution (but see
infra
).
Setting the " local-mac-address" property in the enet package works from the Open Firmware prompt, but vagaries of the probing process overwrite the property if done from nvramrc.
You can get an idea of the process from Oracle docs.
http://docs.oracle.com/cd/E19620-01/805 ... index.html
(although banner and suppress-banner don't seem to be defined in Apple's FCode, so there appears to be no way to override the probe steps)
I still couldn't get it to work from nvramrc, so I wrote a test:
Code:
Select all
sudo nvram nvramrc='true value mymac : checkit " local-mac-address" " enet" get-package get-package-property if else drop to mymac then ; checkit'
If you drop to Open Firmware console by holding Command-Option-O-F during the boot chime, you can see that the nvramrc has already run:
But there was no property to use then:
If we run it again now, the property is there:
The problem is that when nvramrc runs, there is no mac-address property yet, because the enet device hasn't been probed. If we probe it ourselves the device tree gets messed up when OF does it again (tried that, OSX hangs on boot). What we need is to force some code to be run later, after probing is complete (when the console would be able to do it interactively).
The way that you continue booting OSX from the OF console is typing mac-boot. You can see what it does, funny enough, with the see word:
Code:
Select all
see mac-boot
defer mac-boot : ...
A clue! interesting. We can change what happens when mac-boot runs since it is dynamic. It runs after all the probing and device init is done, after the console exits. But we still want that original code to run when we are finished for the OS to load.
Code:
Select all
sudo nvram nvramrc='variable oldboot : changemac " local-mac-address" " enet" get-package get-package-property if else " "(aa bb cc dd ee ff)" drop -rot move then oldboot @ execute ;'" ' mac-boot behavior oldboot ! ' changemac to mac-boot"
(Notice the switch from single-quoting to double-quoting for the shell's sake.)
I tested this and it works.