Who's Online
|
There are currently 2787 online users. [Complete List] » 5 Member(s) | 2782 Guest(s)
|
|
|
Thread Rating:
- 2 Vote(s) - 4.5 Average
- 1
- 2
- 3
- 4
- 5
[Tutorial] Linux Backup NVRAM Script.
|
Posts: 256
Threads: 13
Joined: 2014-04-04
Points:
3,849
Reputation: +258
2014-04-10, 01:32
(This post was last modified: 2014-04-29, 09:06 by vampirefo.)
If you use my scripts or work in your own scripts, your scripts or license should reflect that.
This is a script to backup your NVRAM, this is a Linux script can be modified to work on windows as a batch file.
open terminal
Code: adb shell cat /proc/dumchar_info
find your nvram
Code: nvram 0x0000000000500000 0x0000000000400000 2 /dev/block/mmcblk0
copy hex into [Only registered and activated users can see links Click here to register]
type dec into calculator ÷ 4096
example below first # = count, second # = skip
Code: 5242880÷4096=1280
4194304÷4096=1024
Linux users connect rooted phone to pc, have adb setup and working, copy and paste script, set permissions change count and skip numbers to your own numbers if different than mine, open terminal run from a directory of choice.
Code: #!/bin/bash
adb shell su -c "busybox tar -czvf /sdcard/nvram.tgz /data/nvram"
adb pull /sdcard/nvram.tgz
rm -r /sdcard/nvram.tgz
adb shell su -c "dd if=/dev/block/mmcblk0 of=/sdcard/nvram.bin bs=4096 count=1280 skip=1024"
adb pull /sdcard/nvram.bin
rm -r /sdcard/nvram.bin
If you use my scripts or work in your own scripts, your scripts or license should reflect that.
ZTE Open C
Posts: 727
Threads: 60
Joined: 2014-01-30
Points:
8,462
Reputation: +604
2014-04-27, 17:52
(This post was last modified: 2014-04-28, 10:47 by aus9.)
vampirefo
I have not completed this script
I have made a few modifications for a number of reasons
namely....on my distro....usb devices are not given execute permissions to the local user
2) I want to make it easy for a new Linux user.....but I do not claim to be an expert
----and may be wrong.....but tested script so far
This script is a work in progress and misses the action bit for a reason
I am not sure why you are choosing output file to Android device
b) if you prefer not to adopt it ....I don't want to waste your time any further
Let me know what you think
As I have questions feel free to ask yours
cheers
[Only registered and activated users can see links Click here to register]
I have not added a MIT license to this script as I prefer you adopt it but I can not forecast the future either.......grins like a sheep
You and vampirefo like this post
Posts: 256
Threads: 13
Joined: 2014-04-04
Points:
3,849
Reputation: +258
(2014-04-27, 17:52)aus9 Wrote: [Only registered and activated users can see links Click here to register]
I have not added a MIT license to this script as I prefer you adopt it but I can not forecast the future either.......grins like a sheep Your script looks good, as far as your distro not given permissions, to usb, depends on distro, you might need to grant user permission via 51-android.rules
I run Mepis, pclinuxos,Mint, Ubuntu
I have 4 distros installed on my computer, plus Windows XP, for small windows jobs, mainly to run livesuit when needed.
With Mint and Ubuntu, 51-android.rules are required for user, as these distro use sudo commands.
anyway setting up 51-android.rules allows users to use adb usb support.
You script should be very useful keep at it.
You and aus9 like this post
If you use my scripts or work in your own scripts, your scripts or license should reflect that.
ZTE Open C
Posts: 727
Threads: 60
Joined: 2014-01-30
Points:
8,462
Reputation: +604
2014-04-28, 07:37
(This post was last modified: 2014-04-28, 10:47 by aus9.)
great will do, now, for the nastier questions
Why aren't you saving to your trusty Linux PC?
or are you trying to make it universal to Windows users?
I could do a HERE variable or to keep it simple use PC /root to save to eg
Code: HERE=`pwd`
echo "$HERE"
/home/gordon/Desktop
2) Have you successfully restored?
what command did you use, as we can build from my initial script and make a backup and a restore script
to confess, I am a Linux user but new to Android
cheers
Posts: 256
Threads: 13
Joined: 2014-04-04
Points:
3,849
Reputation: +258
(2014-04-28, 07:37)aus9 Wrote: great will do, now, for the nastier questions
Why aren't you saving to your trusty Linux PC?
or are you trying to make it universal to Windows users?
I could do a HERE variable or to keep it simple use PC /root to save to eg
Code: HERE=`pwd`
echo "$HERE"
/home/gordon/Desktop
2) Have you successfully restored?
what command did you use, as we can build from my initial script and make a backup and a restore script
to confess, I am a Linux user but new to Android
cheers My script saves to linux, it saves the files in same directory the script is ran from.
If you use my scripts or work in your own scripts, your scripts or license should reflect that.
ZTE Open C
Posts: 727
Threads: 60
Joined: 2014-01-30
Points:
8,462
Reputation: +604
2014-04-28, 08:24
(This post was last modified: 2014-04-28, 10:48 by aus9.)
ahhh well in that case, your outfile is not universal as my Debian does not use that pathway for a mounted internal storage or removeable storage
I have taken the liberty of fixing this universal issue with the HERE as now showing here
[Only registered and activated users can see links Click here to register]
dropbox shows command syntax in pretty colours on my PC if I use a sh extension
2) Have you tested restore please?
Posts: 256
Threads: 13
Joined: 2014-04-04
Points:
3,849
Reputation: +258
2014-04-28, 08:29
(This post was last modified: 2014-04-28, 08:31 by vampirefo.)
(2014-04-28, 08:24)aus9 Wrote: [Only registered and activated users can see links Click here to register]
dropbox shows command syntax in pretty colours on my PC if I use a sh extension
2) Have you tested restore please?
My script works on every distro ever created, have you even ran my script?
To restore is just reverse.
If you use my scripts or work in your own scripts, your scripts or license should reflect that.
ZTE Open C
Posts: 727
Threads: 60
Joined: 2014-01-30
Points:
8,462
Reputation: +604
2014-04-28, 10:45
(This post was last modified: 2014-04-28, 11:22 by aus9.)
Hi
Quote:My script works on every distro ever created, have you even ran my script?
To restore is just reverse.
I hope you forgive me if you feel I insulted you. I repeat that the pathway on my Debian does not enjoy the same level of success you have tested. That is one of the reasons why I offer a script for your adoption.
My feelings were not be hurt if you are not interested.
I repeat I am an Android newbie and seeking confirmation that you personally have restored from backup.
I have not run your script in reverse because I am a scaredy cat. However in light of your last reply I will delete some posts but will post my improved script if you are still interested.
BTW, I do understand that your distros may have their own udev rules. What I am trying to do is make a more universal script that ignores what distro we may be using.
feel free to comment etc......this is your tutorial and I am not trying to hijack or troll you.
You and vampirefo like this post
Posts: 256
Threads: 13
Joined: 2014-04-04
Points:
3,849
Reputation: +258
I understand you want to make a script, that requires user interaction for newbies or people who want to interact with a script, in the end your script will work exactly like the one I posted.
I am simply using adb commands to pull the files, to restore I use adb push, which is the opposite of pull.
Nothing wrong with the way you want to make your script, I am not into interactive scripts, I make scripts that only require them to be ran, that way they can be ran automatically or remotely.
I can backup or restore my phone from, a computer from another phone or from another device remotely, an interactive script can't do that cause each time it needs input from user.
For yourself or people who want the interaction they can use your script, others can use mine or make one they like.
If you use my scripts or work in your own scripts, your scripts or license should reflect that.
ZTE Open C
Posts: 727
Threads: 60
Joined: 2014-01-30
Points:
8,462
Reputation: +604
vampirefo
I just looked at this tut
[Only registered and activated users can see links Click here to register]
it suggests you need a backup of both
/dev/nvram
/data/nvram
your thoughts Sir?
2) Fair enough I will contine with my script for my own evil purposes then......grins
|
Possibly Related Threads… |
Thread |
Author |
Replies |
Views |
Last Post |
|
Another IMEI Restore and Backup Method |
tiefighter_85 |
6 |
10,829 |
2022-08-04, 19:10
Last Post: annabriett
|
|
[Tutorial] How to backup MT6752 MT6732 MT6753 MT67xx (and others) SP Flash Tool compatible |
alexzap |
15 |
65,115 |
2021-09-09, 22:51
Last Post: soldiaz
|
|
[Tutorial] HOW TO PORT TWRP MT6735, MT6752, MT6753, MT6795, MT6797 TWRP MT67xx tutorial |
Cleopatra |
485 |
298,474 |
2021-03-02, 20:32
Last Post: itanasa
|
|
[Tutorial] BACKUP, CUSTOM RECOVERY AND ROOT FOR MT67xx SMARTPHONES |
djtetei |
14 |
24,120 |
2020-04-11, 21:53
Last Post: romaneart
|
|
[Tutorial] How to format your NAND Flash MT6589, MT6577, MT6582, MT6572 |
akwangwu |
47 |
285,065 |
2019-03-18, 08:11
Last Post: abrahim
|
Users browsing this thread: 1 Guest(s)
|
|