Author Topic: Q: How to define simple nonvolatile shortcut commands in Open Firmware?  (Read 1757 times)

Offline glt

  • Member
  • *
  • Posts: 1
  • new to the forums
I'd like to be able to start Open Firmware's telnet without having to type the whole incantation every time--I can't always remember it, and for some reason I'm typo-prone when talking to Open Firmware.  :(

Is there a way to define a shortcut for this in Open Firmware and save it in NVRAM somehow, so it will always be there?

For the same reason I'd also like to be able to boot from my USB thumb drive without typing the whole boot usb2/disk@1:2,\\yaboot magic phrase.

I know I should be able to do that with nvalias and will probably try on my own (I haven't yet), but someone  might save me a few moments if they could post it here.

Offline nanopico

  • Platinum Member
  • *****
  • Posts: 656
Yes you should be able to do this.
You just need to define a word in open firmware via a nvram script and an alias for the usb part.
I don't have the specific details at hand as I'm in the hospital at the moment, but if no one else get's back to you then I will try to reply when I get out.
If it ain't broke, don't fix it, or break it so you can fix it!

Offline DieHard

  • Administrator
  • Platinum Member
  • *****
  • Posts: 1250
Quote
I don't have the specific details at hand as I'm in the hospital at the moment

Hope all is well :)

Offline GaryN

  • Platinum Member
  • *****
  • Posts: 681
  • active member
As do we all!

Offline nanopico

  • Platinum Member
  • *****
  • Posts: 656
Quote
I don't have the specific details at hand as I'm in the hospital at the moment

Hope all is well :)

As do we all!

It is now I think.  And thank you.
If it ain't broke, don't fix it, or break it so you can fix it!

Offline nanopico

  • Platinum Member
  • *****
  • Posts: 656
I'd like to be able to start Open Firmware's telnet without having to type the whole incantation every time--I can't always remember it, and for some reason I'm typo-prone when talking to Open Firmware.  :(

Is there a way to define a shortcut for this in Open Firmware and save it in NVRAM somehow, so it will always be there?

For the same reason I'd also like to be able to boot from my USB thumb drive without typing the whole boot usb2/disk@1:2,\\yaboot magic phrase.

I know I should be able to do that with nvalias and will probably try on my own (I haven't yet), but someone  might save me a few moments if they could post it here.
nvalias works like this

Code: [Select]
nvalias alias device-path

So in your instance you would do something like this
Code: [Select]
nvalias usbBoot usb2/disk@1:2,\\yaboot

then you can just type
Code: [Select]
boot usbBoot

You can try this, but I'm not sure how it would work honestly.
Code: [Select]
nvalias usbBoot boot%20usb2/disk@1:2,\\yaboot

Then in theory you could just type usbBoot, hit enter and it would boot.

For the telnet starting thingy you can do (just replace 192.168.1.2 with what ever ip address you want it to listen on)
Code: [Select]
nvalias startTelnet " enet:telnet,192.168.1.2" io

Again you should be able to type startTelnet to start it.

Now I may be restating what you may already know, but be very careful in open firmware.  It is a lot of fun, but can cause issues.  In general most commands that screw anything up can be undone by turning the machine of and restarting it or by starting up and resetting nvram or by powering down and draining all power and letting it sit for a while.
In some instances seemingly harmless commands go wrong (if you miss type something) and poof your done and you are replacing a motherboard.  I've bricked two iBooks now playing around and because it affected early boot, it would never get far enough in initialization to even check for things like Command-Option-P-R to reset anything.    So word of caution, double check that you typed everything in correctly.
If it ain't broke, don't fix it, or break it so you can fix it!