• Home
  • Help
  • Search
  • Login
  • Register
Pages: [1]
Author Topic: unsetenv? How do you unset an env in UBoot?  (Read 4475 times)
begunfx
Newbie
*

Karma: 0
Posts: 13


View Profile
« on: February 11, 2010, 07:58:33 PM »

Hey All,
          okay, so I was messing with trying to setup Multi-Boot on my plug (which was unsuccessful), and ran into issues which completely screwed up my env variables in UBoot.  I tried just about everything to get the env variables back.  As I was trying to fix the env's I was trying to unsetenv some of the variables, but the plug couldn't find the command.  Thankfully I was able to get my plug back up and running, when I ran the installer again.  After it was back up and running I did try apt-get to see if it need to be installed...no luck.  There is an unsetenv in the PC Ubuntu.  Any ideas?
Logged

restamp
Global Moderator
Sr. Member
*****

Karma: 4
Posts: 273


View Profile
« Reply #1 on: February 11, 2010, 09:36:33 PM »

I think the command to re-establish the default environment is resetenv, possibly followed by a saveenv if you'd like to make that permanent.  However, the default environment is what was compiled into the Uboot command when it was built, and is not necessarily what you need to boot your particular configuration.

There is no unsetenv command.  To unset variablename, use "setenv variablename" without specifying a value for it.
Logged

odoll
Full Member
***

Karma: 0
Posts: 148


View Profile
« Reply #2 on: February 12, 2010, 06:32:05 AM »

I think it's good enough to issue the setenv command for the variable without a value for it.

E.g.

> setenv MyVar 'MyVal'

will create (if's not present yet) and set the value MyVal

> setenv MyVar

will clear/'"delete" the variable?!
Logged

begunfx
Newbie
*

Karma: 0
Posts: 13


View Profile
« Reply #3 on: February 12, 2010, 06:26:00 PM »

thanks for the responses.  resetenv is dangerous.  Unless you are using the SheevaPlug out of the box, it resets  the variables back to the factory default, with no consideration to any updates/changes done to the plug.  I had the Installer 1.0 installed, and I tried running resetenv.  It bricked my plug, cause the variables no longer worked with the installer 1.0.  I had to re-run the update process.  I had a happy accident when I tried to re-run the installer 1.0.  For some reason the installer failed just after it ran the uBoot/uImage update.  Ironically that's all I needed.  It then restored my env back to what it needed to be to work with installer 1.0.  For now own, I am making sure NOT to run saveenv until I am certain that my changes to the uBoot env are working as advertised, and I'm good to go.  I also made sure to make a backup copy of the env before I made any changes so I always know what to get them back to if necessary (my own way of "resetting" the env back to proper 1.0 defaults).
Logged

Pages: [1]
Print
Jump to: