How to Restore 7042, 8042, 9742 Dump

vampirefo.

Senior Member
Developer
Nov 8, 2011
3,836
1,394
Many people have taken the time to make a dump of their tablets, this is really great, but none seem to know how to restore them. I am going to give you a quick walk through.

You need to have CW recovery installed, if you don't you need to install it before you begin.

place below files on sdcard. the bottom three files are to come from your dump.

install-boot.sh
install-bootloader.sh
install-system.sh

boot.img
bootloader.img
system.tgz

boot into recovery.

use cwm navigate to mount options format /data /system /cache

mount /sdcard /cache /system

adb shell


cp /sdcard/install-boot.sh /tmp/install-boot.sh
cp /sdcard/install-bootloader.sh /tmp/install-bootloader.sh
cp /sdcard/install-system.sh /tmp/install-system.sh

chmod 755 /tmp/install-system.sh
chmod 755 /tmp/install-bootloader.sh
chmod 755 /tmp/install-boot.sh


busybox sh /tmp/install-boot.sh
busybox sh /tmp/install-bootloader.sh
busybox sh /tmp/install-system.sh

reboot

download below

http://www.mediafire.com/?1xkoel8m4k5246m

The zip say 7042_stock don't worry about that it's just three scripts they install the files you provide.

boot.img
bootloader.img
system.tgz

This video shows the response you should receive as you type or copy and paste commands.



It has came to my attention some of you users might have been piping your system, this is ok for update.zip but not good for direct install.

for the ones that have piped their system, eg caught into a bootloop, do a factory reset then install permissions.zip, place zip on your sdcard and install through cwm after doing factory reset.

http://www.mediafire.com/?l1sssq6bwpb5p66
 
Last edited by a moderator:

purplegold

Member
Jun 21, 2012
7
2
Hi. i've been googling how to install CW Mod. how can I do it if i can not access my android device using the device itself, but i think i may have access via ADB. not sure.
 

Lannig

Senior Member
Mar 26, 2012
18
0
Having a look at these useful scripts (thanks !) I can't help but noticing that the part that restores the /system partition does a tar extract over the existing filesystem. Is this safe? shouldn't the filesystem be recreated (mkfs) before?
 

vampirefo.

Senior Member
Developer
Nov 8, 2011
3,836
1,394
no need to create filesytsem, you are just copying and deleting files.
 

Lannig

Senior Member
Mar 26, 2012
18
0
Deleting? how can the following command found in install-system.sh delete any file?

busybox tar -xzvf /sdcard/system.tgz

Il will extract whatever is in the tgz file, overwriting existing files whenever needed, but it won't delete any existing file.
I understand that those extra files will be hamless in most cases, but not always, and they use space anyway, so we could end up hitting a filesystem full condition on /system, can't we?
 

vampirefo.

Senior Member
Developer
Nov 8, 2011
3,836
1,394
Deleting? how can the following command found in install-system.sh delete any file?

busybox tar -xzvf /sdcard/system.tgz

Il will extract whatever is in the tgz file, overwriting existing files whenever needed, but it won't delete any existing file.
I understand that those extra files will be hamless in most cases, but not always, and they use space anyway, so we could end up hitting a filesystem full condition on /system, can't we?


"use cwm navigate to mount options format /data /system /cache"

this assumes you use cwm and format your partitions first as instructed, if you don't follow instructions correctly you end up with problems please read first post again..

or adb shell
rm -r /system/*
rm -r /cache/*
rm -r /data/*
 
Last edited:

Lannig

Senior Member
Mar 26, 2012
18
0
Oops. I completely overlooked this. :eek:
Sorry for the waste of time and some useful electrons.
 
Last edited:

vampirefo.

Senior Member
Developer
Nov 8, 2011
3,836
1,394
Oops. I completely overlooked this. :eek:
Sorry for the waste of time and some useful electrons.

Not a problem you are trying to understand this process. in Linux I use tar to backup my Linux, android is Linux so tar works just as well for android.
 

Lannig

Senior Member
Mar 26, 2012
18
0
Not a problem you are trying to understand this process. in Linux I use tar to backup my Linux, android is Linux so tar works just as well for android.

As a guy who's been installing, using and administering Linux boxes for 15+ years I guess I should sometimes switch off that "Android is mysterious" thing in my brains and really start looking at it like yet another Linux system :)

Talking of the still mysterious (for me) parts of Android, does anyone have a good reference for a tutorial on the various partitions used by Android and more specifically the boot steps? I'm still very fuzzy as to who does what during the early boot steps and more specifically how are the kernel and modules loaded, taken from where?
As far as I can tell there's a ramdisk involved just like good old Red Hat's initrd, still modules seem to mostly reside on the /system fileystem. What determines which kernel modules are loaded? are the scripts in /system loading these or the ones in the ramdisk? What's the difference between the boot and bootloader partitions?

Kind of off-topic I'm afraid. Feel free to just point me to good sources. Of course Google already has provided a handful of them, but I haven't found them either understandable or complete enough (can't have both maybe :) )
 
Last edited:

vampirefo.

Senior Member
Developer
Nov 8, 2011
3,836
1,394
As a guy who's been installing, using and administering Linux boxes for 15+ years I guess I should sometimes switch off that "Android is mysterious" thing in my brains and really start looking at it like yet another Linux system :)

Talking of the still mysterious (for me) parts of Android, does anyone have a good reference for a tutorial on the various partitions used by Android and more specifically the boot steps? I'm still very fuzzy as to who does what during the early boot steps and more specifically how are the kernel and modules loaded, taken from where?
As far as I can tell there's a ramdisk involved just like good old Red Hat's initrd, still modules seem to mostly reside on the /system fileystem. What determines which kernel modules are loaded? are the scripts in /system loading these or the ones in the ramdisk? What's the difference between the boot and bootloader partitions?

Kind of off-topic I'm afraid. Feel free to just point me to good sources. Of course Google already has provided a handful of them, but I haven't found them either understandable or complete enough (can't have both maybe :) )

look at the files in boot.img to get most of your answers. in init.sun4i.rc you will see what modules are loaded and how they are loaded.

example


on boot


# insmod vibrator
insmod /system/vendor/modules/sun4i-vibrator.ko
chown system system /sys/class/timed_output/sun4i-vibrator/enable

#insmod key & tp driver
insmod /system/vendor/modules/ft5x_ts.ko
insmod /system/vendor/modules/sun4i-keyboard.ko

# insmod mali driver
insmod /system/vendor/modules/ump.ko
insmod /system/vendor/modules/mali.ko

#csi module
insmod /system/vendor/modules/videobuf-core.ko
insmod /system/vendor/modules/videobuf-dma-contig.ko
insmod /system/vendor/modules/gc0308.ko
insmod /system/vendor/modules/gt2005.ko
insmod /system/vendor/modules/sun4i_csi1.ko
insmod /system/vendor/modules/sun4i_csi0.ko
# insmod gsensor driver
insmod /system/vendor/modules/mma7660.ko

#network module
insmod /system/vendor/modules/usbnet.ko
insmod /system/vendor/modules/asix.ko
insmod /system/vendor/modules/qf9700.ko
insmod /system/vendor/modules/mcs7830.ko
insmod /system/vendor/modules/rtl8150.ko

mount ext4 /dev/block/nandd /system rw remount
mount rootfs rootfs / rw remount
# wifi related service
service wpa_supplicant /system/bin/wpa_supplicant -Dwext -iwlan0 \
-c/data/misc/wifi/wpa_supplicant.conf -e/data/misc/wifi/entropy.bin
class main
socket wpa_wlan0 dgram 660 wifi wifi
group system wifi inet
disabled
oneshot
 

Lannig

Senior Member
Mar 26, 2012
18
0
EDIT- OK, got it... eventually went to the source code !

Code:
 INFO("reading config file\n");
parse_config_file("/init.rc");

Code:
get_hardware_name();
 snprintf(tmp, sizeof(tmp), "/init.%s.rc", hardware);
 parse_config_file(tmp);

So init.sun4i.rc is called after init.rc by init itself. Simple.

I've spent most of my day getting images of the boot and bootloader partition from my MID104C, unpacking these based on the documentation I've found up to extracting the cpio archive. So I have the files that you described, vampirefo.
Studying the various scripts is quite interesting indeed. But I am stuck to the following question: what calls init.sun4i.rc? I can see that the init binary seems to call init.rc, but this one doesn't "import" init.sun4i.rc, so who does? Not quite relevant to modding images, I know, but inquiring minds want to know :)
 
Last edited:

tpaine

Senior Member
Aug 18, 2012
525
130
Just got my 7042 this week. I was able to follow your directions to root and backup my system, as you advised. but the files are boot.img, recovery.img and 7042_system.tar. Do these correspond to the boot.img. bootloader.img, system.tgz you list here or do I need to backup the bootloader.img file ?
 

tpaine

Senior Member
Aug 18, 2012
525
130
Thanks for the info. With the info from this site, particularly your work and posts, I have been able to get adb working and using your method rooted and backed up my tab. Im going slow 'cause this is my first android device. I maybe a noobie, but with the info here livesuite is not the best method, just the quickest.
 
Top