MoDaCo is undergoing planned maintenance. Site functionality may be reduced - follow @modaco or @paulobrien on Twitter for updates.

  • Announcements

    • Reminder - MoDaCo position on illegal content

      ILLEGAL CONTENT I'd like to just reaffirm MoDaCo's position regarding piracy and illegal content in the light of some recent questions / postings. Posts will be censored by myself or my moderation team if the contain or link to: Illegal / pirated / cracked software or sites that host such software
      Nintendo emulators / ROMs or sites hosting them (in light of Nintendo's legal stance)


      CUSTOM ROMS

      You may discuss and post links to custom device ROMs on MoDaCo, provided the following rules are adhered to: ROMs must not be hosted directly in topic via the MoDaCo attachment system
      ROMs must not contain any illegal 3rd party software (this includes trial versions included without permission)
      ROMs must give full credit to the original author
      This decision has been taken in light of the huge amount of interest in this area of device customisation within the community, and member feedback! Please note that custom ROM discussion should be kept in specific device sub-areas, (e.g. Kaiser.MoDaCo.com for Kaiser based devices). ISSUES If you have any issues with this policy, please contact me directly via PM. P
    • Support MoDaCo by signing up to a MoDaCo Silver or Gold membership

      To sign up to an annual MoDaCo Silver subscription which will eliminate all ads from the site (as well as giving you access to the MoDaCo Online Kitchens for Android) for only £9.99 using PayPal, Credit or Debit Card, ensure you are logged in to the site, and then click the link below, which will take you directly to the subscription store! You can also sign up to an annual MoDaCo Gold subscription for £29.99, which adds the benefits listed below! PURCHASE A MODACO SUBSCRIPTION - FREE Titanium Backup Mobile for Android worth $5.99! - FREE 1 year PrivateInternetAccess.com worth $39.95! - FREE 1 year LastPass Premium worth $12! - FREE CalcConvert for Pocket PC from Binaryfish worth $17.95! - FREE Calendar Bar for Pocket PC from OmegaOne worth $9.99! - FREE CamerAware for Pocket PC and Smartphone from MoDaCo worth £19.99 / $30! - FREE Chronos for Pocket PC from ActiveKitten worth $14.95! - FREE CodeWallet Pro for Smartphone and Pocket PC from DeveloperOne worth up to $24.95! - FREE Concentrix for Pocket PC from eSoft Interactive worth $9.95! - FREE FlexMail for Pocket PC and Smartphone from WebIS worth up to $59.90! - FREE FTouchSL for Pocket PC from Vekoff s.r.o. worth 10 euro / $12.50! - FREE Jewel Challenge for Pocket PC from eSoft Interactive worth $9.95! - FREE John Cody's Alerts Pro for Smartphone from Omnisoft worth $14.95! - FREE LingvoSoft Talking Dictionary 2008 English <-> Dutch for Pocket PC from Lingvosoft worth $49.95! - FREE LingvoSoft Talking Dictionary 2008 English <-> French for Pocket PC from Lingvosoft worth $49.95! - FREE LingvoSoft Talking Dictionary 2008 English <-> German for Pocket PC from Lingvosoft worth $49.95! - FREE LingvoSoft Talking Dictionary 2008 English <-> Italian for Pocket PC from Lingvosoft worth $49.95! - FREE LingvoSoft Talking Dictionary 2008 English <-> Spanish for Pocket PC from Lingvosoft worth $49.95! - FREE LingvoSoft Dictionary English <-> Dutch for Smartphone from Lingvosoft worth $49.95! - FREE LingvoSoft Dictionary English <-> French for Smartphone from Lingvosoft worth $49.95! - FREE LingvoSoft Dictionary English <-> German for Smartphone from Lingvosoft worth $49.95! - FREE LingvoSoft Dictionary English <-> Russian for Smartphone from Lingvosoft worth $49.95! - FREE LingvoSoft Dictionary English <-> Turkish for Smartphone from Lingvosoft worth $49.95! - FREE Note2Self for Pocket PC and Smartphone from WebIS worth up to $19.90! - FREE Opera 8.60 for Pocket PC and Smartphone from Opera Software worth up to $48! - FREE Pocket Informant for Pocket PC and Smartphone from WebIS worth up to $59.90! - FREE Pocket Launcher for Pocket PC and Smartphone from Conduits worth $9.95! - FREE PTab for Pocket PC and Smartphone from z4soft worth up to $60! - FREE Resco Explorer for Pocket PC and Smartphone from Resco worth up to $49.90! - FREE Safemode for Pocket PC from monocube worth $12.95 - FREE SplashPhoto for Pocket PC and Smartphone from SplashData worth up to $59.90! - FREE Sprite Backup for Pocket PC and Smartphone from Sprite Software worth $29.95! - FREE Teksoft Glyphs UI for Pocket PC and Smartphone from Teksoft €9.95! - FREE Teksoft HeadsetRemote for Pocket PC and Smartphone from Teksoft €4.95! - FREE Traffic Jam for Pocket PC from eSoft Interactive worth $9.95! - FREE unlock (1 per year) from imei-check.co.uk - DISCOUNT of 10% at MoDaCo FairDeal - DISCOUNT of 10% at Semsons.com - FORUM - AD FREE SITE - FORUM - custom rank / title - FORUM - double competition entries - FORUM - double post attachment space - FORUM - no search flood control - FORUM - priority event registration - FORUM - triple PM space
    • Reminder: Selling items on the forum directly is not allowed

      Please note that selling items on the forum directly is not allowed by the forum rules. There is a forum for eBay auctions whereby you can list the items on eBay and link to them there. This is the ONLY forum for this type of activity. You may also advertise links to the eBay forum in your signature. Please note that selling directly in contravention of these rules will result in a warning / suspensions / ban.

Hudl backup script (under review & re-write)

21 posts in this topic

Posted (edited) · Report post

Under review - needs heavy work.

Edited by glossywhite
1

Share this post


Link to post
Share on other sites

Posted · Report post

Hi just found this, looks ideal for a way to fully backup/image my hudl now that it's been rooted/tweaked/configured just how I want it.

 

Just a couple of questions please: -

 

1) I presume nothing is not backed up (except additional SD card if fitted)?

2) I also presume to reflash a backup back, I don't have to blank the whole hudl first - as this wasn't required when performing Paul's root procedure?

 

Again thanks for the script.

0

Share this post


Link to post
Share on other sites

Posted (edited) · Report post

Out of interest in my setup had to increase the 'pause 10' to something bigger (I just doubled it to 20) as the script rebooted the hudl but couldn't recognise it connected to the computer in time before trying to start reading from it.

Edited by CaptainMidnight
1

Share this post


Link to post
Share on other sites

Posted (edited) · Report post

Out of interest in my setup had to increase the 'pause 10' to something bigger (I just doubled it to 20) as the script rebooted the hudl but couldn't recognise it connected to the computer in time before trying to start reading from it.

 

Brill - that's a good idea :)

 

Hi just found this, looks ideal for a way to fully backup/image my hudl now that it's been rooted/tweaked/configured just how I want it.

 

Just a couple of questions please: -

 

1) I presume nothing is not backed up (except additional SD card if fitted)?

2) I also presume to reflash a backup back, I don't have to blank the whole hudl first - as this wasn't required when performing Paul's root procedure?

 

Again thanks for the script.

 

I made the script back up ALL partitions. I have no idea about flashing them back yet - I've not tried it as yet, but I can safely tell you that having backed up my hudl with this, saved my device when I had flashed a generic RockChip CWM into /recovery and it didn't work; I just had to flash the backed-up, original hudl /recovery image and the device was back to normal.

My rationale is that it is better to have backed-up images than not to have them, even if they cannot be used (yet). If I get around to restoring the images, thus proving them to work properly, I'll publish the script here and document it.

Thank you :)

Edited by glossywhite
0

Share this post


Link to post
Share on other sites

Posted · Report post

How about this - comparing your backup script with Paul's short script for reading out and then writing back the original/modded system.img I notice in your script above have you not got the 'offset' and 'sizes' the wrong way round? From the command line help of rkflashtool both read and write modes require 'offset' then 'size'.

 

We know Paul's script correctly writes the modified system.img file.....not sure how you didn't end up with a semi dead hudl though based on this?

 

(presume you are both using the same version of rkflashtool) 

0

Share this post


Link to post
Share on other sites

Posted (edited) · Report post

How about this - comparing your backup script with Paul's short script for reading out and then writing back the original/modded system.img I notice in your script above have you not got the 'offset' and 'sizes' the wrong way round? From the command line help of rkflashtool both read and write modes require 'offset' then 'size'.

 

We know Paul's script correctly writes the modified system.img file.....not sure how you didn't end up with a semi dead hudl though based on this?

 

(presume you are both using the same version of rkflashtool) 

Oops! 

uhm... "lol"?  :wub:

 

Will review and re-release, later or mid-week. Thanks for noticing - the syntax was totally wrong, yup!

Edited by glossywhite
0

Share this post


Link to post
Share on other sites

Posted · Report post

Original backup script offset/size details corrected and PM'd to you - thanks for the initial draft, helped me leap frog some learning stepping stones.

0

Share this post


Link to post
Share on other sites

Posted · Report post

Plan on updating and providing all the detail / working scripts etc tomorrow afternoon. Scripts have been adjusted and proved working by myself and recent upgrade / downgrade ROM testing. Full credit to glossywhite for the initial script.

0

Share this post


Link to post
Share on other sites

Posted · Report post

I know this is a bit cheeky because I can guess how much work it is to work out how to take a backup let alone document it but if you have the time would you make a moron proof walkthrough of the backup process ? (Assuming basic PC skills) Also is it possible to do this with free apps or do you need the paid for version of any of them?

Cheers Paul

0

Share this post


Link to post
Share on other sites

Posted (edited) · Report post

Standard disclaimer:-

:excl: This information is provided as a best effort forum post - you are ultimately solely responsible for your own actions, if you don't understand what you are doing and haven't read any of the other forum posts to gain a background knowledge about modding your hudl and/or don't have enough knowledge of a linux environment - you continue at your own risk...... :excl:

Before starting this procedure, please ensure the following conditions are setup: -

  • You are using a 64bit linux distro (unless you replace the 64bit version of rkflashtool with the 32bit version which is listed in SifJar's thread "[TOOLS] Useful tools for tinkerers") - may not be available yet!
  • On your hudl ensure that in settings>Developer Options> USB debugging is ticked.
  • Download to your linux desktop the following file hudl_scripts.zip
  • Extract the contents of this zip file to a folder on your desktop i.e. hudl
  • Ensure you have a minimum of 2GB disk space available.

Creating a hudl backup:

1. Open a terminal window in you linux distro (Accessories - Terminal), if you're using the unity desktop do the equivalent.
This will open a blank terminal window on your desktop, it will probably be started in your user account area, you can check this by typing: ls

2. Change the terminal directory to the huld folder on your desktop: cd Desktop/hudl

3. Ensure you can see the extracted files: -

ls -l
................. adb
................. hudl_backup.sh
................. hudl_restore.sh
................. rkflashtool-linux

4. Ensure the backup/restore scripts hudl_backup.sh and hudl_restore.sh are marked as executable:-
chmod +x hudl_*.sh

5. Connect your hudl via the usb cable to your computer and wait a couple of minutes to give your computer a chance to detect it - in my version of Ubuntu, nothing happens i.e. no display message or auto-play type dialog box, it just sees it.

6. To create a hudl backup run the following: sudo ./hudl_backup.sh
(this command may now ask for your password - depends on distro version)

7. Follow the on screen prompts to create a backup: (basically press "any key" and wait.............)

If all is working ok, you'll see a rolling address read line and ultimately you'll end up with the following files in your directory:-

hudl_parameters.img
hudl_misc.img
hudl_kernel.img
hudl_boot.img
hudl_recovery.img
hudl_backup.img
hudl_cache.img
hudl_kpanic.img
hudl_system.img
hudl_factory.img
hudl_image_sha1_sums.txt

In the hudl_backup.sh script, the 'offset' and 'size' values that rkflashtool-linux uses have been obtained from the hudl_paramters.img file (they are displayed in reverse). These are crucial to ensuring the correct partition locations are used. The last file generated is a text file containing he sha1 hash values for the other files.

The rest of the data partition (i.e. all the other space, including your downloaded apps and stuff) isn't backed-up via this script, hense use something like "Titanium Backup Pro" to backup anything you want to keep and save it to an EXTERNAL SD CARD, before factory resetting your hudl. (You may want to factory reset your hudl if you flashed back a previous recovery or a new stock ROM etc). You could extend the script and include this user data area, but that would eat up another 12/13GB :(

 

hudl_backup.sh script: -

#!/bin/bash
chmod +x ./rkflashtool-linux

echo
echo
echo
echo

read -p "About to BACKUP Your Hudl - PRESS ANY KEY to CONTINUE or CTRL-C to ABORT..."
./adb reboot bootloader
sleep 20

./rkflashtool-linux p > hudl_parameters.img
./rkflashtool-linux r 0x00002000 0x00002000 > hudl_misc.img
./rkflashtool-linux r 0x00004000 0x00004000 > hudl_kernel.img
./rkflashtool-linux r 0x00008000 0x00008000 > hudl_boot.img
./rkflashtool-linux r 0x00010000 0x00010000 > hudl_recovery.img
./rkflashtool-linux r 0x00020000 0x00020000 > hudl_backup.img
./rkflashtool-linux r 0x00040000 0x00100000 > hudl_cache.img
./rkflashtool-linux r 0x00140000 0x00002000 > hudl_kpanic.img
./rkflashtool-linux r 0x00142000 0x00200000 > hudl_system.img
./rkflashtool-linux r 0x00342000 0x00020000 > hudl_factory.img

date > hudl_image_sha1_sums.txt

sha1sum hudl_*.img >> hudl_image_sha1_sums.txt

./rkflashtool-linux b

echo =================================================================================================
echo ===    HUDL now backed up and REBOOTING. If reboot fails, hold down power button.             ===
echo ===                                                                                           ===
echo ===       SHA1 CHECKSUMS OF ALL IMAGES HAVE BEEN SAVED TO "hudl_image_sha1_sums.txt"          ===
echo =================================================================================================
echo
echo
echo             Originally created by Glossywhite - updated by CaptainMidnight
echo
echo

Restoring a hudl backup:

 

1. [Optional] You could factory reset your hudl before proceeding (maybe you are changing the build or ROM version and it's probably preferable to wipe the old settings etc - please remeber unless you want to loose it - backup your personal stuff, use something like 'Titanium Backup Pro' or whatever you prefer and save it to an EXTERNAL SD CARD. In the hudl go to Settings > Backup & Reset > Factory data reset

 

2. With the hudl rebooted, once again connect your hudl via the usb cable to your computer and wait a couple of minutes to give your computer a chance to detect it.

3. Open a terminal window in your linux distro (Accessories - Terminal), if you're using the unity desktop do the equivalent.
This will open a blank terminal window on your desktop, it will probably be started in your user account area, you can check this by typing: ls

4. Change the terminal directory to the huld folder on your desktop: cd Desktop/hudl

 

5. To restore the hudl using your previous backup images run the following: sudo ./hudl_restore.sh
(this command may now ask for your password - depends on distro version)

 

6. Once completed the hudl should reboot and your ready to configure it as you like. :)

 

hudl_restore.sh script: -

#!/bin/bash
chmod +x ./rkflashtool-linux

echo
echo
echo
echo

read -p "About to RESTORE Your Hudl - PRESS ANY KEY to CONTINUE or CTRL-C to ABORT..."

./adb reboot bootloader
sleep 20

./rkflashtool-linux w 0x00002000 0x00002000 < hudl_misc.img
./rkflashtool-linux w 0x00004000 0x00004000 < hudl_kernel.img
./rkflashtool-linux w 0x00008000 0x00008000 < hudl_boot.img
./rkflashtool-linux w 0x00010000 0x00010000 < hudl_recovery.img
./rkflashtool-linux w 0x00020000 0x00020000 < hudl_backup.img
./rkflashtool-linux w 0x00040000 0x00100000 < hudl_cache.img
./rkflashtool-linux w 0x00140000 0x00002000 < hudl_kpanic.img
./rkflashtool-linux w 0x00142000 0x00200000 < hudl_system.img
./rkflashtool-linux w 0x00342000 0x00020000 < hudl_factory.img

./rkflashtool-linux b

echo =========================================================================================
echo ===     HUDL now restored and REBOOTING. If reboot fails, hold down power button.     ===
echo =========================================================================================
echo
echo
echo             Originally created by Glossywhite - updated by CaptainMidnight
echo
echo

This backup and restore process detailed above has flaws just like anything else - it's not meant to completely backup/restore EVERYTHING on you hudl :huh: - it's presented here purely as a way to backup/restore your current build ROM. That means your downloaded data and stuff is as ever your responsibility to backup/restore.

 

Using the above method enabled me play about with different stock ROM images etc and is purely something I have found very useful - it's not necessarily the easiest way to achieve a backup if your flashed CWM recovery i.e. nandroid backups etc.

 

It's listed here in case you find it useful or learn something by listing it :D I certainly gained a better understanding of android. :ninja:

 

Sorry it took a little longer than anticipated to post, enjoy.

 

 

14/11/2013 Update:

 

If you also wanted to backup / restore  the remaining userdata partition you would need to add this line to the script.

./rkflashtool-linux r 0x00362000 0x01C9E000 > hudl_userdata.img

Remebering to change the mode/direction for a restore.

./rkflashtool-linux w 0x00362000 0x01C9E000 < hudl_userdata.img
Edited by CaptainMidnight
3

Share this post


Link to post
Share on other sites

Posted · Report post

Amazing work, thank you!

 

Now....how are you at cooking Roms? :)

0

Share this post


Link to post
Share on other sites

Posted · Report post

perfect - cheers :)

0

Share this post


Link to post
Share on other sites

Posted · Report post

Thanks for the responses, as I said this was a joint effort building on glossywhite's initial backup script.

Cooking my own ROM - maybe someday, if I get enough tinkering and dev time, who knows....

0

Share this post


Link to post
Share on other sites

Posted · Report post

Great work the two of you :D  i`ve used the script a couple of times now and works a treat i`ve backed up the works hudl`s which dont have "usb debuging" i have to keep them locked down so no "Developer options" here!! I put them into bootloader mode with vol+ and reset pin whilst connected via usb ran the script it throws up an error no device (expected) just leave it about 30 seconds and it carries on backing up :P .I then used that backup to reflash my own rooted/tweaked hudl and it is now back to standard :blink: I will re-root and set it backup how I want again.I do have a question what do i have to set the parameters to so that i can back up everything including user data apps etc?? I know this will not include the external sd card and that it will be approx 16gb so may take a while but i dont mind the wait.

Thank you again for the time and effort that you have put into this

 

0

Share this post


Link to post
Share on other sites

Posted (edited) · Report post

Ok, well I wondered how long it would take before someone asked that ......... :D

 

Well here goes: -

 

Before we get to the answer, maybe it's worth building up to it. As can be seen in the scripts above, rkflashtools-linux is passed 2x parameters per partition. These values are obtained from the first partition or should I say parameter block which is backed-up i.e. hudl_parameters.img - in this file they are listed in 'reverse'  :rolleyes:

 

hudl_parameters.img is viewable in a text editor and here it is: -

FIRMWARE_VER:4.1.1
MACHINE_MODEL:rk30sdk
MACHINE_ID:007
MANUFACTURER:RK30SDK
MAGIC: 0x5041524B
ATAG: 0x60000800
MACHINE: 3066
CHECK_MASK: 0x80
PWR_HLD: 0,0,A,0,1
KERNEL_IMG: 0x60408000
#RECOVER_KEY: 1,1,0,20,0
CMDLINE:console=ttyFIQ0 androidboot.console=ttyFIQ0 board.ap_has_alsa=0 init=/init initrd=0x62000000,0x00800000 mtdparts=rk29xxnand:0x00002000@0x00002000(misc),0x00004000@0x00004000(kernel),0x00008000@0x00008000(boot),0x00010000@0x00010000(recovery),0x00020000@0x00020000(backup),0x00100000@0x00040000(cache),0x00002000@0x00140000(kpanic),0x00200000@0x00142000(system),0x00020000@0x00342000(factory),-@0x00362000(userdata) 

The numbers pre-seeding each partition are the partitions 'size' and 'offset' in reverse order. Also 'offset' and 'size' are in units (blocks) of 512 bytes.

 

So we know the 'offset' for userdata will be 0x00362000, but what about the size? (it's '-' or everything else!)

 

Well it should be 16GB converted to 512 byte units - sum(of all previous partition 512 byte block units)

 

i.e. 17179869184 / 512 = 33554432 or in hex  400000000 / 200 = 2000000 (total number of blocks)

 

2000000 - ( 2000 + 4000 + 8000 + 10000 + 20000 + 100000 + 2000 + 200000 + 20000 ) = 1CA0000

 

So...............

 

You would(should) need to add this line to the bottom of the rklashtool-linux section: -

./rkflashtool-linux r 0x00362000 0x01CA0000 > hudl_userdata.img

My linux partition is low on space, so I haven't been able to verify the above - I'd be interested to hear from anyone who does do this - fairly confident it's right but a practical confirmation would be good.

 

Oh yes, on the other comment of the error and delay, if you are going to place the hudl in bootloader / flash mode by yourself, just delete following lines (as you are probably already aware): -

./adb reboot bootloader
sleep 20

As these just place the hudl in bootloader for you, BUT are designed to wait enough time for it to be recognised again by linux before carrying on.  :)

 

(initial response detialing the above went a bit iffy on the maths  :o)

Edited by CaptainMidnight
0

Share this post


Link to post
Share on other sites

Posted · Report post

Thanks for the reply my maths is poor at best! Well after i reinstalled ubuntu (my hard drive chose today to die) :( i added the line to the script and ran it the user data partion was backed up and shows as 15.4gb this took about 35 minutes it stopped at the offset shown in the screenshot (hopefully)but the script carried on for approx another 10 minutes before rebooting.It didnt throw up any errors either.Here are the screen shots i took if they are any help.post-1027631-0-11821300-1384301944_thumbpost-1027631-0-58822900-1384301950_thumb

Thanks again for all you work this is a bit of a vertical learning curve for me!But enjoying it :P

1

Share this post


Link to post
Share on other sites

Posted · Report post

Looks promising - the ultimate test would be a restore though. I've got another machine with more free disk space which I'll setup and give it a go on, but that won't be until tonight.

We are all learning - just different things!

0

Share this post


Link to post
Share on other sites

Posted (edited) · Report post

Hmm. Looks like we might be 0x2000 out as I would have thought it would have ended under the 0x02000000 number (after a closer look in the morning).

That would be the logical answer as looking back forgot the 'misc' partition started at 0x2000 doh!

Edited by CaptainMidnight
0

Share this post


Link to post
Share on other sites

Posted (edited) · Report post

Finally, I've updated post #10 with the correct userdata backup value i.e. 0x01C9E000 NOT 0x01CA0000 which was 0x02000 out :blush:

 

TurboPask - that's a good article, but it didn't help when I'd forgotton to take into account the first partition after the parameters.img starts at 0x00002000 and so I haven't added that previous space into the equation and we're dealing with 512 byte block units.

Edited by CaptainMidnight
0

Share this post


Link to post
Share on other sites

Posted · Report post

It would be nice and beneficial if this could be 'pinned' in the thread list..............

0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now

MoDaCo is part of the MoDaCo.network, © Paul O'Brien 2002-2015. MoDaCo uses IntelliTxt technology.