inquiry to 'nvram' binary (missing some capabilities)

Issue #15 resolved
Fermulator created an issue

Hi there,

In attempting to write some automation for nvram backup/restore, I noticed a lot of users expect the nvram command to have options like import and export. However mine does not.

i.e. https://github.com/wbtf/nvram-backup/blob/master/nvram-backup.sh

# nvram export --tab output
usage: nvram [get name] [set name=value] [unset name] [show] [commit] [save] [restore] [erase] ...

I presume the version of the nvram binary is built and supplied via this firmware? (but please correct me if I'm mis-understanding)

(running latest Q4 2018 firmware)

Comments (10)

  1. Michał Obrembski

    To export nvram configuration use

    nvram save > /tmp/nvram_content
    

    To import, use nvram restore. I'm not sure if this is what you expect? :) Those both commands are used to import/export via WWW.

  2. Fermulator reporter
    • changed status to open

    Actually, no, save nor restore are available options?

    /tmp/home/root# nvram save
    usage: nvram [get name] [set name=value] [unset name] [show] [commit] [save] [restore] [erase] ...
    /tmp/home/root# nvram restore
    usage: nvram [get name] [set name=value] [unset name] [show] [commit] [save] [restore] [erase] ...
    

    Shouldn't these NOT prompt into usage? (I expect save for example, to either dump to stdout, or save to file)

  3. Michał Obrembski

    sorry, i’ve done a mistake.

    It should be

    nvram save nameoffile.cfg
    

    and

    nvram restore nameoffile.cfg
    

    But i think that we should change the nvram prompt to be more meaningful

  4. Fermulator reporter

    Confirmed, specifying the filename works 🙂 .

    Indeed, this ticket thus can serve to improve the usage prompt.

  5. Fermulator reporter

    Darn, i made the change and tried to push up but

    git push origin enhancement/#15_improve_nvram_usage
    Forbidden
    fatal: Could not read from remote repository.
    
    Please make sure you have the correct access rights
    and the repository exists.
    

  6. Log in to comment