Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # Change this paths to you own
- nvflash=/usr/bin/nvflash
- fastboot=/usr/lib/nvflash/fastboot.bin
- mkdir work
- cd work
- $nvflash --bl $fastboot --sync || exit 1
- echo -n "Making a backup .."
- for i in $(seq 2 6)
- do
- $nvflash -r -q --read $i part$i.img || exit 1
- done
- echo " Done"
- read -p "Press [Enter] key when device rebooted to new recovery mode ..."
- echo -n "Creating new layout .."
- dd if=part2.img bs=1 count=4080 of=original.bct
- ln -s $fastboot bootloader.bin
- $nvflash --bl bootloader.bin --bct original.bct --setbct --configfile ../linux.cfg --create --verifypart -1 --go|| exit 1
- echo " Done"
- read -p "Press [Enter] key when device rebooted to new recovery mode ..."
- echo "Restoring backup .."
- $nvflash --bl $fastboot --sync || exit 1
- $nvflash -r -q --rawdevicewrite 0 1536 part2.img
- $nvflash -r -q --rawdevicewrite 1792 1024 part4.img
- $nvflash -r -q --download 5 part5.img
- $nvflash -r -q --download 6 part6.img
- echo " Done"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement