FORUMS
Remove All Ads from XDA

How about a ROM DUMP?

1,008 posts
Thanks Meter: 23
 
By Da9L, Senior Member on 29th September 2008, 05:04 PM
Post Reply Email Thread
12th October 2008, 11:23 PM |#21  
Valicore's Avatar
Senior Member
Flag San Jose, California
Thanks Meter: 6
 
More
OK here's the deal. I have enough command line knowledge to get around a command prompt in Windows and a terminal in Linux. I've been playing with the adb and nothing I do on the phone or in the system (that I know how to do) will make adb list it as a device I can issue shell commands to. There is a brightspot - I can open a terminal on the G1 itself and issue commands on it directly. There is however no cp command. dd and mv are there however. Is there anyway to use dd or mv to do the equivalent of copying?
 
 
12th October 2008, 11:28 PM |#22  
beartard's Avatar
Senior Member
Flag Winter Haven, Florida, USA
Thanks Meter: 14
 
More
Quote:
Originally Posted by Valicore

OK here's the deal. I have enough command line knowledge to get around a command prompt in Windows and a terminal in Linux. I've been playing with the adb and nothing I do on the phone or in the system (that I know how to do) will make adb list it as a device I can issue shell commands to. There is a brightspot - I can open a terminal on the G1 itself and issue commands on it directly. There is however no cp command. dd and mv are there however. Is there anyway to use dd or mv to do the equivalent of copying?

dd is a copy command on a very low level. It would make a raw image of the disk you're copying. It usually just takes the simple:
Code:
dd if=<disk to copy> of=<image name>
where "if" is "input file" (usually a device node like "/dev/sda1") and "of" is "output file" (like "android.img").
13th October 2008, 03:51 AM |#23  
dzo's Avatar
Senior Recognized Developer
Flag Auckland
Thanks Meter: 5,055
 
Donate to Me
More
Hi,

I would be keen to have a look at the .apk packages in /system/app, you could copy them to an sdcard by doing this:
Code:
cd /system/app
for i in *.apk; do dd if=$i of=/sdcard/$i; done
pm me if you want any more info.
13th October 2008, 04:29 AM |#24  
Member
Thanks Meter: 0
 
More
Quote:
Originally Posted by Valicore

OK here's the deal. I have enough command line knowledge to get around a command prompt in Windows and a terminal in Linux. I've been playing with the adb and nothing I do on the phone or in the system (that I know how to do) will make adb list it as a device I can issue shell commands to. There is a brightspot - I can open a terminal on the G1 itself and issue commands on it directly. There is however no cp command. dd and mv are there however. Is there anyway to use dd or mv to do the equivalent of copying?

YES yes! Alright you're about 2 commands away from dumping our first rom... Hopefully.

In the terminal you open on the phone type:

Code:
~# mount
This will return a listing of all of the mount points on the device. It shows the device that each filesystem is mounted FROM. The root filesystem will be something like /dev/hda or /dev/sda or /dev/***. I haven't had the pleasure so I don't know what you're gonna have there.

I would suggest dumping them all, but hey... do whatever. For each /dev/*** that you want to dump, issue the following command:

Code:
~ # dd if=/dev/*** of=/sdcard/***.g1.dump
At this point you will have some interesting filesystem dumps.

On a normal linux driven system the output of mount might look like:

Code:
~ # mount
/dev/hda3 on / type ext3 (rw,noatime)
proc on /proc type proc (rw,nosuid,nodev,noexec)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec)
/dev/sdcard on /sdcard type fat (rw,noatime)
If I saw that on my android phone I would then run...

Code:
~ # dd if=/dev/hda3 of=/sdcard/hda3.g1.dump
Now you can transfer this over...

Want to tool around with it a bit prior to uploading it to us?

Fire up any livecd, and transfer the file somewhere into the filesystem... run:

Code:
~ # mkdir /mnt/g1
~ # mount -t [type] /.../hda3.g1.dump /mnt/g1
The [type] will be whatever filesystem type was listed for the g1 when you ran mount on the g1. In my example it was ext3, but I don't know what they're using. The /.../ is where ever you ended up putting the rom.

Ha, and what if they're using a proprietary filesystem? Next we ask you to strip a module from the kernel! Hope that doesn't have to happen.
13th October 2008, 08:22 AM |#25  
dzo's Avatar
Senior Recognized Developer
Flag Auckland
Thanks Meter: 5,055
 
Donate to Me
More
Quote:

Ha, and what if they're using a proprietary filesystem? Next we ask you to strip a module from the kernel! Hope that doesn't have to happen.

It will use yaffs2 so won't mount with most distros, you should be able to mount it in the emulator though.
13th October 2008, 04:35 PM |#26  
raymondf13's Avatar
Member
Thanks Meter: 0
 
More
Thanks! I will try this right now!
13th October 2008, 04:39 PM |#27  
raymondf13's Avatar
Member
Thanks Meter: 0
 
More
Quote:
Originally Posted by syrusfrost

YES yes! Alright you're about 2 commands away from dumping our first rom... Hopefully.

In the terminal you open on the phone type:

Code:
~# mount
This will return a listing of all of the mount points on the device. It shows the device that each filesystem is mounted FROM. The root filesystem will be something like /dev/hda or /dev/sda or /dev/***. I haven't had the pleasure so I don't know what you're gonna have there.

I would suggest dumping them all, but hey... do whatever. For each /dev/*** that you want to dump, issue the following command:

Code:
~ # dd if=/dev/*** of=/sdcard/***.g1.dump
At this point you will have some interesting filesystem dumps.

On a normal linux driven system the output of mount might look like:

Code:
~ # mount
/dev/hda3 on / type ext3 (rw,noatime)
proc on /proc type proc (rw,nosuid,nodev,noexec)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec)
/dev/sdcard on /sdcard type fat (rw,noatime)
If I saw that on my android phone I would then run...

Code:
~ # dd if=/dev/hda3 of=/sdcard/hda3.g1.dump
Now you can transfer this over...

Want to tool around with it a bit prior to uploading it to us?

Fire up any livecd, and transfer the file somewhere into the filesystem... run:

Code:
~ # mkdir /mnt/g1
~ # mount -t [type] /.../hda3.g1.dump /mnt/g1
The [type] will be whatever filesystem type was listed for the g1 when you ran mount on the g1. In my example it was ext3, but I don't know what they're using. The /.../ is where ever you ended up putting the rom.

Ha, and what if they're using a proprietary filesystem? Next we ask you to strip a module from the kernel! Hope that doesn't have to happen.

how do i get to the terminal on the phone??
13th October 2008, 05:12 PM |#28  
raymondf13's Avatar
Member
Thanks Meter: 0
 
More
I cant mount the shell because adp cant find my device. I need debug drivers for my G1!!
13th October 2008, 06:02 PM |#29  
Valicore's Avatar
Senior Member
Flag San Jose, California
Thanks Meter: 6
 
More
I tried this last night - I have permission errors I will continue to work on it tho.
14th October 2008, 11:22 AM |#30  
dzo's Avatar
Senior Recognized Developer
Flag Auckland
Thanks Meter: 5,055
 
Donate to Me
More
Quote:
Originally Posted by Valicore

I tried this last night - I have permission errors I will continue to work on it tho.

There's a simple file manager here:

http://cs-alb-pc3.massey.ac.nz/vogue/Glance.apk

Can you see if you can use it to copy anything from /system to /sdcard. To copy a file press and hold the name and select copy then press and hold on the destination directory and select paste.

Thanks
14th October 2008, 01:44 PM |#31  
Member
Thanks Meter: 0
 
More
Quote:
Originally Posted by dzo

There's a simple file manager here:

http://cs-alb-pc3.massey.ac.nz/vogue/Glance.apk

Can you see if you can use it to copy anything from /system to /sdcard. To copy a file press and hold the name and select copy then press and hold on the destination directory and select paste.

Thanks

Today I installed the Android Emulator on my laptop to see how we can solve this problem.

Using the Emulator it's quite easy. Just download the busybox binary to your local machine and upload it to the emulator using the adb commando. The busybox file contains a set of usefull tools which will help us to copy the file system.

To extract the file system from the emulator you need to do this:

download this file http://benno.id.au/android/busybox

Download the SDK and unzip it (download from http://code.google.com/android/download.html )
All the tools you need are located under tools
Create a sdcard rom file using this command (under tools) mksdcard 1024M sdcard1.is
Run the Emulator using this command: emulator.exe -datadir C:\android-sdk\tools\lib\images -sdcard C:\android-sdk\tools\sdcard1.iso

Open a second command prompt and type:
adb.exe shell
# mkdir /data/busybox
# exit


Copy the busybox utility to the android device
adb.exe push c:\android-sdk\downloads\busybox /sdcard/

Install and run the busybox utility
adb.exe shell
# cd /data/busybox
# ./busybox --install
# export PATH=/data/busybox:$PATH


Backup the system directory to the sdcard
# cd /sdcard
# tar -c -f system.tar /system


If you do this you should be able to package the system directory to a tar file.

The only problem is that we need to have shell access on the HTC G1 to do this.

raymondf13,
What will happen if you connect the HTC G1 device with your computer and you fire up the adb command. Is the device listed?


C:\android-sdk\tools>adb.exe devices

List of devices attached
emulator-5554 device

C:\android-sdk\tools>
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes